Examples of ShiftReduceConflict


Examples of net.sourceforge.chaperon.build.conflict.ShiftReduceConflict

        {
          if ((errorreduce) || (reducesymbols.contains(tsymbols.getSymbol(symbol))))
          {
            int tokenpriority = grammar.getPriority((Terminal)tsymbols.getSymbol(symbol));

            ShiftReduceConflict shiftconflict =
              new ShiftReduceConflict(grammar, itemsets, state,
                                      (Terminal)tsymbols.getSymbol(symbol), highestproduction);

            if (tokenpriority>productionpriority)
            {
              automaton.setShiftAction(state, symbol, I.getTransition(tsymbols.getSymbol(symbol)));

              if (log!=null)
              {
                log.info(shiftconflict.toString());
                log.info("The parser will shift");
              }
            }
            else if (tokenpriority<productionpriority)
            {
              automaton.setReduceAction(state, symbol, highestproduction);

              if (log!=null)
              {
                log.info(shiftconflict.toString());
                log.info("The parser will reduce");
              }
            }
            else
            {
              if (log!=null)
                log.warn(shiftconflict.toString());

              Associativity associativity =
                grammar.getAssociativity((Terminal)tsymbols.getSymbol(symbol));
              if (associativity.equals(Associativity.RIGHT))
              {
View Full Code Here

Examples of net.sourceforge.chaperon.parser.generator.conflict.ShiftReduceConflict

                               System.getProperty(("line.separator"))+
                               token+System.getProperty(("line.separator"))+
                               _grammar.getProductionList().getProduction(highestproduction)+
                               System.getProperty(("line.separator"))+
                               "The parser will shift");
                _conflicts.add(new ShiftReduceConflict(I, _tsymbols.getSymbol(j)));
              }
            }
          }
          else
            _table.setShiftAction(i, j, I.getTransition(_tsymbols.getSymbol(j)));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.