Ejemplo n.º 1
0
        public Expression(Operator op, List<VarSpec> varSpecs)
        {
            if (op == null)
            {
                throw new ArgumentNullException("op");
            }

            if (varSpecs == null)
            {
                throw new ArgumentNullException("varSpecs");
            }

            this.op = op;
            this.varSpecs = varSpecs;
        }
Ejemplo n.º 2
0
        public static bool TryParse(char code, out Operator op)
        {
            op = null;

            switch (code)
            {
                case '\0':
                    op = Default;
                    break;

                case '+':
                    op = Reserved;
                    break;

                case '#':
                    op = Fragment;
                    break;

                case '.':
                    op = Label;
                    break;

                case '/':
                    op = Path;
                    break;

                case ';':
                    op = Matrix;
                    break;

                case '?':
                    op = Query;
                    break;

                case '&':
                    op = Continuation;
                    break;

                default:
                    return false;
            }

            return true;
        }
        private void ReadExpression(char ch)
        {
            CreateLiteral();

            token = Token.VarSpec;

            if (!Operator.TryParse(ch, out exprOperator))
            {
                exprOperator = Operator.Default;
                ReadVarSpec(ch);
            }
        }