Package org.jostraca.comp.antlr

Examples of org.jostraca.comp.antlr.NoViableAltException


      if ( inputState.guessing==0 ) {
        attribute(attr.getText());
      }
    }
    else {
      throw new NoViableAltException(LT(1), getFilename());
    }
   
  }
View Full Code Here


      if ( inputState.guessing==0 ) {
        axis=DESCENDANT;
      }
    }
    else {
      throw new NoViableAltException(LT(1), getFilename());
    }
   
  }
View Full Code Here

        if ( inputState.guessing==0 ) {
          element(axis,iden.getText());
        }
      }
    else {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    switch ( LA(1)) {
    case LS:
    {
      predicate();
      if ( inputState.guessing==0 ) {
        pred();
      }
      break;
    }
    case EOF:
    case SLASH:
    case STAR:
    case RS:
    case RP:
    case COMMA:
    case PLUS:
    case MINUS:
    case EQ:
    case NEQ:
    case LT:
    case LTE:
    case GT:
    case GTE:
    case LITERAL_and:
    case LITERAL_or:
    case LITERAL_div:
    case LITERAL_mod:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
  }
View Full Code Here

      primary_expr();
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
  }
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

TOP

Related Classes of org.jostraca.comp.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.