The Implementation of Icon and Unicon a Compendium Clinton Jeffery and Don Ward, editors The Implementation of Icon and Unicon Ralph and Madge T. Griswold Kenneth W. Walker Clinton L. Jeffery Michael D. Wilder Anthony T. Jones Jafar Al Gharaibeh Copyright © 2017 – 2020 Clinton Jeffery Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foun- dation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Portions of this document ("The Implementation of the Icon Programming Language") are in the public domain and not subject to the above copyright or license. Other portions of this document ("An Optimizing Compiler for Icon") are copyrighted by Kenneth Walker and appear in edited form in this document with the express permission of the author. This is a draft manuscript dated April 3, 2020. Send comments and errata to
[email protected]. This document was prepared using LATEX. Special thanks to Don Ward for assistance with the conversion to LATEX. Contents Preface xvii Compendium Introduction.................................1 I The Implementation of the Icon Programming Language3 1 Introduction5 1.1 Implementing Programming Languages.......................6 1.2 The Background for Icon...............................7 2 Icon Language Overview9 2.1 The Icon Programming Language.......................... 10 2.1.1 Data Types.................................. 10 2.1.2 Expression Evaluation............................ 12 2.1.3 Csets and Strings............................... 19 2.1.4 String Scanning...............................