Fabrique

A build language for complex systems

 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
fabrique::ast::EvalContext Class Reference

A context for evaluating AST Expression objects. More...

#include <EvalContext.h>

Inheritance diagram for fabrique::ast::EvalContext:
fabrique::dag::DAGBuilder::Context

Classes

class  AlternateScoping
 An object that represents the use of an alternative scope stack and that will restore the original stack on destruction. More...
 
class  Scope
 An object to represent descending in a call stack. More...
 
class  ScopedValueName
 An object for declaring the name of the value whose initializer we are currently evaluating. More...
 

Public Member Functions

 EvalContext (TypeContext &ctx, std::string buildroot, std::string srcroot)
 
std::vector
< dag::DAG::BuildTarget > 
Evaluate (const ast::Scope &)
 
Scope EnterScope (const std::string &name)
 
AlternateScoping ChangeScopeStack (const dag::ValueMap &alternativeScope)
 
ScopedValueName evaluating (const std::string &name)
 
dag::DAGBuilderbuilder ()
 
virtual std::string buildroot () const
 
virtual std::string srcroot () const
 
virtual std::string currentValueName () const override
 
virtual TypeContexttypes () const override
 
void Define (ScopedValueName &name, dag::ValuePtr value)
 Define a named dag::Value in the current scope.
 
dag::ValuePtr Lookup (const std::string &name)
 Look up a named value from the current scope or a parent scope.
 
dag::ValuePtr Function (dag::Function::Evaluator, const SharedPtrVec< dag::Parameter > &, const FunctionType &, SourceRange=SourceRange::None())
 Define a dag::Function.
 
void Alias (const std::shared_ptr< dag::Target > &)
 Create a new alias for an existing dag::Target.
 

Protected Member Functions

dag::ValueMap & CurrentScope ()
 
dag::ValueMap PopScope ()
 
dag::ValueMap CopyCurrentScope ()
 Make a deep copy of the current scope and all of its parents.
 
void DumpScope ()
 
void PushValueName (const std::string &)
 
std::string PopValueName ()
 
std::string fullyQualifiedName () const
 The fully-qualified name of the value currently being defined.
 
std::string qualifyName (std::string name) const
 

Protected Attributes

TypeContextctx_
 
std::deque< std::string > scopeName_
 The components of the current scope's fully-qualified name.
 
std::deque< dag::ValueMap > scopes_
 Symbols defined in this scope (or the one up from it, or up...).
 
SharedPtrVec< dag::Filefiles_
 
SharedPtrVec< dag::Buildbuilds_
 
SharedPtrMap< dag::Rulerules_
 
SharedPtrMap< dag::Valuevariables_
 
SharedPtrMap< dag::Targettargets_
 

Detailed Description

A context for evaluating AST Expression objects.

This class adds AST scoping logic to dag::DAGBuilder::Context.

Definition at line 69 of file EvalContext.h.


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