Python API class rl3.RL3Engine
Contents
rl3.RL3Engine class overview
rl3.RL3Engine is a subclass of the rl3.BaseEngine class.
The class possesses members enabling to:
- create engine objects of RL3 type;
- perform operations specific for engines of RL3 type, e.g. parse and compile (link) RL3 sources directly (rather than load an engine model already compiled from RL3 sources).
Members inherited from the base class include:
- constructors to initialize rl3.SharedText, rl3.Fact, rl3.Factsheet class objects through factory;
- essential core functions, e.g. to run the engine, select execution mode, load a compiled model to the engine, etc.;
- utils (e.g. to create a simple annotation pattern on-the-fly).
constructor
def __init__(self):
Create an engine of RL3 type.
Returns: | a new engine object |
Class member functions
parse
def parse(self, definitions, stdlib_path = '.', silent = True):
Perform an inline parse of the source.
definitions: | a source code to be processed |
stdlib_path: | a path to the standard library |
silent: | True to suppress system messages, False otherwise
|
parse_project
def parse_project(self, project_file_path, stdlib_path = '.', silent = True):
Perform parsing of the project.
project_file_path: | a path to the project file (containing multiple modules). |
stdlib_path: | a path to the standard library |
silent: | True to suppress system messages, False otherwise
|
parse_module
def parse_module(self, module_file_path, stdlib_path = '.', silent = True):
Perform parsing of a single module.
module_file_path: | a path to the module file. |
stdlib_path: | a path to the standard library |
silent: | True to suppress system messages, False otherwise
|
link
def link(self, silent = True):
Link parsed data -- finalize and compile all parses into a single model.
silent: | True to suppress system messages, False otherwise
|
save
def save(self, file_path):
Save the file with compiled output. In most cases it is used in sequence of parse
, link
and save
calls.
file_path: | a path where a saved file is to be created |
Functions derived from rl3.BaseEngine class
Refer to rl3.BaseEngine class documentation.