ASTCodeGenerator

abstract class ASTCodeGenerator<R : Node>

Transform an AST into code. This can be done on an AST obtained from parsing, or build programmatically. It would work also on AST obtained from parsing and then modified. It should be noted that it does not perform lexical preservation: comments are lost, whitespace is re-organized. It is effectively equivalent to auto-formatting.

The logic for printing the different elements of the language must be defined in subclasses. This logic could be potentially expressed in a DSL, with multi-platform generators. It would permit to have code generators usable from all the StarLasu platforms

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun printToFile(root: R, file: File)
Link copied to clipboard

Properties

Link copied to clipboard