Programme Name B.
Tech CSE Semester : Fall Semester 2025-2026
Course Code and Course BCSE307P – Compiler Design Assessment Lab Assignment - 5
Title Lab Type:
Faculty Dr. P. S. Sreeja Slot No (L19+L20) & (L57+L58)
Submission Starts From 7.08.2025 Due Date 13.08.2025
Design and implement an LL(1) parser for a given grammar. Your parser should:
1. Compute the FIRST and FOLLOW sets for all non-terminals.
2. Construct the LL(1) parsing table using the computed FIRST and FOLLOW sets.
3. Implement a predictive parser that takes an input string and determines whether it
can be derived from the grammar.
4. Clearly display each step of the parsing process, including the stack contents and
input buffer at each stage.
Instructions:
Accept the grammar as input.
Allow the user to input a string to be parsed.
If the string is accepted, display the steps leading to successful parsing.
If the string is rejected, indicate the point of error or mismatch.
Sample Grammar (for testing):
pgsql
CopyEdit
E → T E'
E' → + T E' | ε
T → F T'
T' → * F T' | ε
F → ( E ) | id
Deliverables:
Source code with proper comments.
Output screenshots showing parsing steps for valid and invalid inputs.
A short report summarizing:
o FIRST and FOLLOW sets
o Parsing table
o Sample input strings and corresponding parsing results
Test cases:
1. id+id
2. id+id*id
Source code Poor Good Excellent
3 points 4 points 5 points
Test Case 1- First Poor partially Correct Evaluted all Nodes
perfectly
0.5 points 1 points
1.5 points
Test Case 1- Follow Poor partially Correct Evaluted all Nodes
perfectly
0.5 points 1 points
1.5 points
Test Case1_ Parse table Poor partially Correct Evaluted all Nodes
perfectly
1 points 1.5 points
2 points
Test Case 1- Stack Poor partially Correct Evaluted all Nodes
Implementation perfectly
1 points 1.5 points
2 points
Test Case 2- First Poor partially Correct Evaluted all Nodes
perfectly
0.5 points 1 points
1.5 points
Test Case 2-Follow Poor partially Correct Evaluted all Nodes
perfectly
0.5 points 1 points
1.5 points
Test Case 2- Parse Table Poor partially Correct Evaluted all Nodes
perfectly
1 points 1.5 points
2 points
Test Case 2- Stack Poor partially Correct Evaluted all Nodes
Implementation Table perfectly
1 points 1.5 points
2 points
Handwritten Solution Poor Good Excellent
3 points 4 points 5 points
On time Submission More than one One week late On or before due
week late date
0.5 points
0 points 1 points