Sha256: cd0d4d548757ac92e68662342a6221749173ec9bba2d447ba311f24b94d3ef07

Contents?: true

Size: 436 Bytes

Versions: 10

Compression:

Stored size: 436 Bytes

Contents

require "search_cop_grammar"
require "treetop"

Treetop.load File.expand_path("../../search_cop_grammar.treetop", __FILE__)

module SearchCop
  class GrammarParser
    attr_reader :query_info

    def initialize(query_info)
      @query_info = query_info
    end

    def parse(string)
      node = SearchCopGrammarParser.new.parse(string) || raise(ParseError)
      node.query_info = query_info
      node.evaluate
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
search_cop-1.0.9 lib/search_cop/grammar_parser.rb
search_cop-1.0.8 lib/search_cop/grammar_parser.rb
search_cop-1.0.7 lib/search_cop/grammar_parser.rb
search_cop-1.0.6 lib/search_cop/grammar_parser.rb
search_cop-1.0.5 lib/search_cop/grammar_parser.rb
search_cop-1.0.4 lib/search_cop/grammar_parser.rb
search_cop-1.0.3 lib/search_cop/grammar_parser.rb
search_cop-1.0.2 lib/search_cop/grammar_parser.rb
search_cop-1.0.1 lib/search_cop/grammar_parser.rb
search_cop-1.0.0 lib/search_cop/grammar_parser.rb