Laboratory Exercise for March 4
Finishing the LL(1) Table and the Parser
Objectives
The objectives of this laboratory exercise are
- To provide you opportunity to demonstrate your parser
- To give you time to work on your parser based on your LL(1) tables.
Preparing for Lab
No special preparations needed.
To Do
This day is primarily a catch up day.
- Have your executable up and running. The TA will come around and
check your parser to see what it is able to parse at this point. You
should have a mPascal program with features you
can parse to show and then you should be able to run your program on this
file. Before the TA comes to your station, do your demos for other
teams sitting nearby.
- Be sure your LL(1) table is complete using the empty table in HTML format
on the resources page. This table is to be completed according to the
grammar on the resources page without any modifications. Thus, what
you turn in should reflect any of the conflicts resulting from this grammar.
- Discuss among your group how to resolve any conflicts in the table.
Make a NEW TABLE (do not modify the original table, rather use a copy of
that table) that reflects any changes you make to resolve conflicts.
In cases where there is no resolution, discuss and write down how you will
handle the conflicts.
- Discuss among yourselves how to sharpen your error messages to include
information about what token was found that caused the error and what tokens
were expected in that location.
- Finish working on your parser. Be sure that each member finishes
some of the parser stubs with proper lookaheads. Make sure this is
done in a "stepwise" fashion so that you can continue to test new
features of the grammar as you parse them.
To Turn In
Follow the TA's instructions on how to turn in the original LL(1) table with
all original conflicts represented, the new LL(1) table, and your descriptions
of how the new table is different from the original based on the changes you
made to the new table as well as how you might think you will handle conflicts
that still remain in the new table.
Make sure to include your usual cover page.
Submit your parsers according to the TA's directions.