2.2.4Class _BaseCompiler

Abstract base class for the Compiler and ICompiler classes.

Class _BaseCompiler

This base class is used to put some common properties at disposal of both the subclasses: the standard Compiler, and the ICompiler (Incremental Compiler) that allows live evaluation in a protected children virtual machine.

Properties
alwaysRecomp If true, a load method finding a valid .
compileInMemory If true (the default) intermediate compilation steps are performed in memory.
ignoreSources If true, sources are ignored, and only .
language Language code used to load language-specific string tables.
launchAtLink If true, the main function (that is, the entry point) of the loaded modules is executed before returning it.
path The search path for modules loaded by name.
saveMandatory If true, when saveModule option is true too and a module can't be serialized, the compiler raises an exception.
saveModules If true, once compiled a source that is located on a local file system, the compiler will also try to save the .
sourceEncoding The encoding of the source file.
Methods
addFalconPathAdds the default system paths to the path searched by this compiler.
setDirectiveCompiles a script on the fly.

Properties

alwaysRecomp

If true, a load method finding a valid .

If true, a load method finding a valid .fam that may substitute a .fal will ignore it, and will try to compile and load the .fal instead.

compileInMemory

If true (the default) intermediate compilation steps are performed in memory.

If true (the default) intermediate compilation steps are performed in memory. If false, temporary files are used instead.

ignoreSources

If true, sources are ignored, and only .

If true, sources are ignored, and only .fam or shared object/dynamic link libraries will be loaded.

language

Language code used to load language-specific string tables.

Language code used to load language-specific string tables. When this entry is valorized to a valid international language code, as i.e. "en_US", the compiler tries to use .ftr files found besides their modules to alter their string tables, changing the original strings with their translation for the desired language. If the language table file or the required translation is not available, the operation silently fails and the module is loaded with the string untranslated.

launchAtLink

If true, the main function (that is, the entry point) of the loaded modules is executed before returning it.

If true, the main function (that is, the entry point) of the loaded modules is executed before returning it. This allows the modules to initalize themselves and set their global variables. Notice that this step may be autonomusly performed also by the loader after the loading is complete.

path

The search path for modules loaded by name.

The search path for modules loaded by name. It's a set of Falcon format paths (forward slashes to separate dirs, e.g. "C:/my/path"), separated by semi comma.

saveMandatory

If true, when saveModule option is true too and a module can't be serialized, the compiler raises an exception.

If true, when saveModule option is true too and a module can't be serialized, the compiler raises an exception.

saveModules

If true, once compiled a source that is located on a local file system, the compiler will also try to save the .

If true, once compiled a source that is located on a local file system, the compiler will also try to save the .fam pre-compiled module, that may be used if the same module is loaded a second time. Failure in saving the pre-compiled module is not reported, unless saveMandatory option is set.

sourceEncoding

The encoding of the source file.

The encoding of the source file. It defaults to default system encoding that Falcon is able to detect. Use one of the encoding names known by the Transcoder class.

Methods

addFalconPath

Adds the default system paths to the path searched by this compiler.

_BaseCompiler.addFalconPath()

This method instructs the compiler that the default search path used by Falcon engine should be also searched when loading modules. This means that the directory in which official Falcon modules are stored, or those set in the FALCON_LOAD_PATH environment variables, or compiled in for a particular installation of Falcon, will be searched whenever loading a module.

The paths are inserted at the beginning; so, they will be the first searched. It is possible then to alter the search path by changing the Compiler.path property and i.e. prepending a desired local search path to it.

setDirective

Compiles a script on the fly.

_BaseCompiler.setDirective( dt, value )
dt Directive to be set.
value Value to be given to the directive.
ReturnOn success, a Module instance that contains the loaded module.
Raise
SyntaxError if the module contains logical error.
IoError if the input data is a file stream and there have been a read failure.

Sets a directive as if the scripts that will be loaded by this compiler defined it through the directive statement. Scripts can always override a directive by setting it to a different value in their code; notice also that compilation directives are useful only if a compilation actually take places. In case a .fam or a binary module is loaded, they have no effect.

Made with http://www.falconpl.org