01_user_documentation:07_rgg_xl:02_xl:08_object:02_pattern
Table of Contents
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.
In XL
Custom patterns can be created in XL with the simple syntax:
class patternName(@In Node a, @Out Node b) ( // some patterns )
In Java
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) {...} } }
01_user_documentation/07_rgg_xl/02_xl/08_object/02_pattern.txt · Last modified: 2025/09/02 18:26 by gaetan
