Stage 3 of the
Flair compiler project
OUT: Friday, September 28
DUE: Friday, October 12
STATUS CHECK DUE: Friday, October 5
This stage consists of the second part of the second component of your Flair compiler, and three auxiliary programs.
Modify your table-driven parser to produce an abstract syntax tree.This parser is a function or object that examines a sequence of Flair tokens and produces as output either an abstract syntax tree corresponding to the program (if the program is valid) or a suitable "nothing" value (if the program is not valid).
Write a program that uses your parser to produce a formatted listing of the input program's AST.In order to show the structure of the abstract syntax tree, the entry for each construct should be indented under its parent element. The display of identifiers and numbers must include the semantic content of the node.
program name main args body return_statement integer_literal 1
Create an executable or a Unix command-line script named flairp that takes the name of a Flair source file as an argument and runs your AST-printing program on it.This is the third in a series of tools that makes up the command-line suite of your Flair compiler.
Write at least one meaningful legal program in Flair.Your test program should be at least at the level of a late CS1 program. Feel free to to to write something a more advanced program; you certainly will understand Flair well by the time you have a working parser. If you are stumped for what to do, try one of these ideas.
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.