Você está na página 1de 21

Department of Information Technology

Automata and Compiler Design III B Tech I Semester [Branch: IT] (2007-08)

M.Srikanth Yadav
Assistant Professor

Guru Nanak Engineering College


Ibrahimpatnam, R R District 501 506 (A. P.)

Results Target
Total Strength of the Class: 61 S. No a. b. c. Class / Division First Class with Distinction First Class Pass Class No. of Students 25 25 11

Course Plan
S. No a. b. c. d. e. f. Plan Class Lectures Design Issues Presentations Demonstration Models / Mini Projects Guest Lectures 65 Lectures Grammars Brief Description

Method of Evaluation
a. b. c. d. Internal Examination Assignments Descriptive Exam Final Examination 4 4 2 1

Page: 2

Course Objective
Automata and compiler design is one of the core computer subject, which will provide the information related to the compilers and their design. It will cover the type of grammars and set of designing principles for designing a compiler. Parsing techniques like Top-down and bottom-up approaches. It explains all phases in the designing of a compiler and also explains each and every phase with suitable example, which will give a better idea for the students. And also explains different mechanisms for designing of each and every phase of the compiler.

Guidelines to Students
To implement the parser and compiler concepts we should know all the related fields of compiler and all phases of compiler like lexical analysis, syntax analysis. Types of parsers and grammars and their implementation mechanisms are important in designing of compiler

Page: 3

JNTU Syllabus
Subject: Automata and Complier design

AUTOMATA AND COMPILER DESIGN SYLLABUS


UNIT-1 UNIT-2 UNIT-3 UNIT-4 UNIT-5 UNIT-6 UNIT-7 UNIT-8 Formal Language and Regular Expressions: Languages, Definition Languages regular expressions, Finite Automata DFA, NFA. Conversion of regular expression to NFA, NFA to DFA. Applications of Finite Automata to lexical analysis, lex tools. Context Free grammars and parsing : Context free grammars, derivation, parse trees, ambiguity LL(K) grammars and LL(1) parsing Bottom up parsing handle pruning LR Grammar Parsing, LALR parsing, parsing ambiguous grammars, YACC programming specification. Semantics: Syntax directed translation, S-attributed and L-attributed grammars, Intermediate code abstract syntax tree, translation of simple statements and control flow statements. Context Sensitive features Chomsky hierarchy of languages and recognizers. Type checking, type conversions, equivalence of type expressions, overloading of functions and operations. Run time storage: Storage organization, storage allocation strategies scope access to now local names, parameters, language facilities for dynamics storage allocation. Code optimization: Principal sources of optimization, optimization of basic blocks, peephole optimization, flow graphs, Data flow analysis of flow graphs. Code generation: Machine dependent code generation, object code forms, generic code generation algorithm, Register allocation and assignment. Using DAG representation of Block

Books / Material/ Course Schedule


Text Books (to be acquired by the Students) Book 1 Book 2
Introduction to Theory of computation.Sipser,2nd Edition, Thomson Compilers Principles, Techniques and Tools Aho, Ullman, Ravisethi, Pearson Education

Reference Books Book 3 Book 4 Unit I II III IV V VI VII VIII


Modern Compiler Construction in C, Andrew W.Appel Cambridge University Press. Compiler Construction, LOUDEN, Thomson

Topic
Formal Language and Regular Expressions : Context Free grammars and parsing : Bottom up parsing handle: Semantics : Context Sensitive features: Run time storage: Code optimization : Code generation :

Date From To

No of Classes 8 9 8 8 8 7 8 9 05 07 03 05 85

Classes for above curriculum topics Tutorial classes Descriptive tests Unit tests Total Classes

Page: 4

Topic wise Coverage

Unit 1 H.No 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. Date Topic Languages, Strings Alphabets operations on Languages and strings Regular expressions Finite Automata DFA, NFA. Conversion of regular expression to NFA, NFA to DFA. Applications of Finite Automata to lexical analysis, lex tools Unit- 2 Context free grammars derivation, parse trees, ambiguity in derivation trees LL(K) grammars and LL(1) parsing Recursive parser predictive parser Non recursive predictive parser Unit 3 Bottom up parsing handle pruning LR Grammar Parsing, SLR Parsing CLR Parsing LALR parsing, parsing ambiguous grammars, YACC programming specification Unit-4 Syntax directed translation, . S-attributed and L-attributed grammars, Intermediate code Types of Intermediate code abstract syntax tree, translation of simple statements and Control flow statements Unit-5 Page: 5 [Book 2]

34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. Unit-7 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65.

Context Sensitive features Chomsky hierarchy of languages and Recognizers. Type checking, type conversions, equivalence of type expressions, Overloading of functions and Operations Unit-6 Storage organization, Storage types storage allocation strategies scope access to now local names, parameters, Language facilities for dynamics storage allocation Types of optimization, Principal sources of optimization, Optimization of basic blocks, peephole optimization, flow graphs, Data flow graphs Representation of DFD Analysis of flow graphs Unit 8 Machine dependent code generation, Modes of Generation object code forms, generic code generation algorithm, Types Algorithms Register allocation and assignment. Using DAG representation of Block Properties of DAG Implementation of DAG

Page: 6

Actual Date of Unit Completion & Remarks

Unit 1 Date : __ / __ / __

Remarks: ________________________________________________________________________ ________________________________________________________________________

Unit 2 Date Remarks: ________________________________________________________________________ ________________________________________________________________________ : __ / __ / __

Unit 3 Date Remarks: ________________________________________________________________________ ________________________________________________________________________ : __ / __ / __

Unit 4 Date Remarks: ________________________________________________________________________ ________________________________________________________________________ : __ / __ / __

Page: 7

Unit 8 Unit 5 D at e Date : __ / __ / __ Remarks: ________________________________________________________________________ : __ / __ / __

Remarks:

________________________________________________________________________ ________________________________ ________________________________ ________ ________________________________ ________________________________ ________

Unit 6 D at e

: __ / __ / __

__ / __ / ____

Remarks: ________________________________ ________________________________ ________ ________________________________ ________________________________ ________ Unit 7 D at e

: __ / __ / __

Remarks: ________________________________ ________________________________ ________ ________________________________ ________________________________ ________

Page: 8

Assignments
Automata and Compiler Design Home Assignment Week 1 a) List the basic functions of a language translator. b) Bring out the difference between compiler and interpreter. c) What is bootstrapping? Explain it with example. a) Giving neat diagram explain all the phases of the compilation with example. b) What is the difference between pass and a phase? Week 2 a) Explain the need for look a head operator. b) Write a procedure for minimizing number of states of a DFA, & explain with one example. Write Short Notes on 1) LEX 2) Regular expression 3) FSM Explain a protocol using selective repeat Week 3 What is lexical analysis? Give reasons for separating lexical analysis from syntax analysis. a) What is left recursive grammar? How to eliminate it? b) Explain left factoring a grammar with example. Week 4 Rewrite the following grammar for if else statement eliminating ambiguity. smt if expr then stmt | if expr then stmt else stmt | others where stmt , expr are non terminals and others are terminals Exercises 4.1 & 4.2 from Book 1(Text book). Week 5 Giving algorithm explain non recursive predictive parsing with example. Prove that the given grammar is not LL (1). S iEtSS/ a , S eS / , Eb Give the algorithm for finding FIRST and FOLLOW for given CFG. What is recursive descent parser? Write recursive descent Parser for the following grammar? E TE' , E' TE' /t , T FT ' , T ' *FT ' /t , F (E)/id Week 6 a) Explain briefly, precedence functions. Construct the precedence graph using the following precedence table + * ( ) Id $ f 2 3 0 4 4 g 1 3 5 0 4 b) Explain the construction of LALR parser table for given grammar with example Explain in detail Transport Bridges and source routing bridges Week 7 Write short notes on Dependency graph & DAG. Illustrate the difference between Synthesized attributes & inherited attributes. Week 8 a) What is type checker? Write translation schemes for type checking expressions. b) Give the specification for simple type checker. Page: 9

1 2

3 4 5 6 7

8 9

10 11 12 13

14

15 16. 17. 18

19 2 2 1

22

23

24

25. 26

Discuss type conversion & type coercion with example. Week 9 What is meant by Structural Equivalence of type expressions? Write a function which will test the structural equivalence of two type expressions. Explain in brief the polymorphic functions. Write the translation scheme for checking polymorphic Functions. Week 10 a) Explain about quadruples, triples and indirect triples of a three-address statement of Intermediate code. b) Give a translator grammar for converting a Boolean expression into three address code. Apply the translation scheme on the following expression acb or ccd and e<f. Discuss and analyze about all the allocation strategies in run-time storage environment a) Explain the heap allocation strategy for storage allocation. b) Explain the need for symbol table. List and discuss all the data structures used for Implementing symbol tables. Week 11 Discuss the issues in the design of Code Generator. Write code generation algorithm and explain it by taking suitable example Explain all code optimization techniques. Illustrate the with suitable examples Week 12 a) Explain the peephole optimization technique in detail. b) Explain the strength reduction loop optimization technique in detail. Explain Global flow analysis methods. Week 13 a) What are the various machine dependent code optimization techniques? b) Explain the assembler directives in detail with examples. Week 14 What is two pass assembler? Write algorithms for pass 1 and pass 2 assembler . Discuss Briefly, different tables used by pass 1 and pass 2 assembler . Week 15 What is a micro processor? Write the algorithms for different phases of macro processor. Explain them briefly?

27 28

29

30 31

32

Page: 10

Tutorial

[as many planned per unit]

Unit 1 1. 2. Unit 2 1. 2. Unit 3 1. 2. Unit 4 1. 2. Unit 5 1. 2. Unit 6 1. 2. Unit 7 1. 2. Unit 8 1. 2.

Page: 11

Assignment Valuation Sheet Subject: ACD


Date RollNo Name 1

Faculty Name: M.Srikanth Yadav


2 3 4 5

05B91A1201 05B91A1202 05B91A1203 05B91A1204 05B91A1205 05B91A1206 05B91A1207 05B91A1208 05B91A1209 05B91A1212 05B91A1213 05B91A1214 05B91A1215 05B91A1216 05B91A1217 05B91A1218 05B91A1219 05B91A1220 05B91A1221 05B91A1222 05B91A1223 05B91A1224 05B91A1225 05B91A1226 05B91A1227 05B91A1228 05B91A1229 05B91A1230

A NEEHARIKA A MOHNISH VARDHAN GOWD A PRIYANKA AJAY KUMAR SHINDE ANUJ KUMAR TALUKA B HARISH CHANDER B SRAVAN KUMAR BEENAKAUR S BEERAM UDAYBHASKER REDDY CHALLA USHA D R RAMASWAPNA DIVYA C ESHWAR CHAND ASAWA G MANOGNYA G NIKHIL KUMAR J BINDU REDDY JYOTHI SHARMA K ANUSHA REDDY K ARUN KUMAR K SAURABH K SWETHA SREE KARTHIK KOTA KUNJA VINAY SAGAR DORA M.MONIKA JAIN MADHUKAR P MADHURI PRIYANKA PAYASAM MANI DEEPTHI VALLURU NALABOLU KARTHEEK REDDY

Page: 12

05B91A1231 05B91A1232 05B91A1233 05B91A1235 05B91A1236 05B91A1237 05B91A1238 05B91A1239 05B91A1240 05B91A1241 05B91A1242 05B91A1243 05B91A1244 05B91A1245 05B91A1246 05B91A1247 05B91A1248 05B91A1249 05B91A1250 05B91A1251 05B91A1252 05B91A1253 05B91A1254 05B91A1255 05B91A1256 05B91A1257 05B91A1258 05B91A1259 05B91A1260 03B91A1203 06B95A1201 06B95A1203 06B95A1205

NIMIT PERSHAD P ABHIRAM REDDY PATEL DHARMESH L PRASHANTH DIDDY PRITIKA PEDDI R ARVIND REDDY RADHIKA P ROHAN DHIREN DOSHI ROHAN SRIHARSHA PATNAIK B S HARINI S MEGHANA REDDY SAI MAHESHWAR RAO T N SAI SHANKAR R SAIKIRAN N SANBIR SINGH SRINATH REDDY K SURESH KUMAR K T RAJA RAM T RAM SWAROOP SINGH T SPANDANA TEJASIMHAREDDY KOLLI TRINA MARY JOSE V RAJA RAO V SAI SAILESH V V L S VIDYA VEEREN V SHRIKHANDE VEMPATI SANTOSH KUMAR VIKEN KUMAR M JAIN ZETENDRA LINGAMGUNTA A P SAI KIRAN KRISHNA SUMANTH GURRAM S SANTOSH KUMAR P. SRIDEVI

Page: 13

Attendance as per Internal


Date Roll No Name 1 2 3 4 5

05B91A1201 05B91A1202 05B91A1203 05B91A1204 05B91A1205 05B91A1206 05B91A1207 05B91A1208 05B91A1209 05B91A1212 05B91A1213 05B91A1214 05B91A1215 05B91A1216 05B91A1217 05B91A1218 05B91A1219 05B91A1220 05B91A1221 05B91A1222 05B91A1223 05B91A1224 05B91A1225 05B91A1226 05B91A1227 05B91A1228 05B91A1229 05B91A1230 05B91A1231 05B91A1232

A NEEHARIKA A MOHNISH VARDHAN GOWD A PRIYANKA AJAY KUMAR SHINDE ANUJ KUMAR TALUKA B HARISH CHANDER B SRAVAN KUMAR BEENAKAUR S BEERAM UDAYBHASKER REDDY CHALLA USHA D R RAMASWAPNA DIVYA C ESHWAR CHAND ASAWA G MANOGNYA G NIKHIL KUMAR J BINDU REDDY JYOTHI SHARMA K ANUSHA REDDY K ARUN KUMAR K SAURABH K SWETHA SREE KARTHIK KOTA KUNJA VINAY SAGAR DORA M.MONIKA JAIN MADHUKAR P MADHURI PRIYANKA PAYASAM MANI DEEPTHI VALLURU NALABOLU KARTHEEK REDDY NIMIT PERSHAD P ABHIRAM REDDY

Page: 14

05B91A1233 05B91A1235 05B91A1236 05B91A1237 05B91A1238 05B91A1239 05B91A1240 05B91A1241 05B91A1242 05B91A1243 05B91A1244 05B91A1245 05B91A1246 05B91A1247 05B91A1248 05B91A1249 05B91A1250 05B91A1251 05B91A1252 05B91A1253 05B91A1254 05B91A1255 05B91A1256 05B91A1257 05B91A1258 05B91A1259 05B91A1260 03B91A1203 06B95A1201 06B95A1203 06B95A1205

PATEL DHARMESH L PRASHANTH DIDDY PRITIKA PEDDI R ARVIND REDDY RADHIKA P ROHAN DHIREN DOSHI ROHAN SRIHARSHA PATNAIK B S HARINI S MEGHANA REDDY SAI MAHESHWAR RAO T N SAI SHANKAR R SAIKIRAN N SANBIR SINGH SRINATH REDDY K SURESH KUMAR K T RAJA RAM T RAM SWAROOP SINGH T SPANDANA TEJASIMHAREDDY KOLLI TRINA MARY JOSE V RAJA RAO V SAI SAILESH V V L S VIDYA VEEREN V SHRIKHANDE VEMPATI SANTOSH KUMAR VIKEN KUMAR M JAIN ZETENDRA LINGAMGUNTA A P SAI KIRAN KRISHNA SUMANTH GURRAM S SANTOSH KUMAR P. SRIDEVI

Page: 15

Marks for Internal Theory Examination


Date Roll No Name 1 2 3 4 5

05B91A1201 05B91A1202 05B91A1203 05B91A1204 05B91A1205 05B91A1206 05B91A1207 05B91A1208 05B91A1209 05B91A1212 05B91A1213 05B91A1214 05B91A1215 05B91A1216 05B91A1217 05B91A1218 05B91A1219 05B91A1220 05B91A1221 05B91A1222 05B91A1223 05B91A1224 05B91A1225 05B91A1226 05B91A1227 05B91A1228 05B91A1229 05B91A1230 05B91A1231 05B91A1232 05B91A1233

A NEEHARIKA A MOHNISH VARDHAN GOWD A PRIYANKA AJAY KUMAR SHINDE ANUJ KUMAR TALUKA B HARISH CHANDER B SRAVAN KUMAR BEENAKAUR S BEERAM UDAYBHASKER REDDY CHALLA USHA D R RAMASWAPNA DIVYA C ESHWAR CHAND ASAWA G MANOGNYA G NIKHIL KUMAR J BINDU REDDY JYOTHI SHARMA K ANUSHA REDDY K ARUN KUMAR K SAURABH K SWETHA SREE KARTHIK KOTA KUNJA VINAY SAGAR DORA M.MONIKA JAIN MADHUKAR P MADHURI PRIYANKA PAYASAM MANI DEEPTHI VALLURU NALABOLU KARTHEEK REDDY NIMIT PERSHAD P ABHIRAM REDDY PATEL DHARMESH L

Page: 16

05B91A1235 05B91A1236 05B91A1237 05B91A1238 05B91A1239 05B91A1240 05B91A1241 05B91A1242 05B91A1243 05B91A1244 05B91A1245 05B91A1246 05B91A1247 05B91A1248 05B91A1249 05B91A1250 05B91A1251 05B91A1252 05B91A1253 05B91A1254 05B91A1255 05B91A1256 05B91A1257 05B91A1258 05B91A1259 05B91A1260 03B91A1203 06B95A1201 06B95A1203 06B95A1205

PRASHANTH DIDDY PRITIKA PEDDI R ARVIND REDDY RADHIKA P ROHAN DHIREN DOSHI ROHAN SRIHARSHA PATNAIK B S HARINI S MEGHANA REDDY SAI MAHESHWAR RAO T N SAI SHANKAR R SAIKIRAN N SANBIR SINGH SRINATH REDDY K SURESH KUMAR K T RAJA RAM T RAM SWAROOP SINGH T SPANDANA TEJASIMHAREDDY KOLLI TRINA MARY JOSE V RAJA RAO V SAI SAILESH V V L S VIDYA VEEREN V SHRIKHANDE VEMPATI SANTOSH KUMAR VIKEN KUMAR M JAIN ZETENDRA LINGAMGUNTA A P SAI KIRAN KRISHNA SUMANTH GURRAM S SANTOSH KUMAR P. SRIDEVI

Page: 17

Marks for Descriptive Examination


Date Roll No Name 1 1 2 3 1 2 2 3 1 3 2 3 1 4 2 3 1 5 2 3

05B91A1201 05B91A1202 05B91A1203 05B91A1204 05B91A1205 05B91A1206 05B91A1207 05B91A1208 05B91A1209 05B91A1212 05B91A1213 05B91A1214 05B91A1215 05B91A1216 05B91A1217 05B91A1218 05B91A1219 05B91A1220 05B91A1221 05B91A1222 05B91A1223 05B91A1224 05B91A1225 05B91A1226 05B91A1227 05B91A1228 05B91A1229 05B91A1230 05B91A1231 05B91A1232 05B91A1233 05B91A1235

A NEEHARIKA A MOHNISH VARDHAN GOWD A PRIYANKA AJAY KUMAR SHINDE ANUJ KUMAR TALUKA B HARISH CHANDER B SRAVAN KUMAR BEENAKAUR S BEERAM UDAYBHASKER REDDY CHALLA USHA D R RAMASWAPNA DIVYA C ESHWAR CHAND ASAWA G MANOGNYA G NIKHIL KUMAR J BINDU REDDY JYOTHI SHARMA K ANUSHA REDDY K ARUN KUMAR K SAURABH K SWETHA SREE KARTHIK KOTA KUNJA VINAY SAGAR DORA M.MONIKA JAIN MADHUKAR P MADHURI PRIYANKA PAYASAM MANI DEEPTHI VALLURU NALABOLU KARTHEEK REDDY NIMIT PERSHAD P ABHIRAM REDDY PATEL DHARMESH L PRASHANTH DIDDY

Page: 18

05B91A1236 05B91A1237 05B91A1238 05B91A1239 05B91A1240 05B91A1241 05B91A1242 05B91A1243 05B91A1244 05B91A1245 05B91A1246 05B91A1247 05B91A1248 05B91A1249 05B91A1250 05B91A1251 05B91A1252 05B91A1253 05B91A1254 05B91A1255 05B91A1256 05B91A1257 05B91A1258 05B91A1259 05B91A1260 03B91A1203 06B95A1201 06B95A1203 06B95A1205

PRITIKA PEDDI R ARVIND REDDY RADHIKA P ROHAN DHIREN DOSHI ROHAN SRIHARSHA PATNAIK B S HARINI S MEGHANA REDDY SAI MAHESHWAR RAO T N SAI SHANKAR R SAIKIRAN N SANBIR SINGH SRINATH REDDY K SURESH KUMAR K T RAJA RAM T RAM SWAROOP SINGH T SPANDANA TEJASIMHAREDDY KOLLI TRINA MARY JOSE V RAJA RAO V SAI SAILESH V V L S VIDYA VEEREN V SHRIKHANDE VEMPATI SANTOSH KUMAR VIKEN KUMAR M JAIN ZETENDRA LINGAMGUNTA A P SAI KIRAN KRISHNA SUMANTH GURRAM S SANTOSH KUMAR P. SRIDEVI

Lesson Plan

[as many sheets as number of lectures planned]

Page: 19

Date Time / Hour

: :

__ / __ / ____

On completion of this lecture the student shall be able to

Teaching Aids

Teaching Points

Annexure to Lesson Plan


Page: 20

Page: 21

Você também pode gostar