Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

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.

You might also like