Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


 
Invokes the EDMexpressCompiler to produce one or more long form schema(ta) from short form schemata found on the specified input file(s). The short form schemata may be collected from separate files. The result of this command will be a new source Express file containing the specified long form schema(ta). This function will not effect anything in the EDMdatabase.
The EDMexpressCompiler performs normal compilation checking, i.e. syntax checking, check for unresolved references etc., hence a diagnostic report can be produced by this operation.
Related functions: edmiCompileFile , edmiExpressToHTML
Header:
#include "sdai.h"
Prototype:
EdmiError edmiMakeLongForm(SdaiString   expressFile,
                            SdaiString   diagnosticFile, 
                            SdaiString   longFormSchemata, 
                            SdaiInteger  options, 
                            SdaiString   longFormFile, 
                            SdaiInteger  *warnings, 
                            SdaiInteger  *errors); 
Arguments:

expressFile

Specifies the name of the file(s) containing EXPRESS short form schema(ta). If more than one file is specified, delimit each file name with a comma. The wild card symbol "*" is also a permitted character in a filename. The default file extension is ".exp".

diagnosticFile

Specifies the file name for diagnostic information generated by this function. If no file name is supplied, i.e. the <diagnosticFile> argument is set to NULL, all diagnostic information will be written to the EDMinterface current output device. The EDMinterface current output device can be defined by the edmiDefineOutputFunction operation.

longFormSchemata

Specifies the name of one or more Express schema(ta) that will be the resulting long form schema(ta). When more than one schema name is specified, then each schema name should be delimited by a comma. Schema names are case insensitive.
The schema(ta) specified by the <longFormSchemata> argument must be found in the file(s) specified in the <expressFile> argument.

options

Specifies the current EDMexpressCompiler options. The <options> value should be specified as a bitwise OR of the EDMexpressCompiler options to enable. See descriptions below for more details.
The name of all <options> are defined in the header file sdai.h

longFormFile

Specifies the name of a file that will contain the new Express source of the specified long form schema(ta).

warnings

The address of a variable that will receive the number of warnings detected by the EDMexpressCompiler in the current invocation.

errors

The address of a variable that will receive the number of errors detected by the EDMexpressCompiler in the current invocation.

Option Description

TAG_LONG_FORM

Specifies that an Express comment will be placed before each interfaced item to describe the reason for the interfacing, the originating schema etc.

REPLACE_SCHEMA_NAMES

Specifies that all string literal that defines the schema name of the actual short form schema will be replaced with the appropriate long form schema name in the resulting long form schema to avoid error messages when compiling the resulting long from schema.

REPLACE_SCHEMA_NAME_REPORT

Specifies that a report of the substituted string literal will be issued as a part of the diagnostic report from this command. This report should be checked to see that all substitutions are correct. If errors are found, these errors in the long form schema(ta) should be corrected with a text editor.

DIAGNOSTICS_FOR_LONGFORMS_ONLY

Specifies that only diagnostic related to the resulting long form schema(ta) will be reported. Many errors can be detected when the compilation process produces a long form schema from short form schemata, i.e., resolves all Express schema interface declarations. These errors may not be relevant for the final long form schema, hence the setting of this option prevent the issuing of these error messages.

NO_DIAGNOSTICS

Specifies that no diagnostics should be produced by this function, that means that all necessary checking is performed when the resulting long form schema(ta) are compiled.

HTML_ERROR_LISTING

Specifies that compilation diagnostics will be written in HTML on files in the directory defined by the system variable EDMS_TMP_DIR. The diagnostic report is ready to be displayed by an Internet browser. There are three or four HTML diagnostic files with the following names:
On UNIX: s_main.html, s_err.html, s_exp0.html and optionally s_sch.html
On Windows: s_main.htm, s_err.htm, s_exp0.htm and optionally s_sch.htm
The file named s_main.htm or s_main.html is the main file, hence this file should be specified to the actual Internet browser when displaying the diagnostic report.

INTERFACED_SCHEMAS_REPORT

Specifies that a list of the interfaced schemata for each long form schema will be written as part of the diagnostic report form this function.

Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
SdaiInteger warnings, errors;
EdmiError rstat;
. . .
if (rstat = edmiMakeLongForm ("/usr/hkd/express/ap215/express/*.exp",
"/usr/hkd/express/compiler.diag", 
"Ship_Arrangements", 
TAG_LONG_FORM | REPLACE_SCHEMA_NAMES | 
DIAGNOSTICS_FOR_LONGFORMS_ONLY, 
"/usr/hkd/express/ap215/ap215.exp", 
&warnings, 
&errors)) { 
/* Error in operation */ 
printf("\nError from EDMexpressCompiler: %s", 
edmiGetErrorText(rstat)); 
printf("\nNumber of warnings: %5ld", warnings); 
printf("\nNumber of errors: %5ld", errors); 
goto error; 
}
. . .

  • No labels