%% File generated by the BNF Converter. \batchmode \documentclass[a4paper,11pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8x]{inputenc} \setlength{\parindent}{0mm} \setlength{\parskip}{1mm} \title{The Language Calc} \author{BNF-converter} \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}. \section*{The lexical structure of Calc} \subsection*{Literals} Integer literals \nonterminal{Int}\ are nonempty sequences of digits. \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. There are no reserved words in Calc. The symbols used in Calc are the following: \\ \begin{tabular}{lll} {\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 Calc} 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{Exp}} & {\arrow} &{\nonterminal{Exp}} {\terminal{{$+$}}} {\nonterminal{Exp1}} \\ & {\delimit} &{\nonterminal{Exp}} {\terminal{{$-$}}} {\nonterminal{Exp1}} \\ & {\delimit} &{\nonterminal{Exp1}} \\ \end{tabular} \\ \begin{tabular}{lll} {\nonterminal{Exp1}} & {\arrow} &{\nonterminal{Exp1}} {\terminal{/}} {\nonterminal{Exp2}} \\ & {\delimit} &{\nonterminal{Exp1}} {\terminal{*}} {\nonterminal{Exp2}} \\ & {\delimit} &{\nonterminal{Exp2}} \\ \end{tabular} \\ \begin{tabular}{lll} {\nonterminal{Exp2}} & {\arrow} &{\nonterminal{Integer}} \\ & {\delimit} &{\terminal{(}} {\nonterminal{Exp}} {\terminal{)}} \\ \end{tabular} \\ \end{document}