Example usage for org.antlr.v4.runtime Parser notifyErrorListeners

List of usage examples for org.antlr.v4.runtime Parser notifyErrorListeners

Introduction

In this page you can find the example usage for org.antlr.v4.runtime Parser notifyErrorListeners.

Prototype

public final void notifyErrorListeners(String msg) 

Source Link

Usage

From source file:se.dykstrom.jcc.common.utils.ParseUtils.java

License:Open Source License

/**
 * Checks that the parsing has completed, and that the next token is EOF.
 * If this is not the case, a syntax error is generated.
 *//*w ww.  ja  v a  2  s.com*/
public static void checkParsingComplete(Parser parser) {
    if (parser.getCurrentToken().getType() != Token.EOF) {
        parser.notifyErrorListeners("Syntax error at EOF.");
    }
}