Skip to content
/ lu Public

Lu is a work-in-progress pseudocode compiler that translates pseudocode into Python code. Designed to streamline the transition from algorithm design to implementation, Lu aims to provide clear, efficient, and maintainable Python code from simple pseudocode instructions.

License

Notifications You must be signed in to change notification settings

gsdev215/lu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Lu

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.

Supported Features

  • Output Statements: Converts IGCE pseudocode OUTPUT commands to Python’s print() 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.

Usage

  1. Write your IGCE pseudocode in a .lu file.

  2. 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.

Example

For an input .lu file:

IF x > 5 THEN
    OUTPUT x
ELSE
    OUTPUT "Value too low"
ENDIF

The compiler will output equivalent Python code.

Installation

Clone the repository:

git clone https://github.com/gsdev215/lu.git

Then navigate to the lu directory and run the compiler as described.

About

Lu is a work-in-progress pseudocode compiler that translates pseudocode into Python code. Designed to streamline the transition from algorithm design to implementation, Lu aims to provide clear, efficient, and maintainable Python code from simple pseudocode instructions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages