Class: ScopedSearch::QueryLanguage::AST::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/scoped_search/query_language/ast.rb

Overview

Base AST node class. Instances of this class are used to represent an abstract syntax tree. This syntax tree is created by the ScopedSearch::QueryLanguage parser and visited by the ScopedSearch::QueryBuilder to create SQL query conditions.

Direct Known Subclasses

LeafNode, OperatorNode

Instance Method Summary collapse

Instance Method Details

#compatible_with(node) ⇒ Object

:nodoc


34
35
36
# File 'lib/scoped_search/query_language/ast.rb', line 34

def compatible_with(node) # :nodoc
  false
end

#inspectObject

:nodoc


25
26
27
# File 'lib/scoped_search/query_language/ast.rb', line 25

def inspect # :nodoc
  "<AST::#{self.class.to_s.split('::').last} #{self.to_a.inspect}>"
end

#simplifyObject

Tree simplification. By default, do nothing and return the node as is.


30
31
32
# File 'lib/scoped_search/query_language/ast.rb', line 30

def simplify
  return self
end