diff options
-rw-r--r-- | rulespush.tex | 2 | ||||
-rw-r--r-- | rulesquotify.tex | 23 | ||||
-rw-r--r-- | smurf.sty | 6 |
3 files changed, 27 insertions, 4 deletions
diff --git a/rulespush.tex b/rulespush.tex index 3362b50..9c973f5 100644 --- a/rulespush.tex +++ b/rulespush.tex @@ -14,7 +14,7 @@ Dit geeft de volgende regel: $$ \begin{prooftree} \trans - {\pgm}{\ip}{(\push(\unescape(String)\stk), \str)} + {\pgm}{\ip}{(\push{String}{\stk}), \str)} {\ip}{\op}{\st} \justifies \trans diff --git a/rulesquotify.tex b/rulesquotify.tex index 50acc22..0c0f09c 100644 --- a/rulesquotify.tex +++ b/rulesquotify.tex @@ -12,6 +12,29 @@ q - "Quotifies" the string on top of the stack, so that it can be placed Er worden dus quotes om de string heen gezet. Als er in de oorspronkelijke string quotes stonden dan wordt voor iedere van deze quotes een "$\backslash$" geplaats. +Om de backslashes te zetten word gebruik gemaakt van de hulpfunctie quo Dit geeft de volgende regel: +$$ +\begin{prooftree} + \trans + {\pgm}{\ip}{(\push{"quo (c s)"}{\stk'}, \str) } + {\ip}{\op}{\st} + \justifies + \trans + {\StmQuotify:\pgm}{\ip}{(\stk,\str)} + {\ip}{\op}{\st} + \using{\rquotifyns} + \qquad + \text{met (c s, stk') = pop (stk) + } +\end{prooftree} +$$ +$$ + \quo {c} {s} = + \begin{cases} + \texttt{" c quo s} & \text{als $c=\texttt{"}$} \\ + \texttt{c quo s} & \text{anderszins} + \end{cases} +$$
\ No newline at end of file @@ -1,5 +1,4 @@ \RequirePackage{amssymb} -\RequirePackage{verbatim} % General \def\isdef{\stackrel{\text{def}}{=}} @@ -12,6 +11,8 @@ \def\parsestr#1{\parsestrop\left(#1\right)} \def\unescapeop{\mathit{unescape}} \def\unescape#1{\unescapeop\left(#1\right)} +\def\quo{\mathit{quo}} +\def\quo#1{\quoop\left(#1\right)} % Types \def\Pgm{\mathit{Pgm}} @@ -61,7 +62,6 @@ \def\rule#1#2{[\mbox{#1}_{\mbox{\footnotesize{#2}}}]} \def\rlambdans{\rule{$\lambda$}{ns}} \def\rheadns{\rule{head}{ns}} -\def\rtailns{\rule{tail}{ns}} \def\rgetns{\rule{get}{ns}} \def\rputns{\rule{put}{ns}} \def\rinputns{\rule{input}{ns}} @@ -80,6 +80,6 @@ \def\val{\mathit{val}} % Programs -\newenvironment{smurf}{\begin{center}\tt}{\end{center}} +\newenvironment{smurf}{\tt\begin{center}}{\end{center}} \let\smurfinline\texttt |