Include directive:
An Include directive is implemented with the following format:
--#INCLUDE "fileName"
The"fileName" must be embedded in double quotes to enable all legal file names. The INCLUDE directive can be placed anywhere outside a comment in any source files. There can be any number of INCLUDE directives in a source file and INCLUDE files can be nested to any depths. By default, each beginning and end of a source file in the resulting LongForm will be marked. There is an option NO_SHORT_FILE_NAME_IN_LONG_FORM to avoid this marking in the LongForm. The options ADD_SHORT_FORM_LINE_NUMBERS and ADD_LONG_FORM_LINE_NUMBERS can be used to add to the LongForm the ShortForm and/or the LongForm line numbers. These line numbers will be embedded in comments to avoid compilation errors. All tokens
- SOURCE_FILES_PATHS
- END_SOURCE_FILES_PATHS
- SOURCE_FILES
- END_SOURCE_FILES
- --#INCLUDE
are case insensitive.
The default file extension for an EDMcompilerProject file is".xpxprj",".qexprj",".rexprj" for the various EDMcompilerProject types (mapping, query, rule). The EDMsupervisor has been enhanced to search for files with such extensions when appropriate. Hence all commands (remote or local) for defining mapping schema will look for files with extension".xpx" and".xpxprj", and similar concepts for defining query schema and rule schema. The proposed file extension".xpxc" (Express-X code) is recommended for the ShortForm files. All EDMinterface methods for defining an EDMexpressX schema will by default search the actual specified"source file" to decide if it is a EDMexpressX source file or an EDMcompilerProject file, i.e., when at least one EDMcompilerProject token is found, the actual file will be classified as an EDMcompilerProjectFile, and the producing of the LongForm will be performed and the resulting LongForm will be sent to the compiler. When the EDMexpressXcompiler is invoked from an EDMexpressXmethod on an EDMapplicationServer, the processing of an EDMcompilerProject cannot be performed. All other invocations of the EDMexpressXcompiler can process an EDMcompilerProject. If you want to compile an EDMexpressXschema from an EDMexpressXmethod running in an EDMapplicationServer, you can use the EDMinterfaceMethod edmiBuildExpressXlongForm() and then send the resulting LongForm schema to the actual EDMexpressXmethod running in an EDMapplicationServer and invoke the EDMexpressXcompiler with this LongForm schema .
NOTE: The processing of the INCLUDE directives will only be performed in the"context of an EDMcompilerProject".
The resulting compilation diagnostics will be enhanced with the following:
- A list of all ShortForm files constituting the LongForm, will be listed in the order of the occurrences in the LongForm.
- Each diagnostic message will list the line number in the LongForm and the line number in the actual ShortForm file.
The EDMcompilerProject should be integrated/used by the EDMdevelopersStudio (X-IDE) by implementing functionality to create/change/delete EDMcompilerProjects, GUI to drag&drop file-paths and files to the EDMcompilerProjectFile, and functionality to navigate from an EDMexpressXcompiler diagnostic message to the right line number in the actual source file.
Pragma directive:
Pragma directive in EDMquerySchema, EDMruleSchema and EDMmapSchema (EDMschemaMap) to enable "passing aggregates by reference" instead of "PASS_AGGREGATES_BY_VALUE". In EDMexpressX, the default way of "passing aggregates" is "by value". This means that (almost) each time an aggregate is stored or used as a parameter in a function/procedure call, a copy of the actual aggregate is made, and the aggregateID of the new aggregate is stored or passed to the called function/procedure. This "method" is a performance killer and a large "virtual memory consumer". Hence, this should be avoided whenever possible. When using "pass aggregate by reference", only the aggregateID is stored or passed to the called function/procedure. Until now, the option "PASS_AGGREGATES_BY_REFERENCE" in the relevant EDMinterface operations or in the relevant EDMsupervisor commands, had to be used to enable the "PASS_AGGREGATES_BY_REFERENCE" method. A pragma directive is introduced in all kinds of EDMexpressX schemata to enable (and disable) "passing aggregates by reference". The format of the pragma is:
--$EPP{pragma "VM.pass_aggregates_by_reference"="true"}
All "elements" in the Pragma directive is case insensitive. The actual value must be either true or false. The Pragma directive must be within (between) the actual SCHEMA - END_SCHEMA tokens.It is a good practice to place the Pragma directive right after the actual SCHEMA token. No warning/error message is produced when more than one "VM.pass_aggregates_by_reference" pragma is specified in the same schema. In such cases, the last one will be the only giving an effect at run-time. Hence, it is just confusing to have more than one "VM.pass_aggregates_by_reference" pragma in the same schema. The "old way" of specifying "PASS_AGGREGATES_BY_REFERENCE" is still available, but it is recommended to use the Pragma directive because "passing aggregates" is an attribute of the actual schema, decided at schema design time, and not an option that can/should be enabled/disabled at run-time.