hws/hw05.tex
changeset 602 ae808113721d
parent 527 725597947b3b
child 619 68afa06a8e14
equal deleted inserted replaced
601:0e827b4c1b1c 602:ae808113721d
    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$