Fantom compiler
CDoc models the fandoc for a definition node
CFacet models a facet definition in a CType or CSlot
CField is a "compiler field" which is represents a Field in the compiler.
CMethod is a "compiler method" which is represents a Method in the compiler.
CNode represents a compile node as base type for CType and CSlot
CParam models a MethodParam in the compiler.
CPod is a "compiler pod" used for representing a Pod in the compiler.
CSlot is a "compiler slot" which is represents a Slot in the compiler.
CType is a "compiler type" which is class used for representing the Fantom type system in the compiler.
FConst provides all the fcode constants
Vistor is used to walk the abstract syntax tree and visit key nodes.
ApiDocWriter is used to write out an AST definition in the Fantom API doc formatted used by compilerDoc.
Assemble is responsible for assembling the resolved, analyzed, normalized abstract syntax tree into it's fcode representation in memory as a FPod stored on compiler.fpod.
Assembler assembles all the TypeDefs into their fcode representation.
AstWriter
AttrAsm provides support for assembling the attributes table for types and slots.
BinaryExpr is used for binary expressions with a left hand side and a right hand side including assignment.
Block is a list of zero or more Stmts
BreakStmt breaks out of a while/for loop.
CBridge is the base class for compiler FFI plugins to expose external type systems to the Fantom compiler as CPods, CTypes, and CSlots.
CNamespace is responsible for providing a unified view pods, types, and slots between the entities currently being compiled and the entities being imported from pre-compiled pods.
COperators is used to manage methods annoated with the Operator facet for efficient operator method resolution.
CallExpr is a method call.
CallResolver handles the process of resolving a CallExpr or UnknownVarExpr to a method call or a field access.
Case models a single case block of a SwitchStmt
Catch models a single catch clause of a TryStmt
CheckErrors walks the tree of statements and expressions looking for errors the compiler can detect such as invalid type usage.
CheckInheritance is used to check invalid extends or mixins.
CheckParamDefs is used to process all the parameter default expressions for all the methods.
ClosureExpr is an "inlined anonymous method" which closes over it's lexical scope.
ClosureToImmutable processes each closure to determine its immutability.
ClosureVars is used to process closure variables which have been enclosed from their parent scope
CodeAsm is used to assemble the fcode instructions of an Expr or Block.
Coercer handles all the logic for type casts
CompilationUnit models the top level compilation unit of a source file.
CompileJs is used to call the compilerJs plugin to generate javascript for the pod if the @js facet is configured.
Compiler manages the top level process of the compiler pipeline.
CompilerInput encapsulates all the input needed run the compiler.
CompilerLog manages logging compiler messages.
CompilerOutput encapsulates the result of a compile.
VisitStep represents one discrete task run during the compiler pipeline.
CompilerSupport provides lots of convenience methods for classes used during the compiler pipeline.
ComplexLiteral is used to model a serialized complex object declared in facets.
Cond
CondExpr is used for || and && short-circuit boolean conditionals.
ConstChecks adds hooks into constructors and it-blocks to ensure that an attempt to set a const field will throw ConstErr if not in the objects constructor.
ConstantFolder is used to implement constant folding optimizations where known literals and operations can be performed ahead of time by the compiler.
ContinueStmt continues a while/for loop.
DefNode is the abstract base class for definition nodes such as TypeDef, MethodDef, and FieldDef.
DefaultCtor adds a default public constructor called make() if no constructor was explicitly specified.
Type or slot documentation in plain text fandoc format
DslExpr is an embedded Domain Specific Language which is parsed by a DslPlugin.
DslPlugin is the base class for Domain Specific Language plugins used to compile embedded DSLs.
EnumDef is used to define one ordinal/named enum value in an enum TypeDef.
Expr
ExprStmt is a statement with a stand along expression such as an assignment or method call.
FAttr is attribute meta-data for a FType or FSlot
FCodePrinter prints a human readable syntax for fcode
FFacet
FField is the read/write fcode representation of sys::Field.
FFieldRef
FMethod is the read/write fcode representation of sys::Method.
FMethodRef
FMethodVar models one parameter or local variable in a FMethod
FPod is the read/write fcode representation of sys::Pod.
FPodNamespace implements Namespace by reading the fcode from pods directly.
FPrinter is used to pretty print fcode
FSlot is the read/write fcode representation of sys::Slot.
FTable is a 16-bit indexed lookup table for pod constants.
FType is the read/write fcode representation of sys::Type.
FTypeRef stores a typeRef structure used to reference type signatures.
FUtil provides fcode encoding and decoding utilities.
FacetDef models a facet declaration.
Fantom Disassembler
FieldDef models a field definition
FieldExpr is used for a field variable access.
ForStmt models a for loop of the format
FuncType models a parameterized Func type.
GenerateOutput creates the appropriate CompilerOutput instance for Compiler.output based on the configured CompilerInput.output.
GenericParameterType models the generic parameter types sys::V, sys::K, etc.
GenericType models a parameterized generic type: List, Map, or Func
IfStmt models an if or if/else statement.
IndexedAssignExpr is a subclass of ShortcutExpr used in situations like x[y] += z where we need keep of two extra scratch variables and the get's matching set method.
Inherit processes each TypeDef to resolve the inherited slots.
During the Parse step we created a list of all the closures.
InitEnum is used to auto-generate EnumDefs into abstract syntax tree representation of the fields and method.
InitFacet is used to auto-generate AST modifications to facet classes.
InitInput is responsible
ItExpr models the "it" keyword to access the implicit target of an it-block.
ListLiteralExpr creates a List instance
ListType models a parameterized List type.
LiteralExpr puts an Bool, Int, Float, Str, Duration, Uri, or null constant onto the stack.
LoadPod is used to immediately load the pod which has just been successfully compiled into Compiler.fpod.
Loc provides a source file, line number, and column number.
LocalDefStmt models a local variable declaration and its optional initialization expression.
LocalVarExpr is used to access a local variable stored in a register.
LocaleLiteralExpr: podName::key=defVal
LocaleProps is used to generate or merge locale/en.props if any locale literals specified defaults such as $<foo=Foo>
Loop
Main is the main entry point for the Fantom compiler.
MapLiteralExpr creates a List instance
MapType models a parameterized Map type.
Simple implementation for a marker facet
MethodDef models a method definition - it's signature and body.
MethodVar is a variable used in a method - either param or local.
MockField
MockMethod
MockParam
MockSlot are special slots used between the compiler and runtime but not publically exposed by reflection.
NameExpr is the base class for an identifier expression which has an optional base expression.
Node is the base class of all classes which represent a node in the abstract syntax tree generated by the parser.
NopStmt is no operation do nothing statement.
Normalize the abstract syntax tree
NullableType wraps another CType as nullable with trailing "?".
OrderByInheritance orders the list of TypeDefs from top to bottom such that any inherited types are guaranteed to be positioned first in the types list.
ParamDef models the definition of a method parameter.
ParameterizedField
ParameterizedMethod models a parameterized CMethod
ParameterizedMethodParam
Parse is responsible for parsing all the compilation units which have already been tokenized into their full abstract syntax tree representation in memory.
Parser is responsible for parsing a list of tokens into the abstract syntax tree.
PodDef models the pod being compiled.
ProtectedRegion
RangeLiteralExpr creates a Range instance
ReflectFacet
ReflectField
ReflectMethod
ReflectNamespace implements Namespace using reflection to compile against the VM's current pod repository.
ReflectParam
ReflectPod is the CPod wrapper for a dependent Pod loaded via reflection.
ReflectSlot is the implementation of CSlot for a slot imported from a precompiled pod (as opposed to a SlotDef within the compilation units being compiled).
ReflectType is the implementation of CType for a type imported from a precompiled pod (as opposed to a TypeDef within the compilation units being compiled).
RegexDslPlugin is used to create a Regex instance from a raw string.
ResolveDepends resolves each dependency to a CPod and checks the version.
Walk the AST to resolve
ResolveImports maps every Using node in each CompilationUnit to a pod and ensures that it exists and that no imports are duplicated.
ReturnStmt returns from the method
ScanForUsingsAndTypes is the first phase in a two pass parser.
ShortcutExpr is used for operator expressions which are a shortcut to a method call
SlotDef models a slot definition - a FieldDef or MethodDef
SlotLiteralExpr
StaticTargetExpr wraps a type reference as an Expr for use as a target in a static field access or method call
Stmt
StrDslPlugin is used to create a raw Str literal.
SuperExpr is used to access super class slots.
SwitchStmt models a switch and its case and default block
TernaryExpr is used for the ternary expression <cond> ? <true> : <false>
ThisExpr models the "this" keyword to access the implicit this local variable always stored in register zero.
ThrowExpr models throw as an expr versus a statement for use inside ternary/elvis operations.
ThrowStmt throws an exception
TokenVal stores an instance of a Token at a specific location.
Extra information for DSL tokens.
Tokenize is responsible for parsing all the source files into a a list of tokens.
Tokenizer inputs a Str and output a list of Tokens
TryStmt models a try/catch/finally block
TypeCheckExpr is an expression which is composed of an arbitrary expression and a type - is, as, coerce
TypeDef models a type definition for a class, mixin or enum
TypeParser is used to parser formal type signatures into CTypes.
TypeRef models a type reference such as an extends clause or a method parameter.
UnaryExpr is used for unary expressions including !, +.
UnknownVarExpr is a place holder in the AST for a variable until we can figure out what it references: local or slot.
Using models an using import statement.
UsingAndTypeScanner
WhileStmt models a while loop of the format
WritePod writes the FPod to a zip file.
Input source from the file system
Input source from the file system - see CompilerOutput
ExprId uniquely identifies the type of expr
FOp provides all the fcode constants
FOpArg
ShortcutOp is a sub-id for ExprId.shortcut which identifies the an shortuct operation and it's method call
StmtId
Token is the enum for all the token types.
VisitDepth enumerates how deep to traverse the AST
CompilerErr - instances should always be created via CompilerStep.err().
compiler 1.0.82∙26-Jun-2025 Thu 13:18:36 EDT