This document describes the TP Lex and Yacc compiler generator toolset. These
tools are designed especially to help you prepare compilers and similar programs
like text processing utilities and command language interpreters with the
Turbo Pascal (TM) programming language.
TP Lex and Yacc are Turbo Pascal adaptions of the well-known UNIX (TM) utilities
Lex and Yacc, which were written by M.E. Lesk and S.C. Johnson at Bell Laboratories,
and are used with the C programming language. TP Lex and Yacc are intended
to be approximately "compatible" with these programs. However, they
are an independent development of the author, based on the techniques described
in the famous "dragon book" of Aho, Sethi and Ullman (Aho, Sethi,
Ullman: "Compilers : principles, techniques and tools," Reading
(Mass.), Addison-Wesley, 1986).
Version 4.1 of TP Lex and Yacc works with all recent flavours of Turbo/Borland
Pascal, including Delphi, and with the Free Pascal Compiler, a free Turbo
Pascal-compatible compiler which currently runs on DOS and Linux (other ports
are under development). Recent information about TP Lex/Yacc, and the sources
are available from the TPLY homepage:
http://www.musikwissenschaft.uni-mainz.de/~ag/tply
For information about the Free Pascal Compiler, please refer to:
http://tfdec1.fys.kuleuven.ac.be/~michael/fpc/fpc.html
TP Lex and Yacc, like any other tools of this kind, are not intended for
novices or casual programmers; they require extensive programming experience
as well as a thorough understanding of the principles of parser design and
implementation to be put to work successfully. But if you are a seasoned Turbo
Pascal programmer with some background in compiler design and formal language
theory, you will almost certainly find TP Lex and Yacc to be a powerful extension
of your Turbo Pascal toolset.
This manual tells you how to get started with the TP Lex and Yacc programs
and provides a short description of these programs. Some knowledge about the
C versions of Lex and Yacc will be useful, although not strictly necessary.
For further reading, you may also refer to:
- Aho, Sethi and Ullman: "Compilers : principles, techniques and tools."
Reading (Mass.), Addison-Wesley, 1986.
- Johnson, S.C.: "Yacc - yet another compiler-compiler." CSTR-32,
Bell Telephone Laboratories, 1974.
- Lesk, M.E.: "Lex - a lexical analyser generator." CSTR-39, Bell
Telephone Laboratories, 1975.
- Schreiner, Friedman: "Introduction to compiler construction with UNIX."
Prentice-Hall, 1985.
- The Unix Programmer's Manual, Sections `Lex' and `Yacc |