def parse_filter_expression(expression, tokens)   #:nodoc:
    # The number of tokens will be either 3 (for 1 expression)
    # or 7 (for 2  expressions).
    #
    if (tokens.size == 7)
      conditional = tokens[3]
      if conditional =~ /^(and|&&)$/
        conditional = 0
      elsif conditional =~ /^(or|\|\|)$/
        conditional = 1
      else
        raise "Token '#{conditional}' is not a valid conditional " +
        "in filter expression '#{expression}'"
      end
      expression_1 = parse_filter_tokens(expression, tokens[0..2])
      expression_2 = parse_filter_tokens(expression, tokens[4..6])
      [expression_1, conditional, expression_2].flatten
    else
      parse_filter_tokens(expression, tokens)
    end
  end
def parse_filter_expression(expression, tokens)   #:nodoc:
    # The number of tokens will be either 3 (for 1 expression)
    # or 7 (for 2  expressions).
    #
    if (tokens.size == 7)
      conditional = tokens[3]
      if conditional =~ /^(and|&&)$/
        conditional = 0
      elsif conditional =~ /^(or|\|\|)$/
        conditional = 1
      else
        raise "Token '#{conditional}' is not a valid conditional " +
        "in filter expression '#{expression}'"
      end
      expression_1 = parse_filter_tokens(expression, tokens[0..2])
      expression_2 = parse_filter_tokens(expression, tokens[4..6])
      [expression_1, conditional, expression_2].flatten
    else
      parse_filter_tokens(expression, tokens)
    end
  end
Converts the tokens of a possibly conditional expression into 1 or 2
 sub expressions for further parsing.

 Examples:
          ('x', '==', 2000) -> exp1
          ('x', '>',  2000, 'and', 'x', '<', 5000) -> exp1 and exp2