StringBuilder errorMessage = new StringBuilder( 180 ); errorMessage.append( "error parsing edi on line " ).append( e.line ).append( " position " ).append( e.charPositionInLine ).append( ". " ).append( e.toString() );
public String getErrorMessage(RecognitionException e) { if (null == walker) { return e.toString(); } else { return getErrorMessage(walker, e); } }
@Override public void reportError(RecognitionException ex) { Token token = null; if (ex instanceof MismatchedTokenException) { token = ((MismatchedTokenException)ex).token; } else if (ex instanceof NoViableAltException) { token = ((NoViableAltException)ex).token; } ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "codegen: " + ex.toString(), ex ); }
@Override public void reportError(RecognitionException ex) { Token token = null; if (ex instanceof MismatchedTokenException) { token = ((MismatchedTokenException)ex).token; } else if (ex instanceof NoViableAltException) { token = ((NoViableAltException)ex).token; } ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "antlr.print: " + ex.toString(), ex ); }
@Override public void reportError(RecognitionException ex) { Token token = null; if (ex instanceof MismatchedTokenException) { token = ((MismatchedTokenException)ex).token; } else if (ex instanceof NoViableAltException) { token = ((NoViableAltException)ex).token; } ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "antlr.print: " + ex.toString(), ex ); }
@Override public void reportError(RecognitionException ex) { Token token = null; if (ex instanceof MismatchedTokenException) { token = ((MismatchedTokenException)ex).token; } else if (ex instanceof NoViableAltException) { token = ((NoViableAltException)ex).token; } ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "assign.types: " + ex.toString(), ex); }
@Override public void reportError(RecognitionException ex) { Token token = null; if (ex instanceof MismatchedTokenException) { token = ((MismatchedTokenException)ex).token; } else if (ex instanceof NoViableAltException) { token = ((NoViableAltException)ex).token; } ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "codegen: " + ex.toString(), ex ); }
@Override public void reportError(RecognitionException ex) { Token token = null; if (ex instanceof MismatchedTokenException) { token = ((MismatchedTokenException)ex).token; } else if (ex instanceof NoViableAltException) { token = ((NoViableAltException)ex).token; } ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "assign.types: " + ex.toString(), ex); }
@Override public void reportError(RecognitionException ex) { //Token token = null; //try //{ // token = LT( 1 ); //} //catch ( TokenStreamException tse ) //{ // ErrorManager.internalError( "can't get token???", tse ); //} Token token = ex.token; ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "antlr: " + ex.toString(), ex ); }
@Override public void reportError(RecognitionException ex) { Token token = null; if (ex instanceof MismatchedTokenException) { token = ((MismatchedTokenException)ex).token; } else if (ex instanceof NoViableAltException) { token = ((NoViableAltException)ex).token; } ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "assign.types: " + ex.toString(), ex); }
@Override public void reportError(RecognitionException ex) { Token token = null; if (ex instanceof MismatchedTokenException) { token = ((MismatchedTokenException)ex).token; } else if (ex instanceof NoViableAltException) { token = ((NoViableAltException)ex).token; } ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "assign.types: " + ex.toString(), ex); }
@Override public void reportError(RecognitionException ex) { if ( inTest > 0 ) throw new IllegalStateException(ex); Token token = null; if ( ex instanceof MismatchedTokenException ) { token = ( (MismatchedTokenException)ex ).token; } else if ( ex instanceof NoViableAltException ) { token = ( (NoViableAltException)ex ).token; } ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "buildnfa: " + ex.toString(), ex ); }
@Override public void reportError(RecognitionException ex) { if ( inTest > 0 ) throw new IllegalStateException(ex); Token token = null; if ( ex instanceof MismatchedTokenException ) { token = ( (MismatchedTokenException)ex ).token; } else if ( ex instanceof NoViableAltException ) { token = ( (NoViableAltException)ex ).token; } ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "buildnfa: " + ex.toString(), ex ); }
@Override public void reportError(RecognitionException ex) { //Token token = null; //try //{ // token = LT( 1 ); //} //catch ( TokenStreamException tse ) //{ // ErrorManager.internalError( "can't get token???", tse ); //} Token token = ex.token; ErrorManager.syntaxError( ErrorManager.MSG_SYNTAX_ERROR, grammar, token, "antlr: " + ex.toString(), ex ); }
public void reportError(RecognitionException e) { String msg = e.toString(); if(e.token!=null && e.token.getText()!=null) msg = "Unexpected token: "+e.token.getText()+"."; // ". Maybe missing import?"; throw new RuntimeException(msg); } };
public void reportError(RecognitionException e) { String msg = e.toString(); if(e.token!=null && e.token.getText()!=null) msg = "Unexpected token: "+e.token.getText()+"."; // ". Maybe missing import?"; throw new RuntimeException(msg); } };
public static CronTabList create(String format) throws RecognitionException { List<CronTab> r = new ArrayList<CronTab>(); int lineNumber = 0; for (String line : format.split("\\r?\\n")) { lineNumber++; line = line.trim(); if (line.length() == 0 || line.startsWith("#")) { continue; // ignorable line } try { r.add(new CronTab(line, lineNumber)); } catch (RecognitionException e) { throw new BaseParser.SemanticException(Messages.CronTabList_InvalidInput(line, e.toString()), e); } } return new CronTabList(r); } }
@Override public void reportError(RecognitionException e) { String message = "line=" + getLine() + "(" + getCharPositionInLine() + "): " + e.toString();; throw new XerialError(XerialErrorCode.INVALID_TOKEN, message); }
@Override public void reportError(RecognitionException e) { String message = "line=" + getLine() + "(" + getCharPositionInLine() + "): " + e.toString();; throw new XerialError(XerialErrorCode.INVALID_TOKEN, message); }
private static MessageFilterTranslatable parseToTranslatable(MessageFilterParser parser) { try { MessageFilterParser.filter_return result = parser.filter(); return (MessageFilterTranslatable) result.getTree(); } catch (RecognitionException e) { throw new MessageFilterParsingException(e.toString(), e); } } }