Compiler Construction Instructor : Dr. Tiayyba Riaz [email protected] Fall - 2014 Course Code : CS4435 Credit Hours : 3 Class : BS Course Description: CS4435 provides the students with an opportunity to learn issues that arise in the design and construction of translators for programming languages. The course emphasizes techniques that have direct application to the construction of compilers. Not to forget many of the same concepts find application in the implementation of interpreters. Course Objectives: The aim of this module is to show how to apply the theory of language translation introduced in the prerequisite courses to build compilers. This course provide a thorough understanding of the basic structure of compilers for a programming language. A major part of the course consists of the implementation of a compiler for a simplified programming language. Student Learning Outcomes On completion of this unit students should be able to understand: 1. How the compiler works. 2. Phases of the compiler. 3. Implementation details of the compiler phases. Course Outline Date

Lecture

Description

Readings

Remarks

Week 1

Lecture 1

Introduction and course overview. Compilers, language processors, structure of compiler Introduction to lexical analysis, Role of Lexical Analyzer

Chapter 1 Sections: 1.1, 1.2

Introduction

Chapter 3 Sections: 3.1

Lexical Analyzer

Lecture 3

Specifications of tokens, Recognition of Tokens

Chapter 3 Sections: 3.2, 3.3

Lexical Analyzer

Lecture 4

Implementation details of Lexical Analyzer, Discussion of Programming Assignment 1 (PA1) in class

Chapter 3 Sections: 3.4

PA 1 out

15/09 - 19/09 Lecture 2 Week 2 22/09 - 26/09

  Week 3

Lecture 5

Syntax Directed Translation, Syntax Definition

Chapter 2 Section: 2.1, 2.2

CFG

Lecture 6

Syntax Analysis/Parsing : Roler of Parser, Syntax Error Handling

Chapter 4: Syntax analysis Sections 4.1, 4.1.1

Scanning/ Parsing

Scanning/ Parsing

29/09 - 03/10

Week 4 06/10 - 10/10 Week 5

Eid ul Adha Holidays Lecture 7

Context Free Grammar, Writing a Grammar, Elimination of Ambiguity, Elimination of Recursion

Chapter 4: Syntax analysis Sections: 4.2, 4.3

Lecture 8

Parsing Algorithms, Top down Parsing, Recursive Decent Parsing

Chapter 4: Syntax analysis Sections: 4.4

Lecture 9

First and Follow, LL(1) grammar

Lecture 10

Non recursive Predictive Parsing, Error Recovery in Predictive Parsing

Lecture 11

Bottom Up Parsing, Reductions, Handle Pruning, Shift-Reduce Parsing, Conflicts During Shift-Reduce Parsing Introduction to LR Parsing, Why LR Parsers?, Items and the LR(O) Automaton

Chapter 4: Syntax analysis Sections: 4.4 Chapter 4: Syntax analysis Sections: 4.4 Chapter 4 : Sections : 4.5

13/10 - 17/10

Week 6 20/10 - 24/10

Week 7 27/10 - 31/10

Lecture 12

Week 8

Lecture 13

The LR-Parsing Algorithm

03/11 - 07/11

Lecture 14

Constructing SLR-Parsing Tables

Week 9 10/11 - 14/11

Quiz 1 Scanning/ Parsing PA 1 due Scanning/ Parsing Scanning/ Parsing Scanning/ Parsing

Chapter 4 : Sections : 4.5

Scanning/ Parsing

Chapter 4 : Sections : 4.6

PA2 out Scanning/ Parsing Scanning/ Parsing

Mid Term Exam

Week 10

Lecture 15

Introduction to Semantic Syntax-directed definitions Evaluation Orders for SDD

Analysis

using

Chapter 5: Sections : 5.1 Chapter 5 : Sections : 5.2 Chapter 5 : Sections : 5.3

Semantics

17/11 – 21/11

Lecture 16

Week 11

Lecture 17

Applicatios of Syntax directed translation: Bottom-up evaluation of S-attributed definitions

Lecture 18

Top down translation

Chapter 5: Sections : 5.4 Chapter 5(*Ed 1) Section : 5.5

Semantics

Lecture 19

Top down translation

Lecture 20

Bottom up evaluation of inherited attributes

Chapter 5(*Ed 1) Section : 5.5

Semantics PA2 due

Lecture 21

Intermediate Code generation

Chapter 6

Semantics

Semantics Semantics

24/11 – 28/11

Week 12

Semantics

01/12-05/12

Week 13

  Variants of Syntax Trees, three address codes 08/12-12/12 Week 14

Declarations,

Translation

Sections: 6.1, 6.2

Lecture 22

Types and Expressions

of

Chapter 6 Sections : 6.3

Lecture 23

Type Checking I

Sections : 6.5

Lecture 24

Type Checking II

Sections : 6.5

Lecture 25

Run-time Environment Storage organization

Chapter 7 Section: 7.1

Lecture 26

Stack Allocation of Space

Chapter 7 Section: 7.2

Intermediate Code generation Quiz 2 Intermediate Code generation Intermediate Code generation Intermediate Code generation Run-time Environment

Lecture 27

Access to Nonlocal Data on the Stack

Chapter 7 Section: 7.3

Run-time Environment

Lecture 28

Heap Management

Chapter 7 Section: 7.4

Run-time Environment

15/12-19/12 Week 15 22/12-26/12

Week 16 29/12-02/01

Week 17 05/01-09/01

Week 18 12/12-16/01

Project Evaluation

Compiler Construction Instructor : Dr. Tiayyba Riaz tiayyba.riaz@cs ...

tiayyba.riaz@cs.uol.edu.pk. Fall - 2014. Course Code : CS4435. Credit Hours : 3. Class : BS. Course Description: CS4435 provides the students with an ...

115KB Sizes 0 Downloads 178 Views

Recommend Documents

CSE401 Introduction to Compiler Construction
intrinsicState. ConcreteFlyweight. Operation(extrinsicState). allState. UnsharedConcreteFlyweight. CSE403 Sp10. 10. Participants. • Flyweight (glyph in text example). – Interface through which flyweights can receive and act on extrinsic state. â€

Guest lecture for Compiler Construction, Spring 2015
references and (user-defined) exceptions. ✓ modules, signatures, abstract types. The CakeML language. = Standard ML without I/O or functors. The verified machine-code implementation: parsing, type inference, compilation, garbage collection, bignums

Compiler Construction using Flex and Bison
Most program time is spent in the body of loops so loop optimization can result in significant performance im- provement. Often the induction variable of a for loop is used only within the loop. In this case, the induction variable may be stored in a

Formal Compiler Construction in a Logical ... - Semantic Scholar
Research Initiative (MURI) program administered by the Office of Naval Research. (ONR) under ... address the problem of compiler verification in this paper; our main ...... Science Technical Report 32, AT&T Bell Laboratories, July 1975. Lee89 ...

THAPAR UNIV UEC Instructor: Dr. A 1. Sketch the transfer ...
Sketch the transfer characteristics. 2. Sketch the waveform of Vd for the ... aracteristics that closely matches with simple switch o terminal deice. ----------------------.

Formal Compiler Construction in a Logical ... - Semantic Scholar
literate programming), and the complete source code is available online ..... class of atoms into two parts: those that may raise an exception, and those that do not, and ...... PLAN Notices, pages 199–208, Atlanta, Georgia, June 1988. ACM.

Automating the Construction of Compiler Heuristics ...
requirements for the degree of. Doctor of Philosophy of Science in Computer Science and Engineering. Abstract. Compiler writers are expected to create ...

Riaz v Ashwood - 4 New Square
Mar 28, 2018 - A number of SCCO decisions in this situation have now been reported in the last 4 months: all the reports appear on the SCCO's website for December 2017 to March 2018. Section 68(1) of the Solicitors Act 1974 provides: The jurisdiction

COMPILER DESIGN.pdf
b) Explain the various strategies used for register allocation and assignment. 10. 8. Write short notes on : i) Error recovery in LR parsers. ii) Loops in flow graphs.

Compiler design.pdf
c) Briefly explain main issues in code generation. 6. ———————. Whoops! There was a problem loading this page. Compiler design.pdf. Compiler design.pdf.

ClamAV Bytecode Compiler - GitHub
Clam AntiVirus is free software; you can redistribute it and/or modify it under the terms of the GNU ... A minimalistic release build requires 100M of disk space. ... $PREFIX/docs/clamav/clambc-user.pdf. 3 ...... re2c is in the public domain.

Compiler design.pdf
3. a) Consider the following grammar. E → E + T T. T → T *F F. F → (E) id. Construct SLR parsing table for this grammar. 10. b) Construct the SLR parsing table ...

compiler design__2.pdf
Page 1 of 11. COMPILER DEDIGN SET_2 SHAHEEN REZA. COMPILER DEDIGN SET_2. Examination 2010. a. Define CFG, Parse Tree. Ans: CFG: a context ...

compiler design_1.pdf
It uses the hierarchical structure determined by the. syntax-analysis phase to identify the operators and operands of. expressions and statements. Page 1 of 7 ...

Aaraishi Poday (Ornamental Plants) by Riaz Masood.pdf ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Aaraishi Poday ...

Vasavai CE BE IT 3rd Year May 2013 Compiler Construction (Old).pdf
Write LR(0) items for the following grammar (3). E E + n / n. 5. Define shift – reduce conflict and Reduce – reduce conflict. (3). 6. Writ the Attribute grammar from ...

CS6612-COMPILER-LABORATORY- By EasyEngineering.net.pdf ...
1. Implementation of symbol table. 2. Develop a lexical analyzer to recognize a few patterns in c (ex. Identifers, constants,. comments, operators etc.) 3. Implementation of lexical analyzer using lex tool. 4. Generate yacc specification for a few sy

Instructor Portfolio.pdf
YAHSIR WAHEED , BABYSHOP , IZNIK, SWISS LOUNGE. ,HASHAM BAIG CLOTHING ... Instructor Portfolio.pdf. Instructor Portfolio.pdf. Open. Extract. Open with.

Compiler Design Syllabus.pdf
software design(PO→BCG ). iv. Working skills in theory and application of finite state machines, recursive descent,. production rules, parsing, and language ...

VOCATIONAL INSTRUCTOR-2017Dece@PSC WINNERS.pdf ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. VOCATIONAL INSTRUCTOR-2017Dece@PSC WINNERS.pdf. VOCATIONAL INSTRUCTOR-2017Dece@PSC WINNERS.pdf. Open. Extrac

Emscripten: An LLVM-to-JavaScript Compiler - GitHub
May 14, 2013 - Emscripten, or (2) Compile a language's entire runtime into ...... html.) • Poppler and FreeType: Poppler12 is an open source. PDF rendering ...