A list of compiled muSED statements and the parsing tools needed to create it. More...
#include <muSED.h>
Public Types | |
typedef std::pair < std::string::const_iterator &, std::string::const_iterator & > | CharRange |
Public Member Functions | |
void | clear () |
template<class StringIterator > | |
void | compile (StringIterator first, StringIterator last) |
template<class StringContainer > | |
CompiledScript (StringContainer const &script) | |
std::string const & | error () const |
bool | execute (ScriptRuntimeContext *context) |
void | fail (std::string const &errormsg, int line) |
Set the script parsing state to fail at a certain line. | |
bool | ok () const |
~CompiledScript () | |
Static Public Member Functions | |
template<class LineRange > | |
static void | compileStream (LineRange lineRange, CharRange charRange, Statement *parent, int &line, CompiledScript *script) |
Public Attributes | |
std::string | error_ |
bool | ok_ |
OuterStatement | outerStatement_ |
A list of compiled muSED statements and the parsing tools needed to create it.
Such statements can be executed on a given line in a given ScriptRuntimeContext.
The job of executing statements is broken up between the CompiledScript object and the various statements that it contains. A statement handles the job of performing a single function on a single line, and the CompiledScript handles multiple lines, error reporting, etc.
Definition at line 1479 of file muSED.h.
typedef std::pair<std::string::const_iterator&, std::string::const_iterator&> CharRange |
~CompiledScript | ( | ) |
CompiledScript | ( | StringContainer const & | script | ) |
void clear | ( | ) |
void compile | ( | StringIterator | first, | |
StringIterator | last | |||
) |
static void compileStream | ( | LineRange | lineRange, | |
CharRange | charRange, | |||
Statement * | parent, | |||
int & | line, | |||
CompiledScript * | script | |||
) | [static] |
On entry, the charRange should refer to some segment of the first line defined in the lineRange. That is, charRange must be valid pointers into lineRange.first.
Parse statements from the specified range of strings in some container and produce statements into the statements_ member variable.
Definition at line 1557 of file muSED.h.
std::string const& error | ( | ) | const |
bool execute | ( | ScriptRuntimeContext * | context | ) |
void fail | ( | std::string const & | errormsg, | |
int | line | |||
) |
bool ok | ( | ) | const |