Class: CastOff::Compiler::SimpleIR::ClassVariable
- Inherits:
-
Pointer
- Object
- TypeContainer
- Variable
- Pointer
- CastOff::Compiler::SimpleIR::ClassVariable
- Defined in:
- lib/cast_off/compile/ir/operand.rb
Constant Summary
Constants inherited from TypeContainer
TypeContainer::FixnumWrapper, TypeContainer::FloatWrapper
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Attributes inherited from TypeContainer
Instance Method Summary collapse
- #==(v) ⇒ Object
- #eql?(v) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(id, types) ⇒ ClassVariable
constructor
A new instance of ClassVariable.
- #source ⇒ Object
- #to_name ⇒ Object
Methods inherited from Variable
#class_exact?, #declare?, #has_undefined_path, #is_class_exact, #reset
Methods inherited from TypeContainer
#box, #boxed?, #boxed_form, #can_unbox?, #class_exact?, #declare, #declare_class, #dynamic?, #is_also, #is_also?, #is_annotated, #is_class_exact, #is_dynamic, #is_just?, #is_negative_cond_value, #is_not, #is_static, #not_initialized, #reset, #static?, #to_debug_string, #to_s, #unboxed?, #undefined?, #union
Methods included from Util
Constructor Details
#initialize(id, types) ⇒ ClassVariable
Returns a new instance of ClassVariable.
716 717 718 719 720 721 722 723 724 725 |
# File 'lib/cast_off/compile/ir/operand.rb', line 716 def initialize(id, types) super() @id = id @name = id.slice(2, id.size - 2) if types bug() unless types.is_a?(Array) is_annotated(types) end end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
714 715 716 |
# File 'lib/cast_off/compile/ir/operand.rb', line 714 def id @id end |
Instance Method Details
#==(v) ⇒ Object
740 741 742 |
# File 'lib/cast_off/compile/ir/operand.rb', line 740 def ==(v) eql?(v) end |
#eql?(v) ⇒ Boolean
735 736 737 738 |
# File 'lib/cast_off/compile/ir/operand.rb', line 735 def eql?(v) return false unless v.is_a?(ClassVariable) @id == v.id end |
#hash ⇒ Object
744 745 746 |
# File 'lib/cast_off/compile/ir/operand.rb', line 744 def hash self.to_name.hash end |
#source ⇒ Object
731 732 733 |
# File 'lib/cast_off/compile/ir/operand.rb', line 731 def source @id.to_s end |
#to_name ⇒ Object
727 728 729 |
# File 'lib/cast_off/compile/ir/operand.rb', line 727 def to_name "class_#{@name}" end |