Class: Rubex::AST::Expression::ElementRef
- Extended by:
- Forwardable
- Defined in:
- lib/rubex/ast/expression/element_ref.rb
Instance Attribute Summary collapse
-
#entry ⇒ Object
readonly
Readers needed for accessing elements due to delegator classes.
-
#name ⇒ Object
readonly
Readers needed for accessing elements due to delegator classes.
-
#pos ⇒ Object
readonly
Readers needed for accessing elements due to delegator classes.
-
#subexprs ⇒ Object
readonly
Readers needed for accessing elements due to delegator classes.
Attributes inherited from Base
Instance Method Summary collapse
- #analyse_types(local_scope, struct_scope = nil) ⇒ Object
-
#initialize(name, pos) ⇒ ElementRef
constructor
Initialize an array_ref.
Methods inherited from Base
#allocate_temp, #allocate_temps, #analyse_for_target_type, #c_code, #expression?, #from_ruby_object, #generate_and_dispose_subexprs, #generate_assignment_code, #generate_disposal_code, #generate_evaluation_code, #has_temp, #possible_typecast, #release_temp, #release_temps, #to_ruby_object
Constructor Details
#initialize(name, pos) ⇒ ElementRef
Initialize an array_ref. Can be in an expression or variable decl.
19 20 21 22 23 |
# File 'lib/rubex/ast/expression/element_ref.rb', line 19 def initialize(name, pos) @name = name @pos = pos @subexprs = [] end |
Instance Attribute Details
#entry ⇒ Object (readonly)
Readers needed for accessing elements due to delegator classes.
6 7 8 |
# File 'lib/rubex/ast/expression/element_ref.rb', line 6 def entry @entry end |
#name ⇒ Object (readonly)
Readers needed for accessing elements due to delegator classes.
6 7 8 |
# File 'lib/rubex/ast/expression/element_ref.rb', line 6 def name @name end |
#pos ⇒ Object (readonly)
Readers needed for accessing elements due to delegator classes.
6 7 8 |
# File 'lib/rubex/ast/expression/element_ref.rb', line 6 def pos @pos end |
#subexprs ⇒ Object (readonly)
Readers needed for accessing elements due to delegator classes.
6 7 8 |
# File 'lib/rubex/ast/expression/element_ref.rb', line 6 def subexprs @subexprs end |
Instance Method Details
#analyse_types(local_scope, struct_scope = nil) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/rubex/ast/expression/element_ref.rb', line 25 def analyse_types(local_scope, struct_scope = nil) @entry = struct_scope.nil? ? local_scope.find(@name) : struct_scope[@name] @type = @entry.type.object? ? @entry.type : @entry.type.type @element_ref = proper_analysed_type @element_ref.analyse_types local_scope super(local_scope) end |