Fan

 

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 "compilerDsl" facet and must declare a constructor with a Compiler arg.

Slots

compileSource

abstract Expr compile(DslExpr dsl)

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

findSource

static DslPlugin? find(CompilerSupport c, Location 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 Fan'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.