COP-4020 PROGRAMMING LANGUAGES CONCEPTS
Project: SUBC Parser
DUE: April 25, 11:55 p.m. Upload a zip file on Canvas
Here is the link for the sample programs
* Have your name and UF ID on what you submit
* Submit everything in a single tar file to Canvas.
The objective of this first project is to implement a lexical analyzer, and a recursive descent parser for a (sort of ) subset of C language called SUBC.
The grammar for the language is here.
You must write your OWN lexical and syntax analyzers in C++.
You are NOT allowed to use 'lex' and 'yacc' or any similar software in order to implement this project.
The lexical rules for SUBC are here.
Regarding grading and submission
1. Put in a BUGS file all comments of known errors (if any) of your project.
It is MUCH better for you to list the limitations of your software than to let us discover them.
The more time it takes for us to find what's wrong with your program, the larger the portion of credit WE (and not you) earn.
In short, you must make it easy for us to examine your program.
2. Your output should match the corresponding tree for each one of the test programs.
Please bear with the idiosyncracies of my parser, and match its behavior anyway.
3. Grading strategy:
We will run your program on each of the test programs, and we will compare (bit by bit) your AST with the correct one.
Full credit will be given a perfect match in every case. Credit will be lost for failing to follow the above instructions.
Readability and clarity of the source code is also important for your grade.
4. Executable Name:
p1. Include a make file in your submission.
You must provide a makefile to build this project. We will compile your program by invoking: make
we will then test p1 by invoking it as follows:
Notice that the input is NOT standard input (stdin), but instead a command-line parameter.
p1 -ast tests/Treepicture
5. p1 (without switches) should produce no output whatsoever.
Required switches: -ast This switch prints the abstract syntax tree, and nothing else.
No headers or footers. The AST must match exactly, character for character, the correct one.
6. It must be possible to run p1 from ANY directory.
e.g. ~user/cop4020/p1 testfile