CPP 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 SharedText, Fact, 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
RL3Engine();
Create an engine of RL3 type.
Class member functions
parse functions
void parse(const UnicodeString& definitions, const std::string& stdlib_path = ".", bool silent = true);
Perform an inline parse of the source. The definitions
parameter is of unicode string type.
TBD!!!: clarify whether stdlib_path can be indicated as null or an empty string
definitions: | a source to be parsed |
stdlib_path: | a path to the standard library |
silent: | true (default) to suppress system messages, false if otherwise.
|
Returns: | nothing |
void parse(const std::string& definitions, const std::string& stdlib_path = ".", bool silent = true);
Perform an inline parse of the source. The definitions
and stdlib_path
parameters are of UTF-8 type.
definitions: | a source to be parsed |
stdlib_path: | a path to the standard library |
silent: | true (default) to suppress system messages, false if otherwise.
|
Returns: | nothing |
void parse(const char* definitions, const char* stdlib_path = ".", bool silent = true) {parse(std::string(definitions), std::string(stdlib_path), silent);}
Perform an inline parse of the source. The definitions
and stdlib_path
parameters are character pointers.
definitions: | a source to be parsed |
stdlib_path: | a path to the standard library |
silent: | true (default) to suppress system messages, false if otherwise.
|
Returns: | nothing |
parse_project
void parse_project(const std::string& project_file_path, const std::string& stdlib_path = ".", bool 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 (default) to suppress system messages, false if otherwise
|
Returns: | nothing |
parse_module
void parse_module(const std::string& module_file_path, const std::string& stdlib_path = ".", bool 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 (default) to suppress system messages, false if otherwise
|
Returns: | nothing |
link
void link(bool silent = true);
Link data from single parses.
silent: | true (default) to suppress system messages, false if otherwise
|
Returns: | nothing |
save
void save(const std::string& file_path);
Save the file with compiled output.
file_path: | a path where a saved file is to be created |
Returns: | nothing |
Functions derived from the BaseEngine class
Refer to rl3::BaseEngine class.