org.antlr.v4.runtime.ConsoleErrorListener Maven / Gradle / Ivy
/*
* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
* Use of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/
package org.antlr.v4.runtime;
/**
*
* @author Sam Harwell
*/
public class ConsoleErrorListener extends BaseErrorListener {
/**
* Provides a default instance of {@link ConsoleErrorListener}.
*/
public static final ConsoleErrorListener INSTANCE = new ConsoleErrorListener();
/**
* {@inheritDoc}
*
*
* This implementation prints messages to {@link System#err} containing the
* values of {@code line}, {@code charPositionInLine}, and {@code msg} using
* the following format.
*
*
* line line:charPositionInLine msg
*
*/
@Override
public void syntaxError(Recognizer recognizer,
Object offendingSymbol,
int line,
int charPositionInLine,
String msg,
RecognitionException e)
{
System.err.println("line " + line + ":" + charPositionInLine + " " + msg);
}
}