BLISS Language Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
BLISS Language Reference Manual Order Number: AA–H275E–TK May 1987 This document is a combined tutorial and reference manual for the BLISS programming language, which consists of the dialects BLISS–16, BLISS–32, and BLISS–36. This language, designed for transportable system-level programming, is primarily intended for knowledgeable users of its target systems: PDP–11, VAX, DECsystem–10, and DECSYSTEM–20. Revision/Update Information: Revision/Update Information: This document supersedes the BLISS Language Guide (Order Number AA– H275D–TK). Revision/Update Information: Operating System and Version: VMS Version 3 or higher TOPS–10 Version 7.01 TOPS–20 Version 5 Revision/Update Information: Software Version: BLISS–16 Version 4 BLISS–32 Version 4.3 BLISS–36 Version 4 Digital Equipment Corporation Maynard, Massachusetts First Printing, October 1978 Revised, January 1980 Revised, January 1982 Revised, January 1983 Revised, May 1987 Digital Equipment Corporation makes no representations that the use of its products in the manner described in this publication will not infringe on existing or future patent rights, nor do the descriptions contained in this publication imply the granting of licenses to make, use, or sell equipment or software in accordance with the description. Possession, use, or copying of the software described in this publication is authorized only pursuant to a valid written license from Digital or an authorized sublicensor. © Digital Equipment Corporation 1978, 1980, 1982, 1983, 1987. All rights reserved. The postpaid Reader’s Comments forms at the end of this document request your critical evaluation to assist in preparing future documentation. The following are trademarks of Digital Equipment Corporation: DEC, DEC/CMS, DEC/MMS, DECnet, DECsystem–10, DECSYSTEM–20, DECUS, DECwriter, DIBOL, EduSystem, IAS, MASSBUS, PDP, PDT, RSTS, RSX, UNIBUS, VAX, VAXcluster, VMS, VT, and the DIGITAL logo. ZK4538 This document is available on CD–ROM. This document was prepared using VAX DOCUMENT Version 2.1. Contents Preface ............................................................ xix 1 Introduction 1.1 BLISS Dialects .............................................. 1–1 1.2 Language Objectives and Characteristics . ....................... 1–2 1.2.1 Design Objectives . ........................................ 1–2 1.2.2 Language Overview ....................................... 1–2 1.3 Program Development ........................................ 1–3 1.4 The Main Features of BLISS . ................................ 1–4 1.4.1 Data . ................................................ 1–4 1.4.2 Memory Addressing ....................................... 1–4 1.4.3 Fetching Values . ........................................ 1–5 1.4.4 Assigning Values . ........................................ 1–5 1.4.5 Expressions ............................................. 1–6 1.4.6 Blocks . ................................................ 1–6 1.4.7 Declarations ............................................. 1–8 1.4.8 Structures .............................................. 1–9 1.4.9 Flow of Control . ........................................ 1–9 1.4.10 Loops . ................................................ 1–10 1.4.11 Binding of Names ........................................ 1–11 1.5 Program Transportability ...................................... 1–11 1.6 Effects of Optimization ........................................ 1–12 1.7 The BLISS Programming System ............................... 1–13 1.7.1 System Components ....................................... 1–13 1.7.2 Constant Expressions ...................................... 1–14 1.8 A Complete Program . ........................................ 1–15 2 Lexical Definitions and Syntax Notation 2.1 Characters and Linemarks ..................................... 2–1 2.1.1 Characters .............................................. 2–1 2.1.2 Linemarks .............................................. 2–2 2.2 Lexemes and Spaces . ........................................ 2–2 2.2.1 Lexemes ................................................ 2–3 2.2.2 Spaces and Comments ..................................... 2–3 2.3 The Separation Rules . ........................................ 2–4 2.4 The Syntax Notation . ........................................ 2–4 2.4.1 Syntactic Rules . ........................................ 2–5 2.4.2 Syntactic Names and Syntactic Literals . ....................... 2–5 2.4.3 Concatenations . ........................................ 2–6 2.4.4 Disjunctions ............................................. 2–6 2.4.5 Replications ............................................. 2–7 2.4.6 Dialectal Differences ...................................... 2–7 iii 3 BLISS Values and Data Representations 3.1 BLISS Values . ............................................ 3–1 3.1.1 Fullword Values .......................................... 3–2 3.1.2 Field Values . ............................................ 3–3 3.1.3 Extending Values ......................................... 3–3 3.2 Data Segments . ............................................ 3–5 3.2.1 Addressable Units and Units per BLISS Value .................. 3–5 3.2.2 Scalars ................................................. 3–6 3.2.3 VECTOR Structures . .................................... 3–8 3.2.4 BITVECTOR Structures .................................... 3–9 3.2.5 BLOCK Structures ........................................ 3–10 3.2.6 BLOCKVECTOR Structures ................................ 3–10 3.2.7 Programmed Structures .................................... 3–11 3.3 Character Sequence Data . .................................... 3–11 3.3.1 General Character Representation ............................ 3–12 3.3.2 Character Sequence Operations . ............................ 3–12 3.3.3 BLISS–16 Character Representation .......................... 3–13 3.3.4 BLISS–32 Character Representation .......................... 3–13 3.3.5 BLISS–36 Character Representation .......................... 3–14 3.4 Storage Organization ......................................... 3–14 3.4.1 The Stack . ............................................ 3–15 3.4.2 The Registers ............................................ 3–15 3.4.3 Storage for a Program Module . ............................ 3–15 4 Primary Expressions 4.1 Primaries .................................................. 4–1 4.1.1 Syntax ................................................. 4–2 4.1.2 Semantics . ............................................ 4–2 4.2 Numeric-Literals ............................................ 4–2 4.2.1 Syntax ................................................. 4–3 4.2.2 Restrictions . ............................................ 4–4 4.2.3 Defaults ................................................ 4–5 4.2.4 Semantics . ............................................ 4–5 4.3 String Literals . ............................................ 4–6 4.3.1 Syntax ................................................. 4–6 4.3.2 Restrictions . ............................................ 4–7 4.3.3 Defaults ................................................ 4–8 4.3.4 Semantics . ............................................ 4–8 4.4 PLITs . .................................................... 4–10 4.4.1 Syntax ................................................. 4–11 4.4.2 Restrictions . ............................................ 4–12 4.4.3 Defaults ................................................ 4–12 4.4.4 Semantics . ............................................ 4–12 4.4.5 Pragmatics . ............................................ 4–13 4.5 Names .................................................... 4–13 4.5.1 Syntax ................................................. 4–13 4.5.2 Restrictions . ............................................ 4–14 4.5.3 Semantics . ............................................ 4–14 4.6 Blocks .................................................... 4–14 4.7 Structure-References ......................................... 4–15 4.8 Routine-Calls . ............................................ 4–15 4.9 Field-References . ............................................ 4–15 4.10 Code Comments . ............................................ 4–15 iv 4.10.1 Syntax . ................................................ 4–16 4.10.2 Semantics ............................................... 4–16 5 Computational Expressions 5.1 Operator-Expressions . ........................................ 5–1 5.1.1 Syntax . ................................................ 5–1 5.1.2 Restrictions ............................................. 5–2 5.1.3 Defaults ................................................ 5–3 5.1.4 Semantics ............................................... 5–4 5.1.4.1 Fetch Expressions ..................................... 5–4 5.1.4.2 Prefix Sign Expressions . ................................ 5–5 5.1.4.3 Shift Expression ....................................... 5–5 5.1.4.4 Arithmetic Expressions . ................................ 5–6 5.1.4.5 Relational Expressions . ................................ 5–7 5.1.4.6 Boolean Expressions . ................................ 5–9 5.1.4.7 Assignment Expressions ................................ 5–10 5.1.5 Pragmatics .............................................. 5–10 5.1.5.1 Explicit Parenthesization ................................ 5–10 5.1.5.2 The Order of Evaluation ................................ 5–11 5.1.5.3 Operations on Field Values in BLISS–16/32 . ............... 5–12 5.2 Executable-Functions