Class: Kumi::Core::LIR::Support::Ids
- Inherits:
-
Object
- Object
- Kumi::Core::LIR::Support::Ids
- Defined in:
- lib/kumi/core/lir/support/ids.rb
Instance Method Summary collapse
- #generate_acc ⇒ Object
- #generate_loop_id ⇒ Object
- #generate_temp(prefix: :t) ⇒ Object
-
#initialize ⇒ Ids
constructor
A new instance of Ids.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ Ids
Returns a new instance of Ids.
8 9 10 |
# File 'lib/kumi/core/lir/support/ids.rb', line 8 def initialize reset! end |
Instance Method Details
#generate_acc ⇒ Object
22 23 24 |
# File 'lib/kumi/core/lir/support/ids.rb', line 22 def generate_acc generate_temp(prefix: :acc) end |
#generate_loop_id ⇒ Object
26 27 28 29 |
# File 'lib/kumi/core/lir/support/ids.rb', line 26 def generate_loop_id @l += 1 :"L#{@l}" end |
#generate_temp(prefix: :t) ⇒ Object
17 18 19 20 |
# File 'lib/kumi/core/lir/support/ids.rb', line 17 def generate_temp(prefix: :t) @t += 1 :"#{prefix}#{@t}" end |
#reset! ⇒ Object
12 13 14 15 |
# File 'lib/kumi/core/lir/support/ids.rb', line 12 def reset! @t = 0 @l = 0 end |