[antlr-interest] Complex AST transformaton

Oliver Zeigermann oliver.zeigermann at gmail.com
Sat Dec 13 03:07:05 PST 2008


Oh, I did not know about grammar import. Nice.

Thanks for the help!

I have not properly described my problem, though. I have the following
processing chain:

Input --Lexer--> Token Stream

--Parser--> AST0

--Tree Transformer--> AST1 (still having the token types of defined in
the parser)

--Tree Translator--> AST2 (having a completely new set of token types)

--Tree Template Emitter--> Final Output

As the token types used in AST1 are defined in the parser, how could I
use grammar import from AST2? I guess that does not work, right? There
will be a clash of token types anyway?!

Oliver

2008/12/12 Terence Parr <parrt at cs.usfca.edu>:
> Try a grammar import (from where the new tokens come from).  that hsould
> give a union of AST1/AST2 token types.
> Ter
> On Dec 12, 2008, at 4:36 AM, Oliver Zeigermann wrote:
>
>> Folks!
>>
>> I am struggeling to how to make a complex AST1 -> AST2 transformation
>> where the token types of AST1 are completely different from those in
>> AST2. How do I specify "tokenVocab" in this case? Do I have to create
>> a token file manually?
>>
>> Any hints welcome :)
>>
>> Oliver
>>
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe:
>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>
>
>


More information about the antlr-interest mailing list