Instructions Block. More...

#include <rprginstblock.h>

Inheritance diagram for RPrgInstBlock:
[legend]
Collaboration diagram for RPrgInstBlock:
[legend]

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
 
RPrgScopeVars
 

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
prgProgram.
depthIndentation.
virtual ~RPrgInstBlock ( void  )
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
varPointer to the variable.
void DelVar ( RPrgVar var)

Remove a variable.

Parameters
varPointer 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 void RunBlock ( RInterpreter prg,
RPrgOutput o 
)
virtual

Run the all instructions in the block. This is the method that should be overloaded by child classes.

Parameters
prgProgram.
oOutput.

Reimplemented in RPrgInstSub, and RPrgInstFor.

virtual void Run ( RInterpreter prg,
RPrgOutput o 
)
virtual

Run the blocks. In practice, the methods creates a local scope and execute the method 'RunBlock'.

Parameters
prgProgram.
oOutput.

Reimplemented from RPrgInst.

Member Data Documentation

R::RContainer<RPrgInst,true,false> Insts
protected

List of all "Instructions" to execute.

RPrgScope* Vars
protected

Scope of the block.

size_t Depth
protected

Depth corresponding to this block.