hws/hw04.tex
changeset 294 c29853b672fb
parent 292 7ed2a25dd115
child 347 22b5294daa2a
equal deleted inserted replaced
293:ca349cfe3474 294:c29853b672fb
    65   where the three dots stand for arbitrary characters, but not comment delimiters.
    65   where the three dots stand for arbitrary characters, but not comment delimiters.
    66   (Hint: You can assume you are already given a regular expression written \texttt{ALL},
    66   (Hint: You can assume you are already given a regular expression written \texttt{ALL},
    67   that can recognise any character, and a regular expression \texttt{NOT} that recognises
    67   that can recognise any character, and a regular expression \texttt{NOT} that recognises
    68   the complement of a regular expression.)
    68   the complement of a regular expression.)
    69 
    69 
    70 
    70 \item How many basic regular expressions are there to match the string
       
    71   $abcd$? (ii) How many if they cannot include $\epsilon$ and
       
    72   $\varnothing$? (iii) How many if they are also not allowed to
       
    73   contain stars? (iv) How many if they are also not allowed to contain
       
    74   $\_ + \_$?
    71 
    75 
    72 %\item (Optional) The tokenizer in \texttt{regexp3.scala} takes as
    76 %\item (Optional) The tokenizer in \texttt{regexp3.scala} takes as
    73 %argument a string and a list of rules. The result is a list of tokens. Improve this tokenizer so 
    77 %argument a string and a list of rules. The result is a list of tokens. Improve this tokenizer so 
    74 %that it filters out all comments and whitespace from the result.
    78 %that it filters out all comments and whitespace from the result.
    75 
    79