[antlr-interest] C# vs MSIL Output

Robert Colquhoun rjc at trump.net.au
Wed Mar 10 17:47:11 PST 2004


Hello,

At 10:54 PM 9/03/2004, Anthony Youngman wrote:
>I'm sure Rob will join in when he sees this ... he wrote the MaVerick
>DATABASIC grammar.
>
>But that was originally written to spit out java source to feed into the
>java compiler. He then wrote another emitter to spit out java p-code.

Yes did a to java source and to java bytecode compiler/translator.

I did the translator to java source first thinking that would be 
easier.  In a way it was in that every step of the way was an ascii human 
readable form(ie source, ast tree, java source).  This was offset though by 
the difficulty trying to remotely control third party software in the java 
source compiler(errors were particularly hard to handle nicely), poor 
compiler performance, difficulty in efficiently implementing low level 
constructs of the source language in java and debugging the compiled 
program used the intermediate java lang not the original program source.

The java bytecode is not like traditional asm it is much higher level.  I 
have only had a very brief look at MSIL but it looks kind of similar.

The classes i did to output java bytecode i was thinking of using them to 
create a direct bytecode-generator in antlr.  The major problem i think 
would be that have to do actions differently perhaps some kind of 
listener/event interface or something.

The other thing i could do is a simple tree walker for the java grammer to 
actually output byte codes.

  - Robert



 
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