Fantom

 

class

compiler::Compiler

sys::Obj
  compiler::Compiler

Compiler manages the top level process of the compiler pipeline. There are a couple different "pipelines" used to accomplish various twists on compiling Fantom code (from memory, files, etc). The pipelines are implemented as discrete CompilerSteps. As the steps are executed, the Compiler instance itself stores the state as we move from files -> ast -> resolved ast -> code.

Error reporting is managed via the Compiler.errors list. If the compiler encounters problems it accumulates the errors as CompileExceptions in this list, then raises the first exception to the caller. All errors go thru the CompilerSupport.err() methods for logging. To log an error and continue we simply call err(). To fail fast, we code something like: throw err(). Or at the end of a step we may call bombIfErr() which throws the first exception if any errors have accumulated.

Slots

backendSource

virtual Void backend()

Execute back-end compiler pipeline

closuresSource

ClosureExpr[]? closures

compileSource

virtual CompilerOutput compile()

Compile fan source code from the configured CompilerInput into a fan pod and return the resulting CompilerOutput.

dependsSource

Depend[] depends

errsSource

CompilerErr[] errs

fpodSource

FPod? fpod

frontendSource

virtual Void frontend()

Execute front-end compiler pipeline

inputSource

CompilerInput input

isSysSource

Bool isSys := false

jsSource

Str? js

jsFilesSource

File[]? jsFiles

jsPodSource

Obj? jsPod

logSource

CompilerLog log

makeSource

new make(CompilerInput input)

Construct with reasonable defaults

nsSource

CNamespace? ns

outputSource

CompilerOutput? output

podSource

PodDef? pod

resFilesSource

File[]? resFiles

srcFilesSource

File[]? srcFiles

typesSource

TypeDef[]? types

warnsSource

CompilerErr[] warns

wrappersSource

Str:CField wrappers