[Prev][Next][Index]
Re: Thanks for the enum fix but...
- From: "Beata Winnicka" <bfatyga@slab.cica.indiana.edu>
- Date: Thu, 23 Feb 95 11:00:00 -0500
- To: Diego Novillo <diego@cs.ualberta.ca>
- Subject: Re: Thanks for the enum fix but...
- Cc: sage-bugs@cica.indiana.edu (Sage Bug Reports)
- Sender: owner-sage-bugs@extreme.indiana.edu
> 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