Compilation Process

Most editors have a Compile command that starts the compilation process. For some objects (such as components, services, global objects, and application shells), compilation results in compiled objects that can be used in the Uniface runtime environment. For other objects (such as IncludeScript), the compiler only checks the definition, syntax, and/or integrity.

Compilation takes places in phases, with each phase performing a specific task. The compiler initiates each phase based on the type of object. The compilation phases for a component are:

  1. Get the data structure—analyzes the data structure and builds an entity and field structure from it. The data structure holds the list of entities that are used on the component and their nested relationships
  2. Analyze modeled entity definitions—loads entity, field, key, and relationship definitions. Warnings are generated for definitions that are not found. Modeled ProcScript modules are collected and pre-compiled.
  3. Prepare internal schema structure—rearranges the loaded entities and fields to the data structure sequence.
  4. Analyze local relationships—collects component entity and field definitions, and determines the relationships (up or down) between entities. Locally-defined ProcScript modules are collected and pre-compiled.
  5. Creation of layout to field mapping (Background text)—generates the static part of form components, labels, frames, as well as the creation of the layout to field mapping.
  6. Component variables—generates the definitions for component-level variables.
  7. ProcScript compilation—compiles the ProcScript modules gathered and pre-compiled in previous phases; it handles duplicate ProcScript entries and overlaid ProcScript modules. It checks syntax and references to non-existing fields, (global) variables, and (global) ProcScript modules, for generated warnings and errors, and then creates compiled ProcScript blocks for every ProcScript module.

    While checking references to global ProcScript and global variables, Uniface uses the most recently compiled versions of all global objects.

  8. Structure tables—creates the logical entity/field tables, where the structured data (occurrences) is stored in temporary Uniface memory (hit list) at runtime.
  9. Descriptor—generates the component signature.
  10. Save compiled object—combines the newly created information in one compiled object, for example a component, global object library, or application shell.

Other objects are compiled in fewer phases. The following table shows the compiler phases used to compile Uniface objects. The numbers represent the phase sequence number and the Uniface object types are:

  • ent=Modeled entity
  • aps=Application shell
  • cpt=Component
  • cptm=Component Template
  • men=Menu
  • prc=Global ProcScript
  • var=Global Variable
  • con=Global Constant
  • oper=Public Collection Operation
  • trig=Individual Trigger
Compilation Phases
Compilation phase Uniface object types
ent oper aps cptm cpt prc var men

Get data structure

1 1 1
Analyze model definitions 1 1 2 2
Prepare internal schema structure 2 3 3
Analyze component relationships 3 4 4
Create layout to field mapping (Background text) 2 5 5
Component variables 6 6 1
ProcScript compilation 2 3 7 7 1 1
Structure tables 8 8
Descriptor 3 9 9
Save Compiled Object 4 4 4 10 2 2 2