366x Filetype PDF File size 0.22 MB Source: ndl.ethernet.edu.et
Ambo University Woliso Campus
Department of Computer Science
Semester II, 2020
Compiler Design
Credits: 3
Instructor: Mr. Yoobsan B
COURSE OBJECTIVES:
Upon completion of this course, students will have gained knowledge of compiler design and
construction concepts and to:
Introduce the major concept areas of language translation and compiler design.
Understand the phases of the compilation process and be able to describe the purpose
and implementation approach of each phase.
Know how to use compiler construction tools, such as generators of scanners and
parsers
Be able to define LL(1), LR(1), and SLR(1) grammars with parsing techniques
Design a compiler for a simple programming language; and Implement a compiler based
on its design…
Text book
Compilers: Principles, techniques and tools by Alfred V. Aho, Ravi Sethi, Jeffrey D.
Ullman
Reference book
Compiler construction : Principles and practice; Kenneth C.Louden
Course outline
1. Introduction 4. Syntax directed translation
Analysis and synthesis in a Syntax directed definitions
compilation Dependency graph and
Various phases in a compilation evaluation order
Grouping of phases S-attributed definitions
Major data and structures in a Bottom-up evaluation
compiler Top-down evaluation
Compiler construction tools L-attributed definitions
2. Lexical analysis and Lex 5. Type checking
Token, pattern, lexeme Type systems
Attributes of a token Specifications of a type checker
Errors A simple language example
Specification of tokens using Equivalence of types
regular expressions Type conversion
Regular expression for
programming language tokens 6. Intermediate code generation
Recognizing tokens using Intermediate languages
transition diagrams Types of three address statements
Design of lexical analyzer Syntax directed translation into
Construction and simulation of three address code
NFA and DFA Implementation of three address
Conversion from RE – NFA – statements
DFA Translation scheme to generate
Lex scanner generator three address code
Addressing array elements
3. Syntax analysis and Yacc 7. Code generation and optimization
Role of a parser Issues in the design of a code
Context Free Grammar generator
Derivation, parse tree, ambiguity, A simple code generation
left recursion, left factoring algorithm
Syntax analysis Memory management
Syntax error handling Instruction selection
Top down parsing Register allocation
Recursive decent parsing
Non recursive predictive parsing
Bottom up parsing
LR(k) parsing Evaluation methods:
Shift reduce parsing Quizzes 10%
Construction of SLR parsing
table Lab 15%
Yacc parser generator Assignment/projects 15%
Mid/Tests 20%
Final 40%
no reviews yet
Please Login to review.