Class: Wool::SexpAnalysis::Scope
- Inherits:
-
Object
- Object
- Wool::SexpAnalysis::Scope
- Defined in:
- lib/wool/analysis/scope.rb
Overview
This class models a scope in Ruby. It has a constant table, a self pointer, and a parent pointer to the enclosing scope. It also has a local variable table.
Instance Attribute Summary collapse
-
#constants ⇒ Object
readonly
Returns the value of attribute constants.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#self_ptr ⇒ Object
readonly
Returns the value of attribute self_ptr.
Instance Method Summary collapse
-
#initialize(parent, self_ptr, constants = {}) ⇒ Scope
constructor
A new instance of Scope.
Constructor Details
#initialize(parent, self_ptr, constants = {}) ⇒ Scope
Returns a new instance of Scope.
8 9 10 |
# File 'lib/wool/analysis/scope.rb', line 8 def initialize(parent, self_ptr, constants={}) @parent, @self_ptr, @constants = parent, self_ptr, constants end |
Instance Attribute Details
#constants ⇒ Object (readonly)
Returns the value of attribute constants.
7 8 9 |
# File 'lib/wool/analysis/scope.rb', line 7 def constants @constants end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
7 8 9 |
# File 'lib/wool/analysis/scope.rb', line 7 def parent @parent end |
#self_ptr ⇒ Object (readonly)
Returns the value of attribute self_ptr.
7 8 9 |
# File 'lib/wool/analysis/scope.rb', line 7 def self_ptr @self_ptr end |