APOLLO ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CIA-IMARKS: 50
SUBJECT: CS3501-COMPILER DESIGN TIME: 1.30 HRS
YEAR/SEM: III / V DATE: / /2023
PART-A (Answer all question ) 5*2=10
1.Define Compiler
2. What are the two parts of compilation?Explain.
3 Do LeftRecursion for the given grammar AAC|Aad|bd|c
4.Draw a transition diagram to represent relational operator.
5. Explain the Role of Parser.
PART-B 1*8=8
6.Discuss the various phases of compiler with suitable example, a=b+c*60
PART-C 2*16=32
7)a).(i)Explain the role of Lexical analyzer,write a functions of it. (6)
(ii)Explain the terms Tokens,Patterns, and Lexemes with example (5)
(iii)Explain the input buffering techniques in detail (5)
or
b)(i)Convert the regular expression to FA using Direct method 0*1+10,a*b(a+b)* (4)
(ii)Convert the regular expression to FA using Thompson method( a+b)*b, (0+1)*01 (4)
(iii)Convert the NFA with epsilon to without epsilon NFA (8)
8)a)i) Convert the NFA to DFA (8)
ii.Minimizing the DFA with Table filling method (8)
or
b)i).Construct the Predictive Parser for the grammer,S->(L)|a,L->L,S|S (8)
(ii).Find FIRST and FOLLOW function for S->ABCDE,A->a| (4)
(iii) Do LeftFeactoring for the given grammar A->aAB|aA|a,B->bB|b (4)
APOLLO ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CIA-IMARKS: 50
SUBJECT: CS3501-COMPILER DESIGN TIME: 1.30 HRS
YEAR/SEM: III / V DATE: / /2023
PART-A (Answer all question ) 5*2=10
1.Define Compiler
2. What are the two parts of compilation?Explain.
3 Do LeftRecursion for the given grammar AAC|Aad|bd|c
4.Draw a transition diagram to represent relational operator.
5. Explain the Role of Parser.
PART-B 1*8=8
6.Discuss the various phases of compiler with suitable example, a=b+c*60
PART-C 2*16=32
7)a).(i)Explain the role of Lexical analyzer,write a functions of it. (6)
(ii)Explain the terms Tokens,Patterns, and Lexemes with example (5)
(iii)Explain the input buffering techniques in detail (5)
or
b)(i)Convert the regular expression to FA using Direct method 0*1+10,a*b(a+b)* (4)
(ii)Convert the regular expression to FA using Thompson method( a+b)*b, (0+1)*01 (4)
(iii)Convert the NFA with epsilon to without epsilon NFA (8)
8)a)i) Convert the NFA to DFA (8)
ii.Minimizing the DFA with Table filling method (8)
or
b)i).Construct the Predictive Parser for the grammer,S->(L)|a,L->L,S|S (8)
(ii).Find FIRST and FOLLOW function for S->ABCDE,A->a| (4)
(iii) Do LeftFeactoring for the given grammar A->aAB|aA|a,B->bB|b (4)
----------------------------------------------------------------------------------------------------------------