[antlr-interest] Mixing Grammars

Bogdan Mitu bogdan_mt at yahoo.com
Thu Jun 13 03:59:32 PDT 2002


--- Niall Gormley <ngormley at hotmail.com> wrote:
> Hi,
> 
> As part of a translation project I am working I wish to create an AST of
> the 
> target language, by transforming the source AST, using multiple tree 
> grammars and user interaction.
> 
> Is it possible to mix grammars in a TreeParser, to allow node creation of 
> the target language?

Yes, but the treeParser needs to know what are the tokens of the target
language. You can do this by declaring the new tokens that are introduced in
the tokens section of the treeParser. And if you use a series of
treeParsers, each needs to know the tokens introduced by previous
treeParsers. You can do this by making good use of importVocab/exportVocab
options in each treeParser.

Bogdan

> Has anyone got a good example of how they achieved this type of
> translation 
> in practice.


 
> Thanks for your help,
> Niall
> 
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

 

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



More information about the antlr-interest mailing list