HANDBOOK / GENTLE PRIMER / Using Types and Predicates Written in C /

# External Predicates

Actions and conditions may also be implemented externally. To make them accessible, the Gentle specification must provide a declaration without rules (just as a type declaration without functors introduces an external type).

The declaration

       'action' string_to_id (STRING -> IDENT)

that comes without rules introduces a predicate that takes a `STRING` and yields an `IDENT`. The implementation is not given in Gentle. The actual C implementation may insert the string into a hash table and return a unique reference to the entry. `IDENT` is the type of these references.

Other predicates may be declared that allow us to associate a ``meaning'' with an `IDENT` and access this later:

       'action' DefMeaning (IDENT, MEANING)
       'condition' HasMeaning (IDENT -> MEANING)

(See the Library Reference Manual for information on how to implement external types and predicates.)