Script Program. More...
#include <rinterpreter.h>
Public Member Functions | |
void | Exec (const RString &insts) |
RCursor< RPrgClass > | GetClasses (void) const |
RInterpreter (RPrgOutput *o) | |
void | Run (const RURI &uri) |
virtual | ~RInterpreter (void) |
Protected Member Functions | |
void | AddClass (RPrgClass *c) |
void | AddInst (RPrgInst *inst) |
void | AddVar (RPrgVar *var) |
void | AnalyzeParams (void) |
void | CleanupParams (void) |
void | DelVar (RPrgVar *var) |
void | Eol (bool dbl) |
void | Exec (void) |
RPrgVar * | Find (const RString &name) const |
size_t | GetLine (void) const |
RString | GetToken (const RString chars) |
virtual RString | GetValue (const RString &var) |
RString | GetWord (void) |
RString | ReadLiteral (void) |
void | SkipSpaces (void) |
void | TreatInst (const RString &inst, size_t depth, RChar param) |
void | TreatLine (size_t depth, RString line) |
RString | WhatTreated (void) const |
Protected Attributes | |
const RChar * | Char |
RContainer< RPrgClass, true, false > | Classes |
RPrgOutput * | Cout |
RURI | File |
size_t | Line |
RContainer< RPrgVar, false, false > | Parameters |
RStack< RPrgScope, true, true, true > | Scopes |
RContainer< RPrgInstSub, false, true > | Subroutines |
RStack< RPrgInstBlock, false, true, true > | tmpBlocks |
Detailed Description
Script Program.
The RInterpreter provides a class for executing a script program.
Constructor & Destructor Documentation
RInterpreter | ( | RPrgOutput * | o | ) |
Constructor of a program.
- Parameters
-
o Output.
|
virtual |
Destruct of the program.
Member Function Documentation
void Run | ( | const RURI & | uri | ) |
Run a program.
- Parameters
-
uri URI of the program.
void Exec | ( | const RString & | insts | ) |
Execute a block of instructions.
- Parameters
-
insts Instruction.
|
protected |
Execute the instructions.
|
protected |
Return a string of the form "filename(line)" representing the current element treated.
|
protected |
Add a variable.
- Parameters
-
var Pointer to the variable.
|
protected |
Remove a variable.
- Parameters
-
var Pointer to the variable.
|
protected |
Add an instruction.
- Parameters
-
inst Instruction.
Find a variable by searching in all local blocks.
- Parameters
-
name Name of the variable.
- Returns
- Pointer to the variable or 0 if not found.
Get the value of the variable.
- Parameters
-
var Name of the variable.
|
protected |
Add a class to the interpreter.
- Parameters
-
c Class to add.
|
protected |
Load the script file.
Treat instructions
- Parameters
-
inst depth param
|
protected |
Analyze the parameters. Put the results in Parameters.
|
protected |
Cleanup the parameters if necessary.
|
protected |
Read a literal value.
|
protected |
Get the next word at the line containing the instruction.
Get the next token at the line containing the instruction.
|
protected |
Treat end of line.
- Parameters
-
dbl Must the line contains a double point.
|
protected |
Line number of the current instruction.
|
protected |
Skip the spaces.
Member Data Documentation
|
protected |
Generic output.
|
protected |
List of all "Classes" defined in the program.
|
protected |
Subroutines defined in the program.
|
protected |
Temporary LIFO Stack of instructions blocks (used for analyze).
|
protected |
Parameters actually treated.
|
protected |
Next character to treat.
|
protected |
Number of the line where the last instruction begins.
|
protected |
Name of the file.