diff options
-rw-r--r-- | rulescat.tex | 15 | ||||
-rw-r--r-- | rulespush.tex | 28 | ||||
-rw-r--r-- | rulesquotify.tex | 17 |
3 files changed, 60 insertions, 0 deletions
diff --git a/rulescat.tex b/rulescat.tex new file mode 100644 index 0000000..d05e0e5 --- /dev/null +++ b/rulescat.tex @@ -0,0 +1,15 @@ +% vim: set spelllang=nl: +\subsection{\texttt{Cat}} +\label{sec:rules:cat} + +\begin{quote} + + - concatenates the top two strings on the stack. The string pushed earlier + appears earlier in the resulting string, eg + "Zork" "mid" + + would result in the string "Zorkmid" being placed on the stack. +\end{quote} + +De twee strings die als laatste op de stack zijn gezet worden dus samen gevoegd en terug op de stack gezet. + +Dit geeft de volgende regel: + diff --git a/rulespush.tex b/rulespush.tex new file mode 100644 index 0000000..3362b50 --- /dev/null +++ b/rulespush.tex @@ -0,0 +1,28 @@ +% vim: set spelllang=nl: +\subsection{\texttt{Push}} +\label{sec:rules:push} + +\begin{quote} + "text" - Places the string on top of the stack (without the quotes). The string + may include the following escape sequences: newline, the " - character and the $\backslash$ - character +\end{quote} + +De string tussen de quotes word op de stack gezet. Eerst word er nog gecontroleerd op newlines, "-characters en $\backslash$ characters. Dit gaat doormiddel van de hulpfunctie unescape. + +Dit geeft de volgende regel: + +$$ +\begin{prooftree} + \trans + {\pgm}{\ip}{(\push(\unescape(String)\stk), \str)} + {\ip}{\op}{\st} + \justifies + \trans + {\StmPush<String>:\pgm}{\ip}{(\stk,\str)} + {\ip}{\op}{\st} + \using{\rpushns} + \qquad +\end{prooftree} +$$ + + diff --git a/rulesquotify.tex b/rulesquotify.tex new file mode 100644 index 0000000..50acc22 --- /dev/null +++ b/rulesquotify.tex @@ -0,0 +1,17 @@ +% vim: set spelllang=nl: +\subsection{\texttt{Quotify}} +\label{sec:rules:quotify} + +\begin{quote} +q - "Quotifies" the string on top of the stack, so that it can be placed + into a Smurf program as a literal string, eg + Arthur "two-sheds" Jackson + becomes + "Arthur $\backslash$ "two-sheds $\backslash$ " Jackson" +\end{quote} + + +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. + +Dit geeft de volgende regel: + |