Class TextBodyMethodGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.TextBodyMethodGenerator
Generates IR for text body methods with implicit String return.
Text body methods are unique in EK9 - they have an implicit String return type
where the stringLit IS the return value. Unlike regular methods which declare
<- rtn as String: value, text body methods have:
greeting()
-> name as String
`Hello ${name}!`
The stringLit can be either:
- Quoted string "Hello" - simple constant
- Backtick string `Hello ${name}!` - potentially with interpolation
-
Constructor Summary
ConstructorsConstructorDescriptionTextBodyMethodGenerator(IRGenerationContext stackContext, GeneratorSet generators) -
Method Summary
Modifier and TypeMethodDescriptionvoidprocess(OperationInstr operation, EK9Parser.TextBodyDeclarationContext ctx) Process a text body method and populate the OperationInstr with IR instructions.
-
Constructor Details
-
TextBodyMethodGenerator
-
-
Method Details
-
process
Process a text body method and populate the OperationInstr with IR instructions.- Parameters:
operation- The operation instruction to populatectx- The textBodyDeclaration parse context
-