KSeExpr 6.0.0.0
Public Member Functions | Private Attributes | List of all members
KSeExpr::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 {nullptr}
 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 180 of file ExprEnv.h.

Constructor & Destructor Documentation

◆ ExprVarEnvBuilder()

KSeExpr::ExprVarEnvBuilder::ExprVarEnvBuilder ( )
inline

Creates an empty builder with one current scope entry.

Definition at line 184 of file ExprEnv.h.

References reset().

Member Function Documentation

◆ createDescendant()

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

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

Definition at line 206 of file ExprEnv.h.

References all.

◆ current()

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

Return the current variable scope.

Definition at line 196 of file ExprEnv.h.

References _currentEnv.

◆ reset()

void KSeExpr::ExprVarEnvBuilder::reset ( )
inline

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

Definition at line 189 of file ExprEnv.h.

References _currentEnv, and all.

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

◆ setCurrent()

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

Set a new current variable scope.

Definition at line 201 of file ExprEnv.h.

References _currentEnv.

Member Data Documentation

◆ _currentEnv

ExprVarEnv* KSeExpr::ExprVarEnvBuilder::_currentEnv {nullptr}
private

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

Definition at line 218 of file ExprEnv.h.

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

◆ all

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

All owned symbol tables.

Definition at line 216 of file ExprEnv.h.

Referenced by createDescendant(), and reset().


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