-
Notifications
You must be signed in to change notification settings - Fork 1
The Language
Evi is free-from, meaning that spaces and comments are ignored, except in strings, in characters and as delimiters between tokens. Spaces are recognized as whitespaces, carriage returns and tabs. Only ASCII characters are accepted.
Identifiers consist of a series of alphanumeric characters or underscores, not starting with a digit. Evi has no alphanumerical keywords, so no identifiers are reserved by the compiler. Next to that, Evi is case-sensitive. meaning that mystring
and myString
are two different identifiers.
The following characters are reserved for keysymbols, operators and other tokens:
( ) { } [ ]
+ - * / ! ,
& | ^ ? :
&& || ^^ << >>
== /= <= >= ->
++ -- ?? :: !!
@ % = ~ ; ...
String literals are delimeted by double quotes and can contain any amount of any character except non-escaped double quotes. Character literals are delimeted by single quotes and can contain one single character, or an escape sequence. These escape sequences include the following:
Literal characters | Interpreted character |
---|---|
\a | Bell (alert) |
\b | Backspace |
\e | |
\f | Form feed |
\n | Newline |
\r | Carriage return |
\t | Horizontal tab |
\v | Vertical tab |
\' | Single quote |
\" | Double quote |
\\ | Backslash |
\0 | Null character |
An integer constant can be written as decimal, hexadecimal, binary or octal. Floating-point constants can only be written in decimal and must include a radix point. Examples of valid numerical constants are the following:
1, 123, 0001,
0xFF, 0xaf, 0X003D,
0c7, 0c166, 0C0,
0b1111, 0b1, 0B0001,
1.256, 0.0123, 0.0
Comments can be either single-line or blocks. Single-line comments are denoted by a backslash \
and include the rest of the line, while block comments are denoted by \:
and go on until the end of the file, or until :\
.
Next: 5 – The Standard Library
Home | About | Installation | Language Overview | License: MIT 2022 Sjoerd Vermeulen. Terms