JavaCC: Please give me links to "real" examples

java.is.for.desktop picture java.is.for.desktop · Apr 28, 2010 · Viewed 14.3k times · Source

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.

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).

Please help! ;)

Answer

Sripathi Krishnan picture Sripathi Krishnan · Apr 28, 2010

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

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