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.
Java block
By default the code in an RGG file is interpreted as a java block. Additionally, these blocks are included in { } brackets.
The java block allow java syntax up to java 1.6. (this is independent from the java version that is used to run GroIMP). Therefore, it is possible to use features such as file reading and writing, mathematical calculations, abstraction/inheritance or library functions. If you are not experienced with java it might be useful for you to look into available online tutorials.(For example https://www.w3schools.com/java/default.asp)
XL block
XL blocks are inserted with [ ] brackets. They are used to execute rules.
Import types/ resources
To use types (classes/ methods/ modules/ …) that are defined in a library into your project, the type needs to be imported.
There are several level of imports:
- Automatic imports
- Project imports
- Plugin imports
- Module library imports
- Third party imports
