What is the options for antlr.gunit.Interp? How to turn on its verbose option?

255 views Asked by At

I certainly make wrong, but antlr's gunit seems to have no option for the users.

bash-3.2$ java org.antlr.gunit.Interp --help
Exception in thread "main" java.io.FileNotFoundException: --help (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:120)
    at java.io.FileInputStream.<init>(FileInputStream.java:79)
    at org.antlr.runtime.ANTLRFileStream.load(ANTLRFileStream.java:59)
    at org.antlr.runtime.ANTLRFileStream.<init>(ANTLRFileStream.java:47)
    at org.antlr.runtime.ANTLRFileStream.<init>(ANTLRFileStream.java:42)
    at org.antlr.gunit.Interp.main(Interp.java:62)
bash-3.2$ 

Especially, I would like to turn on verbose option, otherwise it tells really little when error occurs.
Do you know how to turn on its verbose/debug option?

 [java] -----------------------------------------------------------------------
 [java] executing testsuite for grammar:while with 31 tests
 [java] -----------------------------------------------------------------------
 [java] 2 failures found:
 [java] test15 (variables, line20) - 
 [java] expected: OK
 [java] actual: FAIL
 [java] 
 [java] test20 (read, line27) - 
 [java] expected: OK
 [java] actual: FAIL
 [java] 
1

There are 1 answers

0
kierans On BEST ANSWER

Assuming you're using antlr3, looking at the source on GitHub (https://github.com/antlr/antlr3/blob/master/gunit/src/main/java/org/antlr/gunit/Interp.java) you are correct that there is no verbose option.

A way to verify why your tests are failing would be to run the input through AntlrWorks in debug mode, so that you can see what rules are matching.