hws/hw06.tex
changeset 894 4d5058706f1b
parent 726 f6c2e8c48a1c
child 898 5075b69142d9
equal deleted inserted replaced
893:908e4f6cdf7c 894:4d5058706f1b
    66 \item Parser combinators can directly be given a string as
    66 \item Parser combinators can directly be given a string as
    67       input, without the need of a lexer. What are the
    67       input, without the need of a lexer. What are the
    68       advantages to first lex a string and then feed a
    68       advantages to first lex a string and then feed a
    69       sequence of tokens as input to the parser?
    69       sequence of tokens as input to the parser?
    70 
    70 
       
    71 \item The injection function for sequence regular expressions is defined
       
    72       by three clauses:
    71 
    73 
    72   
    74 \begin{center}
       
    75 \begin{tabular}{l@{\hspace{1mm}}c@{\hspace{1mm}}l}
       
    76   $\inj\,(r_1 \cdot r_2)\,c\,\,Seq(v_1,v_2)$ & $\dn$  & $Seq(\inj\,r_1\,c\,v_1,v_2)$\\
       
    77   $\inj\,(r_1 \cdot r_2)\,c\,\,\Left(Seq(v_1,v_2))$ & $\dn$  & $Seq(\inj\,r_1\,c\,v_1,v_2)$\\
       
    78   $\inj\,(r_1 \cdot r_2)\,c\,\,Right(v)$ & $\dn$  & $Seq(\textit{mkeps}(r_1),\inj\,r_2\,c\,v)$\\
       
    79 \end{tabular}
       
    80 \end{center}
       
    81 
       
    82 Explain why there are three cases in the injection function for sequence
       
    83 regular expressions. 
       
    84       
    73 \item \POSTSCRIPT        
    85 \item \POSTSCRIPT        
    74 \end{enumerate}
    86 \end{enumerate}
    75 
    87 
    76 \end{document}
    88 \end{document}
    77 
    89