Ejemplo n.º 1
0
 public SqlUnaryPrefixOperatorExpression(OperatorDef op, SymbolPosition[] unaryMarks, SqlExpression inner)
 {
     Operator   = op;
     Inner      = inner;
     UnaryMarks = unaryMarks;
     if (unaryMarks.Length != op.Tokens.Length)
     {
         throw new InternalError("DAE-00049 operator token count mitchmatch");
     }
     Inner.Parent = this;
 }
Ejemplo n.º 2
0
 public SqlBinaryOperatorExpression(SqlExpression left, OperatorDef op, SymbolPosition[] binaryMarks, SqlExpression right)
 {
     Operator    = op;
     Left        = left;
     Right       = right;
     BinaryMarks = binaryMarks;
     if (binaryMarks.Length != op.Tokens.Length)
     {
         throw new InternalError("DAE-00050 operator token count mitchmatch");
     }
     Left.Parent  = this;
     Right.Parent = this;
 }
Ejemplo n.º 3
0
        public OperatorListOperatorGroup(params string[] operators)
        {
            List <OperatorDef> ops = new List <OperatorDef>();

            foreach (var op in operators)
            {
                OperatorDef od = new OperatorDef();
                od.Tokens   = op.Split(' ');
                od.IsSymbol = !Char.IsLetter(op[0]);
                ops.Add(od);
            }
            Operators = ops.ToArray();
        }
Ejemplo n.º 4
0
        private SymbolPosition[] TestOperator(OperatorDef op)
        {
            int steps = 0;
            List <SymbolPosition> res = new List <SymbolPosition>();

            while (steps < op.Tokens.Length && op.AcceptTokenType(Current) && CurrentData.ToUpper() == op.Tokens[steps].ToUpper())
            {
                res.Add(CurrentOriginal);
                steps++;
                NextToken();
            }
            if (op.Tokens.Length == steps)
            {
                return(res.ToArray());
            }
            GoBack(steps);
            return(null);
        }