Abstract base class for the Compiler and ICompiler classes.
class _BaseCompiler
alwaysRecomp | 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. |
ignoreSources | 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. |
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 .fam pre-compiled module, that may be used if the same module is loaded a second time. |
sourceEncoding | The encoding of the source file. |
addFalconPath() | Adds the default system paths to the path searched by this compiler. |
setDirective() | Compiles a script on the fly. |
class _BaseCompiler
Abstract base class for the Compiler and ICompiler classes.
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.
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.
If true (the default) intermediate compilation steps are performed in memory.
If true, sources are ignored, and only .fam or shared object/dynamic link libraries will be loaded.
Language code used to load language-specific string tables.
If true, the __main__ function (that is, the entry point) of the loaded modules is executed before returning it.
The search path for modules loaded by name.
If true, when saveModule option is true too and a module can't be serialized, the compiler raises an exception.
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.
The encoding of the source file.
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.
Compiles a script on the fly.
_BaseCompiler.setDirective( dt, value )
dt | Directive to be set. | ||||
value | Value to be given to the directive. | ||||
Returns: | On success, a Module instance that contains the loaded module. | ||||
Raises: |
|
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.