This is a Qt project that demonstrates the integration of Python with the Qt framework.
To create a Qt GUI application that demonstrates how to scan and parse tiny language source files using recursive decent parsing method and then generate a parse tree for the syntax.
Before building and running this project, you will need to have the following installed on your system:
- Qt 7.0.0
- Python 3.11
- PyQt6 (the Python bindings for Qt)
- PySide6
- Qt Creator (optional but recommended for development)
- Scan tiny language source files for different types of tokens here's a list:
Token Type | Value |
---|---|
SEMICOLON | ; |
IF | if |
THEN | then |
END | end |
REPEAT | repeat |
UNTIL | until |
IDENTIFIER | x, abc, xyz |
ASSIGN | := |
READ | read |
WRITE | write |
LESSTHAN | < |
EQUAL | = |
PLUS | + |
MINUS | - |
MULT | * |
DIV | / |
OPENBRACKET | ( |
CLOSEDBRACKET | ( |
NUMBER | 12, 289 |
- Parse different kinds of tokens and create the parse tree here's an example for a tiny language source file with its parse/syntax tree:
{sample program in TINY language- computes factorial}
read x; { input an integer }
if 0<x then { don’t compute if x<=0 }
fact:=1;
repeat
fact := fact*x;
x := x-1
until x=0;
write fact{output factorial of x}
end
Here are the steps to build and run the project (for Windows only, we didn't run the project on any other platform):
Last modification date: 2023 - 02 - 22 03:35 PM
- Download Qt Creator or VSCode or any IDE you see fit
- Install python
https://www.python.org/downloads/
- Add scripts directory to your path (if it doesn't) (this includes pip clang-format etc...). Example path:
C:\Users\${YOUR_USERNAME}\AppData\Local\Programs\Python\Python311\Scripts
- Install PySide6
pip install pyside6
- Change the Python interpreter to point to the right one (qt creator, vscode, ...). Example:
C:\Users\${YOUR_USERNAME}\AppData\Local\Programs\Python\Python311\python.exe
- Clone the repository
git clone https://github.com/saifkandil/tiny-language-compiler.git
- Change into the project directory
cd tiny-language-compiler
- Run the project
py tiny-language-compiler
We welcome contributions from the community. If you would like to contribute to this project, please follow these guidelines:
- Fork this repository.
- Create a new branch with a descriptive name for your feature or bug fix.
- Make your changes and ensure that your code follows the project's coding style and conventions.
- Document your changes briefly.
- Commit your changes and provide a clear and concise commit message.
- Push your changes to your forked repository.
- Open a Pull Request against this repository's
master
branch.
If you have questions or need further assistance, please open an issue or join our community discussion in the Discussions section.
Thank you for your contribution!
We would like to extend our gratitude to the Qt and Python communities for their support and for providing such powerful tools for developing GUI applications. We would also like to acknowledge the open-source projects and libraries that were used in the development of this project.
We are a group of four students currently enrolled at Ain Shams University, Faculty of Engineering, who share a passion for solving complex problems and creating innovative solutions. Our team consists of four Computer & Systems Engineering majors, providing a unique blend of skills and perspectives.
At the heart of our team is a shared commitment to hard work, collaboration, and making a difference. Whether we're working on a school project or a startup, we approach every challenge with enthusiasm, creativity, and a drive to succeed.
We are excited to see what the future holds and are committed to making the most of every opportunity that comes our way.
- Usama Ahmed Kawashty Abdelraheem
18Q9484
- Saif Salah Eldeen Yahya Mostafa
1901529
- Hussein Ahmed Hussein Adbelgalil
18Q4984
- Yousef Mohamed Elsharkawy
18Q4486