01_user_documentation:07_rgg_xl:02_xl:01_specification
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 01_user_documentation:07_rgg_xl:02_xl:01_specification [2025/08/18 09:11] – ↷ Links adapted because of a move operation gaetan | 01_user_documentation:07_rgg_xl:02_xl:01_specification [2025/08/19 13:20] (current) – gaetan | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ====== XL Language specification ====== | ====== XL Language specification ====== | ||
| - | The programming language XL is our implementation of relational growth grammars. XL is built on top of the programming language Java: This combines the advantages of the rule-based paradigm with the strength of Java, including the rich set of existing Java libraries. | + | The complete |
| - | + | ||
| - | ==== Rules ==== | + | |
| - | + | ||
| - | Rules are specified within a transformation statement. The snowflake curve can be generated by the two rules: | + | |
| - | + | ||
| - | < | + | |
| - | Axiom ==> F(1) RU(120) F(1) RU(120) F(1); | + | |
| - | F(x) ==> F(x/3) RU(-60) F(x/3) RU(120) F(x/3) RU(-60) F(x/3); | + | |
| - | </ | + | |
| - | + | ||
| - | Behind the scenes, Axiom, F and RU correspond to Java classes of that name. The bound variable x corresponds to a field of class F. | + | |
| - | + | ||
| - | ==== Expressions with multiple values ==== | + | |
| - | + | ||
| - | XL supports expressions that have multiple values successively. E.g., the expression (* F *) returns all existing objects of class F. Operators like ' | + | |
| - | + | ||
| - | < | + | |
| - | sum ((* f:F, (f.diameter > 1) *).length) | + | |
| - | </ | + | |
| - | + | ||
| - | Especially the graph query expressions of the form (* … *) enable you to specify local or global interactions in a concise and expressive way. | + | |
| - | + | ||
| - | + | ||
| - | ==== More extensions to the java syntax ==== | + | |
| - | + | ||
| - | [[01_user_documentation: | + | |
| - | + | ||
| - | ==== Examples ==== | + | |
| - | + | ||
| - | You can find many examples of the XL languages in the [[03_community: | + | |
| - | + | ||
| - | ==== Complete XL documentation ==== | + | |
| - | + | ||
| - | An extensive documentation on the XL language | + | |
| - | + | ||
| - | ==== Java ==== | + | |
| - | + | ||
| - | As XL is based on Java, some coding rules are the same. | + | |
| - | + | ||
| - | For instance, functions are declared with a modifier (public, protected, private, | + | |
| - | + | ||
| - | Similarly, variables are declared with a type, which is identical to the Java types. | + | |
| ====== ====== | ====== ====== | ||
| - | |||
| {{namespace>: | {{namespace>: | ||
01_user_documentation/07_rgg_xl/02_xl/01_specification.1755501111.txt.gz · Last modified: 2025/08/18 09:11 by gaetan
