use of org.matheclipse.parser.client.ast.ASTNode in project symja_android_library by axkr.
the class Parser method getNumber.
/**
* Method Declaration.
*
* @return
* @see
*/
private ASTNode getNumber(final boolean negative) throws SyntaxError {
ASTNode temp = null;
final Object[] result = getNumberString();
String number = (String) result[0];
final int numFormat = ((Integer) result[1]).intValue();
try {
if (negative) {
number = '-' + number;
}
if (numFormat < 0) {
temp = fFactory.createDouble(number);
} else {
temp = fFactory.createInteger(number, numFormat);
}
} catch (final RuntimeException e) {
throwSyntaxError("Number format error: " + number, number.length());
}
getNextToken();
return temp;
}
Aggregations