This is a tiny language compiler that includes a scanner and a parser, equipped with a graphical user interface (GUI). The compiler processes source code written in a simple language, providing functionality to tokenize input code and generate parse trees.
-
Scanner: The scanner reads the source code and tokenizes it, identifying individual tokens and their types.
-
Parser: The parser takes the tokens generated by the scanner and constructs a parse tree, representing the syntactic structure of the input code.
-
GUI Interface: The graphical user interface allows users to interact with the compiler visually. Users can input source code, view generated tokens, and visualize the parse tree.
-
Installation:
- Clone the repository:
git clone https://github.com/yourusername/tiny-language-compiler.git
- Navigate to the project directory:
cd tiny-language-compiler
- Clone the repository:
-
Dependencies:
- Ensure you have the required dependencies installed. This may include GUI libraries such as Tkinter, GraphViz or any other specified in the project documentation.
-
Run the Compiler:
- Execute the main application file:
python main.py
- The GUI interface will be displayed, allowing you to input source code.
- Execute the main application file:
-
Tokenization:
- Click on the "Scan" or "Tokenize" button to initiate the scanning process.
- View the generated tokens and their types in the designated area of the GUI.
-
Parsing:
- Click on the "Parse" button to initiate the parsing process.
- Visualize the parse tree in the GUI.
The GUI can display the tokens and parse tree, helping users understand the structure of the code.