Classifiers, or part types

EGL provides a variety of classifiers, each of which is a category of types. The EGL documentation sometimes refers to a classifier as a part type, but the word “type” in that phrase means “kind” rather than “data type.”

If you are interested in understanding how the EGL generator works, you can start by noting that each EGL part is an instance of a classifier. In any case, be aware that the capabilities of a given classifier are made available to your EGL code when you define or use a part that is based on that classifier:

Each of the EGL parts that you develop has some or all of the following characteristics, depending on the classifier:
One classifier is Record. It enables you to define a part with multiple fields. For example, you might use this classifier to define a part named CarPolicy:
Record CarPolicy type BasicRecord {}
   thePolicyID STRING; 
   theCarCount NumberOfCars;
   theDriverCount NumberofDrivers;
end
You can use a part such as CarPolicy to declare a variable named myCarPolicy:
myCarPolicy CarPolicy;
The variable is called a record, and you can now assign data to each of its fields:
myCarPolicy.thePolicyID    = "ABC123";
myCarPolicy.theCarCount    = 2;
myCarPolicy.theDriverCount = 2;
Another EGL classifier is Program. You use this part type to define a static type, which is a unit that is not the basis of a variable. For example, here is the program part AssignPolicyValues:
Program AssignPolicyValues
   
   myCarPolicy CarPolicy;
   const CONSTANT_TWO INT = 2;

   function main()
      myCarPolicy.thePolicyID    = "ABC123";
      myCarPolicy.theCarCount    = CONSTANT_TWO;
      myCarPolicy.theDriverCount = CONSTANT_TWO;
   end
end

The Program part AssignPolicyValues is a single unit that embeds fields and functions. Those fields and functions are program global, which means that they are accessible from every function in the part.

Incidentally, the EGL documentation often drops the word “part” when referring to a part that is based on a classifier other than Record. For example, AssignPolicyValues is said to be a “program” rather than a “Program part.”