Examples of RecognitionException


Examples of org.antlr.runtime.RecognitionException

    this.srcName = srcName;
  }

  @Override
  public String toString() {
    RecognitionException re = (RecognitionException)cause;
    int line = re.line;
    int charPos = re.charPositionInLine;
    if ( templateToken!=null ) {
      int templateDelimiterSize = 1;
      if ( templateToken.getType()== GroupParser.BIGSTRING ) {
View Full Code Here

Examples of org.antlr.runtime.RecognitionException

            else if ( name.equals("super") ) return newToken(SUPER);
            else if ( name.equals("true") ) return newToken(TRUE);
            else if ( name.equals("false") ) return newToken(FALSE);
            return id;
          }
          RecognitionException re =
            new NoViableAltException("",0,0,input);
                    re.line = startLine;
                    re.charPositionInLine = startCharPositionInLine;
          errMgr.lexerError(input.getSourceName(), "invalid character '"+str(c)+"'", templateToken, re);
          if (c==EOF) {
View Full Code Here

Examples of org.antlr.runtime.RecognitionException

                continue;
            }
            buf.append(c);
            consume();
      if ( c==EOF ) {
        RecognitionException re =
          new MismatchedTokenException((int)'"', input);
        re.line = input.getLine();
        re.charPositionInLine = input.getCharPositionInLine();
        errMgr.lexerError(input.getSourceName(), "EOF in string", templateToken, re);
        break;
View Full Code Here

Examples of org.antlr.runtime.RecognitionException

    Token COMMENT() {
        match('!');
        while ( !(c=='!' && input.LA(2)==delimiterStopChar) ) {
      if (c==EOF) {
        RecognitionException re =
          new MismatchedTokenException((int)'!', input);
        re.line = input.getLine();
        re.charPositionInLine = input.getCharPositionInLine();
        errMgr.lexerError(input.getSourceName(), "Nonterminated comment starting at " +
          startLine+":"+startCharPositionInLine+": '!"+
View Full Code Here

Examples of org.antlr.runtime.RecognitionException

    void LINEBREAK() {
        match('\\'); // only kill 2nd \ as ESCAPE() kills first one
        match(delimiterStopChar);
        while ( c==' ' || c=='\t' ) consume(); // scarf WS after <\\>
    if ( c==EOF ) {
      RecognitionException re = new RecognitionException(input);
      re.line = input.getLine();
      re.charPositionInLine = input.getCharPositionInLine();
      errMgr.lexerError(input.getSourceName(), "Missing newline after newline escape <\\\\>",
                      templateToken, re);
      return;
View Full Code Here

Examples of org.antlr.runtime.RecognitionException

    this.srcName = srcName;
  }

  @Override
  public String toString() {
        RecognitionException re = (RecognitionException)cause;
    int line = 0;
    int charPos = -1;
    if ( token!=null ) {
      line = token.getLine();
      charPos = token.getCharPositionInLine();
View Full Code Here

Examples of org.antlr.runtime.RecognitionException

    this.srcName = srcName;
    }

  @Override
    public String toString() {
        RecognitionException re = (RecognitionException)cause;
    int line = 0;
    int charPos = -1;
    if ( token!=null ) {
      line = token.getLine();
      charPos = token.getCharPositionInLine();
View Full Code Here

Examples of org.antlr.runtime.RecognitionException

            markOtherErrors( markers, drlInfo.getBuilderErrors() );
        } catch ( DroolsParserException e ) {
            // we have an error thrown from DrlParser
            Throwable cause = e.getCause();
            if ( cause instanceof RecognitionException ) {
                RecognitionException recogErr = (RecognitionException) cause;
                markers.add( new DroolsBuildMarker( recogErr.getMessage(),
                                                    recogErr.line ) ); //flick back the line number
            }
        } catch ( DecisionTableParseException e ) {
            if ( !"No RuleTable's were found in spreadsheet.".equals( e.getMessage() ) ) {
                throw e;
View Full Code Here

Examples of org.antlr.runtime.RecognitionException

      String lineS = elements[3];
      String posS = elements[4];
      Class excClass = null;
      try {
        excClass = Class.forName(excName);
        RecognitionException e =
          (RecognitionException)excClass.newInstance();
        e.index = Integer.parseInt(indexS);
        e.line = Integer.parseInt(lineS);
        e.charPositionInLine = Integer.parseInt(posS);
        listener.recognitionException(e);
View Full Code Here

Examples of org.antlr.runtime.RecognitionException

                             drlInfo.getBuilderErrors() );
        } catch ( DroolsParserException e ) {
            // we have an error thrown from DrlParser
            Throwable cause = e.getCause();
            if ( cause instanceof RecognitionException ) {
                RecognitionException recogErr = (RecognitionException) cause;
                markers.add( new DroolsBuildMarker( recogErr.getMessage(),
                                                    recogErr.line ) ); //flick back the line number
            }
        } catch ( Exception t ) {
            String message = t.getMessage();
            if ( message == null || message.trim().equals( "" ) ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.