\documentstyle[a4]{article}
\title{GDL Grammar}
\author{}
\begin{document}

\maketitle

\paragraph{Preliminaries:}
\begin{itemize}
\item {\em ident} is a valid TL-identifier
\item '\#' and ';' are treated as whitespace
\end{itemize}

\section{Gateway Description}
\begin{tabbing}
xxxxxxxxxxxxxxxx\= xxxx\= xx\= xx \= \kill
{\em description} \>::= \> {\bf qateway} {\em string} (* = "C++" *) \\
  \>\> {\em ident ":" ident} (* modul-name :interface-name *) \\
	\>\> [{\bf include} {\em stringList}] \\
	\>\> [{\bf import} {\em identList}] \\
  \>\> {\bf export} \{{\em typeDecl}\} \\
  \>\> {\bf end}  \\

\end{tabbing}


\section{Types}
\begin{tabbing}
xxxxxxxxxxxxxxxx\= xxxx\= xx\= xx \= \kill
{\em typeDecl} \>::= \> {\em typedef $\mid$ define $\mid$ struct 
                         $\mid$ use $\mid$ enum $\mid$ class } \\
\\
{\em typedef} \>::= \> {\bf typedef} {\em ident [ref] name} \\
\\
{\em define} \>::= \> {\bf define} {\em ident int} \\
\\
{\em struct} \>::= \> {\bf struct} {\em name} \\
\\
{\em use} \>::= \> {\bf use} [{\bf class} $\mid$ {\bf struct}] {\em name}
  {\bf from} [{\bf :}] {\em ident}\\
\\
{\em enum} \>::= \> {\bf enum} {\em name} "\{" {\em enumList} "\}" \\
\\
{\em enumList} \>::= \> {\em enumerator \{ "," enumerator\}}\\
\\
{\em enumerator} \>::= \> {\em name} [ "=" {\em integer}] \\ 
\\
{\em ref} \>::= \> * $\mid$ \& \\
\\
{\em name} \>::= \> {\em ident} "$=>$" {\em ident} (* renaming *)
\end{tabbing}

\section{Class}
\begin{tabbing}
xxxxxxxxxxxxxxxx\= xxxx\= xx\= xx \= \kill
{\em class} \>::= \> {\em classHead} ["\{" [{\em headerList}] "\}"] \\
\\
{\em classHead} \>::= \> {\bf class} {\em name} [{\em baseSpec}]  \\
\\
{\em baseSpec} \>::= \> ":" {\em baseList} \\
\\
{\em baseList} \>::= \> {\em baseSpecifier \{ "," baseSpecifier\}}\\
\\
{\em baseSpecifier} \>::= {\em accessSpecifier ident} \\
\\
{\em accessSpecifier} \>::= {\bf public $\mid$ protected $\mid$ private} \\
\end{tabbing}

\section{Methods}
\begin{tabbing}
xxxxxxxxxxxxxxxx\= xxxx\= xx\= xx \= \kill
{\em headerList} \>::= {\em methodHeader \{methodHeader\}} \\
\\
{\em methodHeader} \>::= {\em normalHeader} $\mid$ {\em constructorHeader}
  $\mid$ {\em virtualHeader} \\
\\
{\em normalHeader} \>::= {\em ident} [{\em ref}] {\em nameAndSigs} \\ 
\\
{\em constrHeader} \>::= {\bf constructor} {\em nameAndSigs} \\ 
\\
{\em virtualHeader} \>::= {\bf virtual} {\em ident} [{\em ref}]
  {\em nameAndSigs} \\ 
\\
{\em nameAndSigs} \>::= {\em name} "(" [{\em sigList}] ")" [{\bf const}]  \\
\\
{\em sigList} \>::= \> {\em signature \{ "," signature\}}\\
\\
{\em signature} \>::= \> [{\bf const}] {\em ident} [{\em ref}] {\em ident}  \\
\end{tabbing}


\end{document}
