X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=Docsyntax.tex;h=09e48987172d66864ffffae73e3e784dc9506f2b;hp=b22e5448befef0133379770c9d9808a2e2ed5178;hb=2316d61f350f8b39c9a3f76b91d1d14796d5183b;hpb=ae57d654240e0ac85d1bb5c170c062830d4e0ba3 diff --git a/Docsyntax.tex b/Docsyntax.tex index b22e544..09e4898 100644 --- a/Docsyntax.tex +++ b/Docsyntax.tex @@ -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}