equal
deleted
inserted
replaced
8 |
8 |
9 \HEADER |
9 \HEADER |
10 |
10 |
11 \begin{enumerate} |
11 \begin{enumerate} |
12 \item (i) Give the regular expressions for lexing a language |
12 \item (i) Give the regular expressions for lexing a language |
13 consisting of whitespaces, identifiers (some letters followed by digits), numbers, |
13 consisting of whitespaces, identifiers (some letters |
14 operations \texttt{=}, \texttt{<} and \texttt{>}, and the keywords |
14 followed by digits), numbers, operations \texttt{=}, |
15 \texttt{if}, \texttt{then} and \texttt{else}. |
15 \texttt{<} and \texttt{>}, and the keywords \texttt{if}, |
16 (ii) Decide whether the following strings |
16 \texttt{then} and \texttt{else}. (ii) Decide whether the |
17 can be lexed in this language? |
17 following strings can be lexed in this language? |
18 |
18 |
19 \begin{enumerate} |
19 \begin{enumerate} |
20 \item \texttt{"if y4 = 3 then 1 else 3"} |
20 \item \texttt{"if y4 = 3 then 1 else 3"} |
21 \item \texttt{"if33 ifif then then23 else else 32"} |
21 \item \texttt{"if33 ifif then then23 else else 32"} |
22 \item \texttt{"if x4x < 33 then 1 else 3"} |
22 \item \texttt{"if x4x < 33 then 1 else 3"} |