jplus-0.4.6
|
A J+ script. More...
#include <src/jplus.h>
Public Member Functions | |
jplus () | |
initialize J+ engine with no script | |
bool | init (std::istream &script) |
Load and pre-parse J+ script. | |
~jplus () | |
Free allocated memory. | |
bool | set (std::string name, jarray data) |
Set value of the specified variable inside J+ environment, mark all dependent variables "dirty". | |
jarray | get (std::string name) |
Perform all the necessary calculations to computate the specified variable, return its value in an array. | |
std::vector< std::string > | getProgram (std::set< std::string > vars) |
Pull minimal set of J sentences for computing a given set of variables, assuming everything is "dirty". | |
std::vector< std::string > | getProgram () |
Pull all the sentences in J+ script. | |
Protected Member Functions | |
virtual void | libInit () |
Called by the constructor before parsing the J+ script. |
A J+ script.
jplus::jplus | ( | ) |
initialize J+ engine with no script
jplus::~jplus | ( | ) |
Free allocated memory.
jarray jplus::get | ( | std::string | name | ) |
Perform all the necessary calculations to computate the specified variable, return its value in an array.
name | name of variable to compute. |
Reimplemented from jengine.
std::vector<std::string> jplus::getProgram | ( | std::set< std::string > | vars | ) |
Pull minimal set of J sentences for computing a given set of variables, assuming everything is "dirty".
vars | set of variable names to pull. |
std::vector<std::string> jplus::getProgram | ( | ) |
Pull all the sentences in J+ script.
This pulls all the sentences, assigning value of some variable.
bool jplus::init | ( | std::istream & | script | ) |
Load and pre-parse J+ script.
script | stream, containing the script to load. |
Reimplemented in yacts.
virtual void jplus::libInit | ( | ) | [protected, virtual] |
Called by the constructor before parsing the J+ script.
Does nothing by default, but can be overridden to prepend an additional J+ stream with some definitions and/or define a few verbs and adverbs to be used in J+ program.
Reimplemented in yacts.
bool jplus::set | ( | std::string | name, |
jarray | data | ||
) |
Set value of the specified variable inside J+ environment, mark all dependent variables "dirty".
name | name of the variable. |
data | array for the variable to refer to. |