if (ast.getType() == DISPEL_v4Parser.LITERAL)
{
Tree child = ast.getChild(0);
if (child.getType() == DISPEL_v4Parser.FloatingPointLiteral)
{
return new Constant(Double.valueOf(child.getText()));
}
else if (child.getType() == DISPEL_v4Parser.StringLiteral)
{
// remove quotes around the string
return new Constant(child.getText().substring(1, child.getText().length()-1));
}
else if (child.getType() == DISPEL_v4Parser.DecimalLiteral)
{
return new Constant(Long.valueOf(child.getText()));
}
else if (child.getText().equals("true") || child.getText().equals("false"))
{
return new Constant(Boolean.valueOf(child.getText()));
}
}
else if (ast.getType() == DISPEL_v4Parser.VARIABLE_ID)
{
List<Expression> expressions = new ArrayList<Expression>();