Report warnings as well as errors

This commit is contained in:
Sam Harwell 2012-04-04 09:53:10 -05:00
parent bf9c7c3a28
commit 64e0a8734f
1 changed files with 8 additions and 1 deletions

View File

@ -402,7 +402,7 @@ public abstract class BaseTest {
Tool antlr = newTool(optionsA); Tool antlr = newTool(optionsA);
antlr.addListener(equeue); antlr.addListener(equeue);
antlr.processGrammarsOnCommandLine(); antlr.processGrammarsOnCommandLine();
if ( equeue.errors.size()>0 ) { if ( !equeue.errors.isEmpty() ) {
allIsWell = false; allIsWell = false;
System.err.println("antlr reports errors from "+options); System.err.println("antlr reports errors from "+options);
for (int i = 0; i < equeue.errors.size(); i++) { for (int i = 0; i < equeue.errors.size(); i++) {
@ -413,6 +413,13 @@ public abstract class BaseTest {
System.out.println(grammarStr); System.out.println(grammarStr);
System.out.println("###"); System.out.println("###");
} }
if ( !equeue.warnings.isEmpty() ) {
System.err.println("antlr reports warnings from "+options);
for (int i = 0; i < equeue.warnings.size(); i++) {
ANTLRMessage msg = equeue.warnings.get(i);
System.err.println(msg);
}
}
} }
catch (Exception e) { catch (Exception e) {
allIsWell = false; allIsWell = false;