[antlr-interest] build issues: bytecode assembly generation

Terence Parr parrt at cs.usfca.edu
Thu Oct 21 09:49:55 PDT 2004


Ok, so generating bytecodes for cyclic DFAs complicates the build 
slightly.  For example, if you don't want your .class files in same dir 
as your .g then you have to move it or I need an option to specify 
output dir (for for .java's and one for .class's).

Another thought I had was to simply "inline" the assembly code like you 
could do in some C compilers.  I.e., I'd generate a .java file like 
always for your parser, but it would have some dfa methods like this:

class MyParser extends antlr.Parser {
....constructors...
....parser rule methods...
private static int predictDFA1(IntegerStream input) {
/*!bytecode
aload 0
iconst 1
....
*/
}
private static int predictDFA1(IntegerStream input) {
/*!bytecode
*/
}
....
}

Then either ANTLR can invoke the javac compiler (inside same VM 
process) or it could leave it to another pass.  Both of these 
complicate building a parser.

I lean towards the simple "i generate a .class file that's ready to go" 
method, but I sort of like making an inline assembly code tool; javac 
knows how to make .class files for any java whereas my little thing can 
only do it for specific DFA classes.

Anybody wanna comment on the build issues or coolness factor of inline 
assembly (for programs that generate programs anyway)?

Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list