SNOBOL4 in MTS

Total Page:16

File Type:pdf, Size:1020Kb

SNOBOL4 in MTS M T S The Michigan Terminal System Volume 9: SNOBOL4 in MTS September 1975 Updated June 1979 (Update 1) Updated May 1984 (Update 2) The University of Michigan Computing Center Ann Arbor, Michigan 1 DISCLAIMER This manual is intended to represent the current state of the Michigan Terminal System (MTS), but because the system is constantly being developed, extended, and refined, sections of this manual will become obsolete. The user should refer to the Computing_________ Center______ Newsletter,__________ Computing Center Memos, and future updates to this manual for the latest information about changes to MTS. Copyright 1979 by the Regents of the University of Michigan. Copying is permitted for nonprofit, educational use provided that (1) each reproduction is done without alteration and (2) the volume reference and date of publication are included. Permission to republish any portions of this manual should be obtained in writing from the Director of the University of Michigan Computing Center. 2 MTS 9: SNOBOL4 in MTS September 1975 Page Revised May 1984 PREFACE_______ The software developed by the Computing Center staff for the operation of the high-speed IBM 370-compatible computers can be described as a multipro- gramming supervisor that handles a number of resident, reentrant programs. Among them is a large subsystem, called MTS (Michigan Terminal System), for command interpretation, execution control, file management, and accounting maintenance. Most users interact with the computer’s resources through MTS. The MTS Manual is a series of volumes that describe in detail the facilities provided by the Michigan Terminal System. Administrative poli- cies of the Computing Center and the physical facilities provided are described in a separate publication entitled Introduction_________________________ to Computing Center_______________ Services. The MTS volumes now in print are listed below. The date indicates the most recent edition of each volume; however, since volumes are periodically updated, users should check the file *CCPUBLICATIONS, or watch for announce- ments in the Computing___________________________ Center Newsletter, to ensure that their MTS volumes are fully up to date. | Volume 1: The____________________________ Michigan Terminal System, January 1984 | Volume 2: Public________________________ File Descriptions, April 1982 | Volume 3: System______________________________ Subroutine Descriptions, April 1981 | Volume 4: Terminals_____________________________ and Networks in MTS, March 1984 | Volume 5: System_______________ Services, May 1983 | Volume 6: FORTRAN______________ in MTS, October 1983 | Volume 7: PL/I___________ in MTS, September 1982 | Volume 8: LISP____________________ and SLIP in MTS, June 1976 | Volume 9: SNOBOL4______________ in MTS, September 1975 | Volume 10: BASIC____________ in MTS, December 1980 | Volume 11: Plot_______________________ Description System, August 1978 | Volume 12: PIL/2____________ in MTS, December 1974 | Volume 13: The_____________________________ Symbolic Debugging System, November 1980 | Volume 14: 360/370_________________________ Assemblers in MTS, May 1983 | Volume 15: FORMAT__________________ and TEXT360, April 1977 | Volume 16: ALGOL______________ W in MTS, September 1980 | Volume 17: Integrated__________________________ Graphics System, December 1980 | Volume 18: The___________________ MTS File Editor, September 1982 | Volume 19: Tapes______________________ and Floppy Disks, February 1983 Other volumes are in preparation. The numerical order of the volumes does not necessarily reflect the chronological order of their appearance; however, in general, the higher the number, the more specialized the volume. Volume 1, for example, introduces the user to MTS and describes in general the MTS operating system, while Volume 10 deals exclusively with BASIC. 3 MTS 9: SNOBOL4 in MTS Page Revised May 1984 September 1975 The attempt to make each volume complete in itself and reasonably independent of others in the series naturally results in a certain amount of repetition. Public file descriptions, for example, may appear in more than one volume. However, this arrangement permits the user to buy only those volumes that serve his or her immediate needs. Richard A. Salisbury General Editor 4 MTS 9: SNOBOL4 in MTS September 1975 Page Revised May 1984 Contents________ Preface . 3 Speed Considerations . 76 Overview of SNOBOL4 in MTS . 7 Running in MTS . 78 Introduction to SNOBOL4 . 9 Parameters . 78 SNOBOL4 Constants . 10 I/O in MTS . 82 Variables . 12 External Routines . 83 Assignment . 14 Error Messages and Handling . 84 Arithmetic Operations . 16 Compilation Error Messages 84 Concatenation . 18 Execution Error Messages . 87 Indirection . 20 Error Codes . 89 Input-Output . 22 Calling External System Success and Failure . 23 Subroutines . 98 GOTOs . 24 SNOSTORM . 99 Program Format . 26 Introduction . 99 Simple Pattern Matching . 27 Definition of Terms . 99 Replacement . 29 Statement Expressions . 99 Function Calls . 31 Control Structures . .100 The Complete Statement IF Structures . .101 Format . 34 Simple IF . .101 More Sophisticated Pattern IF...ENDIF . .101 Matching . 35 IF...ELSE...ENDIF . .102 The Arbitrary Pattern - ARB . 36 IF...ELSEIF...ENDIF . .102 Conditional Value Assignment 38 LOOP Structures . .102 The Balanced Pattern - BAL . 40 LOOP . .103 The Fixed-Length Pattern LOOP FOR iteration . .103 Function - LEN(N) . 41 LOOP WHILE sexp . .104 Function definition . 43 LOOP UNTIL sexp . .105 Function Execution . 45 ENDLOOP [REPEAT [while] SPITBOL . 47 [until]] . .105 Introduction . 47 EXITLOOP . .106 Summary of Differences . 48 NEXTLOOP . .106 Features Not Implemented . 48 CASE Structures . .106 Features Implemented Procedure Structures . .107 Differently . 48 PROCEDURE...ENDPROCEDURE .107 Additional Features . 49 EXITPROCEDURE . .108 Other Incompatibilities . 49 Initialization . .108 Datatypes and Conversions . 50 Procedure and Case Datatypes in SPITBOL . 50 Initialization . .108 Datatype Conversion . 50 INITIAL...ENDINITIAL . .109 Syntax . 54 Comment Statements . .109 Pattern Matching . 55 SNOSTORM Comment Lines . .110 Functions . 55 Listing Control Statements .110 Keywords . 70 EJECT [icon] . .110 Control Cards . 72 TITLE ’text of title’ . .110 Listing Control Cards . 72 SUBTITLE ’text of Option Control Cards . 73 subtitle’ . .111 Programming Notes . 75 SPACE icon . .111 Space Considerations . 75 LIST [keyword] . .111 5 MTS 9: SNOBOL4 in MTS Page Revised May 1984 September 1975 SNOSTORM Listing . .111 Registration . .133 Source Indentation . .112 Block Organizations . .135 PAR Options . .112 FIXing a Block . .138 SIZE=icon . .112 Adaptive Blocks . .139 {COM|NOCOM} . .112 Iterated Blocks . .139 {INDENT=string|NOINDENT} .113 Replicated Blocks . .144 {LIST|NOLIST} . .113 Deferred Blocks . .148 CONVERT . .113 Nodes and Mergers . .149 DEBUG . .113 The &FILL Keyword . .154 Running SNOSTORM in MTS . .114 Surrogates . .154 Restrictions . .115 Special Built-in Functions .156 Multiple Statements . .115 Broadcasting . .158 Reserved Words . .115 Carriage Control . .158 Labeled SNOSTORM Examples . .159 Statements . .116 Appendix: Public File -COPY . .116 Descriptions . .169 Error Handling . .117 *CONVSNOBOL . .171 Obsolete SNOSTORM Statements 117 *SNOBOL4 . .173 Examples . .118 *SNOBOL4B . .175 SNOBOL4 Blocks . .127 *SPITBOL . .177 Introduction . .127 *SPITDEBUG . .180 Definition . .128 *SPITERR . .180 Printing . .128 *SPITLIB . .181 Concatenation . .129 *TRANSNOBOL . .183 Vacuous Blocks . .131 Index . .184 6 MTS 9: SNOBOL4 in MTS September 1975 Page Revised June 1979 OVERVIEW__________________________ OF SNOBOL4 IN MTS The SNOBOL4 language was developed at Bell Telephone Laboratories as a tool for string and list-processing applications. As a consequence, the language contains many powerful facilities for solving problems which involve text analysis, text formatting, etc. On the other hand, SNOBOL4 is a poor choice for solving problems which are primarily numeric in nature. Such problems are handled much more efficiently with mathematically oriented languages such as FORTRAN. In MTS, there are four distinct SNOBOL4 language processors which are available in the public files *SNOBOL4, *SNOBOL4B, *SPITBOL, and *SNOSTORM. Each public file is described in detail in the appendix to this volume. A brief summary is given here. *SNOBOL4 contains the language processor developed at Bell Telephone Laboratories and accepts the basic SNOBOL4 language. This processor is an interpreter and is implemented in a machine-independent macro language. This processor tends to be rather slow and expensive to use. *SNOBOL4B contains the language processor developed at Bell Telephone Laboratories for an upward-compatible extension of the basic SNOBOL4 language. This extension is called SNOBOL4 with Blocks and provides additional facilities for producing 2- and 3-dimensional printed output, such as is required for graphs and flowcharts. This processor is also implemented as an interpreter and tends to be expensive to use. *SPITBOL contains the language processor for a nearly compatible exten- sion of the basic SNOBOL4 language which was developed at the Illinois Institute of Technology. This processor is implemented as a true compiler and produces fast and efficient object module programs. Programs compiled with *SPITBOL can be run as much as ten times cheaper than programs run under *SNOBOL4. *SNOSTORM contains a preprocessor for an extended version of the SNOBOL4 language allowing structured-programming types
Recommended publications
  • CSC 272 - Software II: Principles of Programming Languages
    CSC 272 - Software II: Principles of Programming Languages Lecture 1 - An Introduction What is a Programming Language? • A programming language is a notational system for describing computation in machine-readable and human-readable form. • Most of these forms are high-level languages , which is the subject of the course. • Assembly languages and other languages that are designed to more closely resemble the computer’s instruction set than anything that is human- readable are low-level languages . Why Study Programming Languages? • In 1969, Sammet listed 120 programming languages in common use – now there are many more! • Most programmers never use more than a few. – Some limit their career’s to just one or two. • The gain is in learning about their underlying design concepts and how this affects their implementation. The Six Primary Reasons • Increased ability to express ideas • Improved background for choosing appropriate languages • Increased ability to learn new languages • Better understanding of significance of implementation • Better use of languages that are already known • Overall advancement of computing Reason #1 - Increased ability to express ideas • The depth at which people can think is heavily influenced by the expressive power of their language. • It is difficult for people to conceptualize structures that they cannot describe, verbally or in writing. Expressing Ideas as Algorithms • This includes a programmer’s to develop effective algorithms • Many languages provide features that can waste computer time or lead programmers to logic errors if used improperly – E. g., recursion in Pascal, C, etc. – E. g., GoTos in FORTRAN, etc. Reason #2 - Improved background for choosing appropriate languages • Many professional programmers have a limited formal education in computer science, limited to a small number of programming languages.
    [Show full text]
  • Note Quiz 1 K All 10 Questions Ise File Main Sy Thay Note Handouts Main Note Keyword Ko Search Krien Important Points Hain Jin Ko Lazmi Yaad Krna Hy
    Note Quiz 1 k all 10 questions ise file main sy thay Note handouts main note keyword ko search krien important points hain jin ko lazmi yaad krna hy. Ada discriminate types is similar to . C/C++ pointer C/C++ union C/C++ reference All of the given Page # 52 - My Ok The block structure feature of ALGOL60 has scope. No Local Universal Global Page # 26 – My Ok Unlike C/C++, Ada can have _____ within functions/procedures. Objects Functions/procedures Events Parameters Page # 58 – My Ok In the Decimal fixed point type, the distance between values is implemented as a power of 2 10 8 16 Page # 50 – My Ok Function must have at least ______ return statement. Three Two One Four Page # 57 – My Ok Every function must have at least one return statement. A procedure is not required to have any return statements. The expression in a function's return statement must evaluate to a type that matches the return type in the function's declaration. ______ operations must have one of its parameters of the tagged type. Concurrent Synchronized Primitive Generic Page # 59 – My Ok An understanding of implementation issues leads to a/an ______ of why languages are designed the way they are. Uncertainty Understanding Misunderstanding Confusion Page # 5 – My Ok ________ has an efficient use of processor and memory. Plankul Kool LISP CORBA C++ Imperative programming languages are the direct result of . Charles Babbage engine Logic or list program languages. Von Neumann architecture Language application domain Page # 22 – My Ok Following are imperative languages EXCEPT LISP C FORTRAN PASCAL Page # 22 – My Ok Which statement is true from programming language evolution perspective about 1970's era? Analysis and elaboration era Era of effective software technology Era of object oriented programming languages Era of discovery and description Page # 30 – My Ok SNOBOL language questions starts from here Variable name in SNOBOL may not be longer than .
    [Show full text]
  • Regular Expressions
    Regular Expressions A regular expression describes a language using three operations. Regular Expressions A regular expression (RE) describes a language. It uses the three regular operations. These are called union/or, concatenation and star. Brackets ( and ) are used for grouping, just as in normal math. Goddard 2: 2 Union The symbol + means union or or. Example: 0 + 1 means either a zero or a one. Goddard 2: 3 Concatenation The concatenation of two REs is obtained by writing the one after the other. Example: (0 + 1) 0 corresponds to f00; 10g. (0 + 1)(0 + ") corresponds to f00; 0; 10; 1g. Goddard 2: 4 Star The symbol ∗ is pronounced star and means zero or more copies. Example: a∗ corresponds to any string of a’s: f"; a; aa; aaa;:::g. ∗ (0 + 1) corresponds to all binary strings. Goddard 2: 5 Example An RE for the language of all binary strings of length at least 2 that begin and end in the same symbol. Goddard 2: 6 Example An RE for the language of all binary strings of length at least 2 that begin and end in the same symbol. ∗ ∗ 0(0 + 1) 0 + 1(0 + 1) 1 Note precedence of regular operators: star al- ways refers to smallest piece it can, or to largest piece it can. Goddard 2: 7 Example Consider the regular expression ∗ ∗ ((0 + 1) 1 + ")(00) 00 Goddard 2: 8 Example Consider the regular expression ∗ ∗ ((0 + 1) 1 + ")(00) 00 This RE is for the set of all binary strings that end with an even nonzero number of 0’s.
    [Show full text]
  • Technical Standard COBOL Language
    Technical Standard COBOL Language NICAL H S C T A E N T D A R D [This page intentionally left blank] X/Open CAE Specification COBOL Language X/Open Company, Ltd. December 1991, X/Open Company Limited All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior permission of the copyright owners. X/Open CAE Specification COBOL Language ISBN: 1 872630 09 X X/Open Document Number: XO/CAE/91/200 Set in Palatino by X/Open Company Ltd., U.K. Printed by Maple Press, U.K. Published by X/Open Company Ltd., U.K. Any comments relating to the material contained in this document may be submitted to X/Open at: X/Open Company Limited Apex Plaza Forbury Road Reading Berkshire, RG1 1AX United Kingdom or by Electronic Mail to: [email protected] X/Open CAE Specification (1991) Page : ii COBOL Language Contents COBOL LANGUAGE Chapter 1 INTRODUCTION 1.1 THE X/OPEN COBOL DEFINITION 1.2 HISTORY OF THIS DOCUMENT 1.3 FORMAT OF ENTRIES 1.3.1 Typographical Conventions 1.3.2 Terminology Chapter 2 COBOL DEFINITION 2.1 GENERAL FORMAT FOR A SEQUENCE OF SOURCE PROGRAMS 2.2 GENERAL FORMAT FOR NESTED SOURCE PROGRAMS 2.2.1 Nested-Source-Program 2.3 GENERAL FORMAT FOR IDENTIFICATION DIVISION 2.4 GENERAL FORMAT FOR ENVIRONMENT DIVISION 2.5 GENERAL FORMAT FOR SOURCE-COMPUTER-ENTRY 2.6 GENERAL FORMAT FOR OBJECT-COMPUTER-ENTRY 2.7 GENERAL FORMAT FOR SPECIAL-NAMES-CONTENT 2.8 GENERAL FORMAT FOR FILE-CONTROL-ENTRY 2.8.1
    [Show full text]
  • ED027743.Pdf
    DOCUMENT RESUME ED 027 743 EM 007 134 By-Fasana, Paul J., Ed.; Shank, Russell, Ed. Tutorial on Generalized Programming Language s and Systems. Instructor Edition. American Society for Information Science, Washington, D.C. Spons Agency-National Science Foundation, Washington, D.C. Pub Date Jul 68 Grant- F -NSF -GN -657 Note-65p.; Manual based on materials prepared and presented by Thomas K. Burgess and others at the Annual Convention of the American Society for Information Science (New York, October 22-26, 1967) EDRS Price MF-$0.50 HC-$3.35 Descriptors-*Computer Science, *Computer Science Education, Information Retrieval, Information Storage, *Manuals Identifiers-COBOL, FORTRAN, PL I, SNOBOL This instructor's manual is a comparative analysis and review of the various computer programing languagescurrentlyavailable andtheircapabilitiesfor performing text manipulation, information storage, and data retrieval tasks. Based on materials presented at the 1967 Convention of the American Society for Information Science,themanualdescribes FORTRAN, a language designedprimarilyfor mathematicalcomputation;SNOBOL, alist-processinglanguagedesignedfor information retrieval application; COBOL, a business oriented language; and PL/L a new language incorporating many of the desirable features of FORTRAN andCOBOL but as yet implemented only for the IBM 360 computer system. (TI) U.S. DEPARTMENT OF HEALTH, EDUCATION & WELFARE OFFICE OF EDUCATION Pek THIS DOCUMENT HAS BEEN REPRODUCED EXACTLY AS RECEIVED FROM THE N. PERSON OR ORGANIZATION ORIGINATING IT.POINTS Of VIEW OR OPINIONS rJ STATED DO NOT NECESSARILY REPRESENT OFFICIAL OFFICE OF EDUCATION TUTORIAL ON POSITION OR POLICY. GENERALIZED PROGRAMMING LANGUAGES AND SYSTEMS Instructor Edition. Edited by Paul J. Fasana Columbia University Libraries New York, N. Y. and Russell Shank The Smithsonian Institution Washington, D.
    [Show full text]
  • CMPSCI 250 Lecture
    CMPSCI 250: Introduction to Computation Lecture #29: Proving Regular Language Identities David Mix Barrington 6 April 2012 Proving Regular Language Identities • Regular Language Identities • The Semiring Axioms Again • Identities Involving Union and Concatenation • Proving the Distributive Law • The Inductive Definition of Kleene Star • Identities Involving Kleene Star • (ST)*, S*T*, and (S + T)* Regular Language Identities • In this lecture and the next we’ll use our new formal definition of the regular languages to prove things about them. In particular, in this lecture we’ll prove a number of regular language identities, which are statements about languages where the types of the free variables are “regular expression” and which are true for all possible values of those free variables. • For example, if we view the union operator + as “addition” and the concatenation operator ⋅ as “multiplication”, then the rule S(T + U) = ST + SU is a statement about languages and (as we’ll prove today) is a regular language identity. In fact it’s a language identity as regularity doesn’t matter. • We can use the inductive definition of regular expressions to prove statements about the whole family of them -- this will be the subject of the next lecture. The Semiring Axioms Again • The set of natural numbers, with the ordinary operations + and ×, forms an algebraic structure called a semiring. Earlier we proved the semiring axioms for the naturals from the Peano axioms and our inductive definitions of + and ×. It turns out that the languages form a semiring under union and concatenation, and the regular languages are a subsemiring because they are closed under + and ⋅: if R and S are regular, so are R + S and R⋅S.
    [Show full text]
  • Some Aspects of Semirings
    Appendix A Some Aspects of Semirings Semirings considered as a common generalization of associative rings and dis- tributive lattices provide important tools in different branches of computer science. Hence structural results on semirings are interesting and are a basic concept. Semi- rings appear in different mathematical areas, such as ideals of a ring, as positive cones of partially ordered rings and fields, vector bundles, in the context of topolog- ical considerations and in the foundation of arithmetic etc. In this appendix some algebraic concepts are introduced in order to generalize the corresponding concepts of semirings N of non-negative integers and their algebraic theory is discussed. A.1 Introductory Concepts H.S. Vandiver gave the first formal definition of a semiring and developed the the- ory of a special class of semirings in 1934. A semiring S is defined as an algebra (S, +, ·) such that (S, +) and (S, ·) are semigroups connected by a(b+c) = ab+ac and (b+c)a = ba+ca for all a,b,c ∈ S.ThesetN of all non-negative integers with usual addition and multiplication of integers is an example of a semiring, called the semiring of non-negative integers. A semiring S may have an additive zero ◦ defined by ◦+a = a +◦=a for all a ∈ S or a multiplicative zero 0 defined by 0a = a0 = 0 for all a ∈ S. S may contain both ◦ and 0 but they may not coincide. Consider the semiring (N, +, ·), where N is the set of all non-negative integers; a + b ={lcm of a and b, when a = 0,b= 0}; = 0, otherwise; and a · b = usual product of a and b.
    [Show full text]
  • The Evolution of Lua
    The Evolution of Lua Roberto Ierusalimschy Luiz Henrique de Figueiredo Waldemar Celes Department of Computer Science, IMPA–Instituto Nacional de Department of Computer Science, PUC-Rio, Rio de Janeiro, Brazil Matematica´ Pura e Aplicada, Brazil PUC-Rio, Rio de Janeiro, Brazil [email protected] [email protected] [email protected] Abstract ing languages offer associative arrays, in no other language We report on the birth and evolution of Lua and discuss how do associative arrays play such a central role. Lua tables it moved from a simple configuration language to a versatile, provide simple and efficient implementations for modules, widely used language that supports extensible semantics, prototype-based objects, class-based objects, records, arrays, anonymous functions, full lexical scoping, proper tail calls, sets, bags, lists, and many other data structures [28]. and coroutines. In this paper, we report on the birth and evolution of Lua. We discuss how Lua moved from a simple configuration Categories and Subject Descriptors K.2 [HISTORY OF language to a powerful (but still simple) language that sup- COMPUTING]: Software; D.3 [PROGRAMMING LAN- ports extensible semantics, anonymous functions, full lexical GUAGES] scoping, proper tail calls, and coroutines. In §2 we give an overview of the main concepts in Lua, which we use in the 1. Introduction other sections to discuss how Lua has evolved. In §3 we re- late the prehistory of Lua, that is, the setting that led to its Lua is a scripting language born in 1993 at PUC-Rio, the creation. In §4 we relate how Lua was born, what its original Pontifical Catholic University of Rio de Janeiro in Brazil.
    [Show full text]
  • Theme and Variations on the Concatenation Product
    Theme and variations on the concatenation product Jean-Eric´ Pin1⋆ LIAFA, University Paris-Diderot and CNRS, France. Abstract. The concatenation product is one of the most important op- erations on regular languages. Its study requires sophisticated tools from algebra, finite model theory and profinite topology. This paper surveys research advances on this topic over the last fifty years. The concatenation product plays a key role in two of the most important results of automata theory: Kleene’s theorem on regular languages [23] and Sch¨utzen- berger’s theorem on star-free languages [60]. This survey article surveys the most important results and tools related to the concatenation product, including connections with algebra, profinite topology and finite model theory. The paper is organised as follows: Section 1 presents some useful algebraic tools for the study of the concatenation product. Section 2 introduces the main definitions on the product and its variants. The classical results are summarized in Section 3. Sections 4 and 5 are devoted to the study of two algebraic tools: Sch¨utzenberger products and relational morphisms. Closure properties form the topic of Section 6. Hierarchies and their connection with finite model theory are presented in Sections 7 and 8. Finally, new directions are suggested in Section 9. 1 The instruments This section is a brief reminder on the algebraic notions needed to study the con- catenation product: semigroups and semirings, syntactic ordered monoids, free profinite monoids, equations and identities, varieties and relational morphisms. More information can be found in [1–3,18,35,42,45]. 1.1 Semigroups and semirings If S is a semigroup, the set P(S) of subsets of S is also a semiring, with union as addition and multiplication defined, for every X, Y ∈P(S), by XY = {xy | x ∈ X,y ∈ Y } In this semiring, the empty set is the zero and for this reason, is denoted by 0.
    [Show full text]
  • Mal E Init N Synt X Cobol
    BeMA EUROPEAN CO~IPUTER ~lANUFACTURERS ASSOCIATION MAL E INIT N of the SYNT X COBOL eptelnber ] 970 Free copies of this document are available from ECMA, European Computer Manufacturers Association, 114 Rue du Rhone - 1204 Geneva (Switzerland) EeMA EUROPEAN COMPUTER MANUFACTURERS ASSOCIATION FORMAL DEFINITION of the SYNTAX OF COBOL Septenlber 1970 FORMAL DEFINITION of the SYNTAX OF COBOL - i - CONTENTS Page PREFACE ix INTRODUCTION TO THE NOTATION xiii FORMAL DEFINITION OF COBOL SYNTAX G. Syntactic Definitions of General Nature EMPTY 1 COBOL GRAPHICS 2 COBOL CONTROLS 4 SOME FREQUENTLY USED SEPARATORS 5 WORD 6 PROPER NONNUMERIC LITERAL 7 PROPER NUMERIC LITERAL 8 FIGURATIVE CONSTANT 9 LITERAL 10 ARITHMETIC OPERATOR 11 PROPER RELATIONAL OPERATOR 12 PICTURE CHARACTER STRING 13 COMMENT STRING 14 OTHER LANGUAGE STRING 15 T. COBOL Text SEPARATORS 16 GENERALIZED CHARACTER STRING 17 STRUCTURE OF COBOL TEXT 18 - ii - Page N. Names defined by the Imp1ementors HARDWARE NAMES 19 OTHER NAMES 20 C. COBOL Program COBOL PROGRAM STRUCTURE 21 I. Identification Division IDENTIFICATION DIVISION STRUCTURE 22 PROGRAM-ID PARAGRAPH 23 DATE COMPILED PARAGRAPH 24 OTHER PARAGRAPHS 2S COt~ENT PAP~GRAPH BODY 26 E. Environment Division ENVIRONMENT DIVISION STRUCTURE 27 CONFIGURATION SECTION STRUCTURE 28 INPUT-OUTPUT SECTION STRUCTURE 29 SOURCE COMPUTER PARAGRAPH 30 OBJECT COMPUTER PARAGRAPH 31 SEGMENT LIMIT CLAUSE 32 SPECIAL-NAMES PARAGRAPH 33 SPECIAL-NAMES CLAUSE 34 CURRENCY-SIGN CLAUSE 37 DECIMAL-POINT CLAUSE 38 FILE-CONTROL PARAGRAPH 39 SELECT CLAUSE 41 ASSIGN CLAUSE 42 MULTIPLE REEL/UNIT CLAUSE 43 ALTERNATE AREA CLAUSE 44 FILE-LIMIT CLAUSE 4S - iii - Page ACCESS MODE CLAUSE 46 PROCESSING MODE CLAUSE 47 KEY CLAUSE 48 I-O-CONTROL PARAGRAPH 49 RERUN CLAUSE 50 SAME CLAUSE 51 MULTIPLE FILE CLAUSE 52 D.
    [Show full text]
  • SNOBOL-Tone (ST) - a Sound Pattern-Matching Programming Language
    SNOBOL-Tone (ST) - A Sound Pattern-Matching Programming Language Dan Ophir(1) and Dotan Dekel(2) AFEKA, Tel-Aviv Academic College of Engineering, Tel Aviv, Israel (1) [email protected] (2) [email protected] Abstract Keywords: Interpreter, Fast Fourier Transform, Pattern- The proposed programming language, matching, MLAT – Multi Level Adaptive SNOBOL-Tone, performs sound matching in a Technique. given sound stream. This is analogous to pattern-matching of substrings in a given 1. Introduction string, as is done in the SNOBOL language [1]. SNOBOL-Tone is a Domain Specific One way to perform the SNOBOL-Tone pattern Language (DSL) for the specific purpose of matching of a spoken text is to transcribe the treating tones, sounds and signals [5]. Another text into written text followed by regular language that has a similar function is CSound SNOBOL pattern matching [2]. However, [6]. Csound is a computer programming when the sound stream is not a spoken stream language for sound, also known as a sound another solution is needed. SNOBOL-Tone is compiler or an audio programming language, designed to provide such a solution. or more precisely, an audio DSL. It is called SNOBOL-Tone integrates three scientific Csound because it is written in C, as opposed domains: to some of its predecessors. 1. Computer science – creating 2. SNOBOL Concepts compilers and interpreters; 2. Electronic engineering – building SNOBOL [1] is a string pattern matching filters of various frequencies; programming language based on a single 3. Applied mathematics – Fourier statement: transformations, wavelets, optimization of algebraic expressions (1) <label>: <subject> <pattern> = and multi-level-adaptive-techniques <object> :S(label1)F(label2) to accelerate various filtering algorithms [3].
    [Show full text]
  • Introduction to Object-Oriented Programming
    QUIZ How could we disable the automatic creation of copy- constructors pre-C++11? What syntax feature did C++11 introduce to make the disabling clearer and more permanent? • Give a code example. QUIZ How is the overloaded assignment operator different from all other overloaded operators in C++? QUIZ Show in a code example how to disable the automatic creation of the overloaded assignment operator post- C++11. The class is named Foo. Ch. 14: Inheritance & Composition Remember composition Composition If embedded object is private, it will be accessed through member (or friend) functions Composition – multi-level example Draw the UML diagram, as learned in ch.1! Inheritance Base class, from which Y inherits UML diagram Inheritance The default is private inheritance During inheritance, everything defaults to private. If the base class were not preceded by public, it would mean that all of the members of the base class, private and public would be private in the derived class. Examples on next slide Explaining public and private in inheritance (see protected later!) Inheritance – adding new functions change( ) ↔ we can add completely new functions. Inheritance – redefining functions set( ) ↔ we can redefine functions from the base class. If function is redefined, we can still call the base-class version using the scope resolution operator! Inheritance – redefining functions A note on language: redefining functions in a derived class is mostly referred to today as overriding; this includes the C++ standards. (Redefining is used when we talk about typedef or namespaces.) Unfortunately, the matter is further muddled by the existence of the override identifier (since C++11 – it applies only to virtual functions).
    [Show full text]