summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/epslatex-fr/ebnf.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-19 00:50:47 +0000
committerKarl Berry <karl@freefriends.org>2009-05-19 00:50:47 +0000
commit57e2bc6866ae84cbb5c539506ea229d28e5e1eb4 (patch)
tree88fb85bf0bf23e704768f91e87b9dbda81d08c84 /Master/texmf-dist/doc/latex/epslatex-fr/ebnf.sty
parentc2cdbdd285ee5c7a88c8a9459685b2f0a291d1be (diff)
move epslatex-fr out of texmf-doc
git-svn-id: svn://tug.org/texlive/trunk@13223 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/epslatex-fr/ebnf.sty')
-rw-r--r--Master/texmf-dist/doc/latex/epslatex-fr/ebnf.sty74
1 files changed, 74 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/epslatex-fr/ebnf.sty b/Master/texmf-dist/doc/latex/epslatex-fr/ebnf.sty
new file mode 100644
index 00000000000..72cbaebace2
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/epslatex-fr/ebnf.sty
@@ -0,0 +1,74 @@
+%From: Damian.Cugley@prg.oxford.ac.uk (Damian Cugley)
+%Subject: Re: Styles for lispcode and grammars wanted...
+%Date: 11 Jul 90 18:34:23 GMT
+%
+%Here's one I threw together for my own use. It does EBNF, in LaTeX, in
+%the style I like - catagory names italicized in angle brackets, and
+%`::=' introducing productions.
+%
+%Example of use:
+%------------------------------------------------------------------------
+%Generally glue is quoted using this notation~\TBcite[\p271]:
+%\begin{EBNF}
+% \item[glue]
+% \<dimen> [~`plus' \<stretch>~] [~`minus' \<stretch>~].
+% \item[stretch]
+% \<dimen> | \<fil dimen>.
+% \item[fil dimen]
+% \<factor> (~`fil' | `fill' | `filll'~).
+%\end{EBNF}
+%A \<stretch> which is a \<dimen> ...
+%------------------------------------------------------------------------
+%
+%This is "list" environment in the style of "description" etc (Sec. 5.7).
+%Thus, productions start with
+%
+% \item[LHS]
+%
+%which produces
+%
+% <LHS> ::=
+%
+%in the document. (This was so I can alter the ::= to something else if
+%I really want to.) Each production is in LR (horizontal) mode. The
+%whole thing is indented to \parindent, with turnover lines indented a
+%further 2 em.
+%
+%`|' produces a vertical line.
+%
+%\<FOO> or \Cat{FOO} produces <FOO>, with FOO italicized.
+%
+%You might prefer {\tt plus} instead of `plus' etc.
+%
+%
+%Here's the code:
+%------------------------------------------------------------------------
+% Damian Cugley <Damian.Cugley@prg.oxford.ac.uk> Wed 11 Jul 1990
+
+\begingroup \catcode`\|=13
+ \gdef\EBNF
+ {\list{???}%
+ {%
+ \catcode`\|=13 \def|{$\mid$}%
+ \def\makelabel##1{\<##1> ::=}%
+ \parsep=0pt \itemsep=\smallskipamount
+ \leftmargin=\parindent \advance\leftmargin+2em
+ \labelsep=0.5em \labelwidth=1.5em
+ \raggedright
+ }%
+ }
+\endgroup
+
+\let\endEBNF\endlist
+
+\def\Cat#1{\ifmmode%
+\hbox{$\langle${\it #1\/}$\rangle$}\else
+{$\langle$\penalty10000{\it #1\/}\penalty10000$\rangle$}\fi}
+\def\<#1>{\Cat{#1}}
+\endinput
+------------------------------------------------------------------------
+
+ /--------------------------------------------------------------------\
+ | Damian Cugley, Programming Research Group, 11 Keble Rd, Oxford, UK |
+ | Damian.Cugley@prg.oxford.ac.uk =or= ...@oxford.prg in UK |
+ \--------------------------------------------------------------------/