next up previous contents
Next: Target code predicates Up: Predicates in rules Previous: Checked calls to external

   
Calls to external functions

Edges in graphs may be simulated by calling external C functions. The name of the functions must appear in a DECLARE declaration:


\begin{verbsyntax}\synrule{ExternalFunctionDeclaration}{IdentKommaList ':' 'fun'...
...aration}{IdentKommaList ':' 'proc' NodeType '->' SetOrNodeType}
\end{verbsyntax}

The first alternative declares an external C function returning a node type or a set over a node type. The second alternative declares a void C procedure with two parameters, the first an input parameter (pointer/object type), the second one an output set parameter (set type). Examples of declarations:


\begin{examplefoot}DECLARE
f1: fun file -> file;
f2, f3: fun file -> conslist...
...);
p1: proc file -> file;
p2,p3: proc file -> consset(file);
\end{examplefoot}

f1 - p3 may all be refered to as binary predicate names in rule tests:


\begin{examplefoot}( f1(O1,O2), p3(O2,O3) ==> a_normal_graph_edge(O1, O3) )
\end{examplefoot}

The semantics of external C function calls in rule transformations is not defined.



Uwe Assmann
1998-12-22