Article View: comp.specification.z
Article #29Re: concrete syntax and fuzz
From: Brendan Mahony
Date: Fri, 24 Jul 1992 01:44
Date: Fri, 24 Jul 1992 01:44
59 lines
2609 bytes
2609 bytes
In <9207231534.AA00732@auric> cash@auric.uni-koblenz.de (Martin Carstensen) writes:
| The concrete syntax of fuzz differs slightly from the one LaTeX produces
| from specifications (e.g. fuzz syntax contains the string "\forall"
| where LaTeX produces the quantor symbol itself, schemas are more
| complicated examples).
| Recently I tried to define strings like this:
| \begin{zed}
| LETTER ::= a|b|c|d \\
| STRING ::= string \ldata \seq LETTER \rdata
| \end{zed}
|
| Now I'm looking for a way to tell LaTeX what strings shall look like
| and which will be accepted by fuzz. The following approach would be
| treated properly by fuzz, but the LaTeX definition does only do half
| of the job.
| \newcommand{\str}[1]{"#1"}
| %%\begin{zed}
| %%\str == string
| %%\end{zed}
| \begin{axdef}
| s: STRING
| \where
| s = string \langle a, b \rangle \\
| s = \str {\langle a, b \rangle}
| \end{axdef}
I am not sure your solution works at all for the new version of fuzz, at
least we have had troubles with spurious {..} pairs.
Anyway, you need to appeal to a little TeX (i.e. use \def rather than
\newcommand). In general if you want to produce a novel concrete syntax
for a function application use a TeX definition like
\def\f(#1){...}
Now you can write \f(arg) in your Z, get fuzz to accept it, and get
LaTeX to print it any old how. (This idea was suggested by Mike Spivey)
I your case you need to redefine the TeX output of \langle .. \rangle.
Try this:
\def\str(#1){\def\langle{\mathopen{\mbox{``}}}\def\langle{\mathopen{\mbox{``}}}#1}
You list now appears within quotes rather than < .. > brackets.
I am not as clear on how to get rid of the commas. Some trick with a
\mathchardef or \mathcode I suppose. I don't think you can trick fuzz
into accepting some character other than the comma. Find a copy of the
TeXbook.
--
When soldiers form lines or hollow squares, you call it reason.
When wild geese in flight take the form of a letter V, you say instinct.
When the homogeneous atoms of a mineral arrange themselves into shapes
mathematically perfect you have nothing to say. You have not even invented a name to conceal your heroic unreason."
Technical Details
Message-ID:
<9516@uqcspe.cs.uq.oz.au>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!uqcspe!cs.uq.oz.au!brendanReferences:
<9207231534.AA00732@auric>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!uqcspe!cs.uq.oz.au!brendan From: brendan@cs.uq.oz.au (Brendan Mahony) Newsgroups: comp.specification.z Subject: Re: concrete syntax and fuzz Message-ID: <9516@uqcspe.cs.uq.oz.au> Date: 24 Jul 92 01:44:53 GMT References: <9207231534.AA00732@auric> Sender: news@cs.uq.oz.au Reply-To: brendan@cs.uq.oz.au Lines: 59