Class: Rubex::AST::Expression::UnaryBase
- Defined in:
- lib/rubex/ast/expression/unary_base.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #analyse_types(local_scope) ⇒ Object
- #generate_evaluation_code(code, local_scope) ⇒ Object
-
#initialize(expr) ⇒ UnaryBase
constructor
A new instance of UnaryBase.
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, #has_temp, #possible_typecast, #release_temp, #release_temps, #to_ruby_object
Constructor Details
#initialize(expr) ⇒ UnaryBase
Returns a new instance of UnaryBase.
6 7 8 |
# File 'lib/rubex/ast/expression/unary_base.rb', line 6 def initialize expr @expr = expr end |
Instance Method Details
#analyse_types(local_scope) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rubex/ast/expression/unary_base.rb', line 10 def analyse_types local_scope @expr.analyse_types local_scope @expr = @expr.to_ruby_object if @expr.type.object? @type = @expr.type @expr.allocate_temps local_scope @expr.release_temps local_scope end |
#generate_evaluation_code(code, local_scope) ⇒ Object
18 19 20 |
# File 'lib/rubex/ast/expression/unary_base.rb', line 18 def generate_evaluation_code code, local_scope @expr.generate_evaluation_code code, local_scope end |