Beispiel #1
0
            public void SetParamExpression(RuleParameter paramInfo, RuleExpression expr, NavContext paramValueContext)
            {
                if (_ruleParamExpressions == null)
                {
                    _ruleParamExpressions = new Dictionary <string, RuleParameterInfo>();
                }

                _ruleParamExpressions.Add(paramInfo.Name, new RuleParameterInfo(paramInfo, expr, paramValueContext));
            }
Beispiel #2
0
            internal UnaryExpressionGroup(RuleExpression child)
            {
                if (child == null)
                {
                    throw new ArgumentNullException();
                }

                this.Child = child;
            }
Beispiel #3
0
        public ExplicitRule(int tokenId, string name, RuleExpression expression)
            : base(tokenId, name)
        {
            if (expression == null)
            {
                throw new ArgumentNullException();
            }

            this.Expression = expression;
        }
Beispiel #4
0
            public MatchNumber(int countFrom, int countTo, RuleExpression child)
                : base(child)
            {
                if (countFrom < 0)
                {
                    throw new ArgumentOutOfRangeException("countFrom");
                }
                if (countTo < 1 || countTo < countFrom)
                {
                    throw new ArgumentOutOfRangeException("countTo");
                }

                this.CountFrom = countFrom;
                this.CountTo   = countTo;
            }
Beispiel #5
0
        public bool TryEnterParameterContext(string paramName, out RuleExpression expr)
        {
            bool ok;
            RuleParameterInfo paramInfo;

            if (_stack.Peek().TryResolveParamExpression(paramName, out paramInfo))
            {
                expr = paramInfo.expression;
                ok   = true;
                _stack.Push(paramInfo.paramValueContext);
            }
            else
            {
                expr = null;
                ok   = false;
            }

            return(ok);
        }
Beispiel #6
0
 public RuleBodyInfo(RuleExpression expr, RuleSetBase[] subrules)
 {
     this.Expression = expr;
     this.Subrules   = subrules;
 }
Beispiel #7
0
 public ExplicitRule CreateExplicitRule(string name, RuleExpression expr)
 {
     return(new ExplicitRule(_idCounter++, name, expr));
 }
Beispiel #8
0
 public void SetParamExpression(RuleParameter paramInfo, RuleExpression expr)
 {
     _stack.Peek().SetParamExpression(paramInfo, expr, _stack.Skip(1).First());
 }
Beispiel #9
0
 public RuleParameterInfo(RuleParameter paramInfo, RuleExpression expression, NavContext paramValueContext)
 {
     this.paramInfo         = paramInfo;
     this.expression        = expression;
     this.paramValueContext = paramValueContext;
 }
Beispiel #10
0
 public CheckNot(RuleExpression expr)
     : base(expr)
 {
 }