This is an old revision of the document!
Pattern
Patterns are declared from a class that extends UserDefinedPattern. Each concrete subclass of UserDefinedPattern declares a user-defined pattern, where the term “user-defined” distinguishes such a pattern from built-in patterns of the XL programming language. The signature (number and types of parameters) of a user-defined pattern is given by a special method named signature which has no further purpose. The @In and @Out annotations in the signature are needed when textually neighboring patterns are connected.
The minimal format to declare a pattern as java object is:
class X extends Node { static class Pattern extends UserDefinedPattern { private static void signature(@In @Out X node) {} public Matcher createMatcher(Graph graph, XBitSet bound, IntList requiredAsBound) {...} } }
Additionally, the in RGG, a pattern can be declared and used as:
// declaration class xyzPath(@In Node a, @Out Node b) ( a -x-> -y-> -z-> b ) //usage void rule() [ Node -xyzPath-> Node ==>; ]
Note: the rgg declaration is describe in Ole manuscript and is defined in the Parser, however, there is no Compiler section for it. Thus, it cannot work.
