hw03.tex
changeset 27 0f05e90b960d
parent 23 ea594f94f85d
child 30 0e971bd4403d
equal deleted inserted replaced
26:06be91bbb1cd 27:0f05e90b960d
    21 and returns an integer. The function should satisfy the following property:
    21 and returns an integer. The function should satisfy the following property:
    22 \begin{center}
    22 \begin{center}
    23 $zeroable(r)$ \;if and only if\; $L(r) = \varnothing$
    23 $zeroable(r)$ \;if and only if\; $L(r) = \varnothing$
    24 \end{center}
    24 \end{center}
    25 
    25 
       
    26 \item Define the tokens and regular expressions for a language
       
    27 consisting of numbers, left-parenthesis (, right-parenthesis ),
       
    28 identifiers and the operations $+$, $-$ and $*$. Can the following strings 
       
    29 in this language be lexed?
       
    30 
       
    31 \begin{itemize}
       
    32 \item \texttt{"}$(a + 3) * b$\texttt{"}
       
    33 \item \texttt{"}$)()++ -33$\texttt{"}
       
    34 \item \texttt{"}$(a / 3) * 3$\texttt{"}
       
    35 \end{itemize}
    26 \end{enumerate}
    36 \end{enumerate}
       
    37 
       
    38 In case they can, can you give the corresponding token sequences.
    27 
    39 
    28 \end{document}
    40 \end{document}
    29 
    41 
    30 %%% Local Variables: 
    42 %%% Local Variables: 
    31 %%% mode: latex
    43 %%% mode: latex