[antlr-interest] Code Generation/Optimization.

Bharath S payasam79 at yahoo.com
Thu Mar 11 08:48:34 PST 2004


Hi John,

Thanks much for your comments! I downloaded the
grammar for Pascal and found the "tree grammar" that
you mentioned. 

One other question: If I had actions associated with
tokens in my lexer rules, does it have any side
effects when compared to having actions in parser
rules and only tokens in lexer rules? My understanding
is that semantic actions along with tokens is used to
resolve non-determinism.

Thanks!!

B.
--- "John D. Mitchell" <johnm-antlr at non.net> wrote:
> >>>>> "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
> 
> 
>      antlr-interest-unsubscribe at yahoogroups.com
> 
>  
> 


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com


 
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