.TH PARSE-GENERATE 1 "2 April 1991" "Demeter" "Demeter Software" .SH NAME parse-generate \- parsing environment generator for Demeter System/C++ .SH SYNOPSIS .I parse-generate [class-dictionary] .SH DESCRIPTION .I parse-generate generates a minimal environment containing an executable program to run the generic parser provided by Demeter. If .I class-dictionary is not supplied, .I cd-param-exp is used. .I parse-generate assumes that .I class-dictionary is a semantically correct class dictionary. To this end, the command .I sem-check must be run in preparation for running .I parse-generate. sem-check will automatically produce the file .I cd-param-exp. .SH DIRECTORY STRUCTURE AND FILES The following directory structure is created: .RS 28.0 TOP .br | .RE .RS 14.0 ------------------------------ .br | | .br U-1 SCANNER .RE .I TOP contains the .I class-dictionary and it is from this directory that .I parse-generate is executed. Once the environment is generated, the user works in directory .I U-1. .I SCANNER contains all files that are needed to create lex.yy.c. This file is used by the parser, which reads in user objects. The files are: .RS 5.0 a) lex input files .RS 3.0 - lex-DEM (generated by generate) .br - lex-USER (generated by gen-scanner) .RE .RE .RS 5.0 b) components of lex input files .RS 3.0 - lex-definitions .br - lex-syntax .br - lex-comment .br - lex-white-space .br - lex-class-terminals .RE .RE The lex input files are the concatenation of their components under a) in the order they are given. The user can customize the scanner by changing one or more of the components, regenerating with gen-scanner and recompiling. .SH RUNNING THE GENERATED PROGRAM When .I parse-generate has finished generating the environment, the user is advised on how to use the generated program with the notice NOTE, usage of executable generic parser: run-parser demeter-input-file [start-symbol] This means that, once a parsing environment is generated, the user can go into the .I U-1 subdirectory and execute the .I run-parser demeter-input-file command to test sentences stored in the file .I demeter-input-file. The .I [start-symbol] part of the command means that the user can optionally give a start symbol. Typically, the input sentence in the file .I demeter-input-file represents an object of the first class in the class dictionary. However, the user can also specify a sentence that represents an object of some other instantiable class in the class dictionary. If this is the case, .I start-symbol tells the parser which class the user intends to give a sentence for. .SH SOURCE CODE The source is located at $DEMETER/bin and $DEMETER/gen-env/generators. It compiles under AT&T C++ 2.0. .SH SEE ALSO sem-check(1), gen-scanner(1) .SH REFERENCES .I User's Guide for the Demeter System C++ .br Walter L. Hursch .br Northeastern University, 1993 .I The Annotated C++ Reference Manual .br Margaret A. Ellis and Bjarne Stroustrup .br Addison-Wesley, 1990 .I C++ Primer .br Stanley B. Lippman .br Addison-Wesley, 1989