Examples of RecognitionException


Examples of antlr.RecognitionException

              getId(),
              this.getClass(), null));
    } catch (final TokenStreamRecognitionException tre) {
      Utils.getExceptionLogger()
          .debug("TokenStreamRecognitionException occured.", tre);
      final RecognitionException re = tre.recog;
      if (re != null) {
        getMessageCollector().add(
            new LocalizedMessage(
                re.getLine(),
                re.getColumn(),
                Defn.CHECKSTYLE_BUNDLE,
                "general.exception",
                new String[] {re.getMessage()},
                getId(),
                this.getClass(), null));
      } else {
        getMessageCollector().add(
            new LocalizedMessage(
View Full Code Here

Examples of antlr.RecognitionException

        // start parsing at the compilationUnit rule
        try {
            parser.compilationUnit();
        }
        catch (TokenStreamRecognitionException tsre) {
            RecognitionException e = tsre.recog;
            SyntaxException se = new SyntaxException(e.getMessage(),e,e.getLine(),e.getColumn());
            se.setFatal(true);
            sourceUnit.addError(se);
        }
        catch (RecognitionException e) {
            SyntaxException se = new SyntaxException(e.getMessage(),e,e.getLine(),e.getColumn());
            se.setFatal(true);
            sourceUnit.addError(se);
        }
        catch (TokenStreamException e) {
            sourceUnit.addException(e);
View Full Code Here

Examples of antlr.RecognitionException

        // start parsing at the compilationUnit rule
        try {
            parser.compilationUnit();
        }
        catch (TokenStreamRecognitionException tsre) {
            RecognitionException e = tsre.recog;
            SyntaxException se = new SyntaxException(e.getMessage(),e,e.getLine(),e.getColumn());
            se.setFatal(true);
            sourceUnit.addError(se);
        }
        catch (RecognitionException e) {
            SyntaxException se = new SyntaxException(e.getMessage(),e,e.getLine(),e.getColumn());
            se.setFatal(true);
            sourceUnit.addError(se);
        }
        catch (TokenStreamException e) {
            sourceUnit.addException(e);
View Full Code Here

Examples of antlr.RecognitionException

        // start parsing at the compilationUnit rule
        try {
            parser.compilationUnit();
        }
        catch (TokenStreamRecognitionException tsre) {
            RecognitionException e = tsre.recog;
            SyntaxException se = new SyntaxException(e.getMessage(), e, e.getLine(), e.getColumn());
            se.setFatal(true);
            sourceUnit.addError(se);
        }
        catch (RecognitionException e) {
            SyntaxException se = new SyntaxException(e.getMessage(), e, e.getLine(), e.getColumn());
            se.setFatal(true);
            sourceUnit.addError(se);
        }
        catch (TokenStreamException e) {
            sourceUnit.addException(e);
View Full Code Here

Examples of antlr.RecognitionException

  public void testExceptions() throws Exception {
    DetailedSemanticException dse = new DetailedSemanticException( "test" );
    dse.printStackTrace();
    dse.printStackTrace( new PrintWriter( new StringWriter() ) );
    QuerySyntaxException qse = QuerySyntaxException.convert( new RecognitionException( "test" ), "from bozo b where b.clown = true" );
    assertNotNull( qse.getMessage() );
  }
View Full Code Here

Examples of antlr.RecognitionException

        // start parsing at the compilationUnit rule
        try {
            parser.compilationUnit();
        }
        catch (TokenStreamRecognitionException tsre) {
            RecognitionException e = tsre.recog;
            SyntaxException se = new SyntaxException(e.getMessage(), e, e.getLine(), e.getColumn());
            se.setFatal(true);
            sourceUnit.addError(se);
        }
        catch (RecognitionException e) {
            SyntaxException se = new SyntaxException(e.getMessage(), e, e.getLine(), e.getColumn());
            se.setFatal(true);
            sourceUnit.addError(se);
        }
        catch (TokenStreamException e) {
            sourceUnit.addException(e);
View Full Code Here

Examples of org.antlr.runtime.RecognitionException

    this.token = t;
    this.srcName = srcName;
  }

  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.token = t;
    this.srcName = srcName;
    }

    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.templateToken = templateToken;
    this.srcName = srcName;
  }

  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

            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
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.