Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Unit 4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

SUBJECT- COMPILER DESIGN

SEMESTER- 5TH SEM

VISSION AND MISSION OF INSTITUTE

To become a renowned center of outcome based learning and work towards academic,
professional, cultural and social enrichment of the lives of individuals and communities

M1: Focus on evaluation of learning outcomes and motivate students to inculcate research
aptitude by project based learning.

M2: Identify, based on informed perception of Indian, regional and global needs, the areas of
focus and provide platform to gain knowledge and solutions.

M3: Offer opportunities for interaction between academia and industry.

M4: Develop human potential to its fullest extent so that intellectually capable and
imaginatively gifted leaders can emerge in a range of professions.

VISION OF THE DEPARTMENT

To become renowned Centre of excellence in computer science and engineering and make
competent engineers & professionals with high ethical values prepared for lifelong learning.

MISION OF THE DEPARTMENT

M1: To impart outcome based education for emerging technologies


in the field of computer science and engineering.

M2: To provide opportunities for interaction between academia and industry.

M3: To provide platform for lifelong learning by


accepting the change in technologies.

M4: To develop aptitude of fulfilling social responsibilities


PROGRAM OUTCOMES

Engineering knowledge: Apply the knowledge of mathematics, science, engineering


fundamentals, and an engineering specialization to the solution of complex engineering
problems.

Problem analysis: Identify, formulate, research literature, and analyze complex engineering
problems reaching substantiated conclusions using first principles of mathematics, natural
sciences, and engineering sciences.

Design/development of solutions: Design solutions for complex engineering problems and


design system components or processes that meet the specified needs with appropriate
consideration for the public health and safety, and the cultural, societal, and environmental
considerations.

Conduct investigations of complex problems: Use research-based knowledge and research


methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.

Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities
with an understanding of the limitations. The engineer and society: Apply reasoning informed
by the contextual knowledge to assess societal, health, safety, legal and cultural issues and the
consequent responsibilities relevant to the professional engineering practice.

Environment and sustainability: Understand the impact of the professional engineering


solutions in societal and environmental contexts, and demonstrate the knowledge of, and need
for sustainable development.

Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.

Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.

Communication: Communicate effectively on complex engineering activities with the


engineering community and with society at large, such as, being able to comprehend and write
effective reports and design documentation, make effective presentations, and give and receive
clear instructions.
Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member and
leader in a team, to manage projects and in multidisciplinary environments.

Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.

COURSE OUTCOME

CO1: Compare different phases of compiler and design lexical analyzer. CO2: Examine syntax
and semantic analyzer by understanding grammars.

CO3: Illustrate storage allocation and its organization & analyze


symbol table organization.

CO4: Analyze code optimization, code generation & compare various compilers.
CO-PO Mapping

PO2
Semester
Subject

Code

L/T/P

CO

PO1

PO3

PO4

PO5

PO6

PO7
PO8

PO9

PO10
PO11

PO12
L 1. Compare
different phases of
compiler and
design lexical
analyzer. 3 3 3 3 2 1 1 1 1 2 1 3

L 2. Examine syntax
and semantic
analyzer and
illustrate storage
allocation and its
organization 3 3 3 3 1 1 1 1 1 2 2 3

L 3. Analyze symbol
COMPILER DESIGN

table organization,
code optimization
and code generator 3 3 3 3 2 1 1 1 1 2 2 3
5CS4 - 02

L 4.Compare and
evaluate various
3 3 3 3 2 1 1 1 1 2 1 3
compilers and
analyzers
V

V
PROGRAM EDUCATIONAL OBJECTIVES:

1. To provide students with the fundamentals of Engineering Sciences with more


emphasis in Computer Science &Engineering by way of analyzing and exploiting
engineering challenges.
2. To train students with good scientific and engineering knowledge so as to
comprehend, analyze, design, and create novel products and solutions for the real life
problems.
3. To inculcate professional and ethical attitude, effective communication skills,
teamwork skills, multidisciplinary approach, entrepreneurial thinking and an ability to
relate engineering issues with social issues.
4. To provide students with an academic environment aware of excellence, leadership,
written ethical codes and guidelines, and the self motivated life-long learning needed
for a successful professional career.
5. To prepare students to excel in Industry and Higher education by Educating Students
along with High moral values and Knowledge

PSO

PSO1. Ability to interpret and analyze network specific and cyber security issues, automation in
real word environment.
PSO2. Ability to Design and Develop Mobile and Web-based applications under realistic
constraints.
SYLLABUS
LECTURE PLAN:
Subject: Compiler Design (5CS4 – 02) Year/Sem: III/V

Unit
No./
Total Topics Lect. Req.
lec.
Req.
Compiler, Translator, Interpreter definition, Phase of compiler 1
Introduction to one pass & Multipass compilers, Bootstrapping 1
Unit-1
Review of Finite automata lexical analyzer, Input, buffering, 2
(6)
Recognition of tokens, Idea about LEX:, GATE Questions 1
A lexical analyzer generator, Error Handling, Unit Test 1
Review of CFG Ambiguity of grammars, Introduction to parsing 2
Bottom up parsing Top down Parsing Technique 5
Shift reduce parsing, Operator Precedence Parsing 2
Recursive descent parsing predictive parsers 1
Unit-2
(17) LL grammars & passers error handling of LL parser 1
Conical LR & LALR parsing tables 3
parsing with ambiguous grammar, GATE Questions 2
Introduction of automatic parser generator: YACC error handling in LR parsers, Unit
Test
1

Syntax directed definitions; Construction of syntax trees 1


L-attributed definitions, Top down translation 1
Unit 3- Specification of a type checker, GATE Questions 1
(7) Intermediate code forms using postfix notation and three address code, 2
Representing TAC using triples and quadruples, Translation of assignment statement. 1
Boolean expression and control structures, Unit Test 1
Storage organization, Storage allocation, Strategies, Activation records, 1
Unit 4- Accessing local and non local names in a block structured language 1
(4) Parameters passing, Symbol table organization, GATE Questions 1
Data structures used in symbol tables, Unit Test 1

Definition of basic block control flow graphs, 1


DAG representation of basic block, Advantages of DAG, 1
Unit 5- Sources of optimization, Loop optimization Idea about global data flow analysis, Loop
invariant computation, Loop invariant computation, Tutorial
2
(6)
Peephole optimization, GATE Questions, Tutorial 1
Issues in design of code generator, A simple code generator, Code generation from
1
DAG., UNIT TEST, Revision
JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE

Year & Sem – 3rd/ 5th sem


Subject – Compiler Design
Unit – 4

1
Activation Record

□Control stack is a run time stack which is used to keep track of the live
procedure activations i.e. it is used to find out the procedures whose
execution have not been completed.

□When it is called (activation begins) then the procedure name will push on to
the stack and when it returns (activation ends) then it will popped.

□Activation record is used to manage the information needed by a single


execution of a procedure.
An activation record is pushed into the stack when a procedure is called and
it is popped when the control returns to the caller function.

2
The diagram below shows the contents of activation records:

3
□Return Value: It is used by calling procedure to return a
value to calling procedure.

□Actual Parameter: It is used by calling procedures to


supply parameters to the called procedures.

□Control Link: It points to activation record of the caller.

□Access Link: It is used to refer to non-local data held in


other activation records.

4
□Control Link: It points to activation record of the
caller.

5
□Access Link: It is used to refer to non-local data
held in other activation records.

6
□Saved Machine Status: It holds the information about
status of machine before the procedure is called. It also
saves the address of the next instruction to be executed

□Local Data: It holds the data that is local to the execution


of the procedure.

□Temporaries: It stores the value that arises in the


evaluation of an expression.

7
BASIC BLOCKS

8
9
10
11
12
13
14
15
16
17
18
NAME OF FACULTY (POST, DEPTT.) , JECRC, JAIPUR 19
NAME OF FACULTY (POST, DEPTT.) , 1

You might also like