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. 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...
ExprVarEnv * | current ()
| Return the current variable scope. More...
void | setCurrent (ExprVarEnv *env)
| Set a new current variable scope. More...
ExprVarEnv * | createDescendant (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.

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

Return the current variable scope.

Definition at line 159 of file ExprEnv.h.

References _currentEnv.

Referenced by SeExpr2::ExprPrototypeNode::prep(), SeExpr2::ExprIfThenElseNode::prep(), SeExpr2::ExprAssignNode::prep(), SeExpr2::ExprVarNode::prep(), and SeExpr2::ExprFuncNode::prep().

## ◆ 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:

- /build/seexpr/src/SeExpr/src/SeExpr2/ExprEnv.h