Unit 2 PPL
Unit 2 PPL
Unit 2 PPL
MAYANK
VARSHNEY
Specification and Implementation of Elementary Data
Types
Specification and Implementation of Structured Data
Types
Type Equivalence, Checking and Conversion
Vectors and Arrays
Lists ,Structures
Sets ,Files
a run-time grouping of one or more pieces of data in a
virtual computer.
a location in memory with an assigned name in the actual
computer.
Specification
Maximal and minimal values Operations:
Arithmetic
Relational
Assignment
Bit operations
Implementation - hardware defined
Character Strings
Pointers and Programmer- Constructed Objects
Files
Specification:
Fixed declared length : storage allocation at
translation time. Strings longer than the declared
length are truncated.
Variable length to a declared bound: storage
allocation at translation time. An upper bound for
length is set and any string over that length is
truncated
Unbounded length: storage allocation at run time.
String can be any length
•Selection mechanism
•Maximum number of components
Two-step process:
referencing the structure
selection of a particular component
• Simple linear sequence - arrays, stacks, lists
• Multidimensional structures:
• separate types (Fortran)
• a vector of vectors (C++)
Component selection operations
Sequential
Random
Insertion/deletion of components
Storage representations
Sequential representation
Linked representation
The data structure is stored in a single contiguous block
of storage, that includes both descriptor and components.
What is to be checked:
• Existence of a selected component
Issues
Every object must have an assigned type, there can
be no anonymous types.
Issues
• Do components need to be exact duplicates?
• Can field order be different in records?
• Can field sizes vary?
Two objects are equal if each member in one object
is identical to the corresponding member of the other
object.
THANK YOU.. !!