Method: RLTK::Parser::State#add_reduction

Defined in:
lib/rltk/parser.rb

#add_reduction(production) ⇒ void

This method returns an undefined value.

Add a Reduce action to the state.

Parameters:

  • production (Production)

    Production used to perform the reduction



1509
1510
1511
1512
1513
1514
# File 'lib/rltk/parser.rb', line 1509

def add_reduction(production)
  action = Reduce.new(production)

  # Reduce actions are not allowed for the ERROR terminal.
  @actions.each { |k, v| if CFG::is_terminal?(k) and k != :ERROR then v << action end }
end