]> ruin.nu Git - proglang.git/blobdiff - Docsyntax.tex
replace E with in
[proglang.git] / Docsyntax.tex
index b22e5448befef0133379770c9d9808a2e2ed5178..d978641a5ecfd0855d40eb5228723db4ecda8e1a 100644 (file)
@@ -49,12 +49,13 @@ The reserved words used in syntax are the following: \\
 The symbols used in syntax are the following: \\
 
 \begin{tabular}{lll}
-{\symb{{$=$}}} &{\symb{;}} &{\symb{\{}} \\
-{\symb{\}}} &{\symb{(}} &{\symb{)}} \\
+{\symb{;}} &{\symb{\{}} &{\symb{\}}} \\
+{\symb{{$=$}}} &{\symb{(}} &{\symb{)}} \\
 {\symb{{$+$}{$+$}}} &{\symb{{$-$}{$-$}}} &{\symb{{$-$}}} \\
-{\symb{{$<$}}} &{\symb{{$<$}{$=$}}} &{\symb{{$>$}}} \\
-{\symb{{$>$}{$=$}}} &{\symb{{$=$}{$=$}}} &{\symb{!{$=$}}} \\
-{\symb{{$+$}}} &{\symb{*}} &{\symb{/}} \\
+{\symb{!}} &{\symb{{$<$}}} &{\symb{{$<$}{$=$}}} \\
+{\symb{{$>$}}} &{\symb{{$>$}{$=$}}} &{\symb{{$=$}{$=$}}} \\
+{\symb{!{$=$}}} &{\symb{{$+$}}} &{\symb{*}} \\
+{\symb{/}} & & \\
 \end{tabular}\\
 
 \subsection*{Comments}
@@ -72,19 +73,28 @@ All other symbols are terminals.\\
 \end{tabular}\\
 
 \begin{tabular}{lll}
-{\nonterminal{Stm}} & {\arrow}  &{\nonterminal{Type}} {\nonterminal{Ident}} {\terminal{{$=$}}} {\nonterminal{Exp}} {\terminal{;}}  \\
- & {\delimit}  &{\nonterminal{Type}} {\nonterminal{Ident}} {\terminal{;}}  \\
- & {\delimit}  &{\nonterminal{Exp}} {\terminal{;}}  \\
+{\nonterminal{Type}} & {\arrow}  &{\terminal{int}}  \\
+ & {\delimit}  &{\terminal{bool}}  \\
+\end{tabular}\\
+
+\begin{tabular}{lll}
+{\nonterminal{Stms}} & {\arrow}  &{\nonterminal{ListStm}}  \\
+\end{tabular}\\
+
+\begin{tabular}{lll}
+{\nonterminal{Stm}} & {\arrow}  &{\nonterminal{Exp}} {\terminal{;}}  \\
  & {\delimit}  &{\terminal{\{}} {\nonterminal{ListStm}} {\terminal{\}}}  \\
- & {\delimit}  &{\terminal{if}} {\terminal{(}} {\nonterminal{Exp}} {\terminal{)}} {\nonterminal{Stm}}  \\
- & {\delimit}  &{\terminal{if}} {\terminal{(}} {\nonterminal{Exp}} {\terminal{)}} {\nonterminal{Stm}} {\terminal{else}} {\nonterminal{Stm}}  \\
+ & {\delimit}  &{\nonterminal{Type}} {\nonterminal{Ident}} {\terminal{{$=$}}} {\nonterminal{Exp}} {\terminal{;}}  \\
+ & {\delimit}  &{\nonterminal{Type}} {\nonterminal{Ident}} {\terminal{;}}  \\
  & {\delimit}  &{\terminal{while}} {\terminal{(}} {\nonterminal{Exp}} {\terminal{)}} {\nonterminal{Stm}}  \\
+ & {\delimit}  &{\terminal{if}} {\terminal{(}} {\nonterminal{Exp}} {\terminal{)}} {\nonterminal{Stm}} {\terminal{else}} {\nonterminal{Stm}}  \\
+ & {\delimit}  &{\terminal{if}} {\terminal{(}} {\nonterminal{Exp}} {\terminal{)}} {\nonterminal{Stm}}  \\
  & {\delimit}  &{\terminal{print}} {\nonterminal{Exp}} {\terminal{;}}  \\
- & {\delimit}  &{\nonterminal{Stm}} {\terminal{;}}  \\
 \end{tabular}\\
 
 \begin{tabular}{lll}
-{\nonterminal{Exp}} & {\arrow}  &{\nonterminal{Exp1}} {\nonterminal{BOp}} {\nonterminal{Exp1}}  \\
+{\nonterminal{Exp}} & {\arrow}  &{\nonterminal{Ident}} {\terminal{{$=$}}} {\nonterminal{Exp}}  \\
+ & {\delimit}  &{\nonterminal{Exp1}} {\nonterminal{Op0}} {\nonterminal{Exp1}}  \\
  & {\delimit}  &{\nonterminal{Exp1}}  \\
 \end{tabular}\\
 
@@ -102,10 +112,10 @@ All other symbols are terminals.\\
 {\nonterminal{Exp3}} & {\arrow}  &{\nonterminal{Ident}} {\terminal{{$+$}{$+$}}}  \\
  & {\delimit}  &{\nonterminal{Ident}} {\terminal{{$-$}{$-$}}}  \\
  & {\delimit}  &{\nonterminal{Ident}}  \\
- & {\delimit}  &{\nonterminal{Ident}} {\terminal{{$=$}}} {\nonterminal{Exp}}  \\
  & {\delimit}  &{\nonterminal{Integer}}  \\
- & {\delimit}  &{\terminal{{$-$}}} {\nonterminal{Exp3}}  \\
  & {\delimit}  &{\nonterminal{Bool}}  \\
+ & {\delimit}  &{\terminal{{$-$}}} {\nonterminal{Exp3}}  \\
+ & {\delimit}  &{\terminal{!}} {\nonterminal{Exp3}}  \\
  & {\delimit}  &{\terminal{readInt}}  \\
  & {\delimit}  &{\terminal{readBool}}  \\
  & {\delimit}  &{\terminal{(}} {\nonterminal{Exp}} {\terminal{)}}  \\
@@ -117,11 +127,7 @@ All other symbols are terminals.\\
 \end{tabular}\\
 
 \begin{tabular}{lll}
-{\nonterminal{Stms}} & {\arrow}  &{\nonterminal{ListStm}}  \\
-\end{tabular}\\
-
-\begin{tabular}{lll}
-{\nonterminal{BOp}} & {\arrow}  &{\terminal{{$<$}}}  \\
+{\nonterminal{Op0}} & {\arrow}  &{\terminal{{$<$}}}  \\
  & {\delimit}  &{\terminal{{$<$}{$=$}}}  \\
  & {\delimit}  &{\terminal{{$>$}}}  \\
  & {\delimit}  &{\terminal{{$>$}{$=$}}}  \\
@@ -142,11 +148,7 @@ All other symbols are terminals.\\
 \begin{tabular}{lll}
 {\nonterminal{Op}} & {\arrow}  &{\nonterminal{Op1}}  \\
  & {\delimit}  &{\nonterminal{Op2}}  \\
-\end{tabular}\\
-
-\begin{tabular}{lll}
-{\nonterminal{Type}} & {\arrow}  &{\terminal{int}}  \\
- & {\delimit}  &{\terminal{bool}}  \\
+ & {\delimit}  &{\nonterminal{Op0}}  \\
 \end{tabular}\\