diff -r ecbed0155f72 -r e3c64f22dd31 handouts/ho04.tex --- a/handouts/ho04.tex Fri Apr 10 16:30:52 2020 +0100 +++ b/handouts/ho04.tex Thu Apr 16 19:15:46 2020 +0100 @@ -884,15 +884,25 @@ (top\_level:\texttt{ac.uk})]$ \end{center} -Recall that we want to lex a little programming language, -called the \emph{While}-language. A simple program in this -language is shown in Figure~\ref{while}. The main keywords in -this language are \pcode{while}, \pcode{if}, \pcode{then} and -\pcode{else}. As usual we have syntactic categories for -identifiers, operators, numbers and so on. For this we would -need to design the corresponding regular expressions to -recognise these syntactic categories. I let you do this design -task. Having these regular expressions at our disposal, we can +Recall that we want to lex a little programming language, called the +\emph{While}-language. A simple program in this language is shown in +Figure~\ref{while}. The main keywords in this language are +\pcode{while}, \pcode{if}, \pcode{then} and +\pcode{else}.\footnote{Contrast this with the COBOL programming + language, which was developed around 1960 and thought to be dead for + many decades---even your friendly lecturer is not old enough to have + been taught this language. Anyway, this language had over 600 + keywords (or what they called \emph{reserved words}). Interestingly + though this language is still used in 2020: during the height of + Corona crisis the State of New Jewrsey in the US was looking for + COBOL programers who could fix the state's national insurance + webpage. You were probably paid in gold and diamonds, if you were + able to program in COBOL. If you fixed their webpage, surely you + were allowed to marry the governer's son/daughter. } As usual we +have syntactic categories for identifiers, operators, numbers and so +on. For this we would need to design the corresponding regular +expressions to recognise these syntactic categories. I let you do this +design task. Having these regular expressions at our disposal, we can form the regular expression \begin{figure}[t]