Saveliy Tretiakov wrote:
+typedef: tTYPEDEF m_attributes type pident_list {
attr_t *a = $2;
int public = 0;
while(a){
switch(a->type)
{
case ATTR_CONTEXTHANDLE:
case ATTR_STRING:
case ATTR_HANDLE:
case ATTR_SWITCHTYPE:
case ATTR_TRANSMITAS:
case ATTR_POINTERTYPE:
case ATTR_IGNORE:
break;
case ATTR_PUBLIC:
public = 1;
break;
default:
yyerror("Inapplicable attribute\n");
How about changing the grammar to define something like:
attributes: td_attribs | tCONTEXTHANDLE | tSTRING | ... /* other things that can't be a typedef */ ;
td_attribs: tAGGREGATABLE | ... /* other things in the existing attributes rule */ ;
typedef: tTYPEDEF td_attribs type pident_list ....
That way the parser can deal with the problem.
Mike