Book description
Designed for an introductory course, this text encapsulates the topics essential for a freshman course on compilers. The book provides a balanced coverage of both theoretical and practical aspects. The text helps the readers understand the process of compilation and proceeds to explain the design and construction of compilers in detail. The concepts are supported by a good number of compelling examples and exercises.Table of contents
- Cover
- Title Page
- Brief Contents
- Contents
- Dedication
- Preface
-
Chapter 1: Introduction
- 1.1 What Is a Compiler
- 1.2 Compiler vs. Interpreter
- 1.3 Typical Language Processing System
- 1.4 Design Phases
- 1.5 Design Passes
- 1.6 Retargeting
- 1.7 Bootstrapping
- 1.8 Compiler Design Tools
- 1.9 Modern Compilers—Design Need for Compilers
- 1.10 Application of Compiler Design Principles
- Solved Problems
- Summary
- Fill in the Blanks
- Objective Question Bank
- Exercises
- Key for Fill in the Blanks
- Key for Objective Question Bank
-
Chapter 2: Lexical Analyzer
- 2.1 Introduction
- 2.2 Advantages of Separating Lexical Analysis from Syntax Analysis
- 2.3 Secondary Tasks of a Lexical Analyzer
- 2.4 Error Recovery in Lexical Analysis
- 2.5 Tokens, Patterns, Lexemes
- 2.6 Strategies for Implementing a Lexical Analyzer
- 2.7 Input Buffering
- 2.8 Specification of Tokens
- 2.8.1 Operations on Language
- 2.9 Recognition of Tokens
-
2.10 Finite State Machine
- 2.10.1 Finite Automaton Model
- 2.10.2 Properties of the Transition Function "S"
- 2.10.3 Transition Diagram
- 2.10.4 Transition Table
- 2.10.5 Language Acceptance
- 2.10.6 Finite Automation Is of Two Types
- 2.10.7 Deterministic Finite Dutomaton (DFA)
- 2.10.8 Nondeterministic Finite Automaton (NFA)
- 2.10.9 Equivalence of DFAs andNFAs
- 2.10.10 Converting NFA (MN) to DFA (MD)—Subset Construction
- 2.10.11 NFA with Epsilon (ε)-Transitions
- 2.10.12 Epsilon Closure (ε-closure)
- 2.10.13 Eliminating ε- Transitions
- 2.10.14 Converting NFA with ε-Transition to NFA Without ε-Transition
- 2.10.15 Converting NFA with ε-Transition to DFA
- 2.10.16 Comparison Method for Testing Equivalence of Two FAs
- 2.10.17 Reduction of the Number of States in FA
- 2.10.18 Minimization of DFA
- 2.10.19 Minimization of DFA Using the Myhill Nerode Theorem
- 2.11 Lex Tool: Lexical Analyzer Generator
- Solved Problems
- Summary
- Fill in the Blanks
- Objective Question Bank
- Exercises
- Key for Fill in the Blanks
- Key for Objective Question Bank
-
Chapter 3: Syntax Definition - Grammars
- 3.1 Introduction
- 3.2 Types of Grammars—Chomsky Hierarchy
- 3.3 Grammar Representations
- 3.4 Context Free Grammars
- 3.5 Derivation of CFGs
- 3.6 Language Defined by Grammars
- 3.7 Left Recursion
- 3.8 Left-Factoring
- 3.9 Ambiguous Grammar
- 3.10 Removing Ambiguity
- 3.11 Inherent Ambiguity
- 3.12 Non-context Free Language Constructs
- 3.13 Simplification of Grammars
- 3.14 Applications of CFG
- Solved Problems
- Summary
- Fill in the Blanks
- Objective Question Bank
- Exercises
- Key for Fill in the Blanks
- Key for Objective Question Bank
-
Chapter 4: Syntax Analysis—Top-Down Parsers
- 4.1 Introduction
- 4.2 Error Handling in Parsing
- 4.3 Types of Parsers
- 4.4 Types of Top-Down Parsers
- 4.5 Predictive Parsers
- 4.6 Construction of Predictive Parsing Tables
- 4.7 LL(1) Grammar
- 4.8 Error Recovery in Predictive Parsing
- Solved Problems
- Summary
- Fill in the Blanks
- Objective Question Bank
- Exercises
- Key for Fill in the Blanks
- Key for Objective Question Bank
-
Chapter 5: Bottom-Up Parsers
- 5.1 Bottom-Up Parsing
- 5.2 Handle
- 5.3 Why the Name SRParser
- 5.4 Types of Bottom-Up Parsers
-
5.5 Operator Precedence Parsing
- 5.5.1 Precedence Relations
- 5.5.2 Recognizing Handles
- 5.5.3 Parsing Algorithm for Operator Precedence Parser
- 5.5.4 Construction of the Precedence Relation Table
- 5.5.5 Mechanical Method of Constructing Operator Precedence Table
- 5.5.6 Calculating Operator Precedence Relation <..>
- 5.5.7 Error Recovery in Operator Precedence Parser
- 5.5.8 Procedure for Converting Precedence Relation Table to Precedence Function Table
- 5.6 LR Grammar
- 5.7 LR Parsers
- 5.8 LR Parsing Algorithm
- 5.9 Construction of the LR Parsing Table
- 5.10 LR(0) Parser
- 5.11 SLR(l) Parser
- 5.12 Canonical LR(1) Parsers CLR(1)/LR(1)
- 5.13 LALR(1) Parser
- 5.14 Comparison of Parsers: Top-Down Parser vs. Bottom-Up Parser
- 5.15 Error Recovery in LR Parsing
- 5.16 Parser Construction with Ambiguous Grammars
- Solved Problems
- Summary
- Fill in the Blanks
- Objective Question Bank
- Exercises
- Key for Fill in the Blanks
- Key for Objective Question Bank
-
Chapter 6: Syntax-Directed Translation
- 6.1 Introduction
- 6.2 Attributes for Grammar Symbols
- 6.3 Writing Syntax-Directed Translation
- 6.4 Bottom-Up Evaluation of SDT
- 6.5 Creation of the Syntax Tree
- 6.6 Directed Acyclic Graph (DAG)
- 6.7 Types of SDTs
- 6.8 S-Attnbuted Definition
- 6.9 Top-Down Evaluation of S-Attributed Grammar
- 6.10 L-Attributed Definition
- 6.11 Converting L-Attributed to S-Attributed Definition
- 6.12 YACC
- Solved Problems
- Summary
- Fill in the Blanks
- Objective Question Bank
- Key for Fill in the Blanks
- Key for Objective Question Bank
-
Chapter 7: Semantic Analysis
- 7.1 Introduction
- 7.2 Type Systems
- 7.3 Type Expressions
- 7.4 Design of Simple Type Checker
- 7.5 Type Checking of Expressions
- 7.6 Type Checking of Statements
- 7.7 Type Checking of Functions
- 7.8 Equivalence of Type Expressions
- 7.9 Type Conversion
- 7.10 Overloading of Functions and Operators
- 7.11 Polymorphic Functions
- Solved Problems
- Summary
- Fill in the Blanks
- Objective Question Bank
- Exercises
- Key for Fill in the Blanks
- Key for Objective Question Bank
-
Chapter 8: Intermediate Code Generation
- 8.1 Introduction
- 8.2 Intermediate Languages
- 8.3 Types of Three Address Statements
- 8.4 Representation of Three Address Code
- 8.5 Syntax-Directed Translation into Three Address Code
- Solved Problems
- Summary
- Fill in the Blanks
- Objective Question Bank
- Exercises
- Key for Fill in the Blanks
- Key for Objective Question Bank
- Chapter 9: Symbol Table
-
Chapter 10: Code Optimization
- 10.1 Introduction
- 10.2 Where and How to Optimize
- 10.3 Procedure to Identify the Basic Blocks
- 10.4 Flow Graph
- 10.5 DAG Representation of Basic Block
- 10.6 Construction of DAG
- 10.7 Principle Source of Optimization
- 10.8 Function-Preserving Transformations
- 10.9 Loop Optimization
- 10.10 Global Flow Analysis
- 10.11 Machine-Dependent Optimization
- Solved Problems
- Summary
- Fill in the Blanks
- Objective Question Bank
- Exercises
- Key for Fill in the Blanks
- Key for Objective Question Bank
-
Chapter 11: Code Generation
- 11.1 Introduction
- 11.2 Issues in the Design of a Code Generator
- 11.3 Approach to Code Generation
- 11.4 Instruction Costs
- 11.5 Register Allocation and Assignment
- 11.6 Code Generation Using DAG
- Solved Problems
- Summary
- Fill in the Blanks
- Objective Question Bank
- Exercises
- Key for Fill in the Blanks
- Key for Objective Question Bank
- Recommended Readings and Websites
- Acknowledgement
- Copyright
- Back Cover
Product information
- Title: Compiler Construction
- Author(s):
- Release date: June 2013
- Publisher(s): Pearson India
- ISBN: 9789332520134
You might also like
book
Express Learning: Principles of Compiler Design
Express Learning is a series of books designed as quick reference guides to important undergraduate computer …
book
Introduction to Compiler Construction in a Java World
Immersing students in Java and the Java Virtual Machine (JVM), Introduction to Compiler Construction in a …
book
C++ Software Design
Good software design is essential for the success of your project, but designing software is hard …
book
Programming Languages: Concepts and Implementation
Programming Languages: Concepts and Implementation teaches language concepts from two complementary perspectives: implementation and paradigms. It …