coursework/cw02.tex
changeset 657 732cb155d806
parent 630 9b1c15c3eb6f
child 659 15b69ca63b29
equal deleted inserted replaced
656:cfc0e730bcda 657:732cb155d806
   171 
   171 
   172 Extend your lexer from Q2 to also simplify regular expressions
   172 Extend your lexer from Q2 to also simplify regular expressions
   173 after each derivation step and rectify the computed values after each
   173 after each derivation step and rectify the computed values after each
   174 injection. Use this lexer to tokenize the programs in
   174 injection. Use this lexer to tokenize the programs in
   175 Figure~\ref{fib} and \ref{loop}. Give the tokens of these
   175 Figure~\ref{fib} and \ref{loop}. Give the tokens of these
   176 programs where whitespaces are filtered out.\bigskip
   176 programs where whitespaces are filtered out. Make sure you can
       
   177 tokenise \textbf{exactly} these programs.\bigskip
   177 
   178 
   178 
   179 
   179 \begin{figure}[h]
   180 \begin{figure}[h]
   180 \mbox{\lstinputlisting[language=While,xleftmargin=10mm]{../progs/fib.while}}
   181 \mbox{\lstinputlisting[language=While,xleftmargin=10mm]{../progs/fib.while}}
   181 \caption{Fibonacci program in the WHILE language.\label{fib}}
   182 \caption{Fibonacci program in the WHILE language.\label{fib}}