[PATCH] repost: improvements to rlgen-java

David Waite dwa... at gmail.com
Mon Dec 31 14:56:18 UTC 2007


The following patch changes the Java generation a bit:

- Array row/max are changed slightly to 12/8184 based on 80 column
display. This was just my own preference (some might prefer 10
columns, some would prefer the power-of-2-edness of 8 columns).  Toss
it if desired.

- Arrays are generated with an array constructor rather than a large
block of statement constructors. This reduced my packaged JAR size by
14k for a relatively simple JSON vocabulary with 68 states.
- Arrays are generated with whitespace padding in code for
readability.
- Array overflow (over the SAIIC limit) is done by creating multiple
functions with numbered prefixes, then generating a combine_<name>
function which builds a new array using new and arraycopy over all the
previous init_<name>_<number> functions.

-David Waite
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.colm.net/pipermail/ragel/attachments/20071231/6a813891/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rlgen-java_inline_arrays.patch
Type: application/octet-stream
Size: 3351 bytes
Desc: not available
URL: <http://www.colm.net/pipermail/ragel/attachments/20071231/6a813891/attachment.obj>


More information about the ragel-users mailing list