At 17:38 26/02/2004, you wrote:
which case the first character in the body of the command is checked \doifnextcharelse[... which thus fails but in some manner eats it (even
tricky indeed (will think about it) go the etex way: \definecomplexorsimpleempty\startbnfgrammar \long\def\complexstartbnfgrammar[#1]#2\stopbnfgrammar {\bgroup% \global\firstruletrue% \global\newruletrue% \global\donerulefalse% \setupbnfgrammar[#1]% \setcatcodes% \starttable[|r|c|l|]\scantokens{#2}\LR\stoptable \egroup} beware, use \def\BNFsomecommand to avoid future nameclashes; also, no % are needed after a \cs: \long\def\complexstartbnfgrammar[#1]#2\stopbnfgrammar {\bgroup \global\firstruletrue \global\newruletrue \global\donerulefalse \setupbnfgrammar[#1]% \setcatcodes \starttable[|r|c|l|]\scantokens{#2}\LR\stoptable \egroup} I assume that you know that \setcatcodes is an internal command Hans