/** * Handles operands by pushing them onto the stack * * @param o operand * @param stack stack */ private void handleOperand(Operand o, Stack stack) { if (!(o instanceof IntegerValue)) { stack.push(o); return; } if (o instanceof IntegerValue) { IntegerValue iv = (IntegerValue) o; if (!iv.isOutOfRange()) { stack.push(iv); } else { // convert to a double DoubleValue dv = new DoubleValue(iv.getValue()); stack.push(dv); } } }
DoubleValue d = new DoubleValue(); pos += d.read(tokenData, pos); tokenStack.push(d);
DoubleValue d = new DoubleValue(); pos += d.read(tokenData, pos); tokenStack.push(d);
/** * Handles operands by pushing them onto the stack * * @param o operand * @param stack stack */ private void handleOperand(Operand o, Stack stack) { if (!(o instanceof IntegerValue)) { stack.push(o); return; } if (o instanceof IntegerValue) { IntegerValue iv = (IntegerValue) o; if (!iv.isOutOfRange()) { stack.push(iv); } else { // convert to a double DoubleValue dv = new DoubleValue(iv.getValue()); stack.push(dv); } } }
{ return new DoubleValue(yytext()) ;
{ return new DoubleValue(yytext()) ;