Stage 2 of the
Flair compiler project
OUT: Friday, September 14
DUE: Friday, September 28
STATUS CHECK DUE: Friday, September 21
This stage consists of the first part of the second component of your Flair compiler, two auxiliary programs, and five short test programs.
Write a table-driven parser that accepts Flair programs.This parser is a function or object that examines a sequence of Flair tokens to produce a true/false answer: Is the input a legal Flair 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 are nearly legal but which 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 Flair program.This program should invoke your parser on the Flair 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 flairf that takes the name of a Flair 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 Flair 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.) If you have them done by the time the status check is due -- and you probably should... -- submit them with your status check in order to get early feedback.