ydr patch for rxgen compatibility

Derrick J Brashear shadow at dementia.org
Tue Jan 18 23:03:07 CET 2000


The attached patch causes ydr to accept e.g.
enum foo {
 BAR,
 BAZ
};

and implicitly assign BAR=0, BAZ=1, which is what rxgen does.

It will also pick up the numbering after the last explicitly numbered
entry, deliberately. I didn't look to see what Transarc did in that case.

-D



*** parse.y~	Tue Jan 18 17:00:44 2000
--- parse.y	Tue Jan 18 17:01:18 2000
***************
*** 194,200 ****
  		;
  
  enumentry:	T_IDENTIFIER '=' constant
! 		{ $$ = createenumentry ($1, $3); varcnt++; }
  		| T_IDENTIFIER
  		{ $$ = createenumentry ($1, varcnt++); }
  		;
--- 194,200 ----
  		;
  
  enumentry:	T_IDENTIFIER '=' constant
! 		{ $$ = createenumentry ($1, $3); varcnt = $3 + 1; }
  		| T_IDENTIFIER
  		{ $$ = createenumentry ($1, varcnt++); }
  		;





More information about the Arla-drinkers mailing list