INTERP, Lexical Analysis for Problems Oriented Language Development
Creators
- 1. Solid Mechanics Division, Sandia National Laboratories, Livermore (United States)
Description
1 - Description of program or function: INTERP is a free format data interpretation subroutine system for lexical analysis. The system is flexible, easy to use, small, and efficient and simplifies the development of a problem oriented language (POL) as well as any other translation preprocessor for an application program. INTERP is currently being used to interpret POL translators for both engineering analysis codes and utility programs. The application callable part of the INTERP subroutine system consists of the configuration routines, the interrogation routines, the logical testing functions, the utility routines, the advanced operations routines, and a string handling library. INTERP processes textual information in the form of strings, which are a primary means of data exchange between INTERP and the application program. The INTERP system can be configured to read data directly from a file opened by the application program or the application program. The INTERP system can be configured to read data directly from a file opened by the application program or the application program may read the data file directly and pass the data to the INTERP system by means of a utility routine. 2 - Method of solution: INTERP is a lexical analyzer which examines a data line with no prior knowledge of what it contains and informs the application program of what was found. Each data line typically consists of a collection of special characters and tokens. A token is defined to be an identifiable unit of information. Each new data line is loaded into an internal line buffer and examined one character at a time until a complete token is read. At this time control is returned to the application program which uses the INTERP logical testing functions to identify the token.Once the identification is made, INTERP continues processing the data line until it reaches the end-of-line. INTERP is then given a new line and the process is repeated. INTERP recognizes three classes of tokens - numeric, textual, and position identifying. These are further divided into eight types: integer, real, double precision, text, separator, string, end-of-line and end-of-file. INTERP recognizes six types of special characters: delimiters, separators, the comment character, the escape character, and two types of continuation characters. The characters available to be used as one of these six types of special characters can be redefined through a simple subroutine call. 3 - Restrictions on the complexity of the problem - Maxima of: 256 tokens per line, 256 macros, 132 characters per output record, 32 macros per line, 3 INTERP states. While these parameters have been chosen to support a fairly large grammar, they can be changed easily. INTERP assumes it is functioning in an environment using the ASCII character set. Two versions of each routine are needed, one to convert a single character and one to convert a string
Availability note (English)
Available on-line: http://www.nea.fr/abs/html/nesc9480.htmlAdditional details
Identifiers
Publishing Information
- Imprint Pagination
- [html]
INIS
- Country of Publication
- Nuclear Energy Agency of the OECD (NEA)
- Country of Input or Organization
- International Atomic Energy Agency (IAEA)
- INIS RN
- 41084041
- Subject category
- S97: MATHEMATICAL METHODS AND COMPUTING;
- Resource subtype / Literary indicator
- Computer Program Description, Non-conventional Literature
- Descriptors DEI
- COMPUTER PROGRAM DOCUMENTATION; CONFIGURATION; DATA ANALYSIS; DATA PROCESSING; FORTRAN; FUNCTIONS; I CODES; TESTING; WEBSITES
- Descriptors DEC
- COMPUTER CODES; DOCUMENT TYPES; PROCESSING; PROGRAMMING LANGUAGES
Optional Information
- Notes
- 4 refs.