Parser I, Stubbing the Parser

and

Scanner IV, Polishing the Scanner

Posted Tuesday, February 12
Due at the beginning of your lab period the following week


Objectives

The objectives of this assignment are to By the end of this week, your scanner should not only be functioning, but the source code should have a professional appearance.

To Do

Here is what you must do.

Journal and Time Sheet

Remember that the journal and the time sheet are individual assignments, not group assignments.  Be sure that you have followed the directions on the Rules page for making journal entries and filling in the time sheet.  These will be turned in.

Polish Your Scanner

For extra credit, you can include source listing that highlights any errors as part of your scanner output.:  We do not suggest that you do this unless you are completely satisfied that your scanner is complete and correct, because extra credit will do you no good if the scanner doesn't function properly.  There are various ways to do the source listing.  Our suggestion would be to do the following: For example, the source listing file might look like:
begin
  Read(A, B);
  Write(@40);
        ^
*** invalid character in input file
  Fred 'Abcde  xxxyz  sus 
       ^
*** runaway string
  Apple @ Number_of_apples ?;
        ^
*** invalid character in input file

                           ^
*** invalid character in input file
  end.

 

Stub your Parser

The next stage of the compiler will be the construction of the parser.  The parser will eventually need a separate procedure for each nonterminal in the grammar.  Divide the number of nonterminals by the number of people in your group.  Each person is then to be responsible for completing the stubs for the set of nonterminals assigned to them.  Each procedure should be named the same as the nonterminal of the stub.  For example, if the nonterminal is <expression>, then the stubbed procedure should be similar to
procedure Expression is
  begin -- Expression
    Output("Expression has not yet been implemented");
    New_Line;
  end Expression;

Special Notes

To Turn In

You are to turn in, as a team, a professional-looking source listing of your program in a three ring binder notebook.  We have a handful from previous years that you can have if you want to avoid buying one (first come, first served).

You are also to turn in individually your journal and your time sheet.  Remember, these are private.  You are evaluating yourself as well as your partners, so keep the results private.  Be prepared to turn these in at the beginning of lab as well as your source listing.

You must have your program executable code available on esus with permissions set for anyone to execute it (but not to change it).

Your parser stubs are not to be turned in in hardcopy form. Instead, have the source code of the parser stubs available on esus so that the TA can examine it during lab if necessary.