bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: push parser


From: Bob Rossi
Subject: Re: push parser
Date: Tue, 14 Feb 2006 22:43:32 -0500
User-agent: Mutt/1.5.9i

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]