java JavaCC:请给我“真实”示例的链接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2731893/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JavaCC: Please give me links to "real" examples
提问by java.is.for.desktop
I know that there are many examples of JavaCC parsers here, but they all do nothing. They just accept a string, or produce parsing errors.
我知道有JavaCC的解析器的例子很多在这里,但他们都无能为力。他们只接受一个字符串,或者产生解析错误。
What I need is a few examples of real parsers, which actually do something during parsing. (Such as building a DOM tree during parsing an XML string).
我需要的是一些真正的解析器的例子,它们实际上在解析过程中做一些事情。(例如在解析 XML 字符串时构建 DOM 树)。
Please help! ;)
请帮忙!;)
回答by Sripathi Krishnan
Take a look at EcmaScript.jj that DOJO library maintains over here - http://svn.dojotoolkit.org/src/trunk/tools/jslinker/src/org/dojo/jsl/parser/EcmaScript.jjt
看看 DOJO 库在这里维护的 EcmaScript.jj - http://svn.dojotoolkit.org/src/trunk/tools/jslinker/src/org/dojo/jsl/parser/EcmaScript.jjt
It parses real javascript and then optimizes it. Read more about what it does out here http://svn.dojotoolkit.org/src/trunk/tools/jslinker/docs/readme.txt
它解析真正的javascript,然后对其进行优化。在这里阅读更多关于它的作用http://svn.dojotoolkit.org/src/trunk/tools/jslinker/docs/readme.txt
回答by Romain Hippeau
回答by das_weezul
The JavaCC website features a grammar repository with grammars for many programming languages (C,C++,VB,etc.).
JavaCC 网站有一个语法库,其中包含许多编程语言(C、C++、VB 等)的语法。
回答by trashgod
SourceMeter, as patched, uses JavaCC to derive Java source code metrics.
SourceMeter,作为补丁,使用 JavaCC 来导出 Java 源代码指标。

