On Sun, Feb 12, 2006 at 10:30:19PM -0500, Joel E. Denny wrote: > On Sun, 12 Feb 2006, Bob Rossi wrote: > > > Anyways, I ran into an m4 question that might be answered here. I have > > this > > m4_define([b4_yystate],[b4_push_if([(pv->yystate)],yystate)]) > > > > and when I try to use b4_yystate() in this context > > ]b4_yyn()[ = yypact]b4_yystate()[; > > it works fine. However, I need the C array brackets in the output so > > however I try to write the line > > ]b4_yyn()[ = yypact[]b4_yystate()[]; > > or countless other variations, I just can't get it. > > I'm not an m4 expert, so there might be an easier approach, but you could > do this: > > m4_define([b4_bracket],[[[$1]]]) > > and then: > > ]b4_yyn()[ = yypact]b4_bracket(b4_yystate())[; > > It's a little ugly, but it gets the job done.
Thanks, this is much nicer than what I have, I'll redo what I have to do something like this. If it can be improved upon, patch review can pick it up. Thanks, Bob Rossi
