Search


CS 171 Homework



Chapter 12



Homework assignments are listed by their due dates. The homework is not collected unless it says otherwise.
  • Fri, Jan 18, Section 12.1, Numbers 1d, 4, 7, 8, 9b, 10b, 19ghij, 20, 24b, 29b, 30b
  • Mon, Jan 21, Section 12.2, Numbers 6c, 8, 14 and Section 12.3, Numbers 10, 20, 22, 32, 44, 46, 48
  • Fri, Jan 25, Section 12.4, Numbers 1bd, 4bdf, 7a, 10a, 13a, 14ab, 15, 16, plus especially the two additional problems given out in class. Note that 10 has a typo in the picture in the book, as the arrow should go from state 0 to state 1 and not the other way around.
  • Mon, Jan 28, the one homework problem in the pushdown automata handout.
  • Note: For the following 4 parser homework problems, save your files in a folder names ParserHW1, ParserHW2, ParserHW3, and ParserHW4 on your hw171-1 homework drive. Include in these folders your fsm file, keywords file, grammar file, program file, and output file.
  • Correction: The second and third parser examples, both on the course network drive and under the parser web page, contained a typo in the third row of the matrix in the grammar file. The 13 in that row should have been a 14. These files have now been corrected.
  • Further correction: In the grammar file for the third parser example, there should have been a 15 in the matrix in the row for <condition> and the column for the left parenthesis. This is because a valid condition in our grammar might look like (y + 1 ) = num, so that the <expression> on the left of the equals sign begins with a left parenthesis. Thus, in trying to show that we have a condition, we should use rule 15 if the lookahead is a left parenthesis.
  • It has also been pointed out that in parser homework 2, the < does not work as a logical operator, no doubt because the software sees this symbol as the beginning of a nonterminal. Perhaps the software should be modified so that the nonterminals do not use the angle brackets, but for now we will have to accept the fact that the < will not work.
  • Fri, Feb 1, do these problems with the parser software:
    • Parser Homework 1: Starting with parsing example 2, add WHILE loops. See the ParserHW1 folder under the course network drive for example programs that should be recognized with your revised grammar.
    • Parser Homework 2: Starting with parsing example 3, add WHILE loops and the ability to use < and > in logical expressions. See the ParserHW2 folder under the course network drive for example programs that should be recognized with your revised grammar.
  • Parser Homework 3: Mon, Feb 4, starting with parser homework 2 (the previous homework), add the shortcut assignment operators +=, -=, *=, and /=. See the ParserHW3 folder under the course network drive for example programs that should be recognized with your revised grammar.
  • Parser Homework 4: Fri, Feb 8, starting with parser homework 3 (the one before this one), add some feature that you find interesting.
  • For Mon, Feb 4, do the problem on p 5 of your Turing machine handout. This one is not to be turned in.


Maintained by: Br. David Carlson
Last updated: February 03, 2008
Disclaimer