[ragel-users] Re: Generating java source code

Colin Fleming colin.mailingl... at gmail.com
Mon Feb 26 19:20:47 UTC 2007


The issue, as Adrian pointed out, is that Java initialises arrays by
creating a huge list of assignments, and there's a JVM limit of 64k
per method, which is frequently a problem for generated code. There
are various hacks (encoding data in Strings etc), but none of them are
very elegant.

The problem with putting data in Jar files is that it then makes
building the Jar files more complicated. The data files have to exist
in a known location in the jar, and if there's a problem, you won't
know about it until runtime. Not much more complicated, but a bit -
AFAIK it's not easy to do with Maven, for example. As ugly as it is,
the array initialiser method means that you just compile your classes
and can do what you want with them afterwards, and it won't have
runtime dependencies. It might be worth providing this as an option,
though.

I was working on the Java generation a while back, but unfortunately I
got seriously sidetracked, and haven't been able to get back to it.

Cheers,
Colin



More information about the ragel-users mailing list