XL and Java extension
The programming language XL is defined as an extension of the Java programming language.
XL Language specification
The complete specification can be found at https://manual.grogra.de/de.grogra.xl/. Elements of this section highlight some parts of the specification used in other part of the wiki.
XL and Java syntax
The programming language XL is defined as an extension of the Java programming language. Thus the XL programming language benefits from the well-grounded concepts of structured, modular and object-oriented programming on which the Java programming is based. Being an extension not only at the level of the language specification, but also at the binary level, all existing Java libraries can be addressed immediately by XL programs. This introduces at once an enormous power, since the Java programming language is known for being a language with a comprehensive set of high-quality, freely available run-time libraries, including sophisticated graphical user interface components, internet communications, 2D- and 3D-graphics, and XML support.
Additionally, implements the XL-language specification (https://manual.grogra.de/XL/index.html) to enable rule based graph manipulation. This leads to a programming language based on two paradigms, the object orientation of java and the rule based structure of XL. In order to separate these two, XL is using different brackets to define code blocks.
The java blocks are framed by curly brackets {…} and the XL blocks by square brackets […]. These blocks can be embedded into each other recursively and share declared variables.
Production
While left-hand sides of rules are specified by queries, right-hand sides consist of production statements which have a special syntax and are mostly defined by operator overloading. At the beginning of the outermost sequence of production statements (i. e., at the beginning of a right-hand side, of production statements within imperative code, or of an instantiation rule), the method producer$begin is invoked
on the current producer. It is a compile-time error if this method does not exist. The result of the invocation is taken as new current producer. At the end of the outermost sequence of production statements, the method producer$end is invoked on the current producer. Again, it is a compile-time error if this
method does not exist.
Within production statements, fields and methods declared or inherited by the type of the current producer can be referred to by their simple name. For instance fields and methods, the current producer is used as the implicit target reference similar to the implicit this in bodies of instance methods. However, these fields or methods do not shadow members with the same name in enclosing scopes, i. e., the latter have higher priority.
Rule
In order to combine queries and production statements to rules, the XL programming language defines three arrow symbols ==>, ==>> and ::>. The first two are structural rules whose
right-hand sides consist of production statements which define a successor graph. The third one is an execution rule which executes the statement for every match.
Additionally, rules using ==> extend rules using ==>> by implicit connection transformations. I.e. with ==> we can write L-system rules just as we would do this in an L-system environment.
Default additions
Every new RGG file also imports by default a set of library functions that are used to interact with the graph or the GroIMP platform. This functions can be explored in the function explorer in the software. You can find it on the main menu under 'Help/Function Browser'.
WARNING This is not the case in .xl files
Not included
XL includes many syntax and features of Java. But not all. Essentially the language includes all Java 1.6.
Not included: <type>, lambda, …
Project compilation
The project is compiled. i.e. java classes are created from the sources.
