class compiler::Compiler

sys::Obj
  compiler::Compiler

Source

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.

backend

virtual Void backend()

Source

Execute back-end compiler pipeline

cjs

Str? cjs

Source

cjsSourceMap

Str? cjsSourceMap

Source

closures

ClosureExpr[]? closures

Source

compile

virtual CompilerOutput compile()

Source

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

depends

CDepend[] depends

Source

errs

CompilerErr[] errs

Source

esm

Str? esm

Source

fpod

FPod? fpod

Source

frontend

virtual Void frontend()

Source

Execute front-end compiler pipeline

input

CompilerInput input

Source

isSys

Bool isSys := false

Source

js

Str? js

Source

jsFiles

File[]? jsFiles

Source

jsPod

Obj? jsPod

Source

jsPropsFiles

File[]? jsPropsFiles

Source

jsSourceMap

Str? jsSourceMap

Source

localeDefs

LocaleLiteralExpr[] localeDefs

Source

localeProps

Str? localeProps

Source

log

CompilerLog log

Source

make

new make(CompilerInput input)

Source

Construct with reasonable defaults

ns

CNamespace? ns

Source

output

CompilerOutput? output

Source

pod

PodDef? pod

Source

resFiles

File[]? resFiles

Source

srcFiles

File[]? srcFiles

Source

tsDecl

Str? tsDecl

Source

types

TypeDef[]? types

Source

warns

CompilerErr[] warns

Source

wrappers

Str:CField wrappers

Source