/// <summary> /// Parses the NUMBER Production Rule /// NUMBER: [0-9]+ /// </summary> /// <returns></returns> private bool TryParseNumber(out ASTNode node) { node = null; if (IsNext(Token.TokenType.Number)) { node = new NumberASTNode(Accept( )); } return(node != null); }
protected double Evaluate(NumberASTNode node) => node.Value;
protected int Evaluate(NumberASTNode node) => node.Value;