public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException {
_debug(node);
if (node.isConstant() && node.isEvaluated()) {
Stmt insertPoint = Jimple.v().newNopStmt();
_units.insertBefore(insertPoint, _insertPoint);
Local local = PtolemyUtilities.buildConstantTokenLocal(_body,
insertPoint, node.getToken(), "token");
_nodeToLocal.put(node, local);
return;
}
Local local;
try {
local = _getLocalForName(node.getName());
} catch (IllegalActionException ex) {
// Must be a constant. FIXME: Catching the exception is a
// lousy way to figure this out.
// Look up for constants.
if (ptolemy.data.expr.Constants.get(node.getName()) != null) {
//System.err.println("tested!");
// A named constant that is recognized by the parser.
Stmt insertPoint = Jimple.v().newNopStmt();
_units.insertBefore(insertPoint, _insertPoint);
local = PtolemyUtilities.buildConstantTokenLocal(_body,
insertPoint, ptolemy.data.expr.Constants.get(node
.getName()), "token");
} else {