*This preview shows
pages
1–2. Sign up
to
view the full content.*

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
**Unformatted text preview: **3. Consider the following deterministic ﬁnite automaton (DFA) over the alphabet Σ = { , 1 } . 1 1 0, 1 1 0, 1 Give a one-sentence description of the language recognized by the DFA. Write a regular expression for this language. 4. Let L be the language over the alphabet { a 1 ,a 2 ,a 3 } deﬁned as: L : All strings in which a i occurs at least i times for some a i with i ∈ { 1 , 2 , 3 } . Draw a non-deterministic ﬁnite automaton (NFA) for L . Fall 2009/2010 page 1 of 2 CS 143 Compilers Handout 2 5. For each of the following speciﬁcations written in Flex, give a regular expression describing the language of possible outputs. Assume that all inputs are strings consisting of characters a, b, A, and B. (a) Speciﬁcation 1: [aA] { printf ("x"); } [aA][aA] { printf ("y"); } [bB] { printf ("z"); } (b) Speciﬁcation 2: ([aA]+)([bB}+) { printf("a"); } [aA] { printf("b"); } [bB] { printf("c"); } Fall 2009/2010 page 2 of 2...

View
Full
Document