예제 #1
0
        protected override MatchResult MatchSame(PassiveExpression expression, ref int exIndex)
        {
            if (expression == null || exIndex >= expression.Count)
            {
                return(MatchResult.Failure);
            }

            // match same symbol
            if (this.Symbol != null)
            {
                // match the bound value
                if (Symbol.Equals(expression[exIndex++]))
                {
                    return(MatchResult.Success);
                }
            }

            // match same subexpression
            else if (this.Expression != null)
            {
                if (expression.CompareToExpression(exIndex, this.Expression))
                {
                    exIndex += this.Expression.Count;
                    return(MatchResult.Success);
                }
            }

            return(MatchResult.Failure);
        }
예제 #2
0
        protected override MatchResult MatchSame(PassiveExpression expression, ref int exIndex)
        {
            if (expression != null && expression.CompareToExpression(exIndex, this.Expression))
            {
                exIndex += this.Expression.Count;
                return(MatchResult.Success);
            }

            return(MatchResult.Failure);
        }
예제 #3
0
		protected override MatchResult MatchSame(PassiveExpression expression, ref int exIndex)
		{
			if (expression != null && expression.CompareToExpression(exIndex, this.Expression))
			{
				exIndex += this.Expression.Count;
				return MatchResult.Success;
			}

			return MatchResult.Failure;
		}
예제 #4
0
		protected override MatchResult MatchSame(PassiveExpression expression, ref int exIndex)
		{
			if (expression == null || exIndex >= expression.Count)
				return MatchResult.Failure;

			// match same symbol
			if (this.Symbol != null)
			{
				// match the bound value
				if (Symbol.Equals(expression[exIndex++]))
					return MatchResult.Success;
			}

			// match same subexpression
			else if (this.Expression != null)
			{
				if (expression.CompareToExpression(exIndex, this.Expression))
				{
					exIndex += this.Expression.Count;
					return MatchResult.Success;
				}
			}

			return MatchResult.Failure;
		}