Sha256: 2efd12cba08a7445f1466095391a97373f957f207a01dedd6177cefa3d3462bb

Contents?: true

Size: 914 Bytes

Versions: 10

Compression:

Stored size: 914 Bytes

Contents

grammar SQLWhereCondition
  include SQLKeyValuePair

  rule where_condition
    "WHERE" SPACES where_clause {
       def eval
         where_clause.eval
       end
     }
  end

  rule where_clause
    OPEN_PARENS optional_spaces where_clause optional_spaces CLOSE_PARENS {
      def eval
        where_clause.eval
      end
    }
    /
    clause1:single_expression_where_clause      SPACES 
            disjunction_or_conjunction_joiner   SPACES 
    clause2:where_clause {
      def eval
        klass = Expressions.find_class_for(disjunction_or_conjunction_joiner.eval)
        klass.new(clause1.eval, clause2.eval)
      end
    } 
    / 
    single_expression_where_clause
  end

  rule disjunction_or_conjunction_joiner
    and / or
  end

  rule and
    "AND" { def eval; :AND; end }
  end

  rule or
    "OR" { def eval; :OR; end }
  end

  rule single_expression_where_clause
    key_value_pair
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hipster_sql_to_hbase-0.3.29 lib/sql_parser/sql_where_condition.treetop
hipster_sql_to_hbase-0.3.20 lib/sql_parser/sql_where_condition.treetop
hipster_sql_to_hbase-0.3.12 lib/sql_parser/sql_where_condition.treetop
hipster_sql_to_hbase-0.3.2 lib/sql_parser/sql_where_condition.treetop
hipster_sql_to_hbase-0.3.1 lib/sql_parser/sql_where_condition.treetop
hipster_sql_to_hbase-0.3.0 lib/sql_parser/sql_where_condition.treetop
hipster_sql_to_hbase-0.2.2 lib/sql_parser/sql_where_condition.treetop
hipster_sql_to_hbase-0.2.0 lib/sql_parser/sql_where_condition.treetop
hipster_sql_to_hbase-0.1.85 lib/sql_parser/sql_where_condition.treetop
hipster_sql_to_hbase-0.1.8 lib/sql_parser/sql_where_condition.treetop