Eliezer A. Albacea
University of the Philippines OPEN UNIVERSITY
Principles of Programming Languages By Eliezer A. Albacea
Copyright © 2002 by Eliezer A. Albacea and the University of the Philippines Open University Apart from any fair use for the purpose of research or private study, criticism or review, this publication may be reproduced, stored or transmitted, in any form or by any means ONLY WITH THE PERMISSION of the author and the UP Open University.
Published in the Philippines by the UP Open University Office of Academic Support and Instructional Services 2/F, National Computer Center CP Garcia Avenue, Diliman, Quezon City 1101 Telephone (63-2)426-1515 Email oasis@upou.edu.ph First printing, 2002 Second printing, 2005
ISBN 971-767-123-0
Layout by Helen Mercado Creer
Printed in the Philippines
Preface
This book is intended for a one-semester course on programming languages. It discusses the basic concepts of programming languages and the actual implementation of basic programming language constructs which makes it different from other language programming books that stop after a discussion of the concepts. As a teacher for many years, I believe it is best to teach and learn concepts when we put them to use. In this case, to implement the language. You should at least have a basic knowledge of the syntax of a variety of programming languages like Pascal, C. FORTRAN, Algol, COBOL, Prolog, Lisp, and ML, though a working knowledge of Pascal and C is sufficient. I used the intermediate language Slim+ as the target language for for translation. Slim+ is a simple stack-oriented language with very simple instructions that can be mapped to any actual machine instrucitons. As an additional aid both for students and teachers, Slim+ is discussed in the Appendix. I strongly advise the reader to take up this topic before proceeding to Module 3 and before tackling the first topic on implementation. Finally,