Class: Rubex::AST::Expression::AnalysedElementRef

Inherits:
Base
  • Object
show all
Defined in:
lib/rubex/ast/expression/analysed_element_ref.rb

Direct Known Subclasses

CVarElementRef, RubyObjectElementRef

Instance Attribute Summary

Attributes inherited from Base

#entry, #type, #typecast

Instance Method Summary collapse

Methods inherited from Base

#allocate_temp, #allocate_temps, #analyse_for_target_type, #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(element_ref) ⇒ AnalysedElementRef

Returns a new instance of AnalysedElementRef.



5
6
7
8
9
10
11
12
# File 'lib/rubex/ast/expression/analysed_element_ref.rb', line 5

def initialize(element_ref)
  @element_ref = element_ref
  @pos = @element_ref.pos
  @entry = @element_ref.entry
  @name = @element_ref.name
  @subexprs = @element_ref.subexprs
  @type = @element_ref.type
end

Instance Method Details

#analyse_types(local_scope) ⇒ Object



14
15
16
# File 'lib/rubex/ast/expression/analysed_element_ref.rb', line 14

def analyse_types(local_scope)
  @pos.analyse_types local_scope
end

#c_code(local_scope) ⇒ Object



18
19
20
21
22
# File 'lib/rubex/ast/expression/analysed_element_ref.rb', line 18

def c_code(local_scope)
  code = super
  code << @c_code
  code
end