Language Manual, Volume I MAINSAIL@

Total Page:16

File Type:pdf, Size:1020Kb

Language Manual, Volume I MAINSAIL@ Language Manual, Volume I MAINSAIL@ Language Manual, Part I: Syntax and Semantics 24 March 1989 Copyright (c) 1979, 1983, 1984, 1985, 1986, 1987, 1989, by XIDAK, Inc., Menlo Park, Califomia. The software desaibed herein is the property of XIDAK, Inc., with all rights reserved, and is a confidential trade secret of XIDAK. The software desaibed herein may be used only under license from XIDAK. MAINSAIL is a registered trademark ofXIDAK, Inc. MAINDEBUG, MAINEDIT, MAINMEDIA, MAINPM, Structure Blaster, roB, and SQUT are trademarks of XIDAK, Inc. CONCENTRIX is a trademark of Alliant Computer Systems Corporation. Amdahl, Universal Time-Sharing System, and UTS are trademarks of Amdahl Corporation. Aegis, Apollo, DOMAIN, GMR, and GPR are trademarks of Apollo Computer Inc. UNIX and UNIX System V are trademarks of AT&T. DASHER, DG/UX, ECLIPSE, ECLIPSE MV /4000, ECUPSE MV /8000, ECLIPSE MV /10000. and ECLIPSE MV{lOOOO are trademarks of Data General Corporation. DEC,PDP, TOPS-lO, TOPS-20, VAX-H, VAX,MicroVAX,MicroVMS, ULTR1X-32,and VAXNMS are trademarks of Digital Equipment Corporation. EMBOS and ELXSI System 6400 are trademarks of ELXSI, Inc. The KERMIT File Transfer Protocol was named after the star of THE MUPPET SHOW television series. The name is used by pennission of Henson Associates, Inc. HP-UX and Vectra are trademarks of Hewlett-Packard Company. Intel is a trademark of Intel Corporation. CLIPPER. CLIX. Intergraph. InterPro 32, and InterPro 32C are trademarks of Intergraph Corporation. System/370, VM/SP CMS. and CMS are trademarks of International Business Machines Corporation. MC68000. M68000. MC68020. and MC68881 are trademarks of Motorola Semiconductor Products Inc. ROS and Ridge 32 are trademarks of Ridge Computers. SPARC, SWl Microsystems. SlDl Workstation. and the combination of SWl with a numeric suffix are trademarks of Sun Microsystems, Inc. WINtrCP is a trademark of The Wollongong Group. Inc. WY-5d. WY-60, WY-75. and WY-lOO are trademarks ofWyse Technology. Some XIDAK documentation is published in the typefaces "Times" and "Helvetica". used by pennission of Apple Computer, Inc., Wlder its license with the Allied Corporatioo. Helvetica and Times are trademarks of the Allied CotpOration, valid lDlder applicable law. The U$e herein of any of the above trademarks does not create any right. title. or interest in or to the trademarks. -ii- Table 01 Contents 1. Introduction . 1 1.1. Version . 1 1.2. The Design of MAINSAil.. 1 1.3. Terminology and Symbols . .... 2 1.4. Conventions Used in This Document. 4 1.4.1. User Interaction . 4 1.4.2. Syntax Descriptions. 4 1.4.3. Temporary Features . 5 2. Basic Language Concepts . 6 2.1. Character Set . 6 2.2. Comments . 8 2.3. Identifiers . 9 2.4. Use of Semicolons and Fonnatters . 10 2.5. Compiletime Evaluation. ... 10 2.6. Storage Units and Character Units . 11 2.7. Type Codes. 11 2.8. Garbage Collections and Memory Management 12 2.9. cmdFile and logFile 13 3. Data Types. 14 3.1. Boolean . 15 3.2. Integer and Long Integer. 15 3.3. Real and Long Real. 16 3.4. Bits and Long Bits . 17 3.5. String. .. .. 19 3.5.1. Low-Level String Manipulation . '. 20 3.5.2. String Constants and Garbage Collection .... 22 3.6. Pointer. 22 3.7. Address . 22 3.8. Charadr . 23 3.9. Conversion Procedures 25 4. Expressions . 27 4.1. Constants. 27 4.2. Variables. ... 27 4.3. Procedure Expression . 28 4.4. Substrings . 28 4.4.1. "INF" . 29 4.5. If Expression . 29 4.6. Assignment Expression . 31 4.7. Compiletime Pseudo-Procedures 32 - iii- 4.8. Operators and Operations 32 4.8.1. String Comparison . 33 4.8.2. Bitwise Operations . 37 4.8.3. Comparison Chains. 38 4.8.4. Operator Precedence 38 4.8.5. Dotted Operators. 40 4.8.6. Garbage Collection . 41 4.9. Assignment Compatibility .. 42 5. Statements ...... 43 5.1. Assignment Statement 43 5.2. Expression Statement. 43 5.3. Procedme Statement 44 5.4. Return Statement .. 45 5.5. Begin Statement. 45 5.6. If Statement. 46 5.7. Case Statement . 48 5.8. Iterative Statement. 51 5.9. Done Statement . 54 5.10. Continue Statement . ... 54 5.11. Empty Statement . 55 6. ~Urrations . 57 6.1. Scope of Identifiers. 58 6.2. Simple Variable Declarations. 59 6.3. Qualifiers. 59 6.4. "OWN" Qualifier 60 7. Arrays ........ 61 7.1. Array Declarations. 61 7.2. Array Allocation. 62 7.3. Array Disposal .. 62 7.4. Array Initialization. 62 7.5. Accessing an Array Element. 65 7.6. Clearing an Array ....... 66 7.7. Array Assignment . 66 7.8. Array Comparison . 67 7.9. The Short-Array Rule. 68 7.10. Array Pseudo-Fields. 69 8. Classes and Records . 71 8.1. Records . .. .... 71 8.1.1. The Layout of Fields within a Record. 72 8.2. Classes. 73 8.3. Record Allocation and Disposal. 74 8.4. Classified Pointers and Addresses . 74 8.5. Unclassified Pointers and Addresses . 75 - iv- 8.6. Accessing Fields of Records and Storage Templates. 76 8.7. Explicit Classes in Field Variables. 78 8.8. Prefix Classes. 78 8.8.1. Accessing Prefix Fields . 79 8.9. Related Classes ........ 80 8.10. "Safe" and "Unsafe" Assignment of Pointers 80 8.11. Alignment of Chunks 80 9. Procedures. 84 9.1. Procedure Declarations . 84 9.2. Procedure Calls . .. .. 86 9.3. Typed and Untyped Procedures . 86 9.4. Parameters to Procedures 87 9.5. Parameter Qualifiers .... 89 9.5.1. "USES". 89 9.5.2. "PRODUCES". .. .. 89 9.5.3. "MODIFIES". .... 90 9.5.4. "OPTIONAL" . 90 9.5.5. "REPEATABLE".. .. 90 9.6. Order of Argument Evaluation 93 9.7. Array Parameters . 94 9.8. Procedure Qualifiers . 95 9.9. Recursion . 95 9.10. ForwardProcedures .... 96 9.10.1. "FORWARD" for Mutual Recursion .. 96 9.10.2. "FORWARD" for Source Library Declarations . 97 9.11. Inline Procedures . .. 98 9.12. Generic Procedures ............... 99 9.12.1. Sample Generic System Procedure . .. ... 101 9.12.2. Generic Procedure Instance Selection Algorithm . 101 9.12.3. Generic Procedure Extension. 103 9.13. Stack Overflow. 103 10. Modules and Data Sections . 105 10.1. Bound and Nonbound Data Sections 106 10.2. Module Declaration . 107 10.3. Indirect Access to Interface Fields 108 10.4. Classes with Procedures 110 10.5. Direct Access to Interface Fields . 110 10.6. Module Allocation and Disposal . III 10.7. Establishing Module Linkage III 10.8. Intermodule Consistency Checking . 113 10.9. Initial Procedure 113 10.10. Final Procedure 114 10.11. Generic Procedures as Field Variables 115 10.12. Control Sections and Module Swapping. 116 -v- 10.13. Compilation of Several Modules in One File. 116 10.14. Nonbound-Invocation Modules .. 117 11. Intmods. • . 119 11.1. Intmod Directives. 119 11.1.1. Opening Intmods and Accessing Symbols .... 120 11.1.2. Module Visibility . .. .. 120 11.1.3. Individual Symbol Visibility. 121 11.2. Visibility from Supporting Intmods . 122 11.3. "RESTOREFROM" and "SAVEON" 122 11.4. Unqualified Identifier Search Rules . 123 11.5. Use of Symbols from an Intmod . 124 11.6. Intmod Search Rules ...... 124 11.7. Changing an Intmod. 124 11.8. Sample Use of Intmods. 126 12. Objmods, Intmods, Libraries, and Search Rules . 127 12.1. Objmod and Intmod File Names . 127 . 12.2. Objmod and Intmod Search Rules . 128 13. Macros. .. .• .. ... 132 13.1. "DEFINE". 132 13.2. "REDEFINE" . ... 133 13.3. Bracketed Text . .. ... 134 13.4. Interactive Definition . .. ... 135 13.5. Macro Calls . .. .... ... 137 13.6. Macro Arguments. 137 13.6.1. Repeatable Macro Parameters, $numArgs, $arg, and $sArg. 138 13.7. Determining Whether a Macro Argument Has Been Omitted . 141 13.8. Bracketed Text in Constant Expressions . 141 14. Compiler Directives and Conditional Compilation. 143 14.1. "MESSAGE". 143 14.2. "SOURCEFILE" . 143 14.3. "CHECK", "NOCHECK", and "CHECKING" . 144 14.4. "$DIRECTlVE" . 144 14.5. "SAVEON" and "RESTOREFROM" 145 14.6. "ENCODE" . 145 14.7. "$GLOBALREDEFINE" ..... 146 14.8. "DSP" . 147 14.9. "$LEGALNOTICE". 148 'i 14.10. Conditional Compilation: "IFC", "THENC", "$EFC", "ELSEC , and "ENDC" 148 14.11. "$CASEC": Compiletime Case. .... 149 14.11.1. Selectors . 150 14.11.2. Selector Matching Rules. 150 14.11.3. Delimiters of Selected Text. 150 14.12. "$BEGINC" ...... 152 - vi- 14.13. "$DOC", "$OONEC", "$CONTINUEC", "$FORC": Compiletime Iteration 152 14.13.1. "$DOC iteratedTextENDC" .. 152 14.13.2. "$DONEC" and "$CONTINUEC" 152 14.13.3. "$FORC". 153 14.14. "DCI}' ......... 154 14.15. "$TYPEOF" ...... 154 14.16. "$CLASSOF". .. 155 14.17. "$ISCONSTANT" .. ISS 14.18. Scanning Directives . .. .. 156 14.19. "NEEDBQDY" and "NEEDANYBODIES" 158 . 14.20. $compileTimeValue . 159 14.21. $def. 159 15. Optimization and Checking. 161 15.1. Optimization. 161 15.1.1. $compileTimeValue("OPrIMIZE"). 163 15.2. Checking ........... 164 15.2.1. $compileTimeValue("CHECKINGSTATUS"), $compileTimeValue("LOCALCHECKINGSTATUS"), and "CHECKING" 167 15.3. Arithmetic Checking. ... 168 16. Exceptions ...... 170 16.1. Handle Statement .. 171 16.2. Handling Exceptions. 172 16.3. Propagating Exceptions 172 16.4. Information about the Current Exception. 173 16.5. Nested Exceptions. 173 16.6. Aborting Procedures. 173 16.7. Exception Naming Conventions . 174 16.8. Predefined Exceptions . 175 16.9. errMsg Response Abbreviations 176 16.9.1. Sample Use of Registered Exceptions • . 178 17. Coroutines . 179 17.1. Coroutine Implementation 181 17.2. Coroutines and Exceptions 183 18. Files. .. ... 185 18.1. File Names . 185 18.2. The Classes file, textFile, and dataFile . 187 18.3. Text Files . 188 18.4. Data Files . 189 18.5. Input and Output . 189 18.6. Sequential and Random Access . 189 18.7. Opening a File .... 190 18.8. Closing a File 191 18.9. End-of-File .
Recommended publications
  • Documentation User's Guide, Overview, and Master Index MAINSAIL~ Documentation User's Guide
    Documentation User's Guide, Overview, and Master Index MAINSAIL~ Documentation User's Guide MAINSAIL Overview Master Index 24 March 1989 Copyright (c) 1981,1983,1984,1985,1986,1987,1989, by XIDAK, Inc., Menlo Park, California. The software described herein is the property of XIDAK. Inc., with all rights reserved, and is a confidential trade secret of XIDAK. The software described herein may be used only under license from XIDAK. MAlNSAIL is a registered trademark ofXIDAK, Inc. MAlNDEBUG, MAlNEDIT, MAINMEDIA. MAlNPM, Structure Blaster, roB, and SQUT are trademarks of XIDAK, Inc. CONCENTRIX is a trademark of Alliant Computer Systems Corporation. Amdahl, Universal Time-Sharing System, and UTS are trademarks of Amdahl Corporation. Aegis, Apollo, DOMAIN, GMR, and GPR are trademarks of Apollo Computer Inc. UNIX and UNIX System V are trademarks of AT&T. DASHER, DGIUX. ECLIPSE, ECLIPSE MV/4000, ECUPSE MV/8000, ECLIPSE MV/10000, and ECLIPSE MV/20000 are trademarks of Data General Corporation. DEC, PDP, TOPS-10, TOPS-20, V AX-H. V AX. MicroV AX. MicroVMS, ULTRIX-32. and V AX/VMS are trademarks of Digital Equipment Corporation. EMBOS and ELXSI System 6400 are trademarks of ELXSI, Inc. The KERMIT File Transfer Protocol was named after the star of THE MUPPET SHOW television series. The name is used by permission of Henson Associates, Inc. HP-UX and Vectra are trademarks of Hewlett-Packard Company. Intel is a trademark of Intel Corporation. CLIPPER, CLIX, Intergraph, InterPro 32, and InterPro 32C are trademarks of Intergraph Corporation. System/370, VM/SP CMS, and CMS are trademarks of International Business Machines Corporation.
    [Show full text]
  • High-Tech Ventures the Guide for Entrepreneurial Success
    C. GORDON BELL with JOHN E. McNAMARA - HIGH-TECH VENTURES THE GUIDE FOR ENTREPRENEURIAL SUCCESS vvA ADDISON-WESLEY PUBLISHING COMPANY, INC. Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Wokinghan, England Amsterdam Bonn Sydney Singapore Tokyo Madrid San Juan Paris Seoul Milan Mexico City Taipei Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book and Addison- Wesley was aware of a trademark claim, the designations have been printed using initial caps. Library of Congress Cataloging-in-Publication Data Bell, C. Gordon High-Tech ventures : the guide for entrepreneurial success / C. Gordon Bell with John E. McNamara p. cm. ISBN 0-201 -56321 -5 (hardback) 1. High technology industries-Management. 2. New business enterprises-Management. 3. Entrepreneurship. 4. Computer industry-Management. 5. Computer software industry-Management. I. McNamara, John E. 11. Title HC79.HS3B45 1991 90-25717 620.0064~20 CIP Copyright 0 1991 by Addison-Wesley Publishing Company, Inc. 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 prior written consent of the publisher. Printed in the United States of America. Published simultaneously in Canada. Cover design by Hannus Design Associates Cover photographs by Kurt R. Hulteen, Lisa LaForge, and John W. Wait Text design
    [Show full text]
  • Australian UNIX Systems User Group Newsletter Volume 10, Number 5
    Australian UNIX systems User Group Newsletter Volume 10, Number 5 October 1989 Registered by Australia Post, Publication Number NBG6524 The Australian UNIX* systems User Group Newsletter Volume 10 Number 5 October 1989 CONTENTS AUUG General Information ..................... 5 Editorial ........................... 6 Letters To The Editor ....................... 8 President’s Letter .............. ........... 10 Minutes of Annual General Meeting 1989 ................. 11 Secretary’s Report from the 1989 AGM .................. 13 Treasurer’s Report from the 1989 AGM .................. 15 SESSPOOLE Information ........ .............. 21 Western Australian UNIX systems Group Information ............. 22 AUUG Regional Meetings Summer’90 .................. 23 AUUG Institutional Members ..................... 24 Call For Speakers - AUUG Summer’90 (Victoria) ............... 26 AUUG90 - Call For Papers ...................... 27 Book Review: Two Examinations Of UNIX Internals .............. 30 Slides from Larry Crume’s AUUG89 talk ................. 32 From the ;login: Newsletter - Volume 14 Number 3 .............. 44 Au revolt and Hello ...................... 45 USENIX 1989 Summer Conference Tutorials .............. 46 Call for Papers: Large Installation Systems Administration Workshop ....... 48 Call for Papers: Distributed and Multiprocessor Systems Workshop ....... 49 Call for Papers: Computer Graphics Workshop .............. 50 Call for Papers: Winter 1990 USENIX Conference ............. 51 AUUG’89 Conference and Exhibition ................ 52
    [Show full text]
  • Characterization and Modeling of TSV Based 3-D Integrated Circuits
    Characterization and Modeling of TSV Based 3-D Integrated Circuits by Ioannis Savidis Submitted in Partial Fulfillment of the Requirements for the Degree Doctor of Philosophy Supervised by Professor Eby G. Friedman Department of Electrical and Computer Engineering Arts, Sciences and Engineering Edmund J. Hajim School of Engineering and Applied Sciences University of Rochester Rochester, New York 2013 ii © 2013 Copyright by Ioannis Savidis All rights reserved iii Dedication To my family. My achievements are but an indication of your love and support. iv Biographical Sketch Ioannis Savidis was born in Rochester, New York in December 1982. He received the B.S.E. degree in electrical and com- puter engineering and biomedical engineer- ing from Duke University, Durham, NC, in 2005. He received the M.Sc. degree in electrical and computer engineering from the University of Rochester, Rochester, NY, in 2007. He pursued his research in high performance integrated circuits for the Ph.D. degree in electrical and computer engineering under the guidance of Professor Eby G. Friedman. He interned at Freescale Semiconductor Corporation, Austin, TX during the summers of 2006 and 2007, where he worked on the electrical characterization and modeling of interplane 3-D vias. During the summers of 2008, 2009, 2010, and 2011 he interned at v the IBM T. J. Watson Research Center, Yorktown Heights, NY, where he worked on elec- trical characterization and modeling, reticle design, and DC and high frequency electrical measurements of test vehicles implementing various interplane 3-D via topologies. His research interests include analysis, modeling, and design methodologies for high perfor- mance digital and mixed-signal integrated circuits, emerging integrated circuit technolo- gies, and interconnect related issues, with an emphasis on electrical and thermal modeling and characterization, signal and power integrity, and power and clock delivery for 3-D IC technologies.
    [Show full text]
  • Great Microprocessors of the Past and Present Editor's Note: John's Remote Copy May Be More Up-To-Date
    Great Microprocessors of the Past and Present Editor's Note: John's Remote Copy may be more up-to-date. Great Microprocessors of the Past and Present (V 11.7.0) last major update: February 2000 last minor update: February 2000 Feel free to send me comments at (new email address): [email protected] Laugh at my own amateur attempt at designing a processor architecture at: http://www.cs.uregina.ca/~bayko/design/design.html Introduction: What's a "Great CPU"? This list is not intended to be an exhaustive compilation of microprocessors, but rather a description of designs that are either unique (such as the RCA 1802, Acorn ARM, or INMOS Transputer), or representative designs typical of the period (such as the 6502 or 8080, 68000, and R2000). Not necessarily the first of their kind, or the best. A microprocessor generally means a CPU on a single silicon chip, but exceptions have been made (and are documented) when the CPU includes particularly interesting design ideas, and is generally the result of the microprocessor design philosophy. However, towards the more modern designs, design from other fields overlap, and this criterion becomes rather fuzzy. In addition, parts that used to be separate (FPU, MMU) are now usually considered part of the CPU design. Another note on terminology - because of the muddling of the term "RISC" by marketroids, I've avoided using those terms here to refer to architectures. And anyway, there are in fact four architecture families, not two. So I use "memory-data" and "load-store" to refer to CISC and RISC architectures.
    [Show full text]