Class: Rubinius::AST::Container
- Inherits:
-
ClosedScope
- Object
- Node
- ClosedScope
- Rubinius::AST::Container
- Defined in:
- lib/compiler/ast/definitions.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#name ⇒ Object
Returns the value of attribute name.
-
#pre_exe ⇒ Object
Returns the value of attribute pre_exe.
-
#variable_scope ⇒ Object
Returns the value of attribute variable_scope.
Attributes inherited from ClosedScope
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(body) ⇒ Container
constructor
A new instance of Container.
- #pop_state(g) ⇒ Object
- #push_state(g) ⇒ Object
- #to_sexp ⇒ Object
Methods inherited from ClosedScope
#assign_local_reference, #module?, #nest_scope, #new_local, #new_nested_local, #search_local
Methods included from Compiler::LocalVariables
#allocate_slot, #local_count, #local_names, #variables
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk
Constructor Details
#initialize(body) ⇒ Container
Returns a new instance of Container.
629 630 631 632 |
# File 'lib/compiler/ast/definitions.rb', line 629 def initialize(body) @body = body || NilLiteral.new(1) @pre_exe = [] end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
627 628 629 |
# File 'lib/compiler/ast/definitions.rb', line 627 def file @file end |
#name ⇒ Object
Returns the value of attribute name.
627 628 629 |
# File 'lib/compiler/ast/definitions.rb', line 627 def name @name end |
#pre_exe ⇒ Object
Returns the value of attribute pre_exe.
627 628 629 |
# File 'lib/compiler/ast/definitions.rb', line 627 def pre_exe @pre_exe end |
#variable_scope ⇒ Object
Returns the value of attribute variable_scope.
627 628 629 |
# File 'lib/compiler/ast/definitions.rb', line 627 def variable_scope @variable_scope end |
Instance Method Details
#pop_state(g) ⇒ Object
638 639 640 |
# File 'lib/compiler/ast/definitions.rb', line 638 def pop_state(g) g.pop_state end |
#push_state(g) ⇒ Object
634 635 636 |
# File 'lib/compiler/ast/definitions.rb', line 634 def push_state(g) g.push_state self end |
#to_sexp ⇒ Object
642 643 644 645 646 647 |
# File 'lib/compiler/ast/definitions.rb', line 642 def to_sexp sexp = [sexp_name] @pre_exe.each { |pe| sexp << pe.pre_sexp } sexp << @body.to_sexp sexp end |