Package antlr

Examples of antlr.MismatchedTokenException


                }
                return;
            }
        }
        else if (ex instanceof MismatchedTokenException) {
            MismatchedTokenException mismatched = (MismatchedTokenException)ex;
            Token token = mismatched.token;
            if ((mismatched.mismatchType == MismatchedTokenException.TOKEN) &&
                (token != null)) {
                if (token.getType() == Token.EOF_TYPE) {
                    ErrorMsg.error(token.getLine(), token.getColumn(),
View Full Code Here


      match(_t,CMP_FIELD_ACCESS);
      _t = _t.getFirstChild();
      var=extractIdentificationVariable(_t);
      _t = _retTree;
      EJBQLAST tmp10_AST_in = (EJBQLAST)_t;
      if ( _t==null ) throw new MismatchedTokenException();
      _t = _t.getNextSibling();
      _t = __t6;
      _t = _t.getNextSibling();
      break;
    }
    case SINGLE_CMR_FIELD_ACCESS:
    {
      AST __t7 = _t;
      EJBQLAST tmp11_AST_in = (EJBQLAST)_t;
      match(_t,SINGLE_CMR_FIELD_ACCESS);
      _t = _t.getFirstChild();
      var=extractIdentificationVariable(_t);
      _t = _retTree;
      EJBQLAST tmp12_AST_in = (EJBQLAST)_t;
      if ( _t==null ) throw new MismatchedTokenException();
      _t = _t.getNextSibling();
      _t = __t7;
      _t = _t.getNextSibling();
      break;
    }
    case COLLECTION_CMR_FIELD_ACCESS:
    {
      AST __t8 = _t;
      EJBQLAST tmp13_AST_in = (EJBQLAST)_t;
      match(_t,COLLECTION_CMR_FIELD_ACCESS);
      _t = _t.getFirstChild();
      var=extractIdentificationVariable(_t);
      _t = _retTree;
      EJBQLAST tmp14_AST_in = (EJBQLAST)_t;
      if ( _t==null ) throw new MismatchedTokenException();
      _t = _t.getNextSibling();
      _t = __t8;
      _t = _t.getNextSibling();
      break;
    }
View Full Code Here

    _t = _t.getFirstChild();
    expression(_t,buf);
    _t = _retTree;
    buf.append(".substring(");
    start = (EJBQLAST)_t;
    if ( _t==null ) throw new MismatchedTokenException();
    _t = _t.getNextSibling();
    length = (EJBQLAST)_t;
    if ( _t==null ) throw new MismatchedTokenException();
    _t = _t.getNextSibling();
    _t = __t99;
    _t = _t.getNextSibling();
   
    if ((start.getType() == INT_LITERAL) &&
View Full Code Here

    case NOT_NULL:
    case NOT_EMPTY:
    case NOT_MEMBER:
    {
      start = (EJBQLAST)_t;
      if ( _t==null ) throw new MismatchedTokenException();
      _t = _t.getNextSibling();
     
      buf.append(", ")//NOI18N
      if (start.getType() == INT_LITERAL) {
      // Optimization: start is a constant value =>
View Full Code Here

        AST __t173 = _t;
        r = _t==ASTNULL ? null :(AST)_t;
        match(_t,DOT);
        _t = _t.getFirstChild();
        AST tmp74_AST_in = (AST)_t;
        if ( _t==null ) throw new MismatchedTokenException();
        _t = _t.getNextSibling();
        AST tmp75_AST_in = (AST)_t;
        if ( _t==null ) throw new MismatchedTokenException();
        _t = _t.getNextSibling();
        _t = __t173;
        _t = _t.getNextSibling();
        if ( inputState.guessing==0 ) {
          out(r);
View Full Code Here

    if ( token instanceof HqlToken ) {
      HqlToken hqlToken = ( HqlToken ) token;
      // ... and the token could be an identifer and the error is
      // a mismatched token error ...
      if ( hqlToken.isPossibleID() && ( ex instanceof MismatchedTokenException ) ) {
        MismatchedTokenException mte = ( MismatchedTokenException ) ex;
        // ... and the expected token type was an identifier, then:
        if ( mte.expecting == HqlTokenTypes.IDENT ) {
          // Use the token as an identifier.
          reportWarning( "Keyword  '"
              + token.getText()
              + "' is being interpreted as an identifier due to: " + mte.getMessage() );
          // Add the token to the AST.
          ASTPair currentAST = new ASTPair();
          token.setType( HqlTokenTypes.WEIRD_IDENT );
          astFactory.addASTChild( currentAST, astFactory.create( token ) );
          consume();
View Full Code Here

    if ( token instanceof HqlToken ) {
      HqlToken hqlToken = ( HqlToken ) token;
      // ... and the token could be an identifer and the error is
      // a mismatched token error ...
      if ( hqlToken.isPossibleID() && ( ex instanceof MismatchedTokenException ) ) {
        MismatchedTokenException mte = ( MismatchedTokenException ) ex;
        // ... and the expected token type was an identifier, then:
        if ( mte.expecting == HqlTokenTypes.IDENT ) {
          // Use the token as an identifier.
          reportWarning( "Keyword  '"
              + token.getText()
              + "' is being interpreted as an identifier due to: " + mte.getMessage() );
          // Add the token to the AST.
          ASTPair currentAST = new ASTPair();
          token.setType( HqlTokenTypes.WEIRD_IDENT );
          astFactory.addASTChild( currentAST, astFactory.create( token ) );
          consume();
View Full Code Here

    if ( token instanceof HqlToken ) {
      HqlToken hqlToken = (HqlToken) token;
      // ... and the token could be an identifer and the error is
      // a mismatched token error ...
      if ( hqlToken.isPossibleID() && ( ex instanceof MismatchedTokenException ) ) {
        MismatchedTokenException mte = (MismatchedTokenException) ex;
        // ... and the expected token type was an identifier, then:
        if ( mte.expecting == HqlTokenTypes.IDENT ) {
          // Use the token as an identifier.
          reportWarning(
              "Keyword  '"
                  + token.getText()
                  + "' is being interpreted as an identifier due to: " + mte.getMessage()
          );
          // Add the token to the AST.
          ASTPair currentAST = new ASTPair();
          token.setType( HqlTokenTypes.WEIRD_IDENT );
          astFactory.addASTChild( currentAST, astFactory.create( token ) );
View Full Code Here

        AST __t177 = _t;
        r = _t==ASTNULL ? null :(AST)_t;
        match(_t,DOT);
        _t = _t.getFirstChild();
        AST tmp74_AST_in = (AST)_t;
        if ( _t==null ) throw new MismatchedTokenException();
        _t = _t.getNextSibling();
        AST tmp75_AST_in = (AST)_t;
        if ( _t==null ) throw new MismatchedTokenException();
        _t = _t.getNextSibling();
        _t = __t177;
        _t = _t.getNextSibling();
        if ( inputState.guessing==0 ) {
          out(r);
View Full Code Here

    if ( token instanceof HqlToken ) {
      HqlToken hqlToken = ( HqlToken ) token;
      // ... and the token could be an identifer and the error is
      // a mismatched token error ...
      if ( hqlToken.isPossibleID() && ( ex instanceof MismatchedTokenException ) ) {
        MismatchedTokenException mte = ( MismatchedTokenException ) ex;
        // ... and the expected token type was an identifier, then:
        if ( mte.expecting == HqlTokenTypes.IDENT ) {
          // Use the token as an identifier.
          reportWarning( "Keyword  '"
              + token.getText()
              + "' is being interpreted as an identifier due to: " + mte.getMessage() );
          // Add the token to the AST.
          ASTPair currentAST = new ASTPair();
          token.setType( HqlTokenTypes.WEIRD_IDENT );
          astFactory.addASTChild( currentAST, astFactory.create( token ) );
          consume();
View Full Code Here

TOP

Related Classes of antlr.MismatchedTokenException

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.