Quick & dirty support for code gen. Less cumberson than e.g. TS compiler AST

Hierarchy (view full)

Constructors

Properties

entries: Entry[] = ...
indent: string = ""
name: string
parentBlock: undefined | Block
prefix: string = ""
shouldGroup: boolean = false
suffix: string = ""

Accessors

Methods

  • Add a statement or expression that will be automatically delimited

    Parameters

    • labelOrText: any
    • Optionaltext: any

    Returns Atom

  • Add a block with separate statements terminated by ";"

    Parameters

    • prefix: string = ""
    • suffix: string = ""

    Returns StatementBlock

  • Remove a name from the defined pool. This is necessary when e.g. defining a type and object with the same name.

    Parameters

    • name: string

    Returns void

  • Add an atom or block that recreates the input value

    Parameters

    • value: any
    • prefix: string = ""
    • suffix: string = ""

    Returns undefined | ExpressionBlock | Atom