]> ruin.nu Git - proglang.git/blobdiff - Docsyntax.tex
removed NoType and EDefault and added assert
[proglang.git] / Docsyntax.tex
index 89c1a0f72a0fd971c506d65c77b011cc581914a4..e0d2758fa311ea43031e94b4f8e449d033227bba 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,13 +73,24 @@ 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}  &{\terminal{int}} {\nonterminal{Ident}} {\terminal{{$=$}}} {\nonterminal{Exp}} {\terminal{;}}  \\
+ & {\delimit}  &{\terminal{bool}} {\nonterminal{Ident}} {\terminal{{$=$}}} {\nonterminal{Exp}} {\terminal{;}}  \\
+ & {\delimit}  &{\terminal{int}} {\nonterminal{Ident}} {\terminal{;}}  \\
+ & {\delimit}  &{\terminal{bool}} {\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{;}}  \\
 \end{tabular}\\
 
@@ -103,8 +115,9 @@ All other symbols are terminals.\\
  & {\delimit}  &{\nonterminal{Ident}} {\terminal{{$-$}{$-$}}}  \\
  & {\delimit}  &{\nonterminal{Ident}}  \\
  & {\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{)}}  \\
@@ -115,10 +128,6 @@ All other symbols are terminals.\\
  & {\delimit}  &{\nonterminal{Stm}} {\nonterminal{ListStm}}  \\
 \end{tabular}\\
 
-\begin{tabular}{lll}
-{\nonterminal{Stms}} & {\arrow}  &{\nonterminal{ListStm}}  \\
-\end{tabular}\\
-
 \begin{tabular}{lll}
 {\nonterminal{Op0}} & {\arrow}  &{\terminal{{$<$}}}  \\
  & {\delimit}  &{\terminal{{$<$}{$=$}}}  \\
@@ -144,11 +153,6 @@ All other symbols are terminals.\\
  & {\delimit}  &{\nonterminal{Op0}}  \\
 \end{tabular}\\
 
-\begin{tabular}{lll}
-{\nonterminal{Type}} & {\arrow}  &{\terminal{int}}  \\
- & {\delimit}  &{\terminal{bool}}  \\
-\end{tabular}\\
-
 
 
 \end{document}