hws/hw06.tex
changeset 401 5d85dc9779b1
parent 359 db106e5b7c4d
child 459 780486571e38
equal deleted inserted replaced
400:e4afe3f46c29 401:5d85dc9779b1
     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"}