Class IRConstruct
java.lang.Object
org.ek9lang.compiler.ir.instructions.IRConstruct
- All Implemented Interfaces:
INode
In EK9 every construct becomes one of these nodes.
So that means class, trait, component, program, function - everything.
In the case of functions there is a single 'call' method, this has all the parameters that would be supplied when other constructs use the function.
So this is more like a Function in Java - that is really just an object. The reason for this is that in EK9 it is possible for functions to 'capture' variables as properties (dynamic functions). But this whole mechanism makes sense even for normal fixed named functions. It also means it is very easy to pass functions around as data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(INodeVisitor visitor) void
add
(OperationInstr operation) void
Returns signature-qualified name including parameter types and return type.Returns the source file name where this construct was defined.boolean
isForSymbol
(ISymbol toCheck) boolean
Assess if this construct is a function or a general aggregate symbol type.boolean
void
setProgramEntryPoint
(ProgramEntryPointInstr programEntryPoint) toString()
-
Constructor Details
-
IRConstruct
-
-
Method Details
-
isForSymbol
-
getFullyQualifiedName
-
getSourceFileName
Returns the source file name where this construct was defined. This is used for JVM debug information (SourceFile attribute) to enable debuggers to map bytecode back to the original .ek9 source file.- Returns:
- Source file name, typically a relative path like "introduction/HelloWorld.ek9"
-
getSignatureQualifiedName
Returns signature-qualified name including parameter types and return type. For functions and methods, this includes the complete signature to enable method overloading resolution and target code generation.Format: "module::construct(org.ek9.lang::ParamType1,org.ek9.lang::ParamType2)->org.ek9.lang::ReturnType"
- Returns:
- Signature-qualified name for overload resolution.
-
isFunction
public boolean isFunction()Assess if this construct is a function or a general aggregate symbol type.- Returns:
- true if the construct is just a function - otherwise false and it is an aggregate.
-
isProgram
public boolean isProgram() -
addField
-
add
-
getSymbol
-
getFields
-
getOperations
-
setProgramEntryPoint
-
getProgramEntryPoint
-
accept
-
toString
-