Package net.sourceforge.chaperon.build.conflict

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

TOP

Related Classes of net.sourceforge.chaperon.build.conflict.ShiftReduceConflict

Copyright © 2018 www.massapicom. 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.