Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/being-amara-khan/simplelang-compiler

A basic compiler built with Python and Tkinter, designed for educational purposes. It provides essential compilation phases including lexical analysis, syntax analysis, semantic analysis, and code generation. Users can also run the compiled code, open files, and view outputs in a user-friendly graphical interface.
https://github.com/being-amara-khan/simplelang-compiler

compiler-construction programming python

Last synced: 5 days ago
JSON representation

A basic compiler built with Python and Tkinter, designed for educational purposes. It provides essential compilation phases including lexical analysis, syntax analysis, semantic analysis, and code generation. Users can also run the compiled code, open files, and view outputs in a user-friendly graphical interface.

Awesome Lists containing this project

README

        

## SimpleLang Compiler

Welcome to the SimpleLang Compiler project! This is a basic compiler built using Python and Tkinter that performs various phases of compilation on code written in a simple programming language. The compiler includes functionality for lexical analysis, syntax analysis, semantic analysis, and code generation. Additionally, it can run the compiled code and handle file operations.

# Features

- Lexical Analysis: Tokenizes the input code and displays the tokens.
- Syntax Analysis: Placeholder for syntax tree generation (currently a placeholder).
- Semantic Analysis: Placeholder for semantic analysis (currently a placeholder).
- Code Generation: Placeholder for generating code from the input (currently a placeholder).
- Run Code: Executes the input code and displays the output.
- Open File: Allows you to open a text file containing code to be analyzed.
- Exit: Closes the application.

# Installation

1. Ensure you have Python installed on your system. You can download it from [python.org](https://www.python.org/).

2. Clone this repository to your local machine:
```markdown
```bash
git clone https://github.com/being-amara-khan/simplelang-compiler.git
```

3. Navigate to the project directory:

```bash
cd simplelang-compiler
```

4. Install any required dependencies. For this project, Tkinter is used, which is included with Python. No additional packages are required.

# Usage

1. Run the application:

```bash
python simplelang_compiler.py
```

2. The application window will appear. You can perform the following actions:

- **Lexical Analysis**: Click "Lexical Analysis" to see the tokens generated from the input code.
- **Syntax Analysis**: Click "Syntax Analysis" to view the syntax tree output (currently a placeholder).
- **Semantic Analysis**: Click "Semantic Analysis" to view the semantic analysis output (currently a placeholder).
- **Generate Code**: Click "Generate Code" to see the generated code output (currently a placeholder).
- **Run Code**: Click "Run Code" to execute the input code and display the output.
- **Open File**: Click "Open File" to load code from a text file into the editor.
- **Exit**: Click "Exit" to close the application.

## Contributing

Contributions are welcome! If you have suggestions or improvements, please open an issue or submit a pull request.

## License

This project is licensed under the MIT License. See the [LICENSE]() file for details.

### Happy coding! 🚀