CSE%203302CSE@UTA - PowerPoint PPT Presentation

About This Presentation
Title:

CSE%203302CSE@UTA

Description:

Block structured languages generally only allow procedures to be passed in - not ... Parnas's principles of information hiding ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 19
Provided by: jcartermat
Learn more at: https://ranger.uta.edu
Category:

less

Transcript and Presenter's Notes

Title: CSE%203302CSE@UTA


1
CSE3302Programming Languages(notes, notes,
notes)
  • Dr. Carter Tiernan

2
Block Structured Languages Activation records
  • Fixed program part
  • Variable activation-record part
  • Instruction part
  • Environment part
  • Local context
  • Nonlocal context

3
Nonlocal context
  • Static link
  • IP-EP locus of control
  • Two coordinate access
  • Static distance
  • Offset
  • Two step access

4
Procedure Activation
  • Needs static and dynamic links
  • Three steps
  • Save caller state
  • Create callee activation record
  • Enter callee in context of new record

Procedure Deactivation
  • Two steps
  • Delete callee activation record
  • Restore the state of the caller

5
Procedural Parameters
  • Two element record
  • IP gives entry address of actual procedure
  • EP gives pointer to environment of definition of
    procedure
  • Block structured languages generally only allow
    procedures to be passed in - not to be returned

6
Nonlocal context
  • Static chains as discussed
  • Implemented as linked lists
  • Display
  • Random access to context
  • Array with pointers to activation records
  • Calls require saving display data
  • Shallow binding
  • Static activation records on stack

7
Blocks
  • Handled like degenerate procedures

Concepts
  • Activation records very important in language
    implementation
  • Two-coordinate addressing is also significant

8
Ada Overview
  • Rationale
  • Software complexity and cost
  • Maintenance and portability
  • Government backing
  • History
  • 1975 - 79 Specifications
  • CII-Honeywell-Bull Jean Ichbiah
  • Mil std and ANSI 83, ISO 87

9
Ada Highlights
  • Abstract Data Types
  • Information Hiding (D. L. Parnas)
  • Verification
  • Concurrency
  • Generally uses Pascal as basis

10
Ada
  • Packages support info hiding and implement
    abstract data types
  • Specification of public names
  • Private body of package
  • Control structures include
  • Exception handling
  • Concurrent programming

11
Ada Declarations
  • Object (constants and variables)
  • Type
  • Subprogram (procedures, functions and overloaded
    operators)
  • Package (executable modules)
  • Task (concurrently executable modules)

12
Ada Data Structures
  • Based on Pascal
  • Range constraints
  • Accuracy constraints digits, delta
  • Discriminant constraint
  • Index constraint
  • Name equivalence
  • Subtype, derived type
  • Overloaded enumerations

13
Ada Name structures
  • Variables can be initialized at declaration
  • Constants are declared with keyword and are
    constant within scope
  • Separation of interface implementation

14
Ada Issues
  • Global Variables Considered Harmful Wulf Shaw
  • Side effects
  • Indiscriminate access
  • Vulnerability
  • No overlapping definitions
  • Parnass principles of information hiding
  • One must provide the intended user with all the
    info needed to use the module correctly and
    nothing more.
  • One must provide the implementor with all the
    info needed to complete the module and nothing
    more.

15
Name structures (cont.)
  • Packages
  • Interface specification
  • public part of package
  • May have private section
  • Body
  • Defines everything in interface specification
  • This is private to the package developer
  • Use ltpackage_namegt
  • With ltpackage_namegt

16
Ada Packages
  • ADT
  • Library of routines
  • Shared data structure
  • Generic packages
  • ADT templates
  • Parameters
  • Internal vs. External representations

17
Ada Control Structures
  • Iterator - loop ltbodygt end loop
  • Infinite loop - uses exit keyword or exit
    when
  • while phrase prefix
  • for phrase prefix
  • Conditional - if ltconditiongtthen ltbodygtend if
  • Case
  • Subprograms
  • Goto
  • Exception handling
  • Concurrency control

18
4th Generation Languages
4th
  • Data abstraction languages
  • Control structure for concurrency
  • Refinement and correction of 3rd gen
Write a Comment
User Comments (0)
About PowerShow.com