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'.
Tree evaldocexpr (Tree docexpr, Tree eqlist)
Tree pushValueDef (Tree id, Tree def, Tree lenv)
 Push a new layer and add a single definition.
Tree simplifyPattern (Tree pattern)
 Simplify a block-diagram pattern by computing its numerical sub-expressions.

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 115 of file eval.cpp.

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

Referenced by mapEvalDocEqn(), and printDocDgm().

{
    return a2sb(eval(docexpr, nil, pushMultiClosureDefs(eqlist, nil, nil)));
}

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 101 of file eval.cpp.

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

Referenced by main().

{
    Tree b = a2sb(eval(boxIdent("process"), nil, pushMultiClosureDefs(eqlist, nil, nil)));

    if (gSimplifyDiagrams) {
        b = boxSimplification(b);
    }

    return b;
}

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.

{
    Tree lenv2 = pushNewLayer(lenv);
    addLayerDef(id, def, lenv2);
    return lenv2;
}

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

Parameters:
patternan evaluated block-diagram
Returns:
a simplified pattern

Definition at line 590 of file eval.cpp.

{
    Tree num;
    if (!getNumericProperty(value,num)) {
        if (!isBoxNumeric(value,num)) {
            num = value;
        }
        setNumericProperty(value,num);
    }
    return num;
}