Binary file coursework/cw01.pdf has changed
--- a/coursework/cw01.tex Sat Jan 07 14:56:45 2017 +0000
+++ b/coursework/cw01.tex Sat Jan 21 00:25:09 2017 +0000
@@ -94,10 +94,10 @@
\subsection*{Question 2}
-This question does not require any implementation. From the
+From the
lectures you have seen the definitions for the functions
\textit{nullable} and \textit{der} for the basic regular
-expressions. Give the rules for the extended regular
+expressions. Implement the rules for the extended regular
expressions:
\begin{center}
@@ -123,6 +123,9 @@
\item $L(der\,c\,r)) = Der\,c\,(L(r))$
\end{itemize}
+\noindent
+Give the implementation and the text-version of the clauses above.
+
\subsection*{Question 3}
Implement the following regular expression for email addresses
@@ -170,7 +173,8 @@
\noindent
Also test your regular expression matcher with the regular
-expression $a^{\{3,5\}}$ and the strings
+expressions $a^{\{3,5\}}$ and $(a^?)^{\{3,5\}}$. Test whether the
+strings
\begin{enumerate}
\setcounter{enumi}{4}
@@ -181,7 +185,7 @@
\end{enumerate}
\noindent
-Does your matcher produce the expected results?
+are matched or not. Does your matcher produce the expected results?
\subsection*{Question 5}
Binary file coursework/cw02.pdf has changed
--- a/coursework/cw02.tex Sat Jan 07 14:56:45 2017 +0000
+++ b/coursework/cw02.tex Sat Jan 21 00:25:09 2017 +0000
@@ -96,7 +96,7 @@
\end{center}
\noindent
-Later on you will also need the record regular expressions:
+Later on you will also need the record regular expression:
\begin{center}
\begin{tabular}{ll}
Binary file coursework/cw03.pdf has changed
--- a/coursework/cw03.tex Sat Jan 07 14:56:45 2017 +0000
+++ b/coursework/cw03.tex Sat Jan 21 00:25:09 2017 +0000
@@ -117,7 +117,7 @@
how long does your interpreter take when \pcode{start}
is initialised with 100, 500 and so on. How far can
you scale this value if you are willing to wait, say
-1 Minute.
+1 Minute?
\begin{figure}[p]
\begin{center}
Binary file coursework/cw04.pdf has changed
--- a/coursework/cw04.tex Sat Jan 07 14:56:45 2017 +0000
+++ b/coursework/cw04.tex Sat Jan 21 00:25:09 2017 +0000
@@ -100,9 +100,10 @@
\end{center}
\noindent This assembler is largely compatible with the Jasmin
-syntax---that means for the files we look are concerned with,
+syntax---that means for the files we are concerned with here,
it understands the same input syntax (no changes to your
-compiler need to be made). You can generate Java Byte Code by
+compiler need to be made; ok maybe some small syntactic
+adjustments are needed). You can generate Java Byte Code by
using
\begin{center}
@@ -112,7 +113,8 @@
\noindent where you may have to adapt the directory where
Krakatau is installed (I just downloaded the zip file from
Github and \pcode{Krakatau-master} was the directory where it
-was installed).
+was installed). Again the resulting class-file you can run with
+\texttt{java}.
%\noindent You need to submit a document containing the answers
@@ -134,7 +136,8 @@
the console which Fibonacci number and which Factorial should
be calculated. The Fibonacci program is given in
Figure~\ref{fibs}. You can write your own program for
-calculating factorials.
+calculating factorials. Submit your assembler code as
+a file that can be run, not as PDF-text.
\begin{figure}[t]
\lstinputlisting[language=while]{../progs/fib.while}
Binary file handouts/ho01.pdf has changed
--- a/handouts/ho01.tex Sat Jan 07 14:56:45 2017 +0000
+++ b/handouts/ho01.tex Sat Jan 21 00:25:09 2017 +0000
@@ -50,9 +50,11 @@
want to know whether it matches a particular pattern---be it an email
address, for example. In this way we can exclude user input that would
otherwise have nasty effects on our program (crashing it or making it
-go into an infinite loop, if not worse). The point is that the fast
+go into an infinite loop, if not worse). Scanning for computer viruses
+or filtering out spam usually involves scanning for some signature
+(essentially a pattern). The point is that the fast
Knuth-Morris-Pratt algorithm for strings is not good enough for such
-string patterns.\smallskip
+string \emph{patterns}.\smallskip
\defn{Regular expressions} help with conveniently specifying
such patterns. The idea behind regular expressions is that
@@ -682,7 +684,16 @@
addresses. Still it is good to know that some tasks in text
processing just cannot be achieved by using regular
expressions. But for what we want to use them (lexing) they are
-pretty good.
+pretty good.\medskip
+
+\noindent
+Finally there is a joke about regular expressions:
+
+\begin{quote}\it
+ ``Sometimes you have a programming problem and it seems like the
+ best solution is to use regular expressions; now you have two
+ problems.''
+\end{quote}
\begin{figure}[p]