[antlr-interest] Manual tree construction problem with VC 7.1

Thun anm_thunder at yahoo.com.br
Wed Apr 19 12:09:14 PDT 2006


This is only necessary because i am using it with VC 7.1 right? If i recall 
correctly, the doc states i can use a unlabeled token.

Thanks

----- Original Message ----- 
From: "Martin Probst" <mail at martin-probst.com>
To: "Thun" <anm_thunder at yahoo.com.br>
Cc: <antlr-interest at antlr.org>
Sent: Wednesday, April 19, 2006 2:56 AM
Subject: Re: [antlr-interest] Manual tree construction problem with VC 7.1


> You have to give the tree returned by the subrule a label to  reference 
> it, simply it's name doesn't work:
>
> a: mylabel:b EOF { ## = #(#[...], #mylabel); };
>
> will do the trick.
>
> Martin
>
> Am 19.04.2006 um 04:40 schrieb Thun:
>
>> a: b EOF {#shader = #([ITK_A], b);} ;
>>
>>
>> b: "B";
>>
>> I get the following error when compilng the generated code from the 
>> parser above:
>>
>> error C2664: 'antlr::ASTArray::add' : cannot convert parameter 1  from 
>> 'void (void)' to 'antlr::RefAST'
>> a_AST = antlr::RefAST(astFactory->make((new antlr::ASTArray(2))->add 
>> (astFactory->create(ITK_A))->add(b)));
>>
>> The problem is with the '->add(b)'.
>>
>> b is the matching method for the b rule, it returns void.
>>
>> It cant compile in VS 2003 C++ 7.1, is there a way to fix it?
>>
>>
>> Thanks
>>
>>
>>
> 


	

	
		
_______________________________________________________ 
Yahoo! doce lar. Faça do Yahoo! sua homepage. 
http://br.yahoo.com/homepageset.html 



More information about the antlr-interest mailing list