100% found this document useful (3 votes)
3K views120 pages

Principle of Compiler Design

book
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (3 votes)
3K views120 pages

Principle of Compiler Design

book
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 120
PRINCIPLES OF COMPILER DESIGN ‘Tata McGraw Hill Published by the Tata MeGraw Hill Education Private Limited, 7 West Patel Nagar, New Delhi 110.008. Principles of Compiler Design Copyright © 2010 by Tata McGraw Hill Education Private Limited. No part of this publication may be reproduced or distributed in any form or by any means, electronic, mechanics, photocopying, recording, or otherwise or stored in a database or retrieval system without the prior written permission of the publishers, The program listing (ifany) may be entered, stored and executed in a computer system, but they may not be reproduced for publication. ‘This edition ean be exported from India only by the publishers, Tata McGraw Hill Education Private Limited, ISBN 13: 978-0-07-014471-2 ISBN 10: 0-07-014471-0 Managing Director: Ajay Shukle Head—Higher Education Publishing: Vibha Mahajan Manager: Sponsoring—SEM & Tech Ed: Shalini Jha Editorial Exceutive: Surabhi Shukla jor: Srerbhii Surman I Services: Dipika Dey njali Razdan Jr Manager—Producti General Manager: Marketing—Higher Education: Michael J Crus Sr Product Manager—SEM & Tech Ed: Biju Ganesan Asst Product Manager—SEM & Tech Ed: Amit Paranfpe ‘General Manager—Production: Rajender P Ghansela Asst General Manager—Production: B L Dogra Information contained in this work has been obtained by Tata McGraw Hill, from sources believed to be reliable. However, neither Tata MeGraw Hill nor its authors guarantee the accuracy or completeness of any information Published herein, and neither Tata McGraw Hill nor its authors shall be responsible for any crrors, omissions, ‘or damages arising out of usc of this information. This work is published with the understanding that Tata MoGraw Hill and ite authors are supplying information but are not attempting to render engincering or other professional services. If such services are required, the assistance of an appropriate professional should be sought. ‘Typeset at Bukprint india, B-180A, Guru Nanak Pura, Laxmi Nagar-110 092 and printed at Pashupati Printers Pvt, Ltd., 1/429/16, Gali No. 1, Friends Colony, Industrial Area, G.T. Road, Shahdara, Delhi - 110 095 Cover Pr jer: Rashiriya Printers RAXLCRBFDRRBQ Mn Preface CONTENTS Visual Walkthrough 1. Compilers—An Introduction Introduction _1 LI The Bigger Picture 2 .2 The Compiler 5 13 Compiler Implementation _13 14 Data Structures in a Compiler_/4 LS Study Plan_15 Summary Review 2. Lexical An: 16 uestions and Exercises 16 Introduction 18 2.1 Elements of Lexical Analysis 20 2.2 The Mechanies of Lexical Analyser Generators 32 2.3, rlex—A Restricted Lexical Analyser Generator_38 66, Summary Review Questions and Exercises 66 3. Syntax Analysis Lotroduction 49 3.1 Context-free Grammar 70 3.2_Classification of Parsing Techniques 82 3.3_Error Reporting and Recovery in Syntax Analyser _ 84 3.4 Top-down Parsing 86 3.5 Bottom-up Parsing 1/3 3.6_A Syntax Analyser for Language 1/80 Summary 183, Review Questions and Exercises 183 4. Semantic Analysis Introduction 186 4,1 Syntax-Directed Translation 190 4.2 Semantic Analysis 218 Summary 246 Review westions and Exercises 247 ix tii 18 69 186

You might also like