hws/hw05.tex
changeset 602 9aa901039e33
parent 527 2a62f0845f98
child 619 136517d67d40
equal deleted inserted replaced
601:208b0f67a3d0 602:9aa901039e33
    86 
    86 
    87 In case they can, give the corresponding token sequences. (Hint: 
    87 In case they can, give the corresponding token sequences. (Hint: 
    88 Observe the maximal munch rule and the priorities of your regular
    88 Observe the maximal munch rule and the priorities of your regular
    89 expressions that make the process of lexing unambiguous.)
    89 expressions that make the process of lexing unambiguous.)
    90 
    90 
    91 \item Given the following context-free grammar $G$
    91 \item Suppose the following context-free grammar $G$
    92   
    92   
    93 \begin{plstx}[margin=1cm]
    93 \begin{plstx}[margin=1cm]
    94   : \meta{S\/} ::= \meta{A\/}\cdot\meta{S\/}\cdot\meta{B\/} \;\mid\;
    94   : \meta{S\/} ::= \meta{A\/}\cdot\meta{S\/}\cdot\meta{B\/} \;\mid\;
    95                    \meta{B\/}\cdot\meta{S\/}\cdot\meta{A\/} \;\mid\; \epsilon\\
    95                    \meta{B\/}\cdot\meta{S\/}\cdot\meta{A\/} \;\mid\; \epsilon\\
    96   : \meta{A\/} ::= a \mid \epsilon\\
    96   : \meta{A\/} ::= a \mid \epsilon\\
    97   : \meta{B\/} ::= b\\
    97   : \meta{B\/} ::= b\\
    98 \end{plstx}
    98 \end{plstx}
    99 
    99 
   100 which of the following strings are in the language of $G$?
   100 where the starting symbol is $\meta{S}$.
       
   101 Which of the following strings are in the language of $G$?
   101 
   102 
   102 \begin{itemize}
   103 \begin{itemize}
   103 \item[$\bullet$] $a$
   104 \item[$\bullet$] $a$
   104 \item[$\bullet$] $b$
   105 \item[$\bullet$] $b$
   105 \item[$\bullet$] $ab$
   106 \item[$\bullet$] $ab$