X-Git-Url: https://git.distorted.org.uk/~mdw/mdwtools/blobdiff_plain/e1069af1e2771b20455999803846ee852d7e42d6..6d86a5276ba4bac330f33b4e6b56f18e1d7463f0:/syntax.dtx?ds=sidebyside diff --git a/syntax.dtx b/syntax.dtx index 1226067..1b1965f 100644 --- a/syntax.dtx +++ b/syntax.dtx @@ -172,7 +172,7 @@ % \begin{listing} %\def\<#1>{\synt{#1}} % \end{listing} -% to allow you to type "\\<"">" as an alternative to +% to allow you to type "\\<"">" as an alternative to % "\\synt{""}". % % \DescribeMacro\lit @@ -290,7 +290,7 @@ % \DescribeMacro{\[[} % \DescribeMacro{\]]} % You can use syntax diagrams (see below) instead of a straight piece of BNF -% by enclosing it in a |\[[| \dots |\]]| pair. Note that you can't mix +% by enclosing it in a |\[[| \dots |\]]| pair. Note that you can't mix % syntax diagrams and BNF in a production rule, and you will get something % which looks very strange if you try. % @@ -445,7 +445,7 @@ % % \DescribeMacro\tok % You can also include text using the |\tok| command. The argument of this -% command is typeset in \LaTeX's LR~mode and inserted into the diagram. +% command is typeset in \LaTeX's LR~mode and inserted into the diagram. % Syntax abbreviations are allowed within the argument, so you can, for % example, include textual descriptions like % \begin{listing} @@ -473,7 +473,7 @@ % % Note that items on the backwards arrow of a \env{rep} construction should % be displayed \emph{backwards}. You must put the individual items in -% reverse order when building this part of your diagrams. \syn\ will +% reverse order when building this part of your diagrams. \syn\ will % correctly reverse the arrows on \env{rep} structures, but apart from % this, you must cope on your own. You are recommended to keep these parts % of your diagrams as simple as possible to avoid confusing readers. @@ -604,7 +604,7 @@ % % You can also alter the appearance of \env{stack}s and \env{rep}s by using % their optional positioning arguments. By default, \env{stack}s descend -% below the main line of the diagram, and \env{rep}s extend above it. +% below the main line of the diagram, and \env{rep}s extend above it. % Specifying an optional argument of |[b]| for either environment reverses % this, putting \env{stack}s above and \env{rep}s below the line. % @@ -1132,7 +1132,7 @@ % characters through. By default, we re-enable |\|, and make `\verb*" "' % typeset some space glue, rather than a space character. A macro % `\verb*"\ "' is defined to actually print a space character, which yield -% `\verb*" "' in the `|\tt|' font. +% `\verb*" "' in the `|\tt|' font. % % Finally, it defines a |\ch| command, which, given a single-character % control sequence as its argument, typesets the character. This is useful, @@ -1298,7 +1298,7 @@ \addspecial\|% \addspecial\"% \catcode`\|\active% - \catcode`\<\active% + \catcode`\<\active% \catcode`\"\active% \catcode`\`\active% } @@ -1358,8 +1358,8 @@ % commands. Well, almost \dots % % \begin{macrocode} -\newcommand{\grammarlabel}[2]{% - \synt{#1} \hfill#2% +\newcommand{\grammarlabel}[3][]{% + \synt{#2}#1 \hfill#3% } % \end{macrocode} % @@ -1372,8 +1372,8 @@ % strut just makes sure that I know exactly how high the line is. % % \begin{macrocode} -\def\gr@implitem<#1> #2 {% - \sbox\z@{\hskip\labelsep\grammarlabel{#1}{#2}}% +\def\gr@implitem<#1>#2 #3 {% + \sbox\z@{\hskip\labelsep\grammarlabel[{#2}]{#1}{#3}}% \strut\@@par% \vskip-\parskip% \vskip-\baselineskip%