1.2 KiB
1.2 KiB
NEK-Lang
High level Components
- Lexer: Transforms text into Tokens
- Parser: Transforms Tokens into Abstract Syntax Tree
- Interpreter (tree-walk-interpreter): Walks the tree and evaluates the expressions / statements
- Abstract Syntax Tree Optimizer
Language features
- General expressions
- Arithmetic operations
- Addition
X+Y - Subtraction
X-Y - Multiplication
X*Y - Division
X/Y - Modulo
X%Y
- Addition
- Unary operators
- Negate
-X
- Negate
- Parentheses
(X+Y)*Z - Logical boolean operators
- Equal
== - Not equal
!= - Greater than
> - Less than
< - Greater than or equal
>= - Less than or equal
<=
- Equal
- Bitwise operators
- Bitwise AND
X&Y - Bitwise OR
X|Y - Bitwise XOR
X^Y - Bitwise NOT
~X - Bitwise left shift
X<<Y - Bitwise right shift
X>>Y
- Bitwise AND
- Arithmetic operations
- Variables
- Declaration
- Assignment
- Control flow
- While loop
while X { ... } - If else statement
if X { ... } else { ... }- If Statement
- Else statement
- While loop
- Line comments
// - Strings
- IO Intrinsics
- ReadLine