[antlr-interest] Dynamic Java compiler?

Terence Parr parrt at cs.usfca.edu
Sun Apr 24 21:05:14 PDT 2005


On Apr 24, 2005, at 6:33 PM, Jon Schewe wrote:

> On Sun, 2005-04-24 at 13:56 -0700, Terence Parr wrote:
>> <antlr-interest at antlr.org>
>> You can generate .class files with javac and then ask the classloader
>> to load them.  Or, use com.sun.compiler.* or whatever it is to do
>> inline.  See any servlet/jsp engine for the sample code I think.
>
> Unfortunately that requires the source for all of the files to be on 
> the
> filesystem when the compiler runs.  This is possible in a JSP engine
> because it's static, not dynamic code.  However this is not the case in
> my application, as I'm generating the source on the fly as the
> classloader requests the classes.

Can you write to a file?  JSPs change on the fly so they must be 
reloaded throwing out the old .class file.  :)

Ter



More information about the antlr-interest mailing list