Class: Peggy::AST

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAST

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

#rootObject (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