TREGRM(ID:4026/tre006)


for TREe GRaMmar

Language for specifying the creation of parse trees for any current programming language


Structures:
References:
  • Clemm, Geoffrey M. "TREGRM-83 Report and User's Manual" Colorado Univ. at Boulder. Dept. of Computer Science. Jan 83 CU-CS-249-83 view details Abstract: The first phase of the analysis of a computer program is lexical analysis, where the source text is broken up into the words or tokens, of the programming language. The second phase is syntactic analysis of parsing, where structure of the program is determined. The result of parsing is often a sequence of calls to a semantic routine with a reduction number or action number as the argument. To provide a more structured interface between the syntactic analysis and semantic analysis of a program, a parse tree can be created, where the parse tree is a flattened (simplified) version of the derivation tree for that program. To support the production of parse tree for generators, the TREGRM System was developed. TREGRM is a language for specifying the creation of parse trees for any current programming language, including FORTRAN. This report describes the TREGRM language, a com-plier for the language, and an interpreter for the resulting object code. The interpreted object code, in conjunction with a lexical analyzer, forms a syntactic analyzer that takes as input a stream of characters and produces as output a parse tree. The compiler and interpreter are designed for portability. Both are written in ANSI FORTRAN supplemented by a small number of short machine dependent subroutines. Included is a TREGRM program describing the syntax of FORTRAN-77