Subject with Code KALASALINGAM UNIVERSITY ANAND NAGAR, KRISHNAN KOIL 626 126 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING ODD SEMESTER 2013-2014 Semester/Branch/Section Credits : 3 COURSE PLAN : Compiler Design / CSE304 : V / CSE / A, B Prerequisites Familiarity with programming languages Basic knowledge in Theory of Computation (CSE204) and Data Structures and Algorithms (CSE202). Course Goal Provide the foundation for understanding the theory and pracitce of compilers. Learn programming language translation and compiler design concepts; language recognition, symbol table management, semantic analysis and code generation. Course Objectives To understand the theory and practice of compiler implementation. To learn finite state machines and lexical scanning. To learn context free grammars, compiler parsing techniques, construction of abstract syntax trees, symbol tables, intermediate machine representations and actual code generation Learning Outcomes Implementing a small compiler using modern compiler writing tools. Providing the student with skills and knowledge (such as lexical analysis and parsing) which are applicable to a broad range of computer science application areas (such as text editors, information retrieval, etc...).
S. No Name of the Book Author / Publisher(s) / Year Companion Websites TEXTBOOK 1 Compilers principles, techniques and tools Alfred Aho, Ravi Sethi, V.Jeffery Ullman D/ Pearson Education/ 2006 http://dragonbook.stanford.edu/ 2 Compiler Design in C Allen Holub l/ Prentice Hall of India/ 2003. www.holub.com/software/compiler.design. in.c.docs.pdf REFERENCE BOOK(S) 3 4 5 6 Crafting a compiler with C Introduction to Compiler Techniques Practice and Principles of Compiler Building with C Compiler Construction: Principles and Practice Charles N.Fischer Richard J.Leblanc/Benjamin Cummings/ 2003. J.P. Bennet /Tata McGraw- Hill/ 2003. Henk Alblas and Albert Nymeyer/ PHI/2001. Kenneth C. Louden/ Thompson Learning/ 2003. http://163.21.82.150/compiler/ http://www.macs.hw.ac.uk/~gabbay/teachi ng/2007-f23pf2/index.html ------- http://www.aue.auc.dk/~akbar/2007/compl ierconst07.html Web links for similar courses offered at other universities S.No Course Title Name of the 1 Introduction to Compiler Design of Pittsburgh Web site http://www.cs.pitt.edu/undergrad/courses/cs1622.php 2 Compiler Design Kent State 3 Introduction to Cornell Compilers http://www.personal.kent.edu/%7ermuhamma/compil ers/compiler.html http://www.cs.cornell.edu/courses/cs412/2002sp/sched ule.html 4 Compiler Design and Construction I Write State http://www.cs.wright.edu/people/faculty/tkprasad/cours es/cs780/cs780.html 5 Topics in Compiler Rice http://www.owlnet.rice.edu/%7ecomp412/ Construction 6 Compilers Rutgers http://www.cs.rutgers.edu/%7eryder/415/lectures/ 7 Compilers Stanford http://www.stanford.edu/class/cs143/ 8 Compilers of Texas http://www.cs.utexas.edu/users/novak/cs375contents.html
Web Resources S.No Topic Name Website 1 Compiler Construction Tools http://www.linuxgazette.com/issue39/sevenich.html 2 Derivation and Parse tree http://www.softpanorama.org/algorithms/compilers.shtml 3 Parse tree, Lex, Yacc www.flint.cs.yale.edu 4 Context free grammar http://www.cs.nmsu.edu/~jeffery/courses/unlv/478/lecture.ht ml 5 LL(1) http://ag-kastens.uni-paderborn.de /lehre /material /compi /aufgaben/blatt3/blatt3.html 6 SLR,LALR,First and Follow www.pdclab.cs.ucdavis.edu 7 Parsing,LALR,LR(0),LR(1) http://www.cs.umd.edu/class/spr98/c msc430/slides 8 LR(0),LR(1),SLR,YACC,LEX www.cs.gmu.edu 9 Semantics, Grammar www.csee.umbc.edu 10 Predictive Parsing www.ambda.uta.edu 11 Recursive descent www.userpages.umbc.edu 12 Predictive parser www.cs.waikato.ac.nz 13 LR Parser www.cwi.nl/~jurgenv/publications/slides/cc2002.ppt 14 LR parser - LR(0) www.wikipedia.org 15 SLR www.idt.mdh.se/kurser/cd5110/ht01/t1_02 s.html 16 Intermediate Languages www.hardcoreprocessing.com/articles/presentations/ tiliaoc /TheDocument.html 17 Flow Control Stmts www.met.ed.ac.uk/~hcp/wrk/idlcourse/notes/node16.html 18 Symbol Table www.isr.uci.edu/projects/archstudio/symboltable.html 19 Procedure Calls www.sei.cmu.edu/str/descriptions/rpc.html 20 Syntax Directed translation www.dcs.warwick.ac.uk 21 Syntax Directed translation websrv.cs.fsu.edu 22 Code Optimization www.uni-koeln.de 23 Code Generation cs.wwc.edu
Lesson Plan S.No Topic Name Reference Book No. of Periods Cumulative No. of Periods UNIT I INTRODUCTION TO COMPILER 1. Introduction to compiler-the structure of compiler T1(4-12) 2 2 2. Lexical analysis-the Role of Lexical analyzer T1(109-114) 1 3 3. Input Buffering T1(115-116) 1 4 4. Specification of tokens T1(116-128) 2 6 5. Recognition of tokens T1(128-140) 2 8 6. Lexical analyzer generator T1(140-146) 1 9 UNIT II : LEXICAL ANALYSIS 7. Finite Automata T1(147-152) 1 10 8. Regular expressions to an NFA T1(152-166) 2 12 9. Optimization of DFA T1(173-187) 2 14 10. The Role of parser T1(192-196) 1 15 11. Context free grammars T1(197-208) 1 16 12. Writing a Grammar T1(209-216) 1 17 13. Top Down parsing -Recursive Descent T1(217 220) Parsing 1 18 14. Predictive parsing T1(226-228) 1 19 15. Bottom up parsing-shift reduce parsing T1(233-238) 1 20 16. Operator Precedence parsing Course material 1 21 UNIT III SYNTAX ANALYSIS 17. Introduction to LR parsing & SLR parser T1(241-256) 2 23 18. Canonical LR parser and LALR parser generator T1(259-275) 2 25 19. Intermediate languages T1(363-369) 1 26 20. Declarations,control flow and Boolean T1(373) expressions T1(399-408) 2 28 21. Switch statements T1(418-420) 1 29 22. Back patching T1(410-416) 1 30 UNIT IV CODE GENERATION 23. Issues in the design of code generator T1(506-511) 1 31 24. The target Language T1(512-515) 1 32 25. Addresses in target code T1(518-522) 1 33 26. Basic Blocks and Flow Graphs T1(525-531) 1 34 27. A simple Code generator T1(542-547) 1 35 28. DAG representation of Basic Blocks T1(533 540) 1 36
UNIT V CODE OPTIMIZATION AND RUN TIME ENVIRONMENTS 29. Introduction Principal Sources of Optimization T1(584 596) 2 38 30. Peephole optimization T1(549-552) 1 39 31. Optimization of basic Blocks T1(533 540) 1 40 32. Loops in Flow Graphs T1(655-667) 2 42 33. Run time environments-storage T1(427-429) organization 1 43 34 Stack allocation of space T1(430-438) 2 45 35. Access to non local data on the stack T1(441-449) 2 47 Sessional Exam Portions S. No Exam Topic No 1 Sessional I 1-23 2 Sessional - II 24-33 3 End Exam 1-39 Related Magazine: o Software o IT Professional o IEEE Links to research journals and conference proceedings ACM Transactions on Programming Languages and Systems http://www.cs.wustl.edu/~toplas/ ACM SIGPLAN sponsored conferences http://www.acm.org/sigplan/#conferences Upcoming Compiler and Parallel Computing Conferences http://www.cs.rice.edu/~roth/conferences.html Prepared By Verified By Class Teacher HOD/CSE