Class ScopedSearch::QueryLanguage::Compiler
In: lib/scoped_search/query_language.rb
Parent: Object

The Compiler class can compile a query string into an Abstract Syntax Tree, which in turn is used to build the SQL query.

This class inclused the Tokenizer module to transform the query stream into a stream of tokens, and includes the Parser module that will transform the stream of tokens into an Abstract Syntax Tree (AST).

Methods

parse   tokenize  

Included Modules

Tokenizer Parser Enumerable

Public Class methods

Parser a query string to return an abstract syntax tree.

[Source]

    # File lib/scoped_search/query_language.rb, line 24
24:     def self.parse(str)
25:       compiler = self.new(str)
26:       compiler.parse
27:     end

Tokenizes a query string to return a stream of tokens.

[Source]

    # File lib/scoped_search/query_language.rb, line 30
30:     def self.tokenize(str)
31:       compiler = self.new(str)
32:       compiler.tokenize
33:     end

[Validate]