IBM Works OS/2 B.I.L.L.: Design and Implementation Copyright (C) Footprint Software Inc. 1993-1994 IBM42XX IBM 4070 IJ Breakdown of documentation: Introduction - what is B.I.L.L B.I.L.L. Specifications Modular B.I.L.L.: Lexical SymTable Parser ExitCode PCode Global Stackman Cross-platform B.I.L.L.: Windows OS/2 Introduction - what is B.I.L.L.: B.I.L.L. is a subset of the programming language Pascal. It was used by the CSC-309 class as the basis for compiler construction. The name Bill was also chosen in honour of a dog owned by Babbage. B.I.L.L. Specifications: B.I.L.L. follows very closely the syntax used in Pascal. However, not all of the conventions from Pascal were ported to B.I.L.L. Currently, the following reserved words are implemented: if - then while - do write read The programme syntax from Pascal was almost directly carried over to B.I.L.L. This means that a programme must start with the "program" keyword, followed by the programme name. Optional blocks of code following the "program" keyword are used to declare variables or constants. The main section of code must then follow, starting with a "begin" keyword and terminated with the "end" keyword. At the moment, there is no support for functions, procedures, if-then-else constructs, or case statements. Modular B.I.L.L.: B.I.L.L. was designed and implemented in several sections. This allowed for easier programming sessions, debugging, and replacement of entire sections of code with relative ease. I will avoid going into the advantages of programming using modularity since it is beyond the scope of this documentation. Each of the individual sections reside in their own directory, and are aware of the directory structure (thus no errors occur when compiling all the modules together, even if they are in their own directory). Needless to say, the following is a list of each individual modules and the basic functionality encapsulated within them: Lexical: The Lexical module reads in a specified input file and breaks in down into a stream of individual tokens. These routines are called extensively by the Parser module. SymTable: The SymTable (symbol table) is a code-implemented array used to keep track of both constants and variables during the code generation process. These routines are called solely by the Parser module. Parser: The Parser module drives the entire code-generation process. When first called, the Parser module initializes the lexical table, the symbol table, and the gone generation procedures. This module contains all of the routines used both to parse programmes and to generate the necessary code later used by the Stackman. ExitCode: The ExitCode module handles all of the output of error messages, as well as displaying relevant text in order to help the user determine the cause of any errors. PCode: The PCode module outputs to a file all of the instruction codes generated by the Parser as it analyses the programme. Global: Two include files (ERROR.H and GLOBAL.H) located in this directory insure that all of the modules use the same basic definitions. This includes type definitions, project constants and standard error return codes for functions and procedures. Stackman: The Stackman module is constructed slightly differently than the rest of the modules. Implemented as a stack machine, this module can easily be detached from the rest of the project in order to provide a "run-time" version of B.I.L.L. This is used so that the B.I.L.L. parser output files could be distributed with the stack-machine module, without having to distribute the parser. Cross-platform B.I.L.L.: The entire B.I.L.L. project was written in standard ANSI C. This insures that the project can be ported over to almost any platform for which there exists a C compiler. Currently, B.I.L.L. has been ported over to the following platforms: D.O.S.: Using D.O.S., the compiler and Interpreter for B.I.L.L. operates as a text-based programme that utilizes the entire screen. Both Borland C++ and Microsoft C have been used to compiler B.I.L.L. without any problems. Windows: B.I.L.L. has been ported to Windows using Borland's C++ Compiler for Windows. Using the "Easy-WIN" option with the compiler, the entire project was converted to run in a window with scrolling text as resembling the D.O.S. application. OS/2: Two different compiler were used to port B.I.L.L. to OS/2. The first of these is the IBM C Set/2 Compiler v1.0 ( addition: I've since then used the IBM OS/2 C++ Compiler v2.1 without any problems . This compiler generates code that can be used with both OS/2 v2.0 and OS/2 v2.1. Borland's C++ Compiler for OS/2 was also used; this compiler generates code for OS/2 v2.1. Both of these compilers create an executable that can be used in a windowed or full-screen session of OS/2. B.I.L.L. - Bishop's Innovative Lovely Language Project Specifications and Design [ Helvetica Bold Italic Helvetica Courier