Stage 2 of the
Klein compiler project
OUT: Friday, September 15
DUE: Friday, September 29
STATUS CHECK DUE: Friday, September 22
This stage consists of the first part of the second component of your Klein compiler, two auxiliary programs, and five short test programs.
Write a table-driven parser that accepts Klein programs.This parser is a function or object that examines a sequence of Klein tokens to produce a true/false answer: Is the input a legal Klein program? Your parser should either create a scanner on the source program or receive a scanner as an argument.
Create five short test programs that your program correctly rejects.Your programs should test interesting cases that your parser ought to recognize as invalid. A nonsense program is less interesting than a program with a subtle syntax error.
Write a program that uses your parser to validate a candidate Klein program.This program should invoke your parser on the Klein program and print either "valid program" or an error message indicating the one or more errors found by your parser.
Create an executable or a Unix command-line script named kleinf that takes the name of a Klein source file as an argument and runs your parse validation program on it.This is the second in a series of tools that makes up the command-line suite of your Klein compiler.
As before, submit only one copy of each assignment per team, both electronically and on paper. The team captain or a designated team member can be responsible for the submission.
Include all three of these items in the documentation for your project.You can document these as text files, PDFs, or even graphics. (Having them in an editable form is handy even if you also submit a PDF or a graphic.)