Integrating a compiler into a programmer's editor
The front half of the Unicon compiler—loosely corresponding to Chapter 2, Programming Language Design, up to Chapter 5, Syntax Trees, in this book—was integrated into the Unicon IDE, known as ui
. The Unicon frontend consists of three major components: a preprocessor, a lexical analyzer, and a parser. In the Unicon translator, these components are called from a main()
procedure. The translator opens, reads, and writes files in the filesystem to perform its I/O, and provides feedback to the user by writing text to standard output or standard error on a console or terminal window. In an IDE, the compiler components are called from behind the scenes while the user is editing their code in a graphical UI (GUI). The source code is obtained directly from the memory in the IDE and the compiler's output is obtained from the memory by the IDE and presented to the user. Altogether, seven files from the Unicon translator...