guia de referencia para a linguagem do fabricante CCS info_syntax.pdf
Pcdcycle2
1. Dr.PAULS ENGINEERING COLLEGE
Paul’s Nagar
Cycle Test -II
Sub/Sub.code:PCD/CS 2352 Date:
Year/Sec: III-A&B (VI-Sem) Max Mark: 60
Dept: CSE Hour: 2:00
Part-A
Answer to all questions
2*6=12
1. What is mean by parser and its types?
2. What is mean by terminal and Non-terminal with example?
3. What is left recursive and left factoring with example?
4. What is handle and handle pruning with example?
5. Consider this grammar to perform shift reducing parsing E->E+E/E*E/id and the
input string is id1+id2*id3?
6. What is mean by LR parser and its types?
Part-B
Answer any three out of five
16*3=48
7.Consider the following grammar E->E+T/T,T->TF/F,F->F*/a/b construct
SLR(16)?
8. Consider the following grammar S->Aa/bAc/dc/bda,A->d construct LALR(16)?
9.(i)Chech wheather the grammar is LL(1) or not and constrct a predictive parsing
table S->AaAb/BbBa,A-> ε,B-> ε(8)?
(ii)Construct LL(1) or predictive parsing table S->iEtS/iEtSeS/a,E->b(8)?
10.(i).Consider the grammar S->TL;,T->int/float,L->L,id/id parse the input string
int,id,id; using shift reduce parsing(8)?
(ii).construct the operator precedency parsing for this grammar S->(L)/a,
L->L,S/S the input string is (a,(a,a))(8)?
11.(i)What are the rules for FIRST and FOLLOW function(8)?
(ii).To write algorithm for SLR parsing (8)?
2. Dr.PAULS ENGINEERING COLLEGE
Paul’s Nagar
Cycle Test -II
Sub/Sub.code:PCD/CS 2352 Date:
Year/Sec: III-A&B (VI-Sem) Max Mark: 60
Dept: CSE Hour: 2:00
Part-A
Answer to all questions
2*6=12
1. Consider this grammar to perform shift reducing parsing E->E+E/E*E/id and the
input string is id1+id2*id3?
2. What is mean by LR parser and its types?
3. What is mean by parser and its types?
4. What is mean by terminal and Non-terminal with example?
5. What is left recursive and left factoring with example?
6. What is handle and handle pruning with example?
Part-B
Answer any three out of five
16*3=48
7.(i).Consider the grammar S->TL;,T->int/float,L->L,id/id parse the input string
int,id,id; using shift reduce parsing(8)?
(ii).construct the operator precedency parsing for this grammar S->(L)/a,
L->L,S/S the input string is (a,(a,a))(8)?
8.(i)What are the rules for FIRST and FOLLOW function(8)?
(ii).To write algorithm for SLR parsing (8)?
9.Consider the following grammar E->E+T/T,T->TF/F,F->F*/a/b construct
SLR(16)?
10. Consider the following grammar S->Aa/bAc/dc/bda,A->d construct LALR(16)?
11.(i)Chech wheather the grammar is LL(1) or not and constrct a predictive parsing
table S->AaAb/BbBa,A-> ε,B-> ε(8)?
(ii)Construct LL(1) or predictive parsing table S->iEtS/iEtSeS/a,E->b(8)?