X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=Docsyntax.tex;h=e0d2758fa311ea43031e94b4f8e449d033227bba;hp=09e48987172d66864ffffae73e3e784dc9506f2b;hb=565fbd61dca527c23888e08783d0d91cee458524;hpb=3cee522d1f54b39a1efa654da364c6c939cbcf1f diff --git a/Docsyntax.tex b/Docsyntax.tex index 09e4898..e0d2758 100644 --- a/Docsyntax.tex +++ b/Docsyntax.tex @@ -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}