The Project

Chapter 10. Calling entry points

When calling a function that implements an entry point rule, it should be called with the rule's parameters as the first arguments, followed by the addresses of the rule's results as the remaining arguments. The parameters should have their addresses passed if they are of a type that has a parameter assignment operator defined, or if the parameter is a call by reference parameter.

For example, given the following rule:

rule1 : ( :Type1T, :Type2T, :Type3T & ) -> ( :Type4T ) ;

where Type2T has a parameter assignment operator defined, and rule1 is mapped to rule1 (and the type names are mapped to themselves), the call would be something like:

Type1T a = make_type1 () ;
Type2T b = make_type2 () ;
Type3T c = make_type3 () ;
Type4T d ;

rule1 ( a, b, &c, &d ) ;