Computer Science 60
Notes for Week 7 / Assignment 7

On This Page

Submission script enabled
I -> S { > S }

Submission script enabled

Hello -

  cs60submit for assignment 7 is enabled.
As usual, it takes a while to run, so you will probably
want to check your code by hand and not use the submit
script except as a final confirmation.

  There are test cases in the directory /cs/cs60/as/a7 --
they should cover most (but not necessarily all) cases
your grammar should handle. You can assume that your
parser will be tested only against legal strings, however.

  I anyone runs into any trouble with the submission
script, please let me know and I'll try to fix it right away.

  Thanks,

  Zach




Implication rule for Assignment 7

Hello everyone -

  I'm sorry about an inconsistency in the
assignment specification for this week's parsing problem.

  The grammar I presented in class (at least the MW section)
had the following Implication rule:

  I ->  S { > S }

with a single "greater than" to indicate implication.

  However, the grammar in the Parser.java file and
on the handout indicated

  I -> S { -> S }

with an "arrow" (made up of a hyphen and a greater-than) 
instead. 

  Although the tokenizer is designed to handle either,
let me specify that the FORMER rule is the one intended,
so that the > symbol indicates implicaion.

  If you've already done it the other way, fortunately, the
change is a single character:

  from

    if ( tokens.peek() != null && tokens.peek().equals("->") )

  to

    if ( tokens.peek() != null && tokens.peek().equals(">") )

in your I() method.

  Let me know if you have any questions about this... .

  Zach

PS. This note is also posted on the assignments' page.