bison-patches
[Top][All Lists]
Advanced

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

Re: push parser


From: Akim Demaille
Subject: Re: push parser
Date: Thu, 06 Apr 2006 17:13:55 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

>>> "Bob" == Bob Rossi <address@hidden> writes:

 > 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()[;

You don't need the parens.

   ]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.

The scanner provides some "bigraphs": you can use @{ and @} to stand
for [ and ] whatever is the current quotation level.  They are
converted last, m4 never sees them as [ and ].


 > look like
 >   yypack[yystate]; 

address@hidden@}

you might also want to 

m4_define([b4_yypack],
address@hidden@}])

and

b4_yypack([b4_yystate])





reply via email to

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