Class: Dentaku::AST::Access
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#structure ⇒ Object
readonly
Returns the value of attribute structure.
Class Method Summary collapse
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #dependencies(context = {}) ⇒ Object
-
#initialize(data_structure, index) ⇒ Access
constructor
A new instance of Access.
- #type ⇒ Object
- #value(context = {}) ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(data_structure, index) ⇒ Access
Returns a new instance of Access.
23 24 25 26 |
# File 'lib/dentaku/ast/access.rb', line 23 def initialize(data_structure, index) @structure = data_structure @index = index end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
6 7 8 |
# File 'lib/dentaku/ast/access.rb', line 6 def index @index end |
#structure ⇒ Object (readonly)
Returns the value of attribute structure.
6 7 8 |
# File 'lib/dentaku/ast/access.rb', line 6 def structure @structure end |
Class Method Details
.arity ⇒ Object
8 9 10 |
# File 'lib/dentaku/ast/access.rb', line 8 def self.arity 2 end |
.max_param_count ⇒ Object
16 17 18 |
# File 'lib/dentaku/ast/access.rb', line 16 def self.max_param_count arity end |
.min_param_count ⇒ Object
12 13 14 |
# File 'lib/dentaku/ast/access.rb', line 12 def self.min_param_count arity end |
.peek ⇒ Object
20 21 |
# File 'lib/dentaku/ast/access.rb', line 20 def self.peek(*) end |
Instance Method Details
#accept(visitor) ⇒ Object
42 43 44 |
# File 'lib/dentaku/ast/access.rb', line 42 def accept(visitor) visitor.visit_access(self) end |
#dependencies(context = {}) ⇒ Object
34 35 36 |
# File 'lib/dentaku/ast/access.rb', line 34 def dependencies(context = {}) @structure.dependencies(context) + @index.dependencies(context) end |
#type ⇒ Object
38 39 40 |
# File 'lib/dentaku/ast/access.rb', line 38 def type nil end |
#value(context = {}) ⇒ Object
28 29 30 31 32 |
# File 'lib/dentaku/ast/access.rb', line 28 def value(context = {}) structure = @structure.value(context) index = @index.value(context) structure[index] end |