IRFactory

class IRFactory(env: CompilerEnvirons, sourceName: String?, sourceString: String, errorReporter: ErrorReporter = env.errorReporter)

Lowers the AST into the Node IR that the code generator consumes.

The transform methods walk the tree the parser built and rewrite the high-level constructs into the flat, jump-based form the interpreter wants. Loops become labeled targets, switches become a jump table plus labels, comprehensions become nested loops, and destructuring becomes a chain of plain assignments.

KMP: the E4X transforms are not ported, following D-16.

Constructors

Link copied to clipboard
constructor(env: CompilerEnvirons, sourceName: String?, sourceString: String, errorReporter: ErrorReporter = env.errorReporter)
constructor(env: CompilerEnvirons, sourceString: String)

Types

Link copied to clipboard

Reports the source position of the AST node currently being transformed.

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Transforms the tree into the lower-level IR the code generator uses.