Types and values | |
Simple | |
String | "string" |
Boolean | true |
Integer | 1 -100 |
Decimal | 24.86 |
Date | d'yyyy-MM-dd HH:mm:ss.SSS' |
Object | any expression |
Null | null |
Containers | |
Set<T> | { element1,… } |
List<T> | [ element1,… ] |
List<Integer> | -5..81 |
Map<K,V> | [ key1 -> value1,… ] empty map: [ -> ] |
Other | |
Record | new record_name() |
Reference<T> | &variable |
Closure {T,…: U} | { -> expression } |
Type | type(type_definition) record_name |
Operators | |
Assignment | |
Assignment | variable := expression |
Arithmetic | |
Addition | + |
Subtraction | - |
Increment | ++var var++ |
Decrement | --var var-- |
Multiplication | * |
Division | / |
Modulo | % |
Exponentiation | ** |
Boolean | |
Equality | == != <> |
Comparison | < <= > >= <=> instanceof |
Negation | not ! |
Conjunction | and && |
Disjunction | or || |
Exclusive disjunction | xor |
Pattern matching | string like pattern |
Collection containment | item in collection |
Other | |
String concatenation | + |
Parenthetical grouping (precedence) | ( ) |
Compound Assignment | |
Addition | += |
Subtraction | -= |
Multiplication | *= |
Division | /= |
Modulo | %= |
Access | |
Set element | set[index] |
List element | list[index] |
Map element | map[key] |
Record field | record.field |
Record safe field | record?.field |
Record reference field | reference.field |
Record ref. safe field | reference?.field |
Enumeration literal | enum.literal |
Dereferencing | *reference |
Namespace separator | :: |
Function call | function|T1,…|(argument1, argument2,…) |
Closure invocation | closure(argument1, argument2,…) |
Method call | object.method(argument1, argument2,…) |
Special constructs | |
Local variable | def type name with assignment: |
Comments | // single-line comment |
Expression chaining | expr1 ; expr2 ; expr3 ; … |
Block | begin expression end |
Error throw | error(string_expression) |
Try-catch | try expression |
Cast | expression as type |
Control flow | |
If-then If-then-else If-then-elsif-then If-then-elsif-then-else | if condition1 then |
Ternary conditional | condition ? expression1 : expression2 |
Null-coalescing | expression1 ?? expression2 |
Switch | switch arg_expression |
While looping | while condition do |
For looping | for(init; condition; update) do |
Collection iteration | foreach type iterator in collection do |
Looping break (in while,for and foreach) | break |
Looping iteration skipping (in while, for and foreach) | continue |
Function definition file | |
Function | /** description */ |
Function body | expression: { expression } native: native java_method_path |
Annotations | @SideEffect |
Visibility | public |
Function parameter | optional: Type name mandatory: Type name* variadic: Type... name default value: Type name = defaultValueExpression |
Method definition file | |
Record methods | Record { |
Method | /** description */ Note: Annotations and parameters follow syntax of function.
|
Constructor | /** description */ Note: Annotations, parameters and body follow syntax of function; visibility follows syntax of method.
|
Method body | expression: { expression } native: native java_method_path abstract: ; |
Visibility | public |
Modifiers | abstract |
Access (only in method) | |
This instance | this |
Super-type members | super.method(argument,…) |
Access (only as first statement of constructor) | |
Calling constructor of this record | this(argument,…) |
Calling constructor of supertype | super(argument,…) |