Lu is a lightweight pseudocode-to-Python compiler, currently supporting basic IGCE-style pseudocode. It uses Python’s built-in AST module to parse and translate pseudocode logic into Python code.
- Output Statements: Converts IGCE pseudocode
OUTPUTcommands to Python’sprint()function. - Conditional Logic: Handles
IF,ELSE,ENDIF, and nested conditional statements. - Variable Assignment: Supports variable declaration and assignment.
- Error Handling: Detects and reports syntax issues with details.
- Logging: Implements a logging system for debugging.
-
Write your IGCE pseudocode in a
.lufile. -
Run the Lu compiler:
python lu/lu_compiler.py path_to_file/<filename>.lu
This will generate
<filename>.py, a Python equivalent of your pseudocode.
For an input .lu file:
IF x > 5 THEN
OUTPUT x
ELSE
OUTPUT "Value too low"
ENDIF
The compiler will output equivalent Python code.
Clone the repository:
git clone https://github.com/gsdev215/lu.gitThen navigate to the lu directory and run the compiler as described.