Instructions Block. More...
#include <rprginstblock.h>
Inheritance diagram for RPrgInstBlock:
Collaboration diagram for RPrgInstBlock:
Public Member Functions | |
void | AddInst (RPrgInst *ins) |
void | AddVar (RPrgVar *var) |
void | ClearInstructions (void) |
void | DelVar (RPrgVar *var) |
size_t | GetDepth (void) const |
RPrgInstBlock (RInterpreter *prg, size_t depth) | |
virtual void | Run (RInterpreter *prg, RPrgOutput *o) |
virtual void | RunBlock (RInterpreter *prg, RPrgOutput *o) |
virtual | ~RPrgInstBlock (void) |
Public Member Functions inherited from RPrgInst | |
int | Compare (const RPrgInst &t) const |
int | Compare (const RString &t) const |
size_t | GetLine (void) const |
RPrgInst (size_t line) | |
virtual | ~RPrgInst (void) |
Protected Attributes | |
size_t | Depth |
R::RContainer< RPrgInst, true, false > | Insts |
RPrgScope * | Vars |
Detailed Description
Instructions Block.
The RPrgInstBlock provides a class for a block of instructions.
Constructor & Destructor Documentation
RPrgInstBlock | ( | RInterpreter * | prg, |
size_t | depth | ||
) |
Construct a block of instructions.
- Parameters
-
prg Program. depth Indentation.
|
virtual |
Destruct the block of instructions.
Member Function Documentation
void AddInst | ( | RPrgInst * | ins | ) |
Add an instruction to the block.
void AddVar | ( | RPrgVar * | var | ) |
Add a variable.
- Parameters
-
var Pointer to the variable.
void DelVar | ( | RPrgVar * | var | ) |
Remove a variable.
- Parameters
-
var Pointer to the variable.
size_t GetDepth | ( | void | ) | const |
Get the number of tabs.
- Returns
- size_t.
void ClearInstructions | ( | void | ) |
Clear the instructions associated to the block.
|
virtual |
Run the all instructions in the block. This is the method that should be overloaded by child classes.
- Parameters
-
prg Program. o Output.
Reimplemented in RPrgInstSub, and RPrgInstFor.
|
virtual |
Run the blocks. In practice, the methods creates a local scope and execute the method 'RunBlock'.
- Parameters
-
prg Program. o Output.
Reimplemented from RPrgInst.
Member Data Documentation
|
protected |
List of all "Instructions" to execute.
|
protected |
Scope of the block.
|
protected |
Depth corresponding to this block.