Fantom

 

abstract class

compiler::DslPlugin

sys::Obj
  compiler::CompilerSupport
    compiler::DslPlugin

DslPlugin is the base class for Domain Specific Language plugins used to compile embedded DSLs. Subclasses are registered on the anchor type's qname with the "compiler.dsl.{anchor}" indexed prop and must declare a constructor with a Compiler arg.

Slots

compileSource

abstract Expr compile(DslExpr dsl)

Compile DSL source into its Fantom equivalent expression. Log and throw compiler error if there is a problem.

findSource

static DslPlugin? find(CompilerSupport c, Loc loc, CType anchorType)

Find a DSL plugin for the given anchor type. If there is a problem then log an error and return null.

makeSource

new make(Compiler c)

Constructor with associated compiler.

normalizeSrcSource

Str normalizeSrc(DslExpr dsl)

Normalize the DSL source using Fantom's multi-line whitespace rules where no non-whitespace chars may be appear to the left of the opening "<|" token. If source is formatted incorrectly then log and throw error.