6

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! ;)

java.is.for.desktop
  • 10,748
  • 12
  • 69
  • 103

4 Answers4

5

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

Sripathi Krishnan
  • 30,948
  • 4
  • 76
  • 83
2

The JavaCC website features a grammar repository with grammars for many programming languages (C,C++,VB,etc.).

Check it out

Loxley
  • 1,781
  • 17
  • 20
das_weezul
  • 6,082
  • 2
  • 28
  • 33
1

SourceMeter, as patched, uses JavaCC to derive Java source code metrics.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045