Practice Set #1

Complete the following problems:

1.) What token sequence would be produced by the following Java code?

public static void main(String args[]) {
	  System.out.println("Hello, world!");
	  return;
	}
Include any assumptions you made about the scanner. Make sure your tokens are clearly distinguished from one another.

2.) Convert the following NFA to a DFA (the "upside down V" is actually a capital lambda). Show your work!



3.) Convert your answer from problem 2 into a right linear grammar.


Then, complete the following problems from page 106 of the textbook:

Problem 3. Only complete the first two DFAs. In addition, write a one sentence description of each DFA describing the language that it accepts.

Problem 4, parts a and b. In addition, write a one sentence description of each regular expression describing the language that it specifies.

Problem 5.