\batchmode
%This Latex file is machine-generated by the BNF-converter

\documentclass[a4paper,11pt]{article}
\author{BNF-converter}
\title{The Language Hao}
\setlength{\parindent}{0mm}
\setlength{\parskip}{1mm}
\begin{document}

\maketitle

\newcommand{\emptyP}{\mbox{$\epsilon$}}
\newcommand{\terminal}[1]{\mbox{{\texttt {#1}}}}
\newcommand{\nonterminal}[1]{\mbox{$\langle \mbox{{\sl #1 }} \! \rangle$}}
\newcommand{\arrow}{\mbox{::=}}
\newcommand{\delimit}{\mbox{$|$}}
\newcommand{\reserved}[1]{\mbox{{\texttt {#1}}}}
\newcommand{\literal}[1]{\mbox{{\texttt {#1}}}}
\newcommand{\symb}[1]{\mbox{{\texttt {#1}}}}

This document was automatically generated by the {\em BNF-Converter}. It was generated together with the lexer, the parser, and the abstract syntax module, which guarantees that the document matches with the implementation of the language (provided no hand-hacking has taken place).

\section*{The lexical structure of Hao}
\subsection*{Identifiers}
Identifiers \nonterminal{Ident} are unquoted strings beginning with a letter,
followed by any combination of letters, digits, and the characters {\tt \_ '},
reserved words excluded.


\subsection*{Literals}


Infix literals are recognized by the regular expression
\([\mbox{``@.:{$-$}\^*{$+$}{$=$}{$<$}{$>$}\&\%\$!\#\%{$|$}/$\backslash$''}]+\)


\subsection*{Reserved words and symbols}
The set of reserved words is the set of terminals appearing in the grammar. Those reserved words that consist of non-letter characters are called symbols, and they are treated in a different way from those that are similar to identifiers. The lexer follows rules familiar from languages like Haskell, C, and Java, including longest match and spacing conventions.

The reserved words used in Hao are the following: \\

\begin{tabular}{lll}
{\reserved{`}} &{\reserved{case}} &{\reserved{default}} \\
{\reserved{export}} &{\reserved{left}} &{\reserved{module}} \\
{\reserved{operator}} &{\reserved{precedes}} &{\reserved{right}} \\
{\reserved{succeeds}} & & \\
\end{tabular}\\

The symbols used in Hao are the following: \\

\begin{tabular}{lll}
{\symb{,}} &{\symb{::}} &{\symb{;}} \\
{\symb{(}} &{\symb{)}} &{\symb{{$=$}}} \\
{\symb{\{}} &{\symb{\}}} &{\symb{{$|$}}} \\
{\symb{:}} & & \\
\end{tabular}\\

\subsection*{Comments}
There are no single-line comments in the grammar. \\There are no multiple-line comments in the grammar.

\section*{The syntactic structure of Hao}
Non-terminals are enclosed between $\langle$ and $\rangle$. 
The symbols  {\arrow}  (production),  {\delimit}  (union) 
and {\emptyP} (empty rule) belong to the BNF notation. 
All other symbols are terminals.\\

\begin{tabular}{lll}
{\nonterminal{ListOp}} & {\arrow}  &{\emptyP} \\
 & {\delimit}  &{\nonterminal{Op}}  \\
 & {\delimit}  &{\nonterminal{Op}} {\terminal{,}} {\nonterminal{ListOp}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{ListTerm}} & {\arrow}  &{\emptyP} \\
 & {\delimit}  &{\nonterminal{Term}}  \\
 & {\delimit}  &{\nonterminal{Term}} {\terminal{,}} {\nonterminal{ListTerm}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{ListIdent}} & {\arrow}  &{\nonterminal{Ident}} {\terminal{::}}  \\
 & {\delimit}  &{\nonterminal{Ident}} {\terminal{::}} {\nonterminal{ListIdent}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{ListCase}} & {\arrow}  &{\emptyP} \\
 & {\delimit}  &{\nonterminal{Case}} {\nonterminal{ListCase}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{ListGuard}} & {\arrow}  &{\emptyP} \\
 & {\delimit}  &{\nonterminal{Guard}} {\nonterminal{ListGuard}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{ListFixity}} & {\arrow}  &{\emptyP} \\
 & {\delimit}  &{\nonterminal{Fixity}} {\nonterminal{ListFixity}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{ListExport}} & {\arrow}  &{\emptyP} \\
 & {\delimit}  &{\nonterminal{Export}} {\terminal{;}} {\nonterminal{ListExport}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Module}} & {\arrow}  &{\terminal{module}} {\nonterminal{ListIdent}} {\terminal{;}} {\nonterminal{ListExport}} {\nonterminal{Term}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Export}} & {\arrow}  &{\terminal{export}} {\nonterminal{Symbol}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{QIdent}} & {\arrow}  &{\nonterminal{ListIdent}} {\nonterminal{Ident}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{QInfix}} & {\arrow}  &{\nonterminal{ListIdent}} {\nonterminal{Infix}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Symbol}} & {\arrow}  &{\nonterminal{QIdent}}  \\
 & {\delimit}  &{\terminal{(}} {\nonterminal{Op}} {\terminal{)}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Op}} & {\arrow}  &{\nonterminal{QInfix}}  \\
 & {\delimit}  &{\terminal{`}} {\nonterminal{Symbol}} {\terminal{`}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Term}} & {\arrow}  &{\nonterminal{Term1}}  \\
 & {\delimit}  &{\nonterminal{Term}} {\terminal{;}} {\nonterminal{Term1}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Term1}} & {\arrow}  &{\nonterminal{Term2}}  \\
 & {\delimit}  &{\nonterminal{Term4}} {\terminal{{$=$}}} {\nonterminal{Term1}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Term2}} & {\arrow}  &{\nonterminal{Term3}}  \\
 & {\delimit}  &{\nonterminal{Term2}} {\nonterminal{Op}} {\nonterminal{Term3}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Term3}} & {\arrow}  &{\nonterminal{Term4}}  \\
 & {\delimit}  &{\nonterminal{Term3}} {\nonterminal{Term4}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Term4}} & {\arrow}  &{\nonterminal{Symbol}}  \\
 & {\delimit}  &{\terminal{\{}} {\nonterminal{ListCase}} {\terminal{\}}}  \\
 & {\delimit}  &{\terminal{\{}} {\nonterminal{Term}} {\terminal{\}}}  \\
 & {\delimit}  &{\terminal{(}} {\nonterminal{ListTerm}} {\terminal{)}}  \\
 & {\delimit}  &{\terminal{operator}} {\nonterminal{Op}} {\nonterminal{Assoc}} {\nonterminal{ListFixity}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Case}} & {\arrow}  &{\terminal{case}} {\nonterminal{Term}} {\nonterminal{ListGuard}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Guard}} & {\arrow}  &{\terminal{{$|$}}} {\nonterminal{Term}} {\terminal{:}} {\nonterminal{Term}}  \\
 & {\delimit}  &{\terminal{{$|$}}} {\terminal{default}} {\terminal{:}} {\nonterminal{Term}}  \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Assoc}} & {\arrow}  &{\terminal{left}}  \\
 & {\delimit}  &{\terminal{right}}  \\
 & {\delimit}  &{\emptyP} \\
\end{tabular}\\

\begin{tabular}{lll}
{\nonterminal{Fixity}} & {\arrow}  &{\terminal{precedes}} {\terminal{(}} {\nonterminal{ListOp}} {\terminal{)}}  \\
 & {\delimit}  &{\terminal{succeeds}} {\terminal{(}} {\nonterminal{ListOp}} {\terminal{)}}  \\
\end{tabular}\\



\end{document}


