0% found this document useful (0 votes)
7 views

Presentation 1

Uploaded by

shanthini.j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Presentation 1

Uploaded by

shanthini.j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

• Unit III

• Types and Declarations, Translation of Expressions, Type Checking.


• UNIT IV RUN-TIME ENVIRONMENT AND CODE GENERATION 8
• Storage Organization, Stack Allocation Space, Access to Non-local Data on the
Stack, Heap Management - Issues in Code Generation - Design of a simple
Code Generator.
• UNIT V CODE OPTIMIZATION 8
• Principal Sources of Optimization – Peep-hole optimization - DAG-
Optimization of Basic Blocks Global Data Flow Analysis - Efficient Data Flow
Algorithm.
Types and Declarations
• The applications of types can be grouped under checking and
translation:
• Type checking uses logical rules to reason about the behavior of a
program at run time
• Translation Applications. From the type of a name, a compiler can
determine the storage that will be needed for that name at run time
• Int a
• we examine types and storage layout for names declaredwithin a
procedure or a class
• Type Expression:
• Types have structure, which we shall represent using type
expressions: a type expression is either a basic type or is formed by
applying an operator called a type constructor to a type expression.
• The sets of basic types and constructors depend on the language to
be checked.
• We shall use the following definition of type expressions:
• A basic type is a type expression Typical basic types for a language
include boolean, char, integer, oat, and void ; the latter denotes \the
absence of a value.
• A type name is a type expression.
• A type expression can be formed by applying the array type
constructor to a number and a type expression.
• A record is a data structure with named fields. A type expression can
be formed by applying the record type constructor to the eld names
and their types. Record types will be implemented in Section 6.3.6 by
applying the constructor record to a symbol table containing entries
for the elds. A type expression can be formed by using the type
constructor ! for function types. We write s ! t for \function from type
s to type t."

You might also like