This class evaluates a parse tree given a reference to its root node. It implements a visitor that visits the parse tree in depth-first order, evaluating each node and storing the result as a token in the node. Two exceptions are logic nodes and the ternary if node (the ? : construct), which do not necessarily evaluate all children nodes.
This class has the following limitations:
- It is a copy of ParseTreeCodeGenerator from data/expr and thus has lots of code for evaluating expressions, which we don't need
- It is not properly converting types: We need to add logic to convert types.
- The .tcl test has known failures involving nulls
- It does not evaluate constants.
@author Man-Kit Leung
@version $Id: CParseTreeCodeGenerator.java,v 1.56 2008/01/26 02:51:30 cxh Exp $
@since Ptolemy II 6.0
@Pt.ProposedRating Red
@Pt.AcceptedRating Red
@see ptolemy.data.expr.ASTPtRootNode