Expressions
For simplicity's sake only expressions with two operands are allowed.
Boolean expressions:
This operations are supported for boolean expressions:
Operator | Example |
---|---|
and | res = b1 and b2 |
or | res = b1 or b2 |
> | res = n1 > 5 |
< | res = n1 < 5 |
== | res = n1==n2 (comparison is also supported between boolean and string operands!) |
this kind of expressions can be also used directly as "if's conditions" like this:
Numerical expressions:
This operations are supported for numerical expressions:
Operator | Example |
---|---|
+ | n1 = n1 + 1 |
- | n2 = n1 - n3 |
* | n3 = n1 * 7 |
/ | n3 = n2 / n1 |
this kind of expression can be also used directly to determine the start value of a for loop's index like this:
Strings expressions:
Operator | Example |
---|---|
+ | res = "hello " + "world" |
You can concatenate two strings in AVIL just by usign the "+" operator like this: