Class _BaseCompiler[in Compiler]

Abstract base class for the Compiler and ICompiler classes.

class _BaseCompiler

more...

Summary

alwaysRecompIf 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.
compileInMemoryIf true (the default) intermediate compilation steps are performed in memory.
ignoreSourcesIf true, sources are ignored, and only .fam or shared object/dynamic link libraries will be loaded.
languageLanguage code used to load language-specific string tables.
launchAtLinkIf true, the __main__ function (that is, the entry point) of the loaded modules is executed before returning it.
pathThe search path for modules loaded by name.
saveMandatoryIf true, when saveModule option is true too and a module can't be serialized, the compiler raises an exception.
saveModulesIf 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.
sourceEncodingThe 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.

Detailed description

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.

Properties

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.

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 )

dtDirective to be set.
valueValue to be given to the directive.
Returns: On success, a Module instance that contains the loaded module.
Raises:
SyntaxErrorif the module contains logical error.
IoErrorif 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 faldoc 2.2.1