const classafPlastic::PlasticCompiler

sys::Obj
  afPlastic::PlasticCompiler

(Service) - Compiles Fantom source code and afPlastic models into usable Fantom code.

Note: This class is available as a service in IoC v3 under the root scope with an ID of afPlastic::PlasticCompiler.

compileCode

Source

Pod compileCode(Str fantomPodCode, Str? podName := null, Uri? srcCodeLocation := null)

Compiles the given Fantom code into a pod. If no pod name is given, a unique one will be generated.

srcCodeLocation is just used to report errors. If not given, the podName is used.

compileCodeToPodFile

Source

File compileCodeToPodFile(Str fantomPodCode, Str? podName := null, Uri? srcCodeLocation := null)

Compiles the given Fantom code into a pod file. If no pod name is given, a unique one will be generated.

srcCodeLocation is just used to report errors. If not given, the podName is used.

Note the returned file is deemed to be transient, so is deleted on exit.

Note: Fantom 1.0.68 needs this patch in order to work.

compileModel

Source

Type compileModel(PlasticClassModel model, Str? podName := null)

Compiles the given class model into a pod and returns the associated Fantom type. If no pod name is given, a unique one will be generated.

compileModels

Source

Type[] compileModels(PlasticClassModel[] models, Str? podName := null)

generatePodName

Source

Str generatePodName()

Different pod names prevents "sys::Err: Duplicate pod name: <podName>". We internalise podName so we can guarantee no duplicate pod names

make

Source

new make(|This? in := null)

Creates a PlasticCompiler.

podBaseName

Source

Str podBaseName

The base name used to generate pod names. This name may overridden when compiling src.

Defaults to afPlastic so pods will be named afPlasticXXX.

srcCodePadding

Source

Int srcCodePadding

When generating code snippets to report compilation Errs, this is the number of lines of src code the erroneous line should be padded with.

Value is mutable. Defaults to 5.