Class: TRuby::IR::Program

Inherits:
Node
  • Object
show all
Defined in:
lib/t_ruby/ir.rb

Overview

Program - root node containing all top-level declarations

Instance Attribute Summary collapse

Attributes inherited from Node

#location, #metadata, #type_info

Instance Method Summary collapse

Methods inherited from Node

#accept, #transform

Constructor Details

#initialize(declarations: [], source_file: nil, **opts) ⇒ Program



32
33
34
35
36
# File 'lib/t_ruby/ir.rb', line 32

def initialize(declarations: [], source_file: nil, **opts)
  super(**opts)
  @declarations = declarations
  @source_file = source_file
end

Instance Attribute Details

#declarationsObject

Returns the value of attribute declarations.



30
31
32
# File 'lib/t_ruby/ir.rb', line 30

def declarations
  @declarations
end

#source_fileObject

Returns the value of attribute source_file.



30
31
32
# File 'lib/t_ruby/ir.rb', line 30

def source_file
  @source_file
end

Instance Method Details

#childrenObject



38
39
40
# File 'lib/t_ruby/ir.rb', line 38

def children
  @declarations
end