Class ConstantsClassGenerator
java.lang.Object
org.ek9lang.compiler.backend.jvm.ConstantsClassGenerator
Generates a per-module
_Constants JVM class from constant IRConstructs.
Aggregates all constant IRConstructs for a single module into one class with:
- Public static fields for each constant
- A <clinit> that initializes all constants via Type._of(literalValue)
- A private no-arg constructor to prevent instantiation
This is the JVM-specific backend for constant code generation, called by
CodeGenerationConstants (Phase 15). LLVM backend would have its own equivalent.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerate(String moduleName, List<IRConstruct> constants, File outputDirectory) Generate the _Constants.class file for a module.
-
Constructor Details
-
ConstantsClassGenerator
-
-
Method Details
-
generate
Generate the _Constants.class file for a module.- Parameters:
moduleName- the EK9 module name (e.g., "my.app")constants- all constant IRConstructs for this moduleoutputDirectory- the base output directory for generated class files
-