SlideShare uma empresa Scribd logo
1 de 6
Baixar para ler offline
www.studentyogi.com                                                                  www.studentyogi.com

        Code No: R05311201
                                                                                Set No. 1
               III B.Tech I Semester Regular Examinations, November 2007
                             AUTOMATA AND COMPILER DESIGN
          ( Common to Information Technology and Computer Science & Systems
                                              Engineering)
        Time: 3 hours                                                       Max Marks: 80
                                     Answer any FIVE Questions
                                  All Questions carry equal marks



          1. (a) What is Finite Automaton? Give an example.
              (b) Find the number of tokens presented in the following ‘FORTRAN’ statements:
                     i. DO 100 I = 1.625
                    ii. IF ( MIN .EQ. MAX ) GOTO 1000
              (c) Find the Regular Expression for the DFA as shown in gure 1c. [2+2+12]




                                                               Figure 1c

          2. (a) Construct a Context Free Grammar(CFG) for possible sequences of if and else
                   in‘C’
              (b) Find the moves of the above grammar to derive the if - else sequence of the
                   string: iieie.                                                                [10+6]

          3. Consider the following augmented grammar:
              S A
              A BA |
              B aB |b

              (a) Construct the LR(1) parser.
              (b) Find the moves made by the LR(1) parser on the input string: a a b b.[10+6]

          4. (a) Compare Inherited attributes and Synthesized attributes with an example.
              (b) Construct triples of an expression: a * - (b + c).                              [8+8]

          5. Explain Linear bounded automaton with an Example?                                     [16]

          6. (a) Write a notes on the static storage allocation strategy with example and dis-
                   cuss its limitations?
www.studentyogi.com                                                                www.studentyogi.com

        Code No: R05311201
                                                                              Set No. 1
              (b) Discuss about the stack allocation strategy of runtime environment with an
                   example?                                                                    [8+8]

          7. Write explain about Organization for an Optimizing Compiler? [16]

          8. Write di erences between single pass and two pass translation? [16]
www.studentyogi.com                                                                www.studentyogi.com

        Code No: R05311201
                                                                                 Set No. 2
               III B.Tech I Semester Regular Examinations, November 2007
                             AUTOMATA AND COMPILER DESIGN
          ( Common to Information Technology and Computer Science & Systems
                                              Engineering)
        Time: 3 hours                                                       Max Marks: 80
                                     Answer any FIVE Questions
                                  All Questions carry equal marks


          1. (a) De ne Alphabets, Strings, and Languages. Give two examples of each.
              (b) Consider the line number 4 of the following ‘C’ program:
                   int main()                              /* Line 1 */
                   {                                       /* Line 2 */
                          int i, n;                        /* Line 3 */
                          fro(i=0, i n, i++); /* Line 4 */
                   }                                       /* Line 5 */

                   What is the compiler’s response about this line while creating the object mo d-
                   ule? Explain.                                                                   [9+7]
          2. Write a Context Free Grammar(CFG) for the while statement in ‘C’ language. [16]
          3. Consider the following augmented grammar:
             S E
             E E + T |T
             T a |(E)

              (a) Construct the DFA whose states are the canonical collection of LR(0) items.
              (b) Construct the SLR(1) parse table.                                               [8+8]
          4. (a) Construct triples of the expressions: a[i] := b and a := b[i]
              (b) Generate the three-address code for the following ‘C’ program fragment:
                   for( i = 1; i = 20; i++) if( a b) x = y + z;                                   [8+8]
          5. (a) Write a short notes on context sensitive language with suitable example.
              (b) Write about Linear Bounded Automata.                                            [8+8]
          6. Write and Explain about Symbol Table Organization?                                    [16]
          7. Explain the following:
              (a) Dominators
              (b) Algorithm for Constructing the Natural Loops
              (c) Reducible Flow Graphs.                                                         [4 × 4]
          8. Explain the concept of label tree for code generation.                                [16]
www.studentyogi.com                                                                 www.studentyogi.com

        Code No: R05311201
                                                                              Set No. 3
               III B.Tech I Semester Regular Examinations, November 2007
                             AUTOMATA AND COMPILER DESIGN
          ( Common to Information Technology and Computer Science & Systems
                                              Engineering)
        Time: 3 hours                                                       Max Marks: 80
                                     Answer any FIVE Questions
                                  All Questions carry equal marks



          1. (a) Design a DFA that accepts the language over the alphabet, S = {0, 1, 2}
                   where the decimal equivalent of the language is divisible by 3.
              (b) Compare compiler and an interpreter with the help of suitable examples. [8+8]

          2. (a) What is left factoring? Explain with a suitable example.
              (b) What is the language, L generated by the following grammar, G:
                  G = ({S} {a b} {S aSb |ab } S)
              (c) Identify the language, L generated by the following grammar, G:
                   G = ({S A B} {a b} {S Aa A a | B B bB | b } S). [6+5+5]

          3. Construct the collection of non-empty sets of LR(0) items for the following aug-
             mented grammar:
              S E1
              E1 T3E1 |T1
              E2 T3E2 | T2                                                                         [16]
              T1 a$ |(E2$
              T2 a) |(E2)
              T3 a+ |(E2+

          4. Translate the executable statements of the following ‘C’ program into a three-
             address code by assuming each element of an array ‘a’ takes 4 bytes. [16]
             void main()
               {
                           int i = 1, a[10];
                           while(i++ = 10)a[i] = 0;
               }

          5. (a) Distinguish static and dynamic Type checking?
              (b) Explain about on Polymorphic functions?                                         [8+8]

          6. Write and Explain about algorithm for construction of equivalence trees? [16]

          7. (a) De ne the following:
                       i. Basic Block
                      ii. Local Optimization
                     iii. Global Optimization.
www.studentyogi.com                                                              www.studentyogi.com

        Code No: R05311201
                                                                             Set No. 3
              (b) Explain about Algebraic Transformations?
              (c) “Copy propagation Leads to Dead code” - Justify the statement. [6+6+4]

          8. Write and explain an algorithm for building a DAG from a basic Blo ck . [16]
www.studentyogi.com                                                                 www.studentyogi.com

        Code No: R05311201
                                                                               Set No. 4
               III B.Tech I Semester Regular Examinations, November 2007
                             AUTOMATA AND COMPILER DESIGN
          ( Common to Information Technology and Computer Science & Systems
                                              Engineering)
        Time: 3 hours                                                       Max Marks: 80
                                     Answer any FIVE Questions
                                  All Questions carry equal marks


          1. (a) De ne Alphabets, Strings, and Languages. Give two examples of each.
               (b) Consider the line number 4 of the following ‘C’ program:
                    int main()                              /* Line 1 */
                    {                                       /* Line 2 */
                           int i, n;                        /* Line 3 */
                           fro(i=0, i n, i++); /* Line 4 */
                    }                                       /* Line 5 */

                  What is the compiler’s response about this line while creating the object mo d-
                  ule? Explain.                                                                   [9+7]
          2. Construct the predictive parse table for the following grammar:
             S iEtSS |a
             S eS |
             E b.                                                                                  [16]
          3. Consider the grammar: S (S) |a
             Construct the DFA for SLR(1), CLR(1), and LALR(1) parsers and nd the number
             of states in each of the parser.                                                     [16]
          4. Let synthesized attribute, Val give the value of the binary number generated by S
             in the following grammar. For example, on input 101.101, S.Val = 5.625.
              S L • L |L
              L LB |B
              B 0 |1
             Write synthesized attribute values corresponding to each of the productions to
             determine the S.Val.                                                                 [16]
          5. (a) what is type Checker? How does it work?
              (b) Write short notes on Dynamic and Static type checking? [8+8]
          6. Write and Explain about Runtime storage administration?                              [16]
          7. (a) Explain Brie y about the Global Optimization?
              (b) Distinguish machine dependent and machine independent optimization.[8+8]
          8. Explain all the data structures used for designing the macro pre-processor? [16]

Mais conteúdo relacionado

Mais procurados

Chapter Eight(1)
Chapter Eight(1)Chapter Eight(1)
Chapter Eight(1)
bolovv
 
C programming session 05
C programming session 05C programming session 05
C programming session 05
AjayBahoriya
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)
bolovv
 
Chapter Eight(2)
Chapter Eight(2)Chapter Eight(2)
Chapter Eight(2)
bolovv
 
Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1
Shashwat Shriparv
 
C programming & data structure [arrays & pointers]
C programming & data structure   [arrays & pointers]C programming & data structure   [arrays & pointers]
C programming & data structure [arrays & pointers]
MomenMostafa
 
C programming session 05
C programming session 05C programming session 05
C programming session 05
Vivek Singh
 

Mais procurados (20)

7th Semester (December; January-2014 and 2015) Computer Science and Informati...
7th Semester (December; January-2014 and 2015) Computer Science and Informati...7th Semester (December; January-2014 and 2015) Computer Science and Informati...
7th Semester (December; January-2014 and 2015) Computer Science and Informati...
 
Chapter Eight(1)
Chapter Eight(1)Chapter Eight(1)
Chapter Eight(1)
 
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
 
Paper
PaperPaper
Paper
 
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
 
Sample paper i.p
Sample paper i.pSample paper i.p
Sample paper i.p
 
C programming session 05
C programming session 05C programming session 05
C programming session 05
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)
 
Chapter Eight(2)
Chapter Eight(2)Chapter Eight(2)
Chapter Eight(2)
 
Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
5th Semester CS / IS (2013-June) Question Papers
5th Semester CS / IS (2013-June) Question Papers5th Semester CS / IS (2013-June) Question Papers
5th Semester CS / IS (2013-June) Question Papers
 
7th cs june 2013
7th cs   june 20137th cs   june 2013
7th cs june 2013
 
Building Ontologies from Multiple Information Sources
Building Ontologies from Multiple Information SourcesBuilding Ontologies from Multiple Information Sources
Building Ontologies from Multiple Information Sources
 
C programming & data structure [arrays & pointers]
C programming & data structure   [arrays & pointers]C programming & data structure   [arrays & pointers]
C programming & data structure [arrays & pointers]
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
C programming session 05
C programming session 05C programming session 05
C programming session 05
 
6th Semester CS / IS (2013-June) Question Papers
6th Semester CS / IS (2013-June) Question Papers6th Semester CS / IS (2013-June) Question Papers
6th Semester CS / IS (2013-June) Question Papers
 
COMPILER DESIGN AND CONSTRUCTION
COMPILER DESIGN AND CONSTRUCTIONCOMPILER DESIGN AND CONSTRUCTION
COMPILER DESIGN AND CONSTRUCTION
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
 

Semelhante a Automata And Compiler Design

D E S I G N A N D A N A L Y S I S O F A L G O R I T H M S J N T U M O D E L...
D E S I G N A N D A N A L Y S I S O F A L G O R I T H M S  J N T U  M O D E L...D E S I G N A N D A N A L Y S I S O F A L G O R I T H M S  J N T U  M O D E L...
D E S I G N A N D A N A L Y S I S O F A L G O R I T H M S J N T U M O D E L...
guest3f9c6b
 
D A T A B A S E M A N A G E M E N T S Y S T E M S J N T U M O D E L P A P ...
D A T A B A S E M A N A G E M E N T S Y S T E M S  J N T U  M O D E L  P A P ...D A T A B A S E M A N A G E M E N T S Y S T E M S  J N T U  M O D E L  P A P ...
D A T A B A S E M A N A G E M E N T S Y S T E M S J N T U M O D E L P A P ...
guest3f9c6b
 
Databasemanagementsystems Jntu Model Paper{Www.Studentyogi.Com}
Databasemanagementsystems Jntu Model Paper{Www.Studentyogi.Com}Databasemanagementsystems Jntu Model Paper{Www.Studentyogi.Com}
Databasemanagementsystems Jntu Model Paper{Www.Studentyogi.Com}
guest3f9c6b
 
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
guest3f9c6b
 
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
C O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{WwwC O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{Www
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
guest3f9c6b
 
D I G I T A L I C A P P L I C A T I O N S J N T U M O D E L P A P E R{Www
D I G I T A L  I C  A P P L I C A T I O N S  J N T U  M O D E L  P A P E R{WwwD I G I T A L  I C  A P P L I C A T I O N S  J N T U  M O D E L  P A P E R{Www
D I G I T A L I C A P P L I C A T I O N S J N T U M O D E L P A P E R{Www
guest3f9c6b
 
Data structures question paper anna university
Data structures question paper anna universityData structures question paper anna university
Data structures question paper anna university
sangeethajames07
 

Semelhante a Automata And Compiler Design (20)

Ads
AdsAds
Ads
 
Ooad q.papers
Ooad q.papersOoad q.papers
Ooad q.papers
 
212101 Object Oriented Analysis Design Through Uml
212101 Object Oriented Analysis Design Through Uml212101 Object Oriented Analysis Design Through Uml
212101 Object Oriented Analysis Design Through Uml
 
212101 Object Oriented Analysis Design Through Uml
212101 Object Oriented Analysis Design Through Uml212101 Object Oriented Analysis Design Through Uml
212101 Object Oriented Analysis Design Through Uml
 
05211201 A D V A N C E D D A T A S T R U C T U R E S A N D A L G O R I...
05211201  A D V A N C E D  D A T A  S T R U C T U R E S   A N D   A L G O R I...05211201  A D V A N C E D  D A T A  S T R U C T U R E S   A N D   A L G O R I...
05211201 A D V A N C E D D A T A S T R U C T U R E S A N D A L G O R I...
 
05211201 Advanced Data Structures And Algorithms
05211201 Advanced Data Structures  And  Algorithms05211201 Advanced Data Structures  And  Algorithms
05211201 Advanced Data Structures And Algorithms
 
Daa q.paper
Daa q.paperDaa q.paper
Daa q.paper
 
D E S I G N A N D A N A L Y S I S O F A L G O R I T H M S J N T U M O D E L...
D E S I G N A N D A N A L Y S I S O F A L G O R I T H M S  J N T U  M O D E L...D E S I G N A N D A N A L Y S I S O F A L G O R I T H M S  J N T U  M O D E L...
D E S I G N A N D A N A L Y S I S O F A L G O R I T H M S J N T U M O D E L...
 
D A T A B A S E M A N A G E M E N T S Y S T E M S J N T U M O D E L P A P ...
D A T A B A S E M A N A G E M E N T S Y S T E M S  J N T U  M O D E L  P A P ...D A T A B A S E M A N A G E M E N T S Y S T E M S  J N T U  M O D E L  P A P ...
D A T A B A S E M A N A G E M E N T S Y S T E M S J N T U M O D E L P A P ...
 
Databasemanagementsystems Jntu Model Paper{Www.Studentyogi.Com}
Databasemanagementsystems Jntu Model Paper{Www.Studentyogi.Com}Databasemanagementsystems Jntu Model Paper{Www.Studentyogi.Com}
Databasemanagementsystems Jntu Model Paper{Www.Studentyogi.Com}
 
Embedded Systems Jntu Model Paper{Www.Studentyogi.Com}
Embedded Systems Jntu Model Paper{Www.Studentyogi.Com}Embedded Systems Jntu Model Paper{Www.Studentyogi.Com}
Embedded Systems Jntu Model Paper{Www.Studentyogi.Com}
 
Embedded Systems Jntu Model Paper{Www.Studentyogi.Com}
Embedded Systems Jntu Model Paper{Www.Studentyogi.Com}Embedded Systems Jntu Model Paper{Www.Studentyogi.Com}
Embedded Systems Jntu Model Paper{Www.Studentyogi.Com}
 
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
 
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
C O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{WwwC O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{Www
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
 
Cs6503 theory of computation may june 2016 be cse anna university question paper
Cs6503 theory of computation may june 2016 be cse anna university question paperCs6503 theory of computation may june 2016 be cse anna university question paper
Cs6503 theory of computation may june 2016 be cse anna university question paper
 
Aca
AcaAca
Aca
 
C g.2010 supply
C g.2010 supplyC g.2010 supply
C g.2010 supply
 
Digital Ic Applications Jntu Model Paper{Www.Studentyogi.Com}
Digital Ic Applications Jntu Model Paper{Www.Studentyogi.Com}Digital Ic Applications Jntu Model Paper{Www.Studentyogi.Com}
Digital Ic Applications Jntu Model Paper{Www.Studentyogi.Com}
 
D I G I T A L I C A P P L I C A T I O N S J N T U M O D E L P A P E R{Www
D I G I T A L  I C  A P P L I C A T I O N S  J N T U  M O D E L  P A P E R{WwwD I G I T A L  I C  A P P L I C A T I O N S  J N T U  M O D E L  P A P E R{Www
D I G I T A L I C A P P L I C A T I O N S J N T U M O D E L P A P E R{Www
 
Data structures question paper anna university
Data structures question paper anna universityData structures question paper anna university
Data structures question paper anna university
 

Mais de guestac67362

5 I N T R O D U C T I O N T O A E R O S P A C E T R A N S P O R T A T I O...
5  I N T R O D U C T I O N  T O  A E R O S P A C E  T R A N S P O R T A T I O...5  I N T R O D U C T I O N  T O  A E R O S P A C E  T R A N S P O R T A T I O...
5 I N T R O D U C T I O N T O A E R O S P A C E T R A N S P O R T A T I O...
guestac67362
 
4 G Paper Presentation
4 G  Paper  Presentation4 G  Paper  Presentation
4 G Paper Presentation
guestac67362
 

Mais de guestac67362 (20)

5 I N T R O D U C T I O N T O A E R O S P A C E T R A N S P O R T A T I O...
5  I N T R O D U C T I O N  T O  A E R O S P A C E  T R A N S P O R T A T I O...5  I N T R O D U C T I O N  T O  A E R O S P A C E  T R A N S P O R T A T I O...
5 I N T R O D U C T I O N T O A E R O S P A C E T R A N S P O R T A T I O...
 
4 G Paper Presentation
4 G  Paper  Presentation4 G  Paper  Presentation
4 G Paper Presentation
 
Bluetooth Technology Paper Presentation
Bluetooth Technology Paper PresentationBluetooth Technology Paper Presentation
Bluetooth Technology Paper Presentation
 
Ce052391 Environmental Studies Set1
Ce052391 Environmental Studies Set1Ce052391 Environmental Studies Set1
Ce052391 Environmental Studies Set1
 
Bluetooth Technology In Wireless Communications
Bluetooth Technology In Wireless CommunicationsBluetooth Technology In Wireless Communications
Bluetooth Technology In Wireless Communications
 
Bio Chip Paper Presentation
Bio Chip Paper PresentationBio Chip Paper Presentation
Bio Chip Paper Presentation
 
Bluetooth Paper Presentation
Bluetooth Paper PresentationBluetooth Paper Presentation
Bluetooth Paper Presentation
 
Bio Metrics Paper Presentation
Bio Metrics Paper PresentationBio Metrics Paper Presentation
Bio Metrics Paper Presentation
 
Bio Medical Instrumentation
Bio Medical InstrumentationBio Medical Instrumentation
Bio Medical Instrumentation
 
Bluetooth Abstract Paper Presentation
Bluetooth Abstract Paper PresentationBluetooth Abstract Paper Presentation
Bluetooth Abstract Paper Presentation
 
Basic Electronics Jntu Btech 2008
Basic Electronics Jntu Btech 2008Basic Electronics Jntu Btech 2008
Basic Electronics Jntu Btech 2008
 
Basic electronic devices and circuits
Basic electronic devices and circuitsBasic electronic devices and circuits
Basic electronic devices and circuits
 
Awp
AwpAwp
Awp
 
Automatic Speed Control System Paper Presentation
Automatic Speed Control System Paper PresentationAutomatic Speed Control System Paper Presentation
Automatic Speed Control System Paper Presentation
 
Artificial Intelligence Techniques In Power Systems Paper Presentation
Artificial Intelligence Techniques In Power Systems Paper PresentationArtificial Intelligence Techniques In Power Systems Paper Presentation
Artificial Intelligence Techniques In Power Systems Paper Presentation
 
Artificial Neural Networks
Artificial Neural NetworksArtificial Neural Networks
Artificial Neural Networks
 
Auto Configuring Artificial Neural Paper Presentation
Auto Configuring Artificial Neural Paper PresentationAuto Configuring Artificial Neural Paper Presentation
Auto Configuring Artificial Neural Paper Presentation
 
Artificial Neural Network Paper Presentation
Artificial Neural Network Paper PresentationArtificial Neural Network Paper Presentation
Artificial Neural Network Paper Presentation
 
A Paper Presentation On Artificial Intelligence And Global Risk Paper Present...
A Paper Presentation On Artificial Intelligence And Global Risk Paper Present...A Paper Presentation On Artificial Intelligence And Global Risk Paper Present...
A Paper Presentation On Artificial Intelligence And Global Risk Paper Present...
 
Applied Physics Jntu Btech 2008
Applied Physics Jntu Btech 2008Applied Physics Jntu Btech 2008
Applied Physics Jntu Btech 2008
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Automata And Compiler Design

  • 1. www.studentyogi.com www.studentyogi.com Code No: R05311201 Set No. 1 III B.Tech I Semester Regular Examinations, November 2007 AUTOMATA AND COMPILER DESIGN ( Common to Information Technology and Computer Science & Systems Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks 1. (a) What is Finite Automaton? Give an example. (b) Find the number of tokens presented in the following ‘FORTRAN’ statements: i. DO 100 I = 1.625 ii. IF ( MIN .EQ. MAX ) GOTO 1000 (c) Find the Regular Expression for the DFA as shown in gure 1c. [2+2+12] Figure 1c 2. (a) Construct a Context Free Grammar(CFG) for possible sequences of if and else in‘C’ (b) Find the moves of the above grammar to derive the if - else sequence of the string: iieie. [10+6] 3. Consider the following augmented grammar: S A A BA | B aB |b (a) Construct the LR(1) parser. (b) Find the moves made by the LR(1) parser on the input string: a a b b.[10+6] 4. (a) Compare Inherited attributes and Synthesized attributes with an example. (b) Construct triples of an expression: a * - (b + c). [8+8] 5. Explain Linear bounded automaton with an Example? [16] 6. (a) Write a notes on the static storage allocation strategy with example and dis- cuss its limitations?
  • 2. www.studentyogi.com www.studentyogi.com Code No: R05311201 Set No. 1 (b) Discuss about the stack allocation strategy of runtime environment with an example? [8+8] 7. Write explain about Organization for an Optimizing Compiler? [16] 8. Write di erences between single pass and two pass translation? [16]
  • 3. www.studentyogi.com www.studentyogi.com Code No: R05311201 Set No. 2 III B.Tech I Semester Regular Examinations, November 2007 AUTOMATA AND COMPILER DESIGN ( Common to Information Technology and Computer Science & Systems Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks 1. (a) De ne Alphabets, Strings, and Languages. Give two examples of each. (b) Consider the line number 4 of the following ‘C’ program: int main() /* Line 1 */ { /* Line 2 */ int i, n; /* Line 3 */ fro(i=0, i n, i++); /* Line 4 */ } /* Line 5 */ What is the compiler’s response about this line while creating the object mo d- ule? Explain. [9+7] 2. Write a Context Free Grammar(CFG) for the while statement in ‘C’ language. [16] 3. Consider the following augmented grammar: S E E E + T |T T a |(E) (a) Construct the DFA whose states are the canonical collection of LR(0) items. (b) Construct the SLR(1) parse table. [8+8] 4. (a) Construct triples of the expressions: a[i] := b and a := b[i] (b) Generate the three-address code for the following ‘C’ program fragment: for( i = 1; i = 20; i++) if( a b) x = y + z; [8+8] 5. (a) Write a short notes on context sensitive language with suitable example. (b) Write about Linear Bounded Automata. [8+8] 6. Write and Explain about Symbol Table Organization? [16] 7. Explain the following: (a) Dominators (b) Algorithm for Constructing the Natural Loops (c) Reducible Flow Graphs. [4 × 4] 8. Explain the concept of label tree for code generation. [16]
  • 4. www.studentyogi.com www.studentyogi.com Code No: R05311201 Set No. 3 III B.Tech I Semester Regular Examinations, November 2007 AUTOMATA AND COMPILER DESIGN ( Common to Information Technology and Computer Science & Systems Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks 1. (a) Design a DFA that accepts the language over the alphabet, S = {0, 1, 2} where the decimal equivalent of the language is divisible by 3. (b) Compare compiler and an interpreter with the help of suitable examples. [8+8] 2. (a) What is left factoring? Explain with a suitable example. (b) What is the language, L generated by the following grammar, G: G = ({S} {a b} {S aSb |ab } S) (c) Identify the language, L generated by the following grammar, G: G = ({S A B} {a b} {S Aa A a | B B bB | b } S). [6+5+5] 3. Construct the collection of non-empty sets of LR(0) items for the following aug- mented grammar: S E1 E1 T3E1 |T1 E2 T3E2 | T2 [16] T1 a$ |(E2$ T2 a) |(E2) T3 a+ |(E2+ 4. Translate the executable statements of the following ‘C’ program into a three- address code by assuming each element of an array ‘a’ takes 4 bytes. [16] void main() { int i = 1, a[10]; while(i++ = 10)a[i] = 0; } 5. (a) Distinguish static and dynamic Type checking? (b) Explain about on Polymorphic functions? [8+8] 6. Write and Explain about algorithm for construction of equivalence trees? [16] 7. (a) De ne the following: i. Basic Block ii. Local Optimization iii. Global Optimization.
  • 5. www.studentyogi.com www.studentyogi.com Code No: R05311201 Set No. 3 (b) Explain about Algebraic Transformations? (c) “Copy propagation Leads to Dead code” - Justify the statement. [6+6+4] 8. Write and explain an algorithm for building a DAG from a basic Blo ck . [16]
  • 6. www.studentyogi.com www.studentyogi.com Code No: R05311201 Set No. 4 III B.Tech I Semester Regular Examinations, November 2007 AUTOMATA AND COMPILER DESIGN ( Common to Information Technology and Computer Science & Systems Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks 1. (a) De ne Alphabets, Strings, and Languages. Give two examples of each. (b) Consider the line number 4 of the following ‘C’ program: int main() /* Line 1 */ { /* Line 2 */ int i, n; /* Line 3 */ fro(i=0, i n, i++); /* Line 4 */ } /* Line 5 */ What is the compiler’s response about this line while creating the object mo d- ule? Explain. [9+7] 2. Construct the predictive parse table for the following grammar: S iEtSS |a S eS | E b. [16] 3. Consider the grammar: S (S) |a Construct the DFA for SLR(1), CLR(1), and LALR(1) parsers and nd the number of states in each of the parser. [16] 4. Let synthesized attribute, Val give the value of the binary number generated by S in the following grammar. For example, on input 101.101, S.Val = 5.625. S L • L |L L LB |B B 0 |1 Write synthesized attribute values corresponding to each of the productions to determine the S.Val. [16] 5. (a) what is type Checker? How does it work? (b) Write short notes on Dynamic and Static type checking? [8+8] 6. Write and Explain about Runtime storage administration? [16] 7. (a) Explain Brie y about the Global Optimization? (b) Distinguish machine dependent and machine independent optimization.[8+8] 8. Explain all the data structures used for designing the macro pre-processor? [16]