Class: Racc::Reduce
Instance Attribute Summary collapse
-
#refn ⇒ Object
readonly
Returns the value of attribute refn.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Instance Method Summary collapse
- #decref ⇒ Object
- #incref ⇒ Object
-
#initialize(rule) ⇒ Reduce
constructor
A new instance of Reduce.
- #inspect ⇒ Object
- #ruleid ⇒ Object
Constructor Details
#initialize(rule) ⇒ Reduce
Returns a new instance of Reduce.
897 898 899 900 |
# File 'lib/racc/state.rb', line 897 def initialize(rule) @rule = rule @refn = 0 end |
Instance Attribute Details
#refn ⇒ Object (readonly)
Returns the value of attribute refn.
903 904 905 |
# File 'lib/racc/state.rb', line 903 def refn @refn end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
902 903 904 |
# File 'lib/racc/state.rb', line 902 def rule @rule end |
Instance Method Details
#decref ⇒ Object
917 918 919 920 |
# File 'lib/racc/state.rb', line 917 def decref @refn -= 1 raise 'racc: fatal: act.refn < 0' if @refn < 0 end |
#incref ⇒ Object
913 914 915 |
# File 'lib/racc/state.rb', line 913 def incref @refn += 1 end |
#inspect ⇒ Object
909 910 911 |
# File 'lib/racc/state.rb', line 909 def inspect "<reduce #{@rule.ident}>" end |
#ruleid ⇒ Object
905 906 907 |
# File 'lib/racc/state.rb', line 905 def ruleid @rule.ident end |