Class: Peggy::AST
- Inherits:
-
Object
- Object
- Peggy::AST
- Defined in:
- lib/ast.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ AST
constructor
A new instance of AST.
Constructor Details
#initialize ⇒ AST
Returns a new instance of AST.
52 53 54 55 |
# File 'lib/ast.rb', line 52 def initialize @root = Node.new build result, index, @root end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
50 51 52 |
# File 'lib/ast.rb', line 50 def root @root end |
Class Method Details
.build(parser, index = 0) ⇒ Object
57 58 59 |
# File 'lib/ast.rb', line 57 def self::build parser, index = 0 AST.new.build_one results, index, root end |