]> ruin.nu Git - proglang.git/blobdiff - Docsyntax.tex
initial commit of interpreter
[proglang.git] / Docsyntax.tex
index b22e5448befef0133379770c9d9808a2e2ed5178..09e48987172d66864ffffae73e3e784dc9506f2b 100644 (file)
@@ -52,9 +52,10 @@ The symbols used in syntax are the following: \\
 {\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}
@@ -80,11 +81,11 @@ All other symbols are terminals.\\
  & {\delimit}  &{\terminal{if}} {\terminal{(}} {\nonterminal{Exp}} {\terminal{)}} {\nonterminal{Stm}} {\terminal{else}} {\nonterminal{Stm}}  \\
  & {\delimit}  &{\terminal{while}} {\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,9 +103,9 @@ 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}  &{\terminal{!}} {\nonterminal{Exp3}}  \\
  & {\delimit}  &{\nonterminal{Bool}}  \\
  & {\delimit}  &{\terminal{readInt}}  \\
  & {\delimit}  &{\terminal{readBool}}  \\
@@ -121,7 +122,7 @@ All other symbols are terminals.\\
 \end{tabular}\\
 
 \begin{tabular}{lll}
-{\nonterminal{BOp}} & {\arrow}  &{\terminal{{$<$}}}  \\
+{\nonterminal{Op0}} & {\arrow}  &{\terminal{{$<$}}}  \\
  & {\delimit}  &{\terminal{{$<$}{$=$}}}  \\
  & {\delimit}  &{\terminal{{$>$}}}  \\
  & {\delimit}  &{\terminal{{$>$}{$=$}}}  \\
@@ -142,6 +143,7 @@ All other symbols are terminals.\\
 \begin{tabular}{lll}
 {\nonterminal{Op}} & {\arrow}  &{\nonterminal{Op1}}  \\
  & {\delimit}  &{\nonterminal{Op2}}  \\
+ & {\delimit}  &{\nonterminal{Op0}}  \\
 \end{tabular}\\
 
 \begin{tabular}{lll}