Exemplo n.º 1
0
 private ISearchExpression ParseOrOperator()
 {
     ISearchExpression c = this.ParseAndOperator();
     while (this.token == TokenType.Or)
     {
         this.MoveNext();
         c = new LogicalExpression(c, this.ParseAndOperator(), LogicalOperator.Or);
     }
     return c;
 }
Exemplo n.º 2
0
        private ISearchExpression ParseComplexExpression()
        {
            ISearchExpression expression = null;

            switch (this.token)
            {
                case TokenType.LeftParenthesis:
                    this.MoveNext();
                    ISearchExpression c = this.ParseOrOperator();
                    this.AssertTokenType(TokenType.RightParenthesis);
                    expression = c;
                    break;
                case TokenType.Not:
                    this.MoveNext();
                    expression = new LogicalExpression(this.ParseComplexExpression(), null, LogicalOperator.Not);
                    break;
                default:
                    expression = ParseSimpleExpression();
                    break;
            }

            return expression;
        }