Package antlr

Examples of antlr.MismatchedTokenException


    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


          AST __t168 = _t;
          r = _t==ASTNULL ? null :(AST)_t;
          match(_t,DOT);
          _t = _t.getFirstChild();
          AST tmp71_AST_in = (AST)_t;
          if ( _t==null ) throw new MismatchedTokenException();
          _t = _t.getNextSibling();
          AST tmp72_AST_in = (AST)_t;
          if ( _t==null ) throw new MismatchedTokenException();
          _t = _t.getNextSibling();
          _t = __t168;
          _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

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

      {
        id = (org.antlr.stringtemplate.language.StringTemplateAST)_t;
        match(_t,ID);
        _t = _t.getNextSibling();
        a1 = (org.antlr.stringtemplate.language.StringTemplateAST)_t;
        if ( _t==null ) throw new MismatchedTokenException();
        _t = _t.getNextSibling();
        name=id.getText(); args=a1;
        break;
      }
      case VALUE:
      {
        AST __t12 = _t;
        org.antlr.stringtemplate.language.StringTemplateAST tmp9_AST_in = (org.antlr.stringtemplate.language.StringTemplateAST)_t;
        match(_t,VALUE);
        _t = _t.getFirstChild();
        n=expr(_t);
        _t = _retTree;
        a2 = (org.antlr.stringtemplate.language.StringTemplateAST)_t;
        if ( _t==null ) throw new MismatchedTokenException();
        _t = _t.getNextSibling();
        _t = __t12;
        _t = _t.getNextSibling();
        if (n!=null) {name=n.toString();} args=a2;
        break;
View Full Code Here

      {
        t = (org.antlr.stringtemplate.language.StringTemplateAST)_t;
        match(_t,ID);
        _t = _t.getNextSibling();
        args = (org.antlr.stringtemplate.language.StringTemplateAST)_t;
        if ( _t==null ) throw new MismatchedTokenException();
        _t = _t.getNextSibling();
       
        String templateName = t.getText();
        StringTemplateGroup group = self.getGroup();
        StringTemplate embedded = group.getEmbeddedInstanceOf(self, templateName);
        if ( embedded!=null ) {
        embedded.setArgumentsAST(args);
        templatesToApply.addElement(embedded);
        }
       
        break;
      }
      case ANONYMOUS_TEMPLATE:
      {
        anon = (org.antlr.stringtemplate.language.StringTemplateAST)_t;
        match(_t,ANONYMOUS_TEMPLATE);
        _t = _t.getNextSibling();
       
        StringTemplate anonymous = anon.getStringTemplate();
        // to properly see overridden templates, always set
        // anonymous' group to be self's group
                anonymous.setGroup(self.getGroup());
        templatesToApply.addElement(anonymous);
       
        break;
      }
      case VALUE:
      {
        AST __t28 = _t;
        org.antlr.stringtemplate.language.StringTemplateAST tmp20_AST_in = (org.antlr.stringtemplate.language.StringTemplateAST)_t;
        match(_t,VALUE);
        _t = _t.getFirstChild();
        n=expr(_t);
        _t = _retTree;
        args2 = (org.antlr.stringtemplate.language.StringTemplateAST)_t;
        if ( _t==null ) throw new MismatchedTokenException();
        _t = _t.getNextSibling();
       
                  StringTemplate embedded = null;
                  if ( n!=null ) {
                    String templateName = n.toString();
View Full Code Here

        AST __t166 = _t;
        r = _t==ASTNULL ? null :(AST)_t;
        match(_t,DOT);
        _t = _t.getFirstChild();
        AST tmp66_AST_in = (AST)_t;
        if ( _t==null ) throw new MismatchedTokenException();
        _t = _t.getNextSibling();
        AST tmp67_AST_in = (AST)_t;
        if ( _t==null ) throw new MismatchedTokenException();
        _t = _t.getNextSibling();
        _t = __t166;
        _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

    JQLAST query_AST_in = (_t == ASTNULL) ? null : (JQLAST)_t;
    JQLAST q = null;
   
    try {      // for error handling
      q = (JQLAST)_t;
      if ( _t==null ) throw new MismatchedTokenException();
      _t = _t.getNextSibling();
      if ( inputState.guessing==0 ) {
       
        prepareRetrieveDescs(q);
        if (logger.isLoggable(Logger.FINEST))
View Full Code Here

      AST __t45 = _t;
      JQLAST tmp2_AST_in = (JQLAST)_t;
      match(_t,FILTER_DEF);
      _t = _t.getFirstChild();
      expr = (JQLAST)_t;
      if ( _t==null ) throw new MismatchedTokenException();
      _t = _t.getNextSibling();
      _t = __t45;
      _t = _t.getNextSibling();
      if ( inputState.guessing==0 ) {
       
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.