.TH GENERATE 1 "15 October 1993" "Demeter" "Demeter Software" .SH NAME generate \-\- generate the class dictionary dependent files in a Demeter System/C++ environment. .SH SYNOPSIS .I generate { SI | MI} TOPENVNAME NOCTORLIST .SH DESCRIPTION .I generate is part of the Demeter System/C++ environment generation module which generates a C++ environment from a class dictionary (cd). It is usually not called on its own. Instead, it is called implicitely by the Imakefile provided by .I imake-sample. .I generate assumes that the file cd-param-exp (generated by .I sem-check ) is available in the directory /notmod/cds, where is the top environment directory as specified by $(TOPENVNAME) in the Imakefile. The following files are generated: .nf .na - cd-inter intermediate cd, used to generate the other files below - .h application header file containing class definitions - -DEM.C application code file containing class implementations - main.C.sample a sample main file containing code examples - lex-syntax cd specific syntax used for parsing/printing .ad .fi .SH OPTIONS The .I SI or .I MI switch indicates whether a single or multiple inheritance environment should be provided. This switch is usually specified by the user in the Imakefile. The multiple inheritance environment specifies inheritance links as public virtual and provides a "cast-down" mechanism to cast from base to derived classes. The .I TOPENVNAME variable specifies the name of the current environment (specified in the Imakefile). The .I NOCTORLIST variable is a string containing a list of classes for which no constructor should be generated. This variable is usually specified in the Imakefile, too. .SH DEMETER ENVIRONMENT .I generate constitutes only a part of the entire code generation process in Demeter. Additionally, a complete C++ environment is generated. The generation process is, apart from .I generate, entirely .I imake driven and thus can be started by simply typing .I make once the Imakefile and Makefile are in place. The default Imakefile used by imake can be obtained by the command .I imake-sample. The corresponding Makefile is then produced by the command .I dmkmf. As the backbone of the generated environment, the following directory structure is created: .nf .na /---+- cd.cd | +- Imakefile | Makefile | +- main.C | main.C.sample | global.h | run | *.pp | *.C | +- scanner/ -----+- cd-parse | | cd-print | | lex-DEM.l | | lex.yy.c | | +- notmod/ ------+- cds/ ------+- cd-param-exp | | cd-parse | | cd-print | | ... | | +- def/ ------+- .h | | -DEM.C | | make_instance-DEM.C | | _make_instance-DEM.C | +- headers/---+- *.h | +- include/---+- $(TARGETLIBNAME).h | +- lib/-------+- $(TARGETLIBNAME).a | +- sun4/------+- run-exec | | *.o | +- tmp/ .ad .fi The .I subdirectory thus contains the class dictionary, the Imakefile with its corresponding Makefile (generated by .I dmkmf), as well as all propagation pattern specifications .I (*.pp) and C++ programs .I (*.C). Global.h is provided as a global header file which is #included in .h. The generated environment is compilable; that is, it will pass a compilation and produce a default executable .I (run-exec) which can be executed by calling run. For this, Demeter provides both the script .I run as well as a dummy main.C file. A sample of the capabilities of the Demeter generic software is supplied in the file main.C.sample. This file can be substituted and compiled in place of main.C. The .I scanner subdirectory contains files necessary for the generic parser and printer. These files include a class dictionary specific lexical analyzer lex-DEM.l, and two special class dictionaries, cd-parse and cd-print, which specify the input and output object language for the generic parser and printer (see the man pages for .I g_parse and .I g_print. Cd-parse and cd-print can be customized to adapt the input/output languages. The .I notmod subdirectory contains all those files that are used internally by Demeter and thus should NOT be modified. Once they are modified, the ability to freely regenerate the environment is lost since Demeter will overwrite the modified files. Subdirectories in notmod are: .I cds containing other class dictionaries used for various purposes. .I def containing the header file (class definitions), the implementation file (standard method implementations), and files for instance creation. .I headers containing for each class a header file extracted by the command .I headers from the *.C files in . .I include containing a processed headers file for the current environment if desired (specified in the Imakefile). .I lib containing a library for the current environment if desired (specified in the Imakefile). .I sun4 containing the *.o files and the executable for the current environment. .SH NAMING CONVENTION Demeter employs the following naming conventions for files in an environment: .I .cd .br class dictionary file written by the user or generated from the xcddraw tool. The default name is cd.cd. .I .cdg .br PostScript file of class dictionary graph picture generated by xcddraw. .I .pp .br propagation pattern source file. .I ..pp .br meta-expanded propagation pattern file .I .trv .br propagation schema file .I -DEM.C .br C++ source file generated from from a propagation pattern file. .I .C .br C++ source file written by the user. .I .h (other than global.h) .br header file written by the user. .SH SEE ALSO sem-check(1), imake-sample(1), dmkmf(1), headers(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 Art of Growing Adaptive Object-Oriented Software .br Karl J. Lieberherr .br PWS Publishing Company, a Division of Wadsworth, Inc. .I Software Portability with imake .br Paul DuBois .br O'Reilly & Associates, Inc., 1993 .I The Annotated C++ Reference Manual .br Margaret A. Ellis and Bjarne Stroustrup .br Addison-Wesley, 1990 .I C++ Primer, 2nd Edition .br Stanley B. Lippman .br Addison-Wesley, 1989