[antlr-interest] Problem with multiple treeparser ...

LdK ^^ elldekaa at gmail.com
Thu Oct 16 05:58:31 PDT 2008


that works ..
thank you very much !!!

2008/10/16 Gavin Lambert <antlr at mirality.co.nz>

> At 09:51 16/10/2008, LdK ^^ wrote:
>
>> i don't know if there are some difference but i work with the version
>> 2.7.6 of antlr (my school version)
>> and i'm sur that i can put the parser and treeparser in the same grammar
>> file
>>
>
> Oh, right.  You didn't say that before :)  The default now is to assume
> ANTLR v3 unless otherwise specified, and you can't do that in v3.
>
>  NEXT FILE :
>>
>> {import java.util.*;}
>> class XHTMLNewTreeParser extends TreeParser;
>>
>> options    {
>>        buildAST = true;
>>
>>    }
>>
>
> When you have a tree parser in a separate file like this, you need to
> specify the importVocab option, so that it knows how to find the token
> definitions.
>
> // in the parser
> options {
>  exportVocab = XHTML;
> }
>
> // in the tree parser
> options {
>  importVocab = XHTML;
> }
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081016/c26344d6/attachment.html 


More information about the antlr-interest mailing list