SeExpr
Public Member Functions | Private Attributes | List of all members
SeExpr2::ExprVarEnvBuilder Class Reference

Variable scope builder is used by the type checking and code gen to track visiblity of variables and changing of scopes. More...

#include <ExprEnv.h>

Public Member Functions

 ExprVarEnvBuilder ()
 Creates an empty builder with one current scope entry. More...
 
void reset ()
 Reset to factory state (one empty environment that is current) More...
 
ExprVarEnvcurrent ()
 Return the current variable scope. More...
 
void setCurrent (ExprVarEnv *env)
 Set a new current variable scope. More...
 
ExprVarEnvcreateDescendant (ExprVarEnv *parent)
 Create a descendant scope from the provided parent, does not clobber current. More...
 

Private Attributes

std::vector< std::unique_ptr
< ExprVarEnv > > 
all
 All owned symbol tables. More...
 
ExprVarEnv_currentEnv
 The current symbol table (should be a pointer owned by all) More...
 

Detailed Description

Variable scope builder is used by the type checking and code gen to track visiblity of variables and changing of scopes.

Definition at line 152 of file ExprEnv.h.

Constructor & Destructor Documentation

SeExpr2::ExprVarEnvBuilder::ExprVarEnvBuilder ( )
inline

Creates an empty builder with one current scope entry.

Definition at line 155 of file ExprEnv.h.

References reset().

Member Function Documentation

ExprVarEnv* SeExpr2::ExprVarEnvBuilder::createDescendant ( ExprVarEnv parent)
inline

Create a descendant scope from the provided parent, does not clobber current.

Definition at line 169 of file ExprEnv.h.

References all.

Referenced by SeExpr2::ExprIfThenElseNode::prep().

ExprVarEnv* SeExpr2::ExprVarEnvBuilder::current ( )
inline
void SeExpr2::ExprVarEnvBuilder::reset ( )
inline

Reset to factory state (one empty environment that is current)

Definition at line 159 of file ExprEnv.h.

References _currentEnv, and all.

Referenced by ExprVarEnvBuilder(), and SeExpr2::Expression::reset().

void SeExpr2::ExprVarEnvBuilder::setCurrent ( ExprVarEnv env)
inline

Set a new current variable scope.

Definition at line 167 of file ExprEnv.h.

References _currentEnv.

Referenced by SeExpr2::ExprIfThenElseNode::prep().

Member Data Documentation

ExprVarEnv* SeExpr2::ExprVarEnvBuilder::_currentEnv
private

The current symbol table (should be a pointer owned by all)

Definition at line 179 of file ExprEnv.h.

Referenced by current(), reset(), and setCurrent().

std::vector<std::unique_ptr<ExprVarEnv> > SeExpr2::ExprVarEnvBuilder::all
private

All owned symbol tables.

Definition at line 177 of file ExprEnv.h.

Referenced by createDescendant(), and reset().


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