Exemple #1
0
        private static bool MatchCombinator(Expression exp, MatchContext context)
        {
            context.SaveMark();

            bool result = false;

            switch (exp.combinator)
            {
            case ExpressionCombinator.Or:
                result = MatchOr(exp, context);
                break;

            case ExpressionCombinator.OrOr:
                result = MatchOrOr(exp, context);
                break;

            case ExpressionCombinator.AndAnd:
                result = MatchAndAnd(exp, context);
                break;

            case ExpressionCombinator.Juxtaposition:
                result = MatchJuxtaposition(exp, context);
                break;

            case ExpressionCombinator.Group:
                result = MatchGroup(exp, context);
                break;

            case ExpressionCombinator.None:
                break;
            }

            if (result)
            {
                context.DropMark();
            }
            else
            {
                context.RestoreMark();
            }

            return(result);
        }