Professional Documents
Culture Documents
Regno: Name: Computer Science Department: Includes Working Independently On The Quiz. No Group Efforts
Regno: Name: Computer Science Department: Includes Working Independently On The Quiz. No Group Efforts
RegNo: Quiz2
Name: Date:14thDec,20
20 Nov,2020
Program : BS(CS) Class & : BS(CS)-
Section 6A
Course Name : Compiler Construction Duration : 30 min
Instructor’s : Ms. Mehr un Nisa Marks : 15
Name
Note: You are expected to take this quiz according to course and University honor codes; this
includes working independently on the quiz. No group efforts.
Q1: Consider the palindrome grammar
S –>aSa
S –>bSb
S –>c
Perform Shift Reduce parsing for input string “abcba”
Q2: Consider the following augmented grammar
S→ 1A1| 2A2| 1B2| 1B2
A→ 3
B→ 3
Draw the states of the SLR(1) used during a parse of the input 232. Do not construct the entire SLR(1)
states instead, just show the states that are actually used during the parse.