[antlr-interest] ANTLR and GCC

mzukowski at yci.com mzukowski at yci.com
Tue Aug 19 10:35:21 PDT 2003


The GCC transformation toolkit http://www.codetransform.com/gcc.html can
output C text from the ASTs generated by my gcc parser.  If your input
language is close to C in structure then you can transform from your AST to
the gcc AST and then use my emitter.  If your language is not really close
to C then you may be better off writing a tree pass that emits C from your
AST.  With more information we can help you sort out what to do.

Monty

-----Original Message-----
From: goughroger [mailto:goughroger at hotmail.com] 
Sent: Tuesday, August 19, 2003 2:53 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] ANTLR and GCC


Hi All,

I am new to ANTLR and I wish to use it with GCC. I have modified the 
backend of GCC compiler to recognise a new architecure which I am 
modelling. I am trying to use ANTLR as a front-end. Is this possible? 
I have written a basic grammar file containing a lexer and parser. I 
am able to compile this with the commands

java antlr.Tool myGrammarFile.g
javac *.java
main    //main is the class name

The last command does not work, i.e no output is produced. (The 
classpath options are set correctly) Should the output be an AST? Am 
i right in thinking that the antlr can output C functions and if so, 
how? Can ANTLR output assembly language?

Maybe I should post this on gcc.gnu.org mailing list but I hope 
somebody on this list may be able to help me. Any ideas/suggestions 
greatly appreciated.

Kind Regards
Roger


 

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


 

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




More information about the antlr-interest mailing list