Class IRModule
java.lang.Object
org.ek9lang.compiler.IRModule
- All Implemented Interfaces:
Serializable, Module
Represents the Intermediate Representation of the EK9 code for a particular EK9 module.
The idea is to pull out all the EK9 specifics and move more towards a general target CPU based implementation. By this I mean take out things like 'guards' and
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptCompilationUnitContext(EK9Parser.CompilationUnitContext compilationUnitContext) voidadd(IRConstruct node) Adds a new construct operation node (i.e.Get the coverage metadata JSON for this module.intGet the total coverage probe count for this module.booleanbooleanisExtern()voidSet the coverage metadata JSON for this module.voidsetModuleTotalCoverageProbeCount(int count) Set the total coverage probe count for this module.
-
Constructor Details
-
IRModule
-
-
Method Details
-
getAllPrograms
-
getSource
-
getScopeName
- Specified by:
getScopeNamein interfaceModule
-
isEk9Core
-
getConstructs
-
acceptCompilationUnitContext
-
isExtern
public boolean isExtern() -
add
Adds a new construct operation node (i.e. some form of aggregate/function - i.e. a Construct)- Parameters:
node- The node to be added.
-
setModuleTotalCoverageProbeCount
public void setModuleTotalCoverageProbeCount(int count) Set the total coverage probe count for this module. This should be called after all constructs have been added to the module, as it represents the sum of probes across all constructs.- Parameters:
count- The total number of coverage probes in this module
-
getModuleTotalCoverageProbeCount
public int getModuleTotalCoverageProbeCount()Get the total coverage probe count for this module. This is used at code generation time to initialize the coverage probe array with the correct size for all constructs in the module.- Returns:
- The total number of coverage probes, or 0 if not set
-
setCoverageMetadataJson
Set the coverage metadata JSON for this module. Contains serialized probe details (types, lines) and function details for computing line, method, and branch coverage at runtime.- Parameters:
json- The serialized coverage metadata
-
getCoverageMetadataJson
Get the coverage metadata JSON for this module.- Returns:
- The serialized coverage metadata, or null if not set
-