CS 315 - Fall 2017
Project 2

Assigned: Oct. 31, 2017
Due: Nov 20, 2017 23:59

Design and Implementation of a Parser for a Propositional Logic Programming Language

The second project builds on your language design of the first project. This project involves building a parser for your design using the yacc tool. Please refer to the description of Project 1 for the requirements for your programming language design. There are some minor changes, please carefully read the instructions below.

Part A - Revised and Augmented Language Design Report (25 points)

The requirements for the language are the same as Project 1 except a few minor extensions. You can use as much of your previous design work as you can. However, if you have not already done so, you should incorporate the following elements in your design for this second project:

Please note that we are not expecting a single correct answer. This is a design problem. As long as your language is consistent, unambigous and it makes sense with respect to the above specifications, it is fine.

The report (in PDF format) including the following components:

Part B - Implementing the Parser (65 points)

For Project 2, you are required to implement a parser using the yacc tool. The parser reads the source code of a program written in your programming language from the input stream (which can be a file if you use the Unix redirection facilities mentioned in class). If the source code represents a valid program in your language, the parser should print out a message indicating the acceptance of the input (e.g. "Input program accepted"). Otherwise, the parser should print out an error message indicating the line number of the source code that contains the error (e.g. "Syntax error on line **!" where ** will be the line of the source program at which the error was detected).

You should use the lexical analyzer that was developed in Project 1, but you may have to modify it (for example, to count line numbers). Also, the lexical analyzer will return tokens, instead of printing messages.


Part C - Example Program (10 points)

Finally, you will have to submit a valid test program written in your language that exercises all of the core features we required in the project. You can reuse the test program from your first project, but note that you have to make sure to revise it according to the changes you made in your grammar.

VERY IMPORTANT NOTE: If you do not submit a test program, we will have no way of evaluating your parser, hence you will receive a 0 from Part C!



Please email the zip (or rar) file you created above to Gizem Çaylak before Nov 20, 2017 23:59. Late submissions will not be accepted except under the most special circumstances. As model professionals, we should learn to complete our project before the deadline.

If your submission does not adhere to the above guidelines, points will be deducted.
Make sure you have correct file naming, functional Makefile, etc.
Your parser must compile and run on dijkstra.cs.bilkent.edu.tr. The evaluation of your paerser will be done on this machine.