diff -r a18e3c027c1f -r 15b69ca63b29 coursework/cw02.tex --- a/coursework/cw02.tex Wed Oct 16 11:06:32 2019 +0100 +++ b/coursework/cw02.tex Wed Oct 16 11:14:53 2019 +0100 @@ -172,7 +172,7 @@ Extend your lexer from Q2 to also simplify regular expressions after each derivation step and rectify the computed values after each injection. Use this lexer to tokenize the programs in -Figure~\ref{fib} and \ref{loop}. Give the tokens of these +Figure~\ref{fib}, \ref{loop} and \ref{factor}. Give the tokens of these programs where whitespaces are filtered out. Make sure you can tokenise \textbf{exactly} these programs.\bigskip @@ -188,6 +188,12 @@ (Usually used for timing measurements.)\label{loop}} \end{figure} +\begin{figure}[h] +\mbox{\lstinputlisting[language=While,xleftmargin=10mm]{../progs/factors.while}} +\caption{A program that calculates factors for numbers in the WHILE + language.\label{factors}} +\end{figure} + \end{document} %%% Local Variables: