001package jmri.jmrit.logixng.util.parser;
002
003import jmri.jmrit.logixng.SymbolTable;
004
005/**
006 * A parsed expression
007 */
008public class ExpressionNodeFloatingNumber implements ExpressionNode {
009
010    private final Token _token;
011    private final double _value;
012    
013    public ExpressionNodeFloatingNumber(Token token) {
014        _token = token;
015        _value = Double.parseDouble(token.getString());
016    }
017    
018    @Override
019    public Object calculate(SymbolTable symbolTable) {
020        return _value;
021    }
022    
023    /** {@inheritDoc} */
024    @Override
025    public String getDefinitionString() {
026        return "FloatNumber:"+_token.getString();
027    }
028    
029}