Class: StructuredSearch::Tree::BaseNode

Inherits:
Object
  • Object
show all
Defined in:
lib/structured_search/base_node.rb

Overview

The base of any node in the AST, it stores the line, column and type of token.

Direct Known Subclasses

Asterisk, From, Select, String, Where

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(topts = {}) ⇒ BaseNode

sends each token value to it’s respective attribute



14
15
16
# File 'lib/structured_search/base_node.rb', line 14

def initialize(topts = {})
  topts.each { |key, val| send "#{key}=", val }
end

Instance Attribute Details

#columnObject

line

The line this AST node was found

column

The column this AST node was found

type

Holds the type of node for fast lookup



11
12
13
# File 'lib/structured_search/base_node.rb', line 11

def column
  @column
end

#lineObject

line

The line this AST node was found

column

The column this AST node was found

type

Holds the type of node for fast lookup



11
12
13
# File 'lib/structured_search/base_node.rb', line 11

def line
  @line
end

#typeObject

line

The line this AST node was found

column

The column this AST node was found

type

Holds the type of node for fast lookup



11
12
13
# File 'lib/structured_search/base_node.rb', line 11

def type
  @type
end