Class: Wool::SexpAnalysis::Scope

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#constantsObject (readonly)

Returns the value of attribute constants.



7
8
9
# File 'lib/wool/analysis/scope.rb', line 7

def constants
  @constants
end

#parentObject (readonly)

Returns the value of attribute parent.



7
8
9
# File 'lib/wool/analysis/scope.rb', line 7

def parent
  @parent
end

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