macros.tex 1.35 KB
Newer Older
1 2


MARCHE Claude's avatar
MARCHE Claude committed
3 4 5 6
\newcommand{\why}{\textsf{Why3}}
\newcommand{\eg}{\emph{e.g.}}

% BNF grammar
7
\newcommand{\keyword}[1]{\texttt{#1}}
MARCHE Claude's avatar
MARCHE Claude committed
8 9 10 11 12 13 14 15 16
\newcommand{\indextt}[1]{\index{#1@\protect\keyword{#1}}}
\newcommand{\indexttbs}[1]{\index{#1@\protect\keywordbs{#1}}}
\newif\ifspace
\newif\ifnewentry
\newcommand{\addspace}{\ifspace ~ \spacefalse \fi}
\newcommand{\term}[2]{\addspace\hbox{\lstinline|#1|%
\ifthenelse{\equal{#2}{}}{}{\indexttbase{#2}{#1}}}\spacetrue}
\newcommand{\nonterm}[2]{%
  \ifthenelse{\equal{#2}{}}%
17
             {\addspace\hbox{\textsl{#1}\ifnewentry\index{#1@\textsl{#1}}\fi}\spacetrue}%
MARCHE Claude's avatar
MARCHE Claude committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
             {\addspace\hbox{\textsl{#1}\footnote{#2}\ifnewentry\index{grammar entries!\textsl{#1}}\fi}\spacetrue}}
\newcommand{\repetstar}{$^*$\spacetrue}
\newcommand{\repetplus}{$^+$\spacetrue}
\newcommand{\repetone}{$^?$\spacetrue}
\newcommand{\lparen}{\addspace(}
\newcommand{\rparen}{)}
\newcommand{\orelse}{\addspace$\mid$\spacetrue}
\newcommand{\sep}{ \\[2mm] \spacefalse\newentrytrue}
\newcommand{\newl}{ \\ & & \spacefalse}
\newcommand{\alt}{ \\ & $\mid$ & \spacefalse}
\newcommand{\is}{ & $::=$ & \newentryfalse}
\newenvironment{syntax}{\begin{tabular}{@{}rrll@{}}\spacefalse\newentrytrue}{\end{tabular}}
\newcommand{\synt}[1]{$\spacefalse#1$}
\newcommand{\emptystring}{$\epsilon$}
\newcommand{\below}{See\; below}
33 34 35

%%% Local Variables: 
%%% mode: latex
MARCHE Claude's avatar
MARCHE Claude committed
36
%%% TeX-master: "manual"
37
%%% End: