#include <symbols.h>
Public Member Functions | |
frame_t () | |
Default constructor. | |
frame_t (const frame_t &) | |
Copy constructor. | |
~frame_t () | |
Destructor. | |
const frame_t & | operator= (const frame_t &) |
Assignment operator. | |
bool | operator== (const frame_t &) const |
Equality operator. | |
bool | operator!= (const frame_t &) const |
Inequality operator. | |
uint32_t | getSize () const |
Returns the number of symbols in this frame. | |
symbol_t | getSymbol (int32_t) |
Returns the Nth symbol in this frame. | |
int32_t | getIndexOf (std::string name) const |
Returns the index of the symbol with the give name. | |
symbol_t | operator[] (int32_t) |
Returns the Nth symbol in this frame. | |
const symbol_t | operator[] (int32_t) const |
Returns the Nth symbol in this frame. | |
symbol_t | addSymbol (std::string name, type_t, void *user=NULL) |
Adds a symbol of the given name and type to the frame. | |
void | add (frame_t) |
Add all symbols from the given frame. | |
bool | resolve (std::string name, symbol_t &symbol) |
Resolves a name in this frame or a parent frame. | |
frame_t | getParent () throw (NoParentException) |
Returns the parent frame. | |
bool | hasParent () const |
Returns true if this frame has a parent. | |
Static Public Member Functions | |
static frame_t | createFrame () |
Creates and returns a new root-frame. | |
static frame_t | createFrame (const frame_t &parent) |
Creates and returns a new sub-frame. | |
Protected Member Functions | |
frame_t (void *) | |
Friends | |
class | symbol_t |
A frame is an ordered collection of symbols (see also symbol_t). Frames can only be accessed via an instance of frame_t. Internally, frames are reference counted and do not need to be deallocated manually.
A frame can either be a root-frame or a sub-frame. Sub-frames have a parent frame; root frames do not. When a symbol name cannot be resolved in the current frame, it is resolved recursively in the parent frame.
Frames are constructed using one of the static factory methods of frame_t.
In order to avoid cyclic references no counted reference to the parent frame is maintained. Hence, the existence of the parent frame must be ensured by other means throughout the lifetime of the sub-frame.
|
|
|
Default constructor.
|
|
Copy constructor.
|
|
Destructor.
|
|
Add all symbols from the given frame.
|
|
Adds a symbol of the given name and type to the frame.
|
|
Creates and returns a new sub-frame.
|
|
Creates and returns a new root-frame.
|
|
Returns the index of the symbol with the give name.
|
|
Returns the parent frame.
|
|
Returns the number of symbols in this frame.
|
|
Returns the Nth symbol in this frame.
|
|
Returns true if this frame has a parent.
|
|
Inequality operator.
|
|
Assignment operator.
|
|
Equality operator.
|
|
Returns the Nth symbol in this frame.
|
|
Returns the Nth symbol in this frame.
|
|
Resolves a name in this frame or a parent frame.
|
|
|