]> ruin.nu Git - proglang.git/blobdiff - Docsyntax.tex
removed NoType and EDefault and added assert
[proglang.git] / Docsyntax.tex
index 09e48987172d66864ffffae73e3e784dc9506f2b..e0d2758fa311ea43031e94b4f8e449d033227bba 100644 (file)
@@ -49,8 +49,8 @@ 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{{$=$}{$=$}}} \\
@@ -73,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}\\
 
@@ -104,9 +115,9 @@ All other symbols are terminals.\\
  & {\delimit}  &{\nonterminal{Ident}} {\terminal{{$-$}{$-$}}}  \\
  & {\delimit}  &{\nonterminal{Ident}}  \\
  & {\delimit}  &{\nonterminal{Integer}}  \\
+ & {\delimit}  &{\nonterminal{Bool}}  \\
  & {\delimit}  &{\terminal{{$-$}}} {\nonterminal{Exp3}}  \\
  & {\delimit}  &{\terminal{!}} {\nonterminal{Exp3}}  \\
- & {\delimit}  &{\nonterminal{Bool}}  \\
  & {\delimit}  &{\terminal{readInt}}  \\
  & {\delimit}  &{\terminal{readBool}}  \\
  & {\delimit}  &{\terminal{(}} {\nonterminal{Exp}} {\terminal{)}}  \\
@@ -117,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{{$<$}{$=$}}}  \\
@@ -146,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}