This is an interpreter for a custom programming language called SP. The interpreter supports various features such as variable assignments, arithmetic operations, function definitions, conditionals, loops, and more.
- Variable assignments
- Arithmetic operations
- Function definitions and calls
- Conditional statements (
si,alreves) - Loops (
mientras,para) - Print statements (
imprimir) - Importing other SP files (
importar) - User input (
entrada)
To run an SP script, use the following command:
python main.py path/to/your_script.spMake sure the script file has a .sp extension.
You can also start the interpreter in interactive mode (REPL) by running:
python main.pyIn interactive mode, you can type and execute SP code line by line. Type salir to exit the REPL.
Here is a simple example of an SP script:
funcion suma(a, b) {
retorna a + b;
}
imprimir(suma(3, 4)); // Output: 7Save this code in a file with a .sp extension and run it using the interpreter.
This project is licensed under the MIT License.