Class AbstractGenerator

java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
Direct Known Subclasses:
AbstractShortCircuitGenerator, AbstractVariableDeclGenerator, AssertStmtGenerator, AssignExpressionToSymbol, AssignmentExprInstrGenerator, AssignmentStmtGenerator, BinaryOperationGenerator, BlockStmtInstrGenerator, CallInstrGenerator, ControlFlowChainGenerator, EnumerationOperatorGenerator, ExprInstrGenerator, GuardedAssignmentBlockGenerator, ObjectAccessInstrGenerator, PrimaryReferenceGenerator, QuestionBlockGenerator, StmtInstrGenerator, SyntheticMethodGenerator, UnaryOperationGenerator

abstract class AbstractGenerator extends Object
Acts as base for most generators as they all require the context and in most cases need to generate debug information.

Uses stack-based IRGenerationContext for state management, eliminating parameter threading.

  • Field Details

  • Constructor Details

    • AbstractGenerator

      AbstractGenerator(IRGenerationContext stackContext)
      Constructor accepting only IRGenerationContext - the single source of state.
  • Method Details

    • getRecordedSymbolOrException

      protected ISymbol getRecordedSymbolOrException(org.antlr.v4.runtime.tree.ParseTree node)
    • extractCallMetaData

      protected CallMetaDataDetails extractCallMetaData(ISymbol symbol)
      Extract call metadata from a symbol using the common pattern. This consolidates the frequent pattern of creating CallMetaDataExtractor and applying it.