Ejemplo n.º 1
0
        // 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;
        }
Ejemplo n.º 2
0
		// 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;
		}
Ejemplo n.º 3
0
		// 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;
		}