====== Declaration ====== Modules are declared similarly as classes. Their declaration include: * A name * An optional list of [[:01_user_documentation:06_graph:02_node:01_attribute|attributes]] * An optional list of class/interfaces that are extended/ implemented * An [[:01_user_documentation:07_rgg_xl:02_xl:08_object:01_module:05_instantiation| instantiation declaration]] Modules are declared in XL with the keyword ''module'' (different from the java keyword ''module''). module A(int attr1, Object attr2) extends N { /* body */ } ; ====== Syntax ====== Only the Name is non optional in the declaration. Thus, the smallest module declaration is: module A; This declaration is equivalent to: class A extends N { public static class Pattern extends UserDefinedPattern { private static void signature(@In @Out X node) {} ... // suitable implementation of abstract methods } } The declaration uses an implicit superclass N which is determined by the annotation [[https://javadoc.grogra.de/xl/de/grogra/xl/modules/DefaultModuleSuperclass.html|@DefaultModuleSuperclass]] of the innermost enclosing declaration which has such an annotation. RGG files have [[:01_user_documentation:07_rgg_xl:02_xl:10_rgg_addition:01_annotation|default annotations]], one of these is the @DefaultModuleSuperclass. Its value is [[https://javadoc.grogra.de/graph/de/grogra/graph/impl/Node.html|Node]]. Thus, by default all module extends Node. The [[:01_user_documentation:07_rgg_xl:02_xl:03_query:01_predicate:01_node:02_parametrized|parametrized pattern]] is created implicitly and takes the module attributes declared after the name as additional arguments. {{namespace>01_user_documentation:07_rgg_xl:02_xl:08_object:01_module:01_declaration}}