[Prev][Next][Index]

Re: Thanks for the enum fix but...



> Hi,
> 

> Thanks for sending me the enum fix. It worked. However, I
> have another problem concerning enums. If the user
> writes something like:
> 

> enum myEnum { a, b }; 

> enum myEnum fun(int a, int b);
> 

> The code generated by unparse is:
> 

> enum myEnum { a, b }; 

> enum myEnum fun;
> 

> This causes the compiler to fail when it encounters a call
> to 'fun', because it is defined as a variable. Thanks a
> lot.
> 

>  Diego. 

> 


Try the following definition of
DEFNODECODE(ENUM_DECL ...):

DEFNODECODE(ENUM_DECL,          "%CMNT%PUTTAB%DECLSPEC%RIDPT%SETFLAG(ENUM)enum  
%SYMBID %IF (%BLOB1 != %NULL){%INCTAB%NL  
%BLOB1%DECTAB%PUTTAB}%SETFLAG(VARDECL)%LL1;%UNSETFLAG(VARDECL)%NL%ELSE%SETFLA 
G(VARDECL)%LL1;%UNSETFLAG(VARDECL)%NL%ENDIF%UNSETFLAG(ENUM)",
'd',0,BIFNODE)

And please let me know how it works,   --Beata