BlockExecution Class Reference

Controls the execution of a program block. More...

#include <blockexecution.h>

List of all members.

Public Types

enum  ExitCode {
  NoExit, EndReached, BreakPointReached, QuotaExhausted,
  Broken, Continued, Returned
}
 Codes signifying the reason that an execution terminated. More...

Public Member Functions

 BlockExecution (Program block, const Evaluator &evaluator, Scope &scope, ContainerParser *parser=nullptr)
ExitCode execute ()
 Execute the block until it is done.
ExitCode execute (Program::const_iterator breakpoint)
 Execute the block until the breakpoint is reached or it is done.
ExitCode execute (size_t &parseQuota)
 Execute the block until it is done as long as the number of members declared doesn't exceed the parseQuota.
ExitCode execute (Program::const_iterator breakpoint, size_t &parseQuota)
 Execute the block until the breakpoint is reached or it is done as long as the number of members declared doesn't exceed the parseQuota.
bool done ()
 Check if the execution of the block is done.
Variable returnValue ()
 Get the value returned by the block in case the execution has exited with a return statement.

Detailed Description

Controls the execution of a program block.

The program block can either be part of a class definition or a function defintion.


Member Enumeration Documentation

Codes signifying the reason that an execution terminated.

Enumerator:
NoExit 

Invalid exit code.

EndReached 

Has exited when the end of the program block is reached.

BreakPointReached 

Has exited when the breakpoint defined has been reached.

QuotaExhausted 

Has exited when the quota of members declarations have been exhausted.

Broken 

Has exited when a break statement has been reached.

Continued 

Has exited when a continue statement has been reached.

Returned 

Has exited when a return statement has been reached.


Constructor & Destructor Documentation

BlockExecution::BlockExecution ( Program  block,
const Evaluator evaluator,
Scope scope,
ContainerParser parser = nullptr 
)
Parameters:
blockAn execution block tagged program
evaluatorUsed to evaluate right values.
scopeUsed to declare local variables.
parserUsed to handle member declarations in a class definition.

Member Function Documentation

Check if the execution of the block is done.

Execute the block until it is done.

Execute the block until the breakpoint is reached or it is done.

ExitCode BlockExecution::execute ( size_t &  parseQuota)

Execute the block until it is done as long as the number of members declared doesn't exceed the parseQuota.

ExitCode BlockExecution::execute ( Program::const_iterator  breakpoint,
size_t &  parseQuota 
)

Execute the block until the breakpoint is reached or it is done as long as the number of members declared doesn't exceed the parseQuota.

Get the value returned by the block in case the execution has exited with a return statement.


The documentation for this class was generated from the following file: