Fork me on GitHub

Statement Syntax

In SARL, statements are instructions that will be executed. A statement may be one of the elements described in the rest of this document.

As compared to programming languages as Java and C++, there is no need to terminate a statement with the ; character. Use of this statement terminator is optional, and used if you want to put multiple statements on a line. To continue a statement on the next line, you end the line with the \ character.

For instance, the two following lines are equivalent:

var myVariable : int = 5
var myVariable : int = 5;

1. References

This documentation is based on documentations from the Xtext and Xtend projects, and from the Java tutorials. Thank you to the contributors to these documents.

2. Version Specification

Copyright © 2014-2025 SARL.io, the Original Authors and Main Authors.

Documentation text and medias are licensed under the Creative Common CC-BY-SA-4.0; you may not use this file except in compliance with CC-BY-SA-4.0. You may obtain a copy of CC-BY-4.0.

Examples of SARL code are licensed under the Apache License, Version 2.0; you may not use this file except in compliance with the Apache License. You may obtain a copy of the Apache License.

You are free to reproduce the content of this page on copyleft websites such as Wikipedia.

Generated with the translator docs.generator 0.15.1.