Chapter 1. Introduction

Table of Contents

1.1. Organization
1.2. Relation to Predefined Classes and Interfaces

The XL programming language adds syntactic and semantic support for access and rule-based modification of relational data sources to the programming language Java. It is an implementation of the calculus of relational growth grammars [RGG]. The latter is defined as a graph-based extension of the L-system formalism [ABOP] which has been widely used in plant modelling (and in fact led to the name XL which may be read as eXtended L-systems). However, the XL programming language's field of application is not restricted to graphs and plant modelling; it may be used for any relational data source by implementing the XL data model interface. Graphs are just a special, but important case. In this case, the programming language XL may be seen as an implementation of the calculus of programmed graph replacement systems as defined in [PGRS].

The development of the XL programming language started in 2002. Since then, the language has undergone a set of changes. This is a normal process for an initially experimental language; however, one should be aware of this fact when looking at earlier XL-related publications. They may contain examples of source code that are no longer valid XL code, or they may contain terms that are no more used. This XL language specification reflects the first stable version of the XL programming language, future versions are expected to be essentially backwards-compatible to this specification.

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 programmes. 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.

Because the XL programming language is an extension of the Java programming language, this specification often refers (explicitly or implicitly) to the Java Language Specification, Second Edition [JLS] (Java Language Specification for short), and in some cases to the Java Language Specification, Third Edition [JLS3]. The reader should be familiar with the Java programming language and the terms defined in the Java Language Specification.

1.1. Organization

This specification is organized as follows. The structure deliberately resembles that of the Java Language Specification, and some verbalizations of the Java Language Specification were adopted in the chapters.

  • Chapter 2, New Features of the XL Programming Language gives a short, informal overview of some of the new features of the XL programming language.

  • Chapter 3, Data Model Interface gives an overview of the XL data model interface and the dependencies of an XL programme on this model. The specific details of these dependencies are explained in the later chapters.

  • Chapter 4, Extended State of the Virtual Machine describes the extended state of the virtual machine that is used at run-time and assists in implementing some of the new features of the XL programming language. The extended state provides a stack that is more powerful than the stack of the Java virtual machine, because it not only allows for the access of the current stack frame, but also of enclosing stack frames.

  • Chapter 5, Lexical Structure describes the lexical structure of the XL programming language. It is nearly the same as for the Java programming language, with the difference of a set of new tokens.

  • Chapter 6, Types describes the types of the XL programming language. The types are those of the Java programming language, with the addition of the intersection type (which has also been defined similarly in the Java Language Specification, Third Edition).

  • Chapter 7, Variables describes the variables of the XL programming language. These are those of the Java programming language, with the addition of query variables and property variables.

  • Chapter 8, Conversions and Promotions describes conversions. The XL programming language adds the possibility of implicit conversions from double to float.

  • Chapter 9, Names and Scopes describes declarations, names and scopes. Declarations of modules and query variables are new features of the XL programming language, as are some implicit declarations.

  • Chapter 10, Packages and Compilation Units describes the structure of a programme. As for the Java programming language, a programme consists of a set of compilation units, organized in a hierarchical package structure. The XL programming language adds static import declarations (which have also been defined in the Java Language Specification, Third Edition).

  • Chapter 11, Classes and Interfaces describes classes and interfaces. At class level, there are foure extensions of the Java programming language defined: Generator methods, operator methods, instancing methods, and annotations. Generator methods successively yield values to their invoker which is very useful for iterations over collections, e.g., over the objects of a relational data source. Operator methods are used to overload operators of the XL programming language. Instancing methods are syntactic sugar for the technique of object instancing common in 3D computer graphics (but this specification makes no reference to this concrete usage). Annotations are similar to the annotations defined in the Java Language Specification, Third Edition.

  • Chapter 12, Class Predicates describes class predicates. Class predicates are used in queries, they represent an atomic pattern.

  • Chapter 13, Signatures describes signatures, their applicability and specificity. A signature is a method or a class predicate.

  • Chapter 14, Modules describes modules. Modules are a shorter way of declaring classes for typical situations in rule-based modelling.

  • Chapter 15, Blocks and Statements describes blocks and statements. The main extension is the definition of transformation blocks which contain sets of rules that operate in parallel on a relational data source. Their syntax is defined in such a way that it is backwards-compatible with the traditional syntax of L-systems, but easily extends to more complex relational data sources that contain, e.g., labelled hyper-edges. Quasi-parallel assignment statements perform modifications of properties as if they were executed in parallel. An enhanced for-statement is defined which is an extension of the enhanced for-statement of the Java Language Specification, Third Edition, and cooperates with generator expressions and a new iterator class. A construction block allows for the construction of a relational structure. yield is used to yield the results of a generator method. An assert-statement serves to verify conditions at run-time, this has also been defined in the Java Language Specification, Third Edition.

  • Chapter 16, Expressions describes expressions. These are those of the Java programming language, plus query expressions of relational data sources, expression lists (as known from the comma operator of C), instance scope expressions (similar to the with-statement of Basic and Pascal), property access expressions, exponentiation, containment, invocations of aggregate methods, and generator expressions, namely ranges of type int and long, array generators, guard expressions, and invocations of generator methods and filter methods.

  • Chapter 17, Queries describes the syntax and semantics of queries in detail. Queries are used in query expressions and as the left hand side of rules in transformation blocks. The query syntax resembles the syntax of the right hand side of rules in order to stress the rewriting character of rules, but contains various additions. E.g., there is a regular-expression style syntax that allows for the specification of transitive closures of binary relations.

The above chapters do not cover all aspects of the XL programming language. For the remaining aspects, the XL programming language behaves identically to the Java programming language (e.g., arrays, exceptions, threads and locks).