简体   繁体   English

antlr.gunit.Interp有哪些选项? 如何打开其详细选项?

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

I certainly make wrong, but antlr's gunit seems to have no option for the users. 我当然错了,但是antlr的功能似乎对用户没有选择。

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] 

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. 假设您正在使用antlr3,请查看GitHub( https://github.com/antlr/antlr3/blob/master/gunit/src/main/java/org/antlr/gunit/Interp.java )上的源代码更正没有详细选项。

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. 验证测试失败原因的一种方法是在调试模式下通过AntlrWorks运行输入,以便您可以查看匹配的规则。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM