You are on page 1of 255
QUANTUM Series « Topic-wise coverage of entire syllabus in Question-Answer form. + Short Questions (2 Marks) 2015-16 * 2016-17 » 2017-18 + 2018 QUANTUM SERIES For B.Tech Students of Third Year of All Engineering Colleges Affiliated to Dr. A.P.J. Abdul Kalam Technical University, Uttar Pradesh, Lucknow (Formerly Uttar Pradesh Technical University) Compiler Design By Nupur Tripathi ™ ZS uantum Sugntum QUANTUM PAGE PVT. LTD. Ghaziabad m New Delhi PUBLISHED BY: Phone : 0120- 4160479 Email: pagequantum@ gmail.com Website: www.quantumpage.co.in Delhi Office : 1/6590, East Rohtas Nagar, Shahdara, Delhi-110032 Apram Singh Quantum Publications® (A Unit of Quantum Page Pvt. Ltd.) Plot No. 59/2/7, Site - 4, Industrial Area, Sahibabad, Ghaziabad-201 010 © Att Ricnts Reserved Nes joer of thin pubhection’ soy ba veprachll 0 wansimitted, in any form or by any means, without permission. Information contained in this work is derived from sources believed to be reliable. Every effort has been made to ensure accuracy, however neither the publisher nor the authors guarantee the accuracy or completeness of any information published herein, and neither the publisher nor the authors shall be responsible for any errors, omissions, or damages arising out of use of this information. Compiler Design (CS/IT : Sem-5) 4st gth Edition : Edition : Edition Edition : Edition : Edition : Edition : Edition : Edition : 10 Edition : 2019-20 2010-11 2011-12 2012-13 2013-14 2014-15 2015-16 2016-17 2017-18 2018-19 11" Edition : 2020-21 (Thoroughly Revised Edition) Price: Rs. 80/- only Printed Version : e-Book. UNIT-1 : INTRODUCTION TO COMPILER (1-1 C to 1-31 C) Phases and passes, Bootstrapping, Finite state machines and regular expressions and their applications to lexical analysis, Optimization of DEA-Based Pattern Matchers implementation of lexical analyzers, lexical-analyzer generator, LEX compiler, Formal grammars and their application to syntax analysis, BNF notation, ambiguity, YACC. The syntactic specification of programming languages: Context free grammars, derivation and parse trees, capabilities of CFG. UNIT-2 : BASIC PARSING TECHNIQUES (2-1 C to 2-38 C) Parsers, Shift reduce parsing, operator precedence parsing, top down parsing, predictive parsers Automatic Construction of efficient Parsers: LR parsers, the canonical Collection of LR(0) items, constructing SLR parsing tables, constructing Canonical LR parsing tables, Constructing LALR parsing tables, using ambiguous grammars, an automatic parser generator, implementation of LR parsing tables. UNIT-3 : SYNTAX-DIRECTED TRANSLATION (3-1 Cto3-27 C) Syntax-directed Translation schemes, Implementation of Syntax- directed Translators, Intermediate code, postfix notation, Parse trees & syntax trees, three address code, quadruple & triples, translation of assignment statements, Boolean expressions, statements that alter the flow of control, postfix translation, translation with a top down parser. More about translation: Array references in arithmetic expressions, procedures call, declarations and case statements. UNIT-4 : SYMBOL TABLES (4-1 Cto 4-22 C) Data structure for symbols tables, representing scope information. Run-Time Administration: Implementation of simple stack allocation scheme, storage allocation in block structured language. Error Detection & Recovery: Lexical Phase errors, syntactic phase errors semantic errors. UNIT-5 : CODE GENERATION (5-1 C to 5-26 C) Design Issues, the Target Language. Addresses in the Target Code, Basic Blocks and Flow Graphs, Optimization of Basic Blocks, Code Generator. Code optimization: Machine-Independent Optimizations, Loop optimization, DAG representation of basic blocks, value numbers and algebraic laws, Global Data-Flow analysis. SHORT QUESTIONS (SQ-1 C to SQ-16 C) SOLVED PAPERS (2015-16 TO 2018-19) (SP-1 C to SP-13 C) = eran QUANTUM Series oer RE CMU Cem Une U EM Cluny the big picture without spending hours over lengthy text books. For Semester - 5 Quantum Series is the complete one-stop : sneering | stllon or enghooring sudsm looking fr (Computer Science & Engineering simple yet afscive guidance system for i core engineering subject Based on the | Information Technology) ca sores er Bare Oe + Database Management System fequiremenis of the sylabi, this series tuniquely addresses the way in which + Design and Analysis of Algorithm concepts are tested through university . examinations. The easy to comprehend Compler Design question answer form achered to by the + Web Technology books in this series is suitable and recommended for student. The students are Departmental Elective-1 able to effortlessly grasp the concepts and : ‘eas discussed in their course books wth pee the help ofthis sores. The soled queston * Computer Graphics papers of previous years act as a additional eR advaniage for students to comprehend the * Object Oriented System Design paper pattem, and. thus aniicioate and Departmental Electives prepare for examinations accordingly + Machit i " ‘Tne coherent manner in which the books in Machine Learntg locieues this series present new ideas and concepts + Application of Soft Computing to students makes this series play an essential role in the preparation for + Human Computer interface university examinations. The detailed and ‘Commom Non Credit Course (NC) comprehensive discussions, easy to " : ; Understand examples, objective questions + Constitution of India, Law & Engineering and amplo oxarise, al aid tho tudonts to + Indian Tradition, Culture & Society ee Sen eh et eee Wiopie-wise coverane in Question-Answer form, The periect assistance for scoring good marks) Clears course fundamentals ‘©Good for brush up before exams, ‘elnclides solved University Questions. ‘oldeal for self-study Quantum Publications® (A Unit of Quantum Page Pvt. Ld.) Plot No, 89/27, Site-, sta Area, Sahibabed, Ghuzlavad, 201010, W.A) Phone; 0120-4160479 E-mal pagequartum@aracom Web: www.quentumpage.coin Senta ‘Compiler Design (KCS-502) ‘Course Outcome (CO) Bloom’s Knowledge Level (KL) ‘At the end of course , the student will be able ‘Acquire Knowledge of different phases and passes of the compiler and also able to use the | Kx, Ky €O1 | compiler tools like LEX, YACC, etc. Students will also be able to design different types of compiler tools to meet the requirements of the realistic constraints of compilers. Understand the parser and its types ic. Top-Down and Bottom-up parsers and construction of LL, SLR, CLR, and LALR parsing table. co2 CO} _ | Hmplement the compiler using syntax-directed translation method and get knowledge about the |~ Ka, Ks synthesized and inherited attributes Co4 | Acquire knowledge about run time data structure like symbol table organization and different | Ka, K techniques used in that G05 _ | Understand the target machine's run time environment, its instruction set for code generation Ke, Ky 5 _| and techniques used for code optimization. DETAILED SYLLABUS, 30-0 Unit Topic Proposed Lecture Introduction to Compiler: Phases and passes, Bootstrapping, Finite state machines and regular expressions and their applications to lexical analysis, Optimization of DFA-Based Pattern Matchers T | implementation of texical analyzers, lexical-analyzer generator, LEX compiler, Formal grammars | gg and their application to syntax analysis, BNF notation, ambiguity, YACC. The syntactic specification of programming languages: Context free grammars, derivation and parse trees, ‘capabilities of CFG. Basic Parsing Techniques: Parsers, Shift reduce parsing, operator precedence parsing, top down parsing, predictive parsers Automatic Construction of efficient Parsers: LR parsers, the canonical Collection of LR(O) items, constructing SLR parsing tables, constructing Canonical LR parsing | 08 tables, Constructing LALR parsing tables, using ambiguous grammars, an automatic parser generator, implementation of LR parsing tables. ‘Syntax-directed Translation: Syntax-directed Translation schemes, Implementation of Syntax directed Translators, Intermediate code, postfix notation, Parse trees & syntax trees, three address IM | code, quadruple & triples, translation of assignment statements, Boolean expressions, statements that alter the flow of control, postfix translation, translation with a top down parser. More about | ° translation: Array references in arithmetic expressions, procedures call, declarations and case statements. ‘Symbol Tables; Data structure for symbols tables, representing scope information, Run-Time IV. | Administration: Implementation of simple stack allocation scheme, storage allocation in block | gg structured language. Error Detection & Recovery: Lexical Phase errors, syntactic phase errors semantic errors. ‘Code Generation: Design Issues, the Target Language. Addresses in the Target Code, Basic V_ | Blocks and Flow Graphs, Optimization of Basic Blocks, Code Generator. Code optimization: | gg ‘Machine-Independent Optimizations, Loop optimization, DAG representation of basic blocks, ‘value numbers and algebraic laws, Global Data-Flow analy: Text books: 1. K. Muneeswaran Compiler Design First Edition, Oxford University Press. 2. LP. Bennet, “Introduction to Compiler Techniques”, Second Edition, Tata McGraw-Hill 3. Henk Alblas and Albert Nymeyer, “Practice and Principles of Compiler Building with C”, PHI, 2001 4, Aho, Sethi & Ullman, "Compilers: Principles, Techniques and Tools”, Pearson Education 5. V Raghvan, “ Principles of Compiler Design”, TMH 6, Kenneth Louden,” Compiler Construction”, Cengage Learning, 7. Charles Fischer and Ricard LeBlanc,” Crafting a Compiler with C”, Pearson Education

You might also like