RAP(ID:4568/rap004)Text processing language for linguisticsfor Rational Pilot SIL Pilot variant by Strangfeld, suitable for presentation of linguistic materials The two documents are available in the distribution file at the SIL FTP site. Related languages
References: The RAP language (Strangfeld 1988) was designed especially for writing computer programs that interact heavily with users. RAP makes it easy to display text on the terminal screen, and to get and test responses typed by users. RAP's high-level features, such as the menu-construct and built-in pattern matching, allow complicated control structures to be programmed with a minimum of effort. The philosophy behind RAP is not, however, to provide every possible user-interface feature as a built-in function. Instead, RAP seeks to provide the basic building blocks from which such features can be constructed. To support this, RAP provides for extension in two ways: the set of program commands can be extended by adding user-defined procedures, and the set of program functions can be extended by adding user-defined numeric functions and string functions. These user-defined constructs we refer to collectively as subroutines, or simply routines. This volume describes one set of subroutines which extend RAP's capabilities in the areas of user interaction, file handling, context-sensitive help, string processing, and terminal control. The subroutine library is called COMMON, because it contains a set of commonly needed procedures and functions. We envision that this COMMON library will be used by virtually every RAP application program. The library is contained in the file COMMON.RAP. To make use of the subroutines, a programmer needs only to include the line .include common.rap in the main RAP program file. The simplicity of accessing the library makes it possible for even novice programmers to make full use of the subroutines. RAP is derived from the PILOT programming language (Starkweather 1969). PILOT is a computer-aided instruction language intended for use by novice programmers. RAP (whose name was once Rational Pilot) has many of the features of PILOT, but adds enhancements that make the language more structured and more powerful. There are three key additions: structured program control constructs (with the removal of jumps), parameters for called subprograms, and local variables. These changes make it easier to write clear and useful programs in RAP. Apart from the enhancements, most RAP commands come from ordinary PILOT. Abstract: RAP is a programming language intended to help put a "friendlier" layer between "unfriendly" complicated programs and their users. An experienced user of some complex program could write a RAP program to help his or her less experienced colleagues. That RAP program might ask questions and offer menus to the user in a "friendly" fashion, then pass the instructions obtained to the other program in whatever "unfriendly" format it required. A typical use of RAP might be with IT--the interlinear text processing system (Simons and Versaw 1988). This system consists of a number of programs for manipulating interlinear annotated text. Most of these programs get their instructions on what the user wants to do from a "control file." Without RAP, the user must use a text editor to type the control file by hand. This file is written to rather exacting specifications; the user generally works with a book open to the page giving those specifications in order to see what is needed and in what format. After creating and saving the control file, the user might type something like itprep -f prep.ctl chumash.txt to run an IT program. With RAP, you can set up a "friendly" program to handle the messy details that the IT programs require. When run, this RAP program would present the user with a set of multiple-choice menus and other questions. It would provide explanations and extra helps as needed. It would ask all the questions required for the operation selected, automatically write the control file, and automatically run the proper IT program. Resources
|