FAUST compiler  0.9.9.6b8
Functions
eval.hh File Reference

Interface of the block diagram evaluator. More...

#include "boxes.hh"
#include "sourcereader.hh"
#include "environment.hh"
Include dependency graph for eval.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Tree evalprocess (Tree eqlist)
 Eval the definition of 'process'. More...
 
Tree evaldocexpr (Tree docexpr, Tree eqlist)
 
Tree pushValueDef (Tree id, Tree def, Tree lenv)
 Push a new layer and add a single definition. More...
 
Tree simplifyPattern (Tree pattern)
 Simplify a block-diagram pattern by computing its numerical sub-expressions. More...
 

Detailed Description

Interface of the block diagram evaluator.

A strict lambda-calculus evaluator for block diagram expressions.

Definition in file eval.hh.

Function Documentation

Tree evaldocexpr ( Tree  docexpr,
Tree  eqlist 
)

Definition at line 114 of file eval.cpp.

References a2sb(), eval(), nil, and pushMultiClosureDefs().

Referenced by mapEvalDocEqn(), and printDocDgm().

115 {
116  return a2sb(eval(docexpr, nil, pushMultiClosureDefs(eqlist, nil, nil)));
117 }
static Tree eval(Tree exp, Tree visited, Tree localValEnv)
Definition: eval.cpp:280
static Tree a2sb(Tree exp)
Definition: eval.cpp:135
Tree pushMultiClosureDefs(Tree ldefs, Tree visited, Tree lenv)
Push a new layer with multiple definitions creating the appropriate closures.
Tree nil
Definition: list.cpp:116

Here is the call graph for this function:

Here is the caller graph for this function:

Tree evalprocess ( Tree  eqlist)

Eval the definition of 'process'.

Eval the definition of 'process' in the environment passed as argument

Parameters
eqlistthe global environment (a list of definitions)
Returns
the 'process' block diagram in normal form that is

Eval the definition of 'process'.

Strict evaluation of a block diagram expression by applying beta reduction.

Parameters
eqlista list of faust defintions forming the the global environment
Returns
the process block diagram in normal form

Definition at line 100 of file eval.cpp.

References a2sb(), boxIdent(), boxSimplification(), eval(), gSimplifyDiagrams, nil, and pushMultiClosureDefs().

Referenced by main().

101 {
102  Tree b = a2sb(eval(boxIdent("process"), nil, pushMultiClosureDefs(eqlist, nil, nil)));
103 
104  if (gSimplifyDiagrams) {
105  b = boxSimplification(b);
106  }
107 
108  return b;
109 }
static Tree boxSimplification(Tree box)
boxSimplification(box) : simplify a block-diagram by replacing expressions denoting a constant number...
Definition: eval.cpp:1347
static Tree eval(Tree exp, Tree visited, Tree localValEnv)
Definition: eval.cpp:280
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
Tree boxIdent(const char *name)
Definition: boxes.cpp:57
static Tree a2sb(Tree exp)
Definition: eval.cpp:135
Tree pushMultiClosureDefs(Tree ldefs, Tree visited, Tree lenv)
Push a new layer with multiple definitions creating the appropriate closures.
bool gSimplifyDiagrams
Definition: main.cpp:129
Tree nil
Definition: list.cpp:116

Here is the call graph for this function:

Here is the caller graph for this function:

Tree pushValueDef ( Tree  id,
Tree  def,
Tree  lenv 
)

Push a new layer and add a single definition.

Parameters
idthe symbol id to be defined
defthe definition to be binded to the symbol id
lenvthe environment where to push the layer and add the definition
Returns
the new environment

Definition at line 94 of file environment.cpp.

95 {
96  Tree lenv2 = pushNewLayer(lenv);
97  addLayerDef(id, def, lenv2);
98  return lenv2;
99 }
static void addLayerDef(Tree id, Tree def, Tree lenv)
Add a definition (as a property) to the current top level layer.
Definition: environment.cpp:69
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
static Tree pushNewLayer(Tree lenv)
Push a new (unique) empty layer (where multiple definitions can be stored) on top of an existing envi...
Definition: environment.cpp:26
Tree simplifyPattern ( Tree  value)

Simplify a block-diagram pattern by computing its numerical sub-expressions.

Parameters
patternan evaluated block-diagram
Returns
a simplified pattern

Definition at line 617 of file eval.cpp.

618 {
619  Tree num;
620  if (!getNumericProperty(value,num)) {
621  if (!isBoxNumeric(value,num)) {
622  num = value;
623  }
624  setNumericProperty(value,num);
625  }
626  return num;
627 }
static bool isBoxNumeric(Tree in, Tree &out)
Definition: eval.cpp:630
Definition: num.hh:58
void setNumericProperty(Tree t, Tree num)
Definition: eval.cpp:599
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
bool getNumericProperty(Tree t, Tree &num)
Definition: eval.cpp:604