The second project builds on your language design of the first project.
This project involves building a parser for your language 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 read carefully the instructions below.
Please note that there is no single correct answer. This is a design project. As long as your language is consistent, unambiguous and it makes sense with respect to the specifications given above, it is fine. However, it is expected to be readable, writable and reliable, as much as possible.
For the second project, 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 an input file.
If the source code represents a valid program in your programming language,
the parser should print out a message indicating the acceptance of the input
(e.g. "Input program is valid"). 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 number
of the source program at which the error was detected).
You should use the lexical analyzer that was developed in the project, but you may have to modify it; for example, to count line numbers. Also, the lexical analyzer will return tokens, instead of printing messages.
VERY IMPORTANT NOTE:
yacc
and lex
specification files must compile
on the dijkstra.cs.bilkent.edu.tr
machine;
otherwise, you will receive 0 from Part B.
Finally, you will test your parser on the programs that you submitted in the first part of the project. Also show that your parser finds syntax errors by introducing small errors in these programs.
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!
guvenir@cs.bilkent.edu.tr
, on the same day of submission.
Rename the files as CS315_24F_Team_X-ID_Y
,
where X
is your team number and Y
is your ID number.
If you do not submit this form, your teamwork grade will be 0.
Likewise, if any two students are given the same grade on any dimension,
your teamwork grade will be 0.
The teamwork grade of each student will be computed separately,
by taking into account the comments written by the student and other team members.
The numerical values in columns D-H of the form will be used in statistical analyses.
Needless to say, do NOT collaborate in preparing and submitting your peer assessments.
CS315_24F_Team_X
,
where X
will be your team number.
CS315_24F_Team_X.lex
: Your lex specification file.
CS315_24F_Team_X.yacc
: Your yacc specification file.
CS315_24F_Team_X.txt
: Your example program, in text format.
parser
in the dijkstra.cs.bilkent.edu.tr
machine.
Check that when you type make
in the same directory the desired executable is generated.
rm
command.
BE CAREFUL, do not remove your lex and yacc files. MAKE FREQUENT BACKUPS.
zip
or rar
.
Please upload the zip (or rar) file you created to Moodle (CS 315 (All Sections) Programming Languages) before the due date. Late submissions will be accepted, with 20 points (out of 100) deduction for each extra day.
If your submission does not adhere to the above guidelines, points will be deducted.
Make sure you have correct file naming.
Your parser must compile and run on dijkstra.cs.bilkent.edu.tr
.
The evaluation of your parser will be done only on this machine.