Two VAX-PASCAL Terminal Interface
Modules for Visualizing Scanning and Parsing

Frans

University of Twente, Department of Computer Science,
P.O. Box 217, 7500 AE Enschede, The Netherlands.

Abstract. Most parsing algorithms make use of a stack. The two modules described in this memorandum can be used to visualize a scanning and parsing process, both for educational and debugging purposes.

They provide a stack-display mechanism, a scrolling screen (in which parts of the bottom line can be highlighted), a header line and an error-message line. The modules are designed in such way that they can also be used for other applications.

The modules have been used effectively in several compiler generation programs. Adding them to existing programs turned out to be rather simple and straightforward.


Introduction

This paper describes two VAX-PASCAL modules which implement a terminal interface. These modules display a stack screen in combination with a scrolling screen, in which parts of the bottom line can be highlighted. This can be used to visualize a scanning and parsing process, both for demonstrational and debugging purposes.

The two modules were designed as part of an attributed abstract program tree evaluator generator as described in [Xxxx88]. A report on this work [Xxxx89] also contains a description of these modules. These modules have been used to enhance the user interface of a number of compiler projects. They are not only easily incorporated into existing programs, they are of great value in debugging, especially where extensive use of recursive procedures is made.

The Screen Management Module (SCREEN) contains the procedures that implement the different screens. It makes use of the Primitive Terminal Interface module (VT100). This module provides a one-to-one translation of terminal primitives into the control sequences of a VT100-terminal. This module can also be used for other applications which exploit the capabilities of VT100 terminals. The description of this module can serve as a small reference guide for VT100 terminals.

The PASCAL source is contained in subdirectory DISK$USER2:[SCHAAPBIBLIO.AAPT] on the UTRCV1 EARN/BITNET node, and will also be included in [Xxxx89].

These modules have also been implemented using Turbo PASCAL 4.0. This implementation is different, but the interface is almost the same. The description here can be used for this version as well. The source of this version is available from the author.


References

[Xxxx88]F.J.Xxxx :
"Specification and Implementation of An Attributed Abstract Program Tree Evaluator Generator",
Memorandum INF-88-59.
Dept. of Computer Science, Univ. of Twente, The Netherlands.
[Xxxx89]F.J.Xxxx :
"Documentation and source of the AAPT-evaluator generator",
(to be published as an internal technical report),
Dept. of Computer Science, Univ. of Twente, The Netherlands.


My life as a hacker | My home page