.TH SEM-CHECK 1 "29 September 1992" "Demeter" "Demeter Software" .SH NAME sem-check \- semantic checker of class dictionaries for Demeter/C++ .SH SYNOPSIS .I sem-check [ -i ] [ -n ] [ class dictionary ] .SH DESCRIPTION .I sem-check determines the semantic correctness of class dictionaries for Demeter System/C++. .br .I sem-check performs the following three tasks: .br 1. verification of the 14 rules of a legal class dictionary .br 2. three expansions. .br 3. one correction. .SH RULES .RS 3.0 Checking label names .RE .RS 8.0 Label names cannot be the names of types and the keywords of Demeter System/C++.If a class is used as a part without a label, then the name of this class must contain at least on capital letter. .I sem-check will automatically create a part name by transform all the letters in the class name into the corresponding letters in lower case. .RE .RS 3.0 Checking class names .RE .RS 8.0 Class names cannot be the keywords of Demeter System/C++. .RE .RS 3.0 Checking the first production .RE .RS 8.0 The first production must be an unparameterized construction production.The construction production serves as the default start symbol for the grammar defined by the class dictionary. .RE .RS 3.0 Checking the definitions of classes .RE .RS 8.0 Every class must be defined exactly once. .RE .RS 3.0 Checking repetition productions .RE .RS 8.0 The two class instances on the right-hand-side of a repetition production must be identical. .RE .RS 3.0 Checking the use of parameterized classes .RE .RS 8.0 Every parameterized class is used with the same number of parameters as defined. .RE .RS 3.0 Checking formal class parameters .RE .RS 8.0 Each formal class parameter cannot be used as parameterized class on the rigth-hand-side of a parameterized production. .RE .RS 3.0 Checking parameterized alternatives .RE .RS 8.0 For a parameterized alternation class, all its alternatives have to use all its formal parameters in the same order .RE .RS 3.0 Checking inheritance cycles .RE .RS 8.0 There may be no inheritance cycle leaded by alternation edges and use of *inherit*. .RE .RS 3.0 Checking alternatives .RE .RS 8.0 All alternatives must be defined by construction classes or by alternation classes that will eventually be defined by construction classes. .RE .RS 3.0 Checking the unique label axiom .RE .RS 8.0 Any two parts of a class cannot have the same name. .RE .RS 3.0 Checking the inductiveness axiom .RE .RS 8.0 Every vertex in the class dictionary graph corresponding to the class dictionary must have at least one cycle-free subdictionary graph anchored at this vertex. .RE .RS 3.0 Checking left recursion .RE .RS 8.0 There should be no left recursion in the class dictionary. .RE .RS 3.0 Checking LL(1) conditions .RE .RS 8.0 There should be no LL(1) violation in the class dictionary graph. .RE .SH EXPANSIONS .RS 3.0 Expansion of parameterization .RE .RS 8.0 Transforming a parameterized class dicitionary into an unparameterized class dictionary. .RE .RS 3.0 Expansion of inherited classes .RE .RS 8.0 Transforming a class dicitionary with inherited classes(*inherit*) the one whithout them. .RE .RS 3.0 Expansion of common-parts .RE .RS 8.0 Transforming a class dicitionary with common-part classes into one without them. .RE .SH CORRECTION - LL(1) enforcing Transform a class dictionary violating the LL(1) conditions into one satisfying these condictions. .SH OPTIONS .TP .I \-i Generate intermediate file. .I sem-check creates the following 9 files which will be described at the end. .RS 9.0 notmod/cds/cd-param-exp, .br notmod/cds/cd-inh-exp, .br notmod/cds/cd-com-exp, .br notmod/cds/cd-ffsets, .br notmod/cds/cd-ll1-corrected, .br notmod/cds/cd-parse, .br notmod/cds/cd-parse-old, .br notmod/cds/cd-print, .br notmod/cds/cd-print-old. .RE .TP .I \-n .I sem-check will not do LL(1) checking and enforcing. .TP .I class-dictionary If .I class-dictionary is not specified, .I sem-check will take file .I cd.cd in the current directory by default. .SH OUTPUT FILES .RS 3.0 .I notmod/cds/cd-param-exp .RE .RS 8.0 This file contains the class dictionary with parameterization expanded. .RE .RS 3.0 .I notmod/cds/cd-inh-exp .RE .RS 8.0 This file contains the class dictionary with parameterization and inherited classes expanded. .RE .RS 3.0 .I notmod/cds/cd-com-exp .RE .RS 8.0 This file contains the class dictionary with parameterization, inherited ckasses and common-part classes expanded. .RE .RS 3.0 .I notmod/cds/cd-ffsets .RE .RS 8.0 This file contains the first sets and follow sets of all classes. .RE .RS 3.0 .I notmod/cds/cd-ll1-corrected .RE .RS 8.0 If the input class dictionary violates LL(1) conditions, this file contains a class dictionary with some concrete syntax added to satisfy the LL(1) conditions. .RE .RS 3.0 .I notmod/cds/cd-parse .RE .RS 8.0 This file contains the grammar derived from the input class dictionary for the generic printer. Originally it is the same as the file .I notmod/cds/cd-com-exp. You can add or remove concrete syntax to tune your input language. .RE .RS 3.0 .I notmod/cds/cd-parse-old .RE .RS 8.0 This file contains the previous version when you run .I sem-check again. .RE .RS 3.0 .I notmod/cds/cd-print .RE .RS 8.0 This file contains the grammar derived from the input class dictionary for the generic printer. Originally it is the same as the file .I notmod/cds/cd-com-exp. You can add or remove concrete syntax to tune your output language. .RE .RS 3.0 .I notmod/cds/cd-print-old .RE .RS 8.0 This file contains the previous version when you run .I sem-check again. .RE .SH BUG: The user has to verify that every parameterized class is bounded (see JOOP 88, Lieberherr, Riel). If this condition does not hold, the parameterization expander gets into an infinite loop.