Capture ANTLR4 syntax errors and log them 25/29025/3
authorMartin Ciglan <mciglan@cisco.com>
Fri, 30 Oct 2015 14:27:42 +0000 (15:27 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Sat, 31 Oct 2015 02:31:25 +0000 (02:31 +0000)
commited9da13b5ccdd7f041040b1403c60a4a0a91ed9c
tree913a09d1b02ca3d9d64a1456400045e061dd0ed0
parent488049c0db535a3ef357ea3980696f2ea986e30b
Capture ANTLR4 syntax errors and log them

By default, ANTLR4 parser instance has ANTLR4's ConsoleErrorListener
attached to it, therefore error messages are piped to System.err.

In this patch, this is silenced and captured via existing
custom implementation of ANTLR4's BaseErrorListener.

Change-Id: I1922880bf09e69ca55316dacbca9b5fc338f721c
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/impl/YangErrorListener.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/YangStatementSourceImpl.java