Question: ASAP please Goal: This assignment serves several purposes: - to be familiar with Bison, - to create context - free grammar for Tiger language, and

ASAP please
Goal:
This assignment serves several purposes:
- to be familiar with Bison,
- to create context-free grammar for Tiger language, and
- to create the parser for Tiger language using Bison
Description:
This is a team project that builds on the previous project. In this project, you are required to use Bison to create a parser for the Tiger language. More specifically, write the context-free grammar for the Tiger language. Please read the Tiger language manual carefully before you start. The manual can be found in D2L as well as the project repository.
In this project, Record and any record-related features will not be supported. These features include, but are not limited to, record expression, record definition, and accessing a field of a record.
Team Project Requirement:
Please read "team requirements.doc"
Responsibility of Team Leader:
- Organize regular team meetings (virtual or in-person) to discuss progress and issues of the project and submit time log reports before each deadline.
The time log report is used to monitor the progress of the project. Each team is required to submit 3-time log reports. Each report should specify the major work that has been done and the estimated time needed to finish the project,
- The first-time log report should be submitted within 2-3 days after the project is assigned. This report should specify the team members' roles and the estimated time needed from each team member.
- One time-log reports to monitor the progress of the project (alpha version) and test cases.
- One report to monitor the progress of the final version of the project.
The time log report pattern file can be found in the "project3\timelog" folder.
- Make sure programmers and testers submit their required documents by deadlines.
- Put team member names in the rubric file and submit it to the project repository.
Responsibility of Programmer:
- Work on the tiger.yy file. He can seek help from team leaders and testers if needed.
- Submit the alpha version of tiger.yy before the deadline.
- Fix errors based on the test report provided by the tester and submit the final version before the deadline.
Responsibility of Tester:
- Work on test cases and submit it before the deadline. The test case should be a tiger program without any syntax errors. In this project, we focus on the syntax of the tiger program only, not semantics. The tiger program should cover all features supported in the language.
The Tiger program will be used to test the project (alpha version). The pattern of the test case file can be found at: "project3\Testing"
What to do in this project?
Come up with a context-free grammar for Tiger language, and use Bison to generate its parser. Your
grammar should have as few shift-reduce conflicts as possible and no reduce-reduce conflicts. When
you compile your parser file, Bison will output information about the number of shift-reduce conflicts
and the number of reduce-reduce conflicts. If your grammar has a reduce-reduce conflict, please talk
to me to see how to get rid of it.
Most Tiger CFG can be found in the brief manual located at "class
repository \\ Document \\ Tiger \\BriefManual.pdf". However, some changes are required to make it work.
The brief manual uses id for variable names and type-id for type names. In your CFG, please
use ID for both.
Some non-terminals in the brief manual have subscript "opt" like the following:
( expr-seq _("opt "))
It means optional. You should treat it as two productions like the following:
()//expr_seq doesn't occur
( expr-seq)//expr_seq occur once.
Replace punctuation symbols and operators with the corresponding token names. For
example, replace := with ASSIGN, ( with LPAREN.
For production expr binary-operator expr, please use actual operators to replace symbol
binary-operator to get productions like expr LE expr, expr NEQ expr, etc.
Replace productions of left recursion with productions of right recursion. For example, the
following production is left recursion since the production head appears as the first symbol in
the production body.
type-fields: quad type-field
type-fields, type-field
Rewrite it to make the production head appear as the last symbol in the production body.
type-fields: type-field
type-field, type-fields
In the tiger.In the yy file, the operators' precedence level and association should be specified based on
the Tiger manual.
Extra rules should be provided to recover from errors. Your grammar should generate the same
output on the sample file example.tig as the one provided by the instructor.
Set up environment:
I strongly suggest teams use the sample Visual Studio solution I provided in the class repository.
Choose a tiger. 1l from your team members (typically the one with the highest grades). Correct
all existing errors. Copy the tiger. 1l to project 3\\ BisonProjectlMainDriver, and make the
following change:
a. Replace the line #include "tokens.h" by #include "tiger.tab.hh". This is required
because there are no tokens.h, and all token definition
ASAP please Goal: This assignment serves several

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!