SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTER SCIENCE AND ENGINEERING COURSE PLAN Course Code : CS1014 Semester: VI Course Title : System Software and Compiler Design Course Time: Feb-May 2016 SECTION DAY ORDER PERIOD TIMINGS 1 6 1.25 pm 2.15 pm Group - I 3 5 11.35 am- 12.25 pm 4 7 2.20 pm-3.10 pm 1 6 1.25 pm 2.15 pm Group - II 3 9 4.05 pm-4.55 pm 4 3 9.45 am-10.35 am Location : Faculty Details Gro up II I Name OFFICE OFFICE HOURS Mail id T. Senthil Kumar K. Sathyapriya Dorathi Jayaseeli R. Jeya R. Vidhya K. Deeba A.L. Amutha Dr. R. Annie Uthra K.Senthilkumar C. Jothi Kumar Sravan Yadav Kanmani Sivagar senthilkumar.g@ktr.srmuniv.ac.in sathyapriya.k@ktr.srmuniv.ac.in dorathijayaseeli.jd@ktr.srmuniv.ac.in jeya.r@ktr.srmuniv.ac.in vidhya.r@ktr.srmuniv.ac.in deeba.k@ktr.srmuniv.ac.in amutha.al@ktr.srmuniv.ac.in annie.u@ktr.srmuniv.ac.in senthilkumar.k@ktr.srmuniv.ac.in jothikumar.c@ktr.srmuniv.ac.in sravanyadav.n@ktr.srmuniv.ac.in kanmani.s@ktr.srmuniv.ac.in
Text Books: 1. Alfred V. Aho, Ravi Sethi & Jeffrey. D. Ullman, Compilers Principles, Techniques & Tools,Pearson Education, third edition, 2007. 2. D.M.Dhamdhere, "System Programming and Operating Systems", 2nd Edition., Tata Mcgraw Hill,1995 Web resources http://lambda.uta.edu/cse5317/notes/notes.html www.cs.bilkent.edu.tr/~ilyas/courses/cs416/ Objectives 1. To study the features and design aspects of assemblers, Macro, loaders and linkers 2. To learn the design principles of a Compiler 3. To learn the various parsing techniques and different levels of translation 4. To learn how to optimize and effectively generate machine codes Assessment Details Cycle I Surprise I Cycle II Attendance Model Exam : 10 Marks : 5 Marks : 10 Marks : 5 Marks : 20 Marks Schedule S.No. DATE TEST TOPICS DURATION 1 Cycle - I Unit III & IV 2 periods 2 Cycle - II Unit IV 2 periods 3 Model Exam All 5 units 3 Hrs Outcomes Students who have successfully completed this course will have full understanding of the following concepts Course outcome To learn * The various system software concepts and tools * The design aspects of a typical Compiler * To develop a comprehensive compiler for a given language Program outcome An ability to understand the basic functioning of various system software To analyze and be able to design a compiler To implement various parsing, conversion, optimization and generation algorithms for the design of a compiler
Detailed Session Plan UNIT III - COMPILERS : GRAMMARS & AUTOMATA (8 Hours) Languages Grammars Types of grammars Context free grammar - regular expression - Recognizing of patterns - finite automation (deterministic & non deterministic) Conversion of NDFA to DFA - Conversion of regular expression of NDFA Thompson s construction- minimization of NDFA - Derivation - parse tree - ambiguity Lexical analysis- handles - token specification - design of lexical analysis (LEX) - Automatic generation of lexical analyzer - input buffering - A language for specifying lexical analyzers - implementation of lexical analyzer. Introduction to Compiling, Phases of Discussion 1 Compiler Grammers and Languages, Types of Illustration by examples 2 grammars regular expression - Recognizing of Illustration by examples 3 patterns Finite State Automata, DFA,NDFA, 4 Thompson s construction minimization of NDFA, Conversion of 5 NDFA to DFA Derivation, parse tree, ambiguity, Lexical 6 analysis, handles, token specification 7 Design of lexical analysis (LEX) 8 Automatic generation of lexical analyzer, input buffering, A language for specifying lexical analyzers, implementation of lexical analyzer 9 Problem solving, surprise test UNIT IV - SYNTAX ANALYSIS PARSING (11 Hours) Definition - role of parsers - top down parsing - bottom-up parsing - Left recursion - left factoring - Handle pruning, Shift reduce parsing - operator precedence parsing FIRST- FOLLOW- LEADING- TRAILING- Predictive parsing - recursive descent parsing. LR parsing LR (0) items - SLR parsing Canonical LR - LALR parsing - generation of LALR - Ambiguous grammars - error recovery Introduction to Parsing, Top down and Bottom up 10 11 Problems in Top down parsing: Left Recursion, Left factoring Handle pruning, Shift Reduce Parsing 12 LEADING and TRAILING procedure, Surprise 13 Operator Precedence Parsing, Precedence Matrix and Precedence functions 14 FIRST and FOLLOW procedures 15 16 17 Predictive parsing, Parsing table construction Simple LR Parsing, LR(0) items, parsing table generation
18 Canonical LR, LookAhead LR parsing, 19 Ambiguous grammars - error recovery UNIT V - SYNTAX DIRECTED TRANSLATION & CODE OPTIMIZATION (12Hours) Intermediate Languages - prefix - postfix - Quadruple - triple - indirect triples syntax tree- Evaluation of expression - three-address code- Synthesized attributes Inherited attributes Conversion of statements- Boolean expressions Backpatching - Declaration - CASE statements CODE OPTIMIZATION: Local optimization- Loop Optimization techniques DAG Dominators- Flow graphs Storage allocations- Peephole optimization Issues in Code Generation. Intermediate Languages: prefix, postfix, 20 21 22 23 24 25 26 27 28 29 30 31 Quadruple, triple, indirect triples syntax tree, Evaluation of expression, three-address code Syntax-directed translation: Syntaxdirected definitions, synthesized and inherited attributes Translation of assignment statements Translation of Boolean expressions, Backpatching Translation of Declaration, procedure calls Translation of CASE statements Loop optimization Frequency reduction, Strength reduction, index variable elimination DAG, Dominators, Flow graphs Storage allocations peephole optimization Issues in Code Generation,, UNIT I - ASSEMBLERS & MACROS (7 Hours) Overview of Language processors Assemblers: Design of two pass assemblers - single pass assemblers MACRO: Macro definition- macro call macro expansion- nested macro advanced macro facilities- Design of Macroprocessor. 32 Overview of Language processors 33 Assemblers, overview of assembly process, Mnemonic codes 34 Design of two pass assembler 35 Single pass assembler 36 Macro, Definition, expansion, usage 37 Nested macro advanced macro facilities Macro Processor Design, Examples of 38 Macros
UNIT II - LINKERS & LOADERS (7 Hours) Relocation and linking concepts Design of linker self relocating programs linking in MS-DOS overlays DYNAMIC LINKING : Loaders Absolute loaders- relocating loaders Sessi on No. Topics to be covered Time (min) Ref Teaching Method ing Method Relocation and linking concepts 39 40 Design of linker / practical 41 self relocating programs / practical 42 linking in MS-DOS overlays 43 Loaders / practical Absolute loaders, 44 45 relocating loaders, Signature of Faculty Member Head of the Department