[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: SableCC hangs when 'compiling' a grammar
The grammar i'm trying to compile with sablecc is the one from my original
post on this subject. It is derived from the scriptonite's ecma-script
grammer, but then a lot more simplified: DCL has fewer keywords, fewer
productions etc.... and i removed all 'unicode' helpers and replaced them
with ASCII to speed up the compiling and reduce memory when still testing
the DCL-grammar. I compiled the ECMA script and indeed 'only' 1751
states..... I have no idea why my script has so many, since it is just a
'simplified ecma' grammer....
BTW: When sablecc is executing DFA.optimize(), no extra memory is being
used. On my NT machine, it stays at about 179 million bytes.
Thank you very much,
From: Mariusz Nowostawski [mailto:firstname.lastname@example.org]
Sent: Wednesday, May 23, 2001 21:16
To: Anton Spaans
Subject: RE: SableCC hangs when 'compiling' a grammar
I have played a little, to make optimizing faster (hmmmm, it supposed to
be less memory consuming, huh? ;), anyway, all the simple stuff I could do
I have done, making some of the classes final for the compiler to inline
the code, etc, but there is no easy way of making it use less memory. One
could use primitive types more often and get rid of thousends of created
objects, but it is not easy to achieve without major redoing of DFA
core, and.. it would make a nightmare to maintain it I guess.
and.. I have done the lazy check of other grammars: Java grammar has
something about 860 states to optimize and ecmascript (1.7 from
sourceforge/scriptonite) 1751 states.
so, good luck with the grammar hacking! ;o)