coursework/cw02.tex
changeset 333 8890852e18b7
parent 328 bc03ff3d347c
child 358 b3129cff41e9
equal deleted inserted replaced
332:4755ad4b457b 333:8890852e18b7
    90 $r^{\{n\}}$ & n-times $r$\\
    90 $r^{\{n\}}$ & n-times $r$\\
    91 \end{tabular}
    91 \end{tabular}
    92 \end{center}
    92 \end{center}
    93 
    93 
    94 \noindent
    94 \noindent
    95 Once you have designed all regular expressions for 1 - 8, then
       
    96 give the token sequence for the Fibonacci program shown below in Fig.~\ref{fib}.
       
    97 
    95 
    98 \subsection*{Question 2 (marked with 3\%)}
    96 \subsection*{Question 2 (marked with 3\%)}
    99 
    97 
   100 Implement the Sulzmann tokeniser from the lectures. For this you need
    98 Implement the Sulzmann tokeniser from the lectures. For this you need
   101 to implement the functions $nullable$ and $der$ (you can use your code
    99 to implement the functions $nullable$ and $der$ (you can use your code
   113 \code{"read n;"}
   111 \code{"read n;"}
   114 \end{center} 
   112 \end{center} 
   115 
   113 
   116 \noindent
   114 \noindent
   117 and use your \pcode{env} function to give the token sequence.
   115 and use your \pcode{env} function to give the token sequence.
       
   116 
   118 
   117 
   119 \subsection*{Question 3 (marked with 1\%)}
   118 \subsection*{Question 3 (marked with 1\%)}
   120 
   119 
   121 Extend your tokenizer from Q2 to also simplify regular expressions
   120 Extend your tokenizer from Q2 to also simplify regular expressions
   122 after each derivation step and rectify the computed values after each
   121 after each derivation step and rectify the computed values after each