123456789_123456789_123456789_123456789_123456789_

Class: Racc::Reduce

Relationships & Source Files
Inherits: Object
Defined in: lib/racc/state.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(rule) ⇒ Reduce

[ GitHub ]

  
# File 'lib/racc/state.rb', line 895

def initialize(rule)
  @rule = rule
  @refn = 0
end

Instance Attribute Details

#refn (readonly)

[ GitHub ]

  
# File 'lib/racc/state.rb', line 901

attr_reader :refn

#rule (readonly)

[ GitHub ]

  
# File 'lib/racc/state.rb', line 900

attr_reader :rule

Instance Method Details

#decref

[ GitHub ]

  
# File 'lib/racc/state.rb', line 915

def decref
  @refn -= 1
  raise 'racc: fatal: act.refn < 0' if @refn < 0
end

#incref

[ GitHub ]

  
# File 'lib/racc/state.rb', line 911

def incref
  @refn += 1
end

#inspect

[ GitHub ]

  
# File 'lib/racc/state.rb', line 907

def inspect
  "<reduce #{@rule.ident}>"
end

#ruleid

[ GitHub ]

  
# File 'lib/racc/state.rb', line 903

def ruleid
  @rule.ident
end