elftosb::EvalContext Class Reference

Context for evaluating AST tree and expressions. More...

`#include <EvalContext.h>`

Collaboration diagram for elftosb::EvalContext:
[legend]

## Classes

class | SourceFileManager
| Abstract interface for a manager of source files. More...
struct | variable_info_t
| Information about a variable's value. More...

## Public Member Functions

| EvalContext ()
| Constructor.
virtual | ~EvalContext ()
| Destructor.
void | dump ()
Source file manager
void | setSourceFileManager (SourceFileManager *manager)
SourceFileManager * | getSourceFileManager ()
Variables
bool | isVariableDefined (const std::string &name)
uint32_t | getVariableValue (const std::string &name)
int_size_t | getVariableSize (const std::string &name)
void | setVariable (const std::string &name, uint32_t value, int_size_t size=kWordSize)
Locks
bool | isVariableLocked (const std::string &name)
void | lockVariable (const std::string &name)
void | unlockVariable (const std::string &name)

## Protected Types

typedef std::map< std::string, variable_info_t > | variable_map_t
| Type to maps between the variable name and its info.

## Protected Attributes

SourceFileManager * | m_sourcesManager
| Interface to source file manager.
variable_map_t | m_variables
| Map of variables to their final values.

## Detailed Description

Context for evaluating AST tree and expressions.

Keeps a map of variable names to integer values. Each integer value has a size attribute in addition to the actual value. Variables can be locked, which simply means that they cannot be assigned a new value.

## Class Documentation

struct elftosb::EvalContext::variable_info_t

Information about a variable's value.

Class Members
bool | m_isLocked | Can this variable's value be changed?
int_size_t | m_size | Number of bytes.
uint32_t | m_value | Variable value.

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

- EvalContext.h
- EvalContext.cpp