[antlr-interest] Code Generation/Optimization.

John D. Mitchell johnm-antlr at non.net
Thu Mar 11 08:39:05 PST 2004


>>>>> "Bharath" == Bharath S <payasam79 at yahoo.com> writes:
[...]

> My understanding is that AntLR can be used to generate the front-end of a
> compiler (lex-parser-AST). What about the backend? (code
> generation/optimization?). As of now, I am getting clear ideas about
> defining the "structured text" language's syntax+semantics; How would i
> convert it to bytecode?

Basically, write a set of tree grammars that performs various tree
transformations (such as optimizations) and side effects (such as use-def
chains, constants table creation, etc.) and then a final tree grammar which
takes all of that and spits out the output in your desired format.

Of course, it goes without saying that the output of that last pass may
also be the input for other code generation tools.

Have fun,
	John



 
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