Package persistence.antlr

Examples of persistence.antlr.NoViableAltException


                        token.getText(), ex);
                }
            }
        }
        else if (ex instanceof NoViableAltException) {
            NoViableAltException noviable = (NoViableAltException)ex;
            Token token = noviable.token;
            if (token != null) {
                if (token.getType() == Token.EOF_TYPE) {
                    result = EJBQLException.unexpectedEOF(getQueryInfo(),
                        noviable.getLine(), noviable.getColumn(), ex);
                }
                else {
                    result = EJBQLException.unexpectedToken(getQueryInfo(),
                        noviable.getLine(), noviable.getColumn(),
                        token.getText(), ex);
                }
            }
        }
        else if (ex instanceof NoViableAltForCharException) {
View Full Code Here


          {
            break;
          }
          default:
          {
            throw new NoViableAltException(LT(1), getFilename());
          }
          }
          }
          h = LT(1);
          match(ACTION);
          if ( inputState.guessing==0 ) {
           
                  // store the header action
                  // FIXME: 'n' should be checked for validity
                  behavior.refHeaderAction(n,h);
               
          }
        }
        else {
          break _loop4;
        }
       
      } while (true);
      }
      {
      switch ( LA(1)) {
      case OPTIONS:
      {
        fileOptionsSpec();
        break;
      }
      case EOF:
      case ACTION:
      case DOC_COMMENT:
      case LITERAL_lexclass:
      case LITERAL_class:
      {
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      {
      _loop7:
View Full Code Here

      {
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      {
      switch ( LA(1)) {
      case DOC_COMMENT:
      {
        d = LT(1);
        match(DOC_COMMENT);
        if ( inputState.guessing==0 ) {
          doc=d.getText();
        }
        break;
      }
      case LITERAL_lexclass:
      case LITERAL_class:
      {
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      {
      boolean synPredMatched13 = false;
      if (((LA(1)==LITERAL_lexclass||LA(1)==LITERAL_class) && (LA(2)==TOKEN_REF||LA(2)==RULE_REF))) {
        int _m13 = mark();
        synPredMatched13 = true;
        inputState.guessing++;
        try {
          {
          switch ( LA(1)) {
          case LITERAL_lexclass:
          {
            match(LITERAL_lexclass);
            break;
          }
          case LITERAL_class:
          {
            match(LITERAL_class);
            id();
            match(LITERAL_extends);
            match(LITERAL_Lexer);
            break;
          }
          default:
          {
            throw new NoViableAltException(LT(1), getFilename());
          }
          }
          }
        }
        catch (RecognitionException pe) {
          synPredMatched13 = false;
        }
        rewind(_m13);
        inputState.guessing--;
      }
      if ( synPredMatched13 ) {
        lexerSpec(doc);
      }
      else {
        boolean synPredMatched15 = false;
        if (((LA(1)==LITERAL_class) && (LA(2)==TOKEN_REF||LA(2)==RULE_REF))) {
          int _m15 = mark();
          synPredMatched15 = true;
          inputState.guessing++;
          try {
            {
            match(LITERAL_class);
            id();
            match(LITERAL_extends);
            match(LITERAL_TreeParser);
            }
          }
          catch (RecognitionException pe) {
            synPredMatched15 = false;
          }
          rewind(_m15);
          inputState.guessing--;
        }
        if ( synPredMatched15 ) {
          treeParserSpec(doc);
        }
        else if ((LA(1)==LITERAL_class) && (LA(2)==TOKEN_REF||LA(2)==RULE_REF)) {
          parserSpec(doc);
        }
        else {
          throw new NoViableAltException(LT(1), getFilename());
        }
        }
        }
        rules();
        if ( inputState.guessing==0 ) {
          behavior.endGrammar();
        }
      }
      catch (RecognitionException ex) {
        if (inputState.guessing==0) {
         
              if ( ex instanceof NoViableAltException ) {
                NoViableAltException e = (NoViableAltException)ex;
                // RK: These probably generate inconsequent error messages...
                // have to see how this comes out..
                if ( e.token.getType()==DOC_COMMENT ) {
                  reportError(ex, "JAVADOC comments may only prefix rules and grammars");
                }
View Full Code Here

      }
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    return idTok ;
  }
View Full Code Here

      {
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if ( inputState.guessing==0 ) {
      behavior.startLexer(getFilename(), idTok,sup,doc);
    }
    match(SEMI);
    {
    switch ( LA(1)) {
    case OPTIONS:
    {
      lexerOptionsSpec();
      break;
    }
    case ACTION:
    case DOC_COMMENT:
    case TOKENS:
    case TOKEN_REF:
    case LITERAL_protected:
    case LITERAL_public:
    case LITERAL_private:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if ( inputState.guessing==0 ) {
      behavior.endOptions();
    }
    {
    switch ( LA(1)) {
    case TOKENS:
    {
      tokensSpec();
      break;
    }
    case ACTION:
    case DOC_COMMENT:
    case TOKEN_REF:
    case LITERAL_protected:
    case LITERAL_public:
    case LITERAL_private:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    switch ( LA(1)) {
    case ACTION:
    {
      a = LT(1);
      match(ACTION);
      if ( inputState.guessing==0 ) {
        behavior.refMemberAction(a);
      }
      break;
    }
    case DOC_COMMENT:
    case TOKEN_REF:
    case LITERAL_protected:
    case LITERAL_public:
    case LITERAL_private:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
  }
View Full Code Here

    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if ( inputState.guessing==0 ) {
      behavior.startTreeWalker(getFilename(), idTok,sup,doc);
    }
    match(SEMI);
    {
    switch ( LA(1)) {
    case OPTIONS:
    {
      treeParserOptionsSpec();
      break;
    }
    case ACTION:
    case DOC_COMMENT:
    case TOKENS:
    case TOKEN_REF:
    case LITERAL_protected:
    case LITERAL_public:
    case LITERAL_private:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if ( inputState.guessing==0 ) {
      behavior.endOptions();
    }
    {
    switch ( LA(1)) {
    case TOKENS:
    {
      tokensSpec();
      break;
    }
    case ACTION:
    case DOC_COMMENT:
    case TOKEN_REF:
    case LITERAL_protected:
    case LITERAL_public:
    case LITERAL_private:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    switch ( LA(1)) {
    case ACTION:
    {
      a = LT(1);
      match(ACTION);
      if ( inputState.guessing==0 ) {
        behavior.refMemberAction(a);
      }
      break;
    }
    case DOC_COMMENT:
    case TOKEN_REF:
    case LITERAL_protected:
    case LITERAL_public:
    case LITERAL_private:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
  }
View Full Code Here

      {
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      break;
    }
    case SEMI:
    {
      if ( inputState.guessing==0 ) {
       
              antlrTool.warning("use 'class X extends Parser'", getFilename(), idTok.getLine(), idTok.getColumn());
        //      System.out.println("warning: line " +
        //        idTok.getLine() + ": use 'class X extends Parser'");
             
      }
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if ( inputState.guessing==0 ) {
      behavior.startParser(getFilename(), idTok, sup, doc);
    }
    match(SEMI);
    {
    switch ( LA(1)) {
    case OPTIONS:
    {
      parserOptionsSpec();
      break;
    }
    case ACTION:
    case DOC_COMMENT:
    case TOKENS:
    case TOKEN_REF:
    case LITERAL_protected:
    case LITERAL_public:
    case LITERAL_private:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if ( inputState.guessing==0 ) {
      behavior.endOptions();
    }
    {
    switch ( LA(1)) {
    case TOKENS:
    {
      tokensSpec();
      break;
    }
    case ACTION:
    case DOC_COMMENT:
    case TOKEN_REF:
    case LITERAL_protected:
    case LITERAL_public:
    case LITERAL_private:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    switch ( LA(1)) {
    case ACTION:
    {
      a = LT(1);
      match(ACTION);
      if ( inputState.guessing==0 ) {
        behavior.refMemberAction(a);
      }
      break;
    }
    case DOC_COMMENT:
    case TOKEN_REF:
    case LITERAL_protected:
    case LITERAL_public:
    case LITERAL_private:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
  }
View Full Code Here

    do {
      if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) {
        rule();
      }
      else {
        if ( _cnt68>=1 ) { break _loop68; } else {throw new NoViableAltException(LT(1), getFilename());}
      }
     
      _cnt68++;
    } while (true);
    }
View Full Code Here

      }
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    return retval ;
  }
View Full Code Here

    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    return b ;
  }
View Full Code Here

TOP

Related Classes of persistence.antlr.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.