This
preview
has intentionally blurred sections.
Sign up to view the full version.
Unformatted text preview: a. a = 0 # OUTPUT = puts “a++ = #{a+1}” if a puts a b. b = [ 1, 2, 3 ] # OUTPUT = b.each { |c| puts c } c. if “route66” =~ /([^a-z]+)/ puts $1 # OUTPUT = puts $2 else puts “None” end 2. (6 pts) Construct a NFA for the regular expression x|y*. You must use the algorithm described in class for full credit. 3. (8 pts) Convert the following NFA into a DFA by applying the subset construction algorithm discussed in class. Be sure to list the NFA states represented by each DFA state. a 1 a ε ε 3 2 a ε 4...
View
Full Document
- Fall '08
- staff
- Ruby, A Closed Book, following Ruby program, runtime exception. a., regular expression x|y*
-
Click to edit the document details