docs: def _slr_build_parser_table(productionset):
      """SLR method to build parser table"""
      result = ParserTable()
      statesset = build_states_sets(productionset)
      for itemindex, itemset in enumerate(statesset):
          LOG.debug("_slr_build_parser_table: Evaluating itemset:" + str(itemset))
          for symbol in productionset.getSymbols() + [EndSymbol()]:
              numberoptions = 0
              for lritem in itemset.itemlist:
                  #if cursor is before a terminal, and there is a transition to another itemset with the following terminal, append shift rule
                  if isinstance(symbol, TerminalSymbol) and lritem.next_symbol() == symbol and itemset.has_transition(symbol):
                      destinationstate = statesset.index(itemset.get_transition(symbol))
                      result.append(itemindex, symbol, "Shift", destinationstate)
                      numberoptions += 1
                  if isinstance(symbol, NonTerminalSymbol) and lritem.next_symbol() == symbol and itemset.has_transition(symbol):
                      destinationstate = statesset.index(itemset.get_transition(symbol))
                      result.append_goto(itemindex, symbol, destinationstate)
                  #if cursor is at the end of the rule, then append reduce rule and go transition
                  if lritem.previous_symbol() == symbol and lritem.is_last_position() and symbol != Extended_S:
                      for x in productionset.next_lookup(symbol):
                          if isinstance(x, Grammar):
                              result.append(itemindex, TerminalSymbol(x), "Reduce", None, lritem.rule)
                          elif isinstance(x, Symbol):
                              result.append(itemindex, x, "Reduce", None, lritem.rule)
                          else:
                              raise TypeError(x)
                      numberoptions += 1
                  #if cursor is at the end of main rule, and current symbol is end, then append accept rule
                  if symbol == EndSymbol() and lritem.previous_symbol() == productionset.initialsymbol and lritem.next_symbol() == EndSymbol():
                      result.append(itemindex, symbol, "Accept", None)
                      numberoptions += 1
              if not numberoptions:
                  LOG.info("No rule found to generate a new parsertable entry ")
                  LOG.debug("symbol: " + str(symbol))
                  LOG.debug("itemset: " + str(itemset))
              elif numberoptions > 1: #FIXME can it count duplicated entries?
                  raise Exception("LR Conflict %s" % symbol)
      return result