A simple arithmetic expressions interpreter built in Julia that implements the Pratt parsing algorithm. Made for educational purposes.
The interpreter supports the following basic math operations:
- Addition:
+ - Subtraction:
- - Multiplication:
* - Division:
/ - Modulo (remainder):
% - Exponentiation:
^
You can also define your own variables and use parentheses in expressions.
Important
The program allows for single-letter variable names only.
The same applies to numbers - expressions must consist of digit-based number operations.
-
Open a terminal of your choice and navigate to the project folder.
-
Start a new Julia REPL from there:
julia --project
-
Import the
Interpretermodule:using Interpreter -
Run the interpreter:
Interpreter.start()
To exit the program, type quit and press ENTER.