Package org.antlr.runtime

Examples of org.antlr.runtime.NoViableAltException


            case RANGELITERAL: {
               alt26 = 10;
            }
            break;
            default:
               NoViableAltException nvae =
                  new NoViableAltException("", 26, 0, input);

               throw nvae;
         }

         switch (alt26) {
View Full Code Here


    @Override
    public String getErrorMessage(RecognitionException e, String[] tokenNames) {
      String msg = null;

      if (e instanceof NoViableAltException) {
        @SuppressWarnings("unused")
        NoViableAltException nvae = (NoViableAltException) e;
        // for development, can add
        // "decision=<<"+nvae.grammarDecisionDescription+">>"
        // and "(decision="+nvae.decisionNumber+") and
        // "state "+nvae.stateNumber
View Full Code Here

      for (int i = 0; i < tokenNames.length; ++i) {
        xlateNames[i] = ParseDriver.xlate(tokenNames[i]);
      }

      if (e instanceof NoViableAltException) {
        @SuppressWarnings("unused")
        NoViableAltException nvae = (NoViableAltException) e;
        // for development, can add
        // "decision=<<"+nvae.grammarDecisionDescription+">>"
        // and "(decision="+nvae.decisionNumber+") and
        // "state "+nvae.stateNumber
View Full Code Here

    @Override
    public String getErrorMessage(RecognitionException e, String[] tokenNames) {
      String msg = null;

      if (e instanceof NoViableAltException) {
        @SuppressWarnings("unused")
        NoViableAltException nvae = (NoViableAltException) e;
        // for development, can add
        // "decision=<<"+nvae.grammarDecisionDescription+">>"
        // and "(decision="+nvae.decisionNumber+") and
        // "state "+nvae.stateNumber
View Full Code Here

      for (int i = 0; i < tokenNames.length; ++i) {
        xlateNames[i] = ParseDriver.xlate(tokenNames[i]);
      }

      if (e instanceof NoViableAltException) {
        @SuppressWarnings("unused")
        NoViableAltException nvae = (NoViableAltException) e;
        // for development, can add
        // "decision=<<"+nvae.grammarDecisionDescription+">>"
        // and "(decision="+nvae.decisionNumber+") and
        // "state "+nvae.stateNumber
View Full Code Here

      for (int i = 0; i < tokenNames.length; ++i) {
        xlateNames[i] = ParseDriver.xlate(tokenNames[i]);
      }

      if (e instanceof NoViableAltException) {
        @SuppressWarnings("unused")
        NoViableAltException nvae = (NoViableAltException) e;
        // for development, can add
        // "decision=<<"+nvae.grammarDecisionDescription+">>"
        // and "(decision="+nvae.decisionNumber+") and
        // "state "+nvae.stateNumber
View Full Code Here

    @Override
    public String getErrorMessage(RecognitionException e, String[] tokenNames) {
      String msg = null;

      if (e instanceof NoViableAltException) {
        @SuppressWarnings("unused")
        NoViableAltException nvae = (NoViableAltException) e;
        // for development, can add
        // "decision=<<"+nvae.grammarDecisionDescription+">>"
        // and "(decision="+nvae.decisionNumber+") and
        // "state "+nvae.stateNumber
View Full Code Here

                                                     AS3Parser parser,
                                                     RecognitionException e)
  {
    String msg;
    if (e instanceof NoViableAltException) {
      NoViableAltException ex = (NoViableAltException)e;
      msg = "Unexpected token "+tokenName(parser, ex.getUnexpectedType());
      if (statement != null) {
        msg += " in "+ActionScriptFactory.str(statement);
      }
    } else if (e instanceof MismatchedTokenException) {
      MismatchedTokenException ex = (MismatchedTokenException)e;
      msg = "Unexpected token "+tokenName(parser, ex.getUnexpectedType())+" (expecting "+tokenName(parser, ex.expecting)+")";
      if (statement != null) {
        msg += " in "+ActionScriptFactory.str(statement);
      }
    } else {
      if (statement == null) {
View Full Code Here

   * specific messages.
   */
  @Override
  public String getMessage() {
    if (re instanceof NoViableAltException) {
      NoViableAltException nvae = (NoViableAltException) re;
      if (nvae.token == null) {
        String c = StringEscapeUtils.escapeJava("" + (char) nvae.c);
        return "Lexer error at char '" + c + "' at line " + nvae.line
            + " char " + nvae.charPositionInLine;
      }
View Full Code Here

                {
                alt1=4;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 1, 0, input);

                throw nvae;
            }

            switch (alt1) {
View Full Code Here

TOP

Related Classes of org.antlr.runtime.NoViableAltException

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.