[antlr-interest] #setType (C++)

Hrvoje Nezic hrvoje.nezic at envox-lab.hr
Thu Dec 5 06:14:45 PST 2002


Ok, I realised that I have to use #PLUS->setType instead of
#PLUS.setType.

----- Original Message -----
From: "Hrvoje Nezic" <hrvoje.nezic at envox-lab.hr>
To: "ANTLR mailing list" <antlr-interest at yahoogroups.com>
Sent: Thursday, December 05, 2002 2:36 PM
Subject: [antlr-interest] #setType (C++)


> Is it possible to use #setType in C++?
>
> In options I declared:
>     buildAST = true;
>
> and then tried to use #setType in rules:
>
> unaryExpr
> :
>     PLUS^ { #PLUS.setType(UNARY_PLUS); } ...
>     ...
> ;
>
> This is translated into:
>
>     antlr::RefAST tmp19_AST = antlr::nullAST;
>     tmp19_AST.setType(UNARY_PLUS);
>
> and cannot be compiled, because ASTRefCount doesn't have
> the setType method (RefAST is defined as ASTRefCount<AST>).
>
> Is there a workaround for this, or am I doing something wrong?
>
> Regards,
> Hrvoje Nezic
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


 

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



More information about the antlr-interest mailing list