Class VariableOnlyDeclInstrGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.AbstractVariableDeclGenerator
org.ek9lang.compiler.phase7.generator.VariableOnlyDeclInstrGenerator
- All Implemented Interfaces:
Function<EK9Parser.VariableOnlyDeclarationContext, List<IRInstr>>
public final class VariableOnlyDeclInstrGenerator
extends AbstractVariableDeclGenerator
implements Function<EK9Parser.VariableOnlyDeclarationContext, List<IRInstr>>
Creates IR instructions for variable only declarations.
Uses REFERENCE instructions for all variables - backend handles storage allocation.
Also handles injection-marked variables (the ! suffix) by generating LOAD_STATIC_FIELD
from the global _Application static struct (root-level singleton).
STACK-BASED: Now uses IRGenerationContext for scope management instead of parameter threading.
-
Field Summary
Fields inherited from class AbstractGenerator
debugInfoCreator, instructionBuilder, MAX_MESSAGE_LENGTH, stackContext, typeNameOrException -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerate IR instructions for variable only declaration.Methods inherited from class AbstractVariableDeclGenerator
getDeclInstrsMethods inherited from class AbstractGenerator
addCoverageProbe, createTempVariable, createTempVariableFromContext, extractReturnType, getRecordedSymbolOrException, processBlockStatements, processBlockStatements, truncateMessage, truncateMessage
-
Constructor Details
-
VariableOnlyDeclInstrGenerator
-
-
Method Details
-
apply
Generate IR instructions for variable only declaration. Example: someVar as String? — Generates: REFERENCE only (no assignment) Example: logger as AbstractLogger! — Generates: REFERENCE + LOAD_STATIC_FIELD from _Application STACK-BASED: Gets scope ID from stack context instead of parameter threading.- Specified by:
applyin interfaceFunction<EK9Parser.VariableOnlyDeclarationContext, List<IRInstr>>
-