@Override TemplateModel calculateResult(String s, Environment env) throws TemplateException { try { return new SimpleNumber(env.getArithmeticEngine().toNumber(s)); } catch (NumberFormatException nfe) { throw NonNumericalException.newMalformedNumberException(this, s, env); } } }
final public Expression NumberLiteral() throws ParseException {Token op = null, t; switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case INTEGER:{ t = jj_consume_token(INTEGER); break; } case DECIMAL:{ t = jj_consume_token(DECIMAL); break; } default: jj_la1[13] = jj_gen; jj_consume_token(-1); throw new ParseException(); } String s = t.image; Expression result = new NumberLiteral(pCfg.getArithmeticEngine().toNumber(s)); Token startToken = (op != null) ? op : t; result.setLocation(template, startToken, t); {if ("" != null) return result;} throw new Error("Missing return statement in function"); }
@Override TemplateModel calculateResult(String s, Environment env) throws TemplateException { try { return new SimpleNumber(env.getArithmeticEngine().toNumber(s)); } catch (NumberFormatException nfe) { throw NonNumericalException.newMalformedNumberException(this, s, env); } } }
@Override TemplateModel calculateResult(String s, Environment env) throws TemplateException { try { return new SimpleNumber(env.getArithmeticEngine().toNumber(s)); } catch (NumberFormatException nfe) { throw NonNumericalException.newMalformedNumberException(this, s, env); } } }
TemplateModel calculateResult(String s, Environment env) throws TemplateException { try { return new SimpleNumber(env.getArithmeticEngine().toNumber(s)); } catch(NumberFormatException nfe) { String mess = "Error: " + getStartLocation() + "\nExpecting a number here, found: " + s; throw new NonNumericalException(mess, env); } } }
final public Expression NumberLiteral() throws ParseException {Token op = null, t; switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case INTEGER:{ t = jj_consume_token(INTEGER); break; } case DECIMAL:{ t = jj_consume_token(DECIMAL); break; } default: jj_la1[13] = jj_gen; jj_consume_token(-1); throw new ParseException(); } String s = t.image; Expression result = new NumberLiteral(pCfg.getArithmeticEngine().toNumber(s)); Token startToken = (op != null) ? op : t; result.setLocation(template, startToken, t); {if ("" != null) return result;} throw new Error("Missing return statement in function"); }
final public Expression NumberLiteral() throws ParseException {Token op = null, t; switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case INTEGER:{ t = jj_consume_token(INTEGER); break; } case DECIMAL:{ t = jj_consume_token(DECIMAL); break; } default: jj_la1[13] = jj_gen; jj_consume_token(-1); throw new ParseException(); } String s = t.image; Expression result = new NumberLiteral(pCfg.getArithmeticEngine().toNumber(s)); Token startToken = (op != null) ? op : t; result.setLocation(template, startToken, t); {if ("" != null) return result;} throw new Error("Missing return statement in function"); }
final public Expression NumberLiteral() throws ParseException { Token op = null, t; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTEGER: t = jj_consume_token(INTEGER); break; case DECIMAL: t = jj_consume_token(DECIMAL); break; default: jj_la1[8] = jj_gen; jj_consume_token(-1); throw new ParseException(); } String s = t.image; Expression result = new NumberLiteral(template.getArithmeticEngine().toNumber(s)); Token startToken = (op != null) ? op : t; result.setLocation(template, startToken, t); {if (true) return result;} throw new Error("Missing return statement in function"); }