Implementation guide and users manual for a subset of pl/i on an apple computer (compiler, programming language, microcomputers)
Wayne Summers · 1986
One of the more important and versatile computer programming languages of the last fifteen years has been the language PL/I. At present there exists only one implementation of this language, PL/M, available for microcomputers. This coupled with the tremendous usage of microcomputers in education and business has caused a serious look at creating another PL/I compiler for microcomputers. The problem with the existing PL/M compiler is that it requires that the computer use the CP/M operating system which for the Apple computer requires the purchase of additional hardware and software. This paper documents the creation and implementation of a complier for a subset of PL/I which will run on the family of Apple II computers without any additional hardware and which only requires the use of the Apple Pascal P-system. Additionally this compiler will run with a few modifications on any computer equipped with the UCSD P-system. This paper describes a compiler which takes programs written in PL/I and translates those programs into P-code. This P-code can then be executed on an Apple computer using the Apple Pascal P-system. The compiler will consist of essentially four components: the lexical analyzer which retrieves the PL/I code one token at a time, the syntax analyzer which parses the tokens from the lexical analysis and then recognizes the constituent parts of the PL/I program, the semantic analyzer which then uses these constituent parts to determine what the program means, and then the code generator which uses this information to generate the equivalent P-code. The first three components will employ the usual techniques utilized by a typical recursive descent LL(1) compiler with top-down parsing. The code generation component will be essentially similar to the code generation that is used by the Apple Pascal compiler with the appropriate modifications made that are required for the implementation of a different language. This paper will conclude with discussions on using this compiler with the Apple computers and also some suggestions on implementing this compiler on other computer systems.