Class: Peggy::AST
Overview
The root node of an Abstract Syntax Tree. Every node in the tree maps to a production found in the parse.
Instance Attribute Summary collapse
-
#_options ⇒ Object
readonly
Returns the value of attribute _options.
Attributes inherited from Node
#_first, #_name, #_next, #_parent, #_range, #_source
Instance Method Summary collapse
-
#initialize(source, results, options = {}) ⇒ AST
constructor
A new instance of AST.
- #to_s ⇒ Object
Methods inherited from Node
#<<, #[], #_count, #_depth, #_format, #_last, #_length, #_option, #_root, #_sample, #_strip, #children, #each, #inspect, #method_missing, #to_sym
Constructor Details
#initialize(source, results, options = {}) ⇒ AST
Returns a new instance of AST.
163 164 165 166 167 168 169 170 |
# File 'lib/parse/ast.rb', line 163 def initialize source, results, ={} super nil @results = results @_options = @ignore = Array([:ignore]) # XXX: turn to set self._source = source build_left nil, 0, self end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Peggy::Node
Instance Attribute Details
#_options ⇒ Object (readonly)
Returns the value of attribute _options.
161 162 163 |
# File 'lib/parse/ast.rb', line 161 def @_options end |
Instance Method Details
#to_s ⇒ Object
172 173 174 |
# File 'lib/parse/ast.rb', line 172 def to_s _format end |