This list is incomplete.
- Numeric literals
- String literals
- Multiline string literals
- Char literals
- Date literals
Name | Syntax | Type | Supported |
---|---|---|---|
add | + | binary | [x] |
subtract | - | binary | [x] |
negate | - | unary prefix | [x] |
multiply | * | binary | [x] |
divide | / | binary | [x] |
integer_divide | DIV | binary | [x] |
mod | MOD | binary | [x] |
or | OR | binary | [x] |
and | AND | binary | [x] |
not | NOT | unary prefix | [x] |
equal_to | = | binary | [x] |
not_equal_to | <> | binary | [x] |
less_than | < | binary | [x] |
less_than_equal | <= | binary | [x] |
greater_than | > | binary | [x] |
greater_than_equal | >= | binary | [x] |
string_concatenate | & | binary | [x] |
pointer_reference | ^ | unary prefix | [x] |
pointer_dereference | ^ | unary postfix | [x] |
access | . | binary | [x] |
array access | [ ] | special | [x] |
function call | ( ) | special | [x] |
new | NEW | special | [x] |
- Single line comments (from
//
not in a string, to the end of the line) - Multiline comments (from
/*
not in a string, to the next*/
)
Name | Comment | Supported |
---|---|---|
BOOLEAN | [x] | |
INTEGER | [x] | |
REAL | Usually known as "double" | [x] |
STRING | Arbitrary length | [x] |
CHAR | Stores a single Unicode Scalar Value | [x] |
DATE | Stores a day, month, and year | [x] |
ARRAY | Stores a fixed number of another data type | [x] |
Name | Comment | Example | Supported |
---|---|---|---|
Record | Usually known as "struct". | TYPE name DECLARE field: INTEGER ENDTYPE |
[x] |
Pointer | Points at a variable and can be used to change it. | TYPE name = ^INTEGER | [x] |
Set | Similar to an array, but without ordering. | TYPE name = SET OF INTEGER | [x] |
Enum | Stores one of a few specified values. | TYPE name = (value1, value2, value3) | [x] |
Class | Supports normal object-oriented programming features | CLASS name ENDCLASS |
[x] |
Integer range | An INTEGER between two values (inclusive). | 1..10 | [x] |
A record type is a user-defined composite data type, made up of zero or more fields.
Initializing a variable of type (record type) causes all its fields to be initialized automatically.
Syntax: a + b
Adds two numbers and returns the result as a number.
Can also be used on enum values, returning the previous or next enum value.
Syntax: a - b
Subtracts two numbers and returns the result as a number.
Syntax: - a
Returns the negation of a number (the number times -1).
Syntax: a * b
Multiplies two numbers and returns the result as a number.
Syntax: a / b
Divides two numbers, giving the result as a REAL. The return type of this operator cannot be coerced to INTEGER, please use the DIV operator for that.
Syntax: a DIV b
Divides two numbers using integer division, and returns the result as an INTEGER, discarding the remainder. Equivalent to FLOOR(a / b).
Syntax: a MOD b
Divides two numbers using integer division and returns the remainder.
Syntax: a OR b
Returns TRUE if one or both of its boolean inputs are TRUE.
Syntax: a AND b
Returns TRUE if both of its boolean inputs are TRUE.
Syntax: NOT a
Returns the opposite of its boolean input: TRUE if the input is FALSE, and FALSE if the input is TRUE.
Syntax: a = b
Returns TRUE if the inputs are equal. Inputs can be of any type.
Syntax: a <> b
Returns TRUE if the inputs are not equal. Inputs can be of any type.
Syntax: a < b
Returns TRUE if the first input is less than the second input.
Syntax: a <= b
Returns TRUE if the first input is less than or equal to the second input.
Syntax: a > b
Returns TRUE if the first input is greater than the second input.
Syntax: a >= b
Returns TRUE if the first input is greater than or equal to the second input.
Syntax: a & b
Puts the second string input after the first and returns the combined string.
Syntax: ^a
Returns a pointer to the input.
Syntax: a^
Deferences the pointer input, accessing the underlying value.
Syntax: a.b
Accesses a property on the first input.
Syntax: a[b]
or a[b, c]
a
must be an array with dimension equal to the number of indexes. Returns the value in the array at the specified index(es).
Syntax: a()
or a(b, c, d)
a
must be a function with parameter count equal to the number of arguments. Calls the function a
with the specified arguments and returns the return value.
Syntax: NEW a()
or NEW a(b, c, d)
a
must be the name of a class. Creates a new instance of the class by invoking the constructor with the given arguments and returns the class instance.
TODO