// BaseType: FuncIdent | NUMBER | QUOTE - note certain types are restricted in expressions private void MatchBaseType(out IExpr result) { if (MatchFuncIDent(out result)) { return; } switch (curToken.Type) { case TokenTypes.NUMBER: result = new ConstantDecimal(curToken.Value); break; case TokenTypes.DATETIME: result = new ConstantDateTime(curToken.Value); break; case TokenTypes.DOUBLE: result = new ConstantDouble(curToken.Value); break; case TokenTypes.INTEGER: result = new ConstantInteger(curToken.Value); break; case TokenTypes.QUOTE: result = new ConstantString(curToken.Value); break; default: throw new ParserException("Constant or Identifier expected but not found. Found '" + curToken.Value + "' At column " + Convert.ToString(curToken.StartCol)); } curToken = tokens.Extract(); return; }
// BaseType: FuncIdent | NUMBER | QUOTE - note certain types are restricted in expressions private void MatchBaseType(out IExpr result) { if (MatchFuncIDent(out result)) return; switch (curToken.Type) { case TokenTypes.NUMBER: result = new ConstantDecimal(curToken.Value); break; case TokenTypes.DATETIME: result = new ConstantDateTime(curToken.Value); break; case TokenTypes.DOUBLE: result = new ConstantDouble(curToken.Value); break; case TokenTypes.INTEGER: result = new ConstantInteger(curToken.Value); break; case TokenTypes.QUOTE: result = new ConstantString(curToken.Value); break; default: throw new ParserException("Constant or Identifier expected but not found. Found '" + curToken.Value + "' At column " + Convert.ToString(curToken.StartCol)); } curToken = tokens.Extract(); return; }
// BaseType: FuncIdent | NUMBER | QUOTE - note certain types are restricted in expressions private void MatchBaseType(out IExpr result) { if (MatchFuncIDent(out result)) return; switch (curToken.Type) { case TokenTypes.NUMBER: result = new ConstantDecimal(curToken.Value); break; case TokenTypes.DATETIME: result = new ConstantDateTime(curToken.Value); break; case TokenTypes.DOUBLE: result = new ConstantDouble(curToken.Value); break; case TokenTypes.INTEGER: result = new ConstantInteger(curToken.Value); break; case TokenTypes.QUOTE: result = new ConstantString(curToken.Value); break; default: throw new ParserException(Strings.Parser_ErrorP_IdentifierExpected + GetLocationInfoWithValue(curToken)); } curToken = tokens.Extract(); return; }