SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
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)?
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)?

Weitere ähnliche Inhalte

Was ist angesagt?

Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler DesignShine Raj
 
COMPILER DESIGN AND CONSTRUCTION
COMPILER DESIGN AND CONSTRUCTIONCOMPILER DESIGN AND CONSTRUCTION
COMPILER DESIGN AND CONSTRUCTIONAnil Pokhrel
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design) Tasif Tanzim
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generationRamchandraRegmi
 
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTanzeela_Hussain
 
Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Iffat Anjum
 
Fundamentals of Computing and C Programming - Part 1
Fundamentals of Computing and C Programming - Part 1Fundamentals of Computing and C Programming - Part 1
Fundamentals of Computing and C Programming - Part 1Karthik Srini B R
 
Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1Shashwat Shriparv
 
Fundamentals of Computing and C Programming - Part 2
Fundamentals of Computing and C Programming - Part 2Fundamentals of Computing and C Programming - Part 2
Fundamentals of Computing and C Programming - Part 2Karthik Srini B R
 
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Saikrishna Tanguturu
 
Syntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address CodeSyntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address Codesanchi29
 

Was ist angesagt? (20)

Compiler unit 2&3
Compiler unit 2&3Compiler unit 2&3
Compiler unit 2&3
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler Design
 
COMPILER DESIGN AND CONSTRUCTION
COMPILER DESIGN AND CONSTRUCTIONCOMPILER DESIGN AND CONSTRUCTION
COMPILER DESIGN AND CONSTRUCTION
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Intermediate code
Intermediate codeIntermediate code
Intermediate code
 
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive Parsing
 
Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2
 
Chapter 5 Syntax Directed Translation
Chapter 5   Syntax Directed TranslationChapter 5   Syntax Directed Translation
Chapter 5 Syntax Directed Translation
 
Fundamentals of Computing and C Programming - Part 1
Fundamentals of Computing and C Programming - Part 1Fundamentals of Computing and C Programming - Part 1
Fundamentals of Computing and C Programming - Part 1
 
Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1
 
Interm codegen
Interm codegenInterm codegen
Interm codegen
 
Fundamentals of Computing and C Programming - Part 2
Fundamentals of Computing and C Programming - Part 2Fundamentals of Computing and C Programming - Part 2
Fundamentals of Computing and C Programming - Part 2
 
Lecture4 lexical analysis2
Lecture4 lexical analysis2Lecture4 lexical analysis2
Lecture4 lexical analysis2
 
Ch3
Ch3Ch3
Ch3
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
 
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
 
Syntax analysis
Syntax analysisSyntax analysis
Syntax analysis
 
Assignment12
Assignment12Assignment12
Assignment12
 
Syntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address CodeSyntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address Code
 

Ähnlich wie Pcdcycle2

Cs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer KeyCs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer Keyappasami
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignKuppusamy P
 
Engineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptxEngineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptxhappycocoman
 
Chapter Eight(2)
Chapter Eight(2)Chapter Eight(2)
Chapter Eight(2)bolovv
 
Presentation(intermediate code generation)
Presentation(intermediate code generation)Presentation(intermediate code generation)
Presentation(intermediate code generation)Sourov Kumar Ron
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To LispLISP Content
 
Topic 2_revised.pptx
Topic 2_revised.pptxTopic 2_revised.pptx
Topic 2_revised.pptxJAYAPRIYAR7
 
Cs6660 compiler design may june 2017 answer key
Cs6660 compiler design may june 2017  answer keyCs6660 compiler design may june 2017  answer key
Cs6660 compiler design may june 2017 answer keyappasami
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxSONU KUMAR
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generatorsanchi29
 
Dbms final quiz1
Dbms final quiz1Dbms final quiz1
Dbms final quiz1nanmannit
 
LET US C (5th EDITION) CHAPTER 1 ANSWERS
LET US C (5th EDITION) CHAPTER 1 ANSWERSLET US C (5th EDITION) CHAPTER 1 ANSWERS
LET US C (5th EDITION) CHAPTER 1 ANSWERSKavyaSharma65
 
guia de referencia para a linguagem do fabricante CCS info_syntax.pdf
guia de referencia para a linguagem do fabricante CCS info_syntax.pdfguia de referencia para a linguagem do fabricante CCS info_syntax.pdf
guia de referencia para a linguagem do fabricante CCS info_syntax.pdfSilvanildoManoeldaSi
 

Ähnlich wie Pcdcycle2 (20)

Cs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer KeyCs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer Key
 
Assignment
AssignmentAssignment
Assignment
 
Adobe
AdobeAdobe
Adobe
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler Design
 
Engineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptxEngineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptx
 
Syntaxdirected
SyntaxdirectedSyntaxdirected
Syntaxdirected
 
Syntaxdirected
SyntaxdirectedSyntaxdirected
Syntaxdirected
 
Syntaxdirected (1)
Syntaxdirected (1)Syntaxdirected (1)
Syntaxdirected (1)
 
Chapter Eight(2)
Chapter Eight(2)Chapter Eight(2)
Chapter Eight(2)
 
Presentation(intermediate code generation)
Presentation(intermediate code generation)Presentation(intermediate code generation)
Presentation(intermediate code generation)
 
LISP: Introduction to lisp
LISP: Introduction to lispLISP: Introduction to lisp
LISP: Introduction to lisp
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To Lisp
 
Topic 2_revised.pptx
Topic 2_revised.pptxTopic 2_revised.pptx
Topic 2_revised.pptx
 
Cs6660 compiler design may june 2017 answer key
Cs6660 compiler design may june 2017  answer keyCs6660 compiler design may june 2017  answer key
Cs6660 compiler design may june 2017 answer key
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
 
Ocs752 unit 3
Ocs752   unit 3Ocs752   unit 3
Ocs752 unit 3
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generator
 
Dbms final quiz1
Dbms final quiz1Dbms final quiz1
Dbms final quiz1
 
LET US C (5th EDITION) CHAPTER 1 ANSWERS
LET US C (5th EDITION) CHAPTER 1 ANSWERSLET US C (5th EDITION) CHAPTER 1 ANSWERS
LET US C (5th EDITION) CHAPTER 1 ANSWERS
 
guia de referencia para a linguagem do fabricante CCS info_syntax.pdf
guia de referencia para a linguagem do fabricante CCS info_syntax.pdfguia de referencia para a linguagem do fabricante CCS info_syntax.pdf
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)?