Class IRModule

java.lang.Object
org.ek9lang.compiler.IRModule
All Implemented Interfaces:
Serializable, Module

public final class IRModule extends Object implements 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 Details

  • Method Details

    • getAllPrograms

      public List<AggregateSymbol> getAllPrograms()
    • getSource

      public CompilableSource getSource()
      Specified by:
      getSource in interface Module
    • getScopeName

      public String getScopeName()
      Specified by:
      getScopeName in interface Module
    • isEk9Core

      public boolean isEk9Core()
      Specified by:
      isEk9Core in interface Module
    • getConstructs

      public List<IRConstruct> getConstructs()
    • acceptCompilationUnitContext

      public void acceptCompilationUnitContext(EK9Parser.CompilationUnitContext compilationUnitContext)
    • isExtern

      public boolean isExtern()
    • add

      public void add(IRConstruct node)
      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

      public void setCoverageMetadataJson(String json)
      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

      public String getCoverageMetadataJson()
      Get the coverage metadata JSON for this module.
      Returns:
      The serialized coverage metadata, or null if not set