From: Nikolai Weibull <context-list@pcppopper.org>
Subject: Wrapping \type{}
Date: Sun, 30 May 2004 01:20:22 +0200 [thread overview]
Message-ID: <20040529232021.GA3268@puritan.pcp.ath.cx> (raw)
In my BNF module I use " as an active character that begins and ends
terminals in the grammar:
<regex>: <branch> ; <branch>, "\|", <regex>.
Now, the above doesn't quite work as written, as \ is still active (and
so is, in fact | as we're really inside a \starttabulate.
What I would like for the "" pair to do is work as a wrapper for
\type{}, so that everything in-between is passed on to \type{}.
Is there a way of getting them to do that?
This is my current definition:
\gdef"%
{\ifBNFoutsidestring%
\global\BNFoutsidestringfalse%
\begingroup%
\BNFunsetcatcodes%
\catcode`\"\@@active%
\@@bnfterminalstart%
\else%
\@@bnfterminalstop%
\endgroup%
\global\BNFoutsidestringtrue%
\fi}
I figured something like
\long\gdef"#1"%
{\type{#1}}
might work, but it didn't. It chokes on "." where . is also an
activated character for terminating a production in the grammar.
Any suggestions on how to go about this? I mean, the obvious solution
is simply to write
<regex>: <branch> ; <branch>, "\type{\|}", <regex>.
instead, but I would like to keep the input as clean as possible.
nikolai
--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
next reply other threads:[~2004-05-29 23:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-29 23:20 Nikolai Weibull [this message]
2004-06-01 18:33 ` Hans Hagen
2004-06-01 21:24 ` Nikolai Weibull
2004-06-23 11:40 ` Patrick Gundlach
2004-06-23 18:15 ` Nikolai Weibull
2004-12-02 14:27 ` BNF module (was: Wrapping \type{}) Patrick Gundlach
2004-12-02 14:43 ` Nikolai Weibull
2004-12-02 14:55 ` BNF module Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040529232021.GA3268@puritan.pcp.ath.cx \
--to=context-list@pcppopper.org \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).