SeExpr
SeExpr2::ExprVarEnvBuilder Class Reference

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

#include <ExprEnv.h>

Public Member Functions

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

Private Attributes

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

Detailed Description

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

Definition at line 148 of file ExprEnv.h.

Constructor & Destructor Documentation

◆ ExprVarEnvBuilder()

SeExpr2::ExprVarEnvBuilder::ExprVarEnvBuilder ( )
inline

Creates an empty builder with one current scope entry.

Definition at line 151 of file ExprEnv.h.

References reset().

Member Function Documentation

◆ createDescendant()

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

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

Definition at line 163 of file ExprEnv.h.

References all.

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

◆ current()

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

◆ reset()

void SeExpr2::ExprVarEnvBuilder::reset ( )
inline

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

Definition at line 153 of file ExprEnv.h.

References _currentEnv, and all.

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

◆ setCurrent()

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

Set a new current variable scope.

Definition at line 161 of file ExprEnv.h.

References _currentEnv.

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

Member Data Documentation

◆ _currentEnv

ExprVarEnv* SeExpr2::ExprVarEnvBuilder::_currentEnv
private

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

Definition at line 174 of file ExprEnv.h.

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

◆ all

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

All owned symbol tables.

Definition at line 172 of file ExprEnv.h.

Referenced by createDescendant(), and reset().


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