Class: FAM::Syntax::AST::SyntaxTree

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSyntaxTree

Returns a new instance of SyntaxTree.



11
12
13
# File 'lib/fam/syntax/ast.rb', line 11

def initialize
  @tree = []
end

Instance Attribute Details

#treeObject (readonly)

Returns the value of attribute tree.



9
10
11
# File 'lib/fam/syntax/ast.rb', line 9

def tree
  @tree
end

Instance Method Details

#<<(node) ⇒ Object



15
16
17
# File 'lib/fam/syntax/ast.rb', line 15

def <<(node)
  @tree << node
end

#[](i) ⇒ Object



19
20
21
# File 'lib/fam/syntax/ast.rb', line 19

def [](i)
  @tree[i]
end