JavaCC: Please give me links to "real" examples [closed]
Asked Answered
T

4

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

Thrush answered 28/4, 2010 at 17:47 Comment(0)
S
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

Sultana answered 28/4, 2010 at 18:17 Comment(0)
S
4

http://www.engr.mun.ca/~theo/JavaCC-Tutorial/javacc-tutorial.pdf
http://www.cobase.cs.ucla.edu/projects/coxml/doc/Eric-Master.pdf

Sartin answered 28/4, 2010 at 18:20 Comment(1)
your first tutorial is awesome !!!Poe
R
2

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

Check it out

Ratel answered 28/4, 2010 at 17:48 Comment(0)
P
1

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

Padilla answered 28/4, 2010 at 18:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.