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.
902 903 904 905 |
# File 'lib/racc/state.rb', line 902 def initialize(rule) @rule = rule @refn = 0 end |
Instance Attribute Details
#refn ⇒ Object (readonly)
Returns the value of attribute refn.
908 909 910 |
# File 'lib/racc/state.rb', line 908 def refn @refn end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
907 908 909 |
# File 'lib/racc/state.rb', line 907 def rule @rule end |
Instance Method Details
#decref ⇒ Object
922 923 924 925 |
# File 'lib/racc/state.rb', line 922 def decref @refn -= 1 raise 'racc: fatal: act.refn < 0' if @refn < 0 end |
#incref ⇒ Object
918 919 920 |
# File 'lib/racc/state.rb', line 918 def incref @refn += 1 end |
#inspect ⇒ Object
914 915 916 |
# File 'lib/racc/state.rb', line 914 def inspect "<reduce #{@rule.ident}>" end |
#ruleid ⇒ Object
910 911 912 |
# File 'lib/racc/state.rb', line 910 def ruleid @rule.ident end |