1 / 6

PL/I

PL/I. Designed by IBM Designed to replace Fortran, COBOL, LISP, and system applications of assembly language Compiled Imperative. Syntax. A program is a sequence of expressions Expressions can be: Statements Definitions Functions Subroutines Comments are surrounded by /* */

callum-gill
Download Presentation

PL/I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PL/I Designed by IBM Designed to replace Fortran, COBOL, LISP, and system applications of assembly language Compiled Imperative

  2. Syntax • A program is a sequence of expressions • Expressions can be: • Statements • Definitions • Functions • Subroutines • Comments are surrounded by /* */ • Supports Block-Structures DO; <statements> END;

  3. Data Types • Primitive types: FIXED, FIXED BIN, FLOAT, BIT, and COMPLEX values, also strings and labels • Declare variables by: DECLARE (<var>, <var>,…) <type>[(<precision>)] [<attributes>]…; • Variable names: • A-Z, $, @, #, _ • No reserved words • Data structures: Example: DECLARE 1 PERSON, 2 NAME CHAR(25), 2 BIRTH_DATE, 3 MONTH CHAR(9), 3 DAY FIXED(2), 3 YEAR FIXED(4);

  4. Control Flow • GO TO statements • IF statements: IF <condition> THEN <statement>; ELSE <statement>; • DO statements: <label>: DO i=m1 TO m2 BY m3; <statement>; END <label>;

  5. Functions • Can pass by value or reference by using BYVALUE or BYADDR <label>: PROC(<params>) RETURNS(<type>); <statements>; END <label> Example: EXP: PROC(I,J) RETURNS(FIXED BIN(31)); RETURN(I**J); END EXP;

  6. Evaluation • GO TO statements and lack of reserved words greatly decreases the readability • Complexity from combining several languages and additional facilities made the writability of PL/I poor • It was fairly reliable since it could detect and handle several different types of exceptions and errors

More Related