[antlr-interest] build issues: bytecode assembly generation

Don Caton dcaton at shorelinesoftware.com
Thu Oct 21 18:08:48 PDT 2004



Terence:

I haven't been a subscriber to this list for too long, so forgive me if this
has already been discussed, but...

Why did you write Antlr in Java in the first place, and why are you fighting
with these issues?  C++ is at least as portable as Java and it has no
runtime to impose limitations that get the way of what you need to do.  I'm
not anti-Java, but I don't see what benefits it brings to the table over
C++, at least not for this kind of programming task.  

Don

 

> -----Original Message-----
> From: Terence Parr [mailto:parrt at cs.usfca.edu] 
> Sent: Thursday, October 21, 2004 12:50 PM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] build issues: bytecode assembly generation
> 
> 
> 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
> 
> 
> 
>  
> 
> 
> 
> 







 
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