A Python-based Lexical Analyzer GUI tool built with Tkinter that tokenizes C/C++ code, displays a symbol table, checks syntax errors, generates a mock parse tree, and supports file loading and token copying — ideal for Compiler Construction coursework.

| Feature |
Description |
| 🔤 Tokenizer |
Tokenizes C/C++ code into Keywords, Identifiers, Numbers, Operators and more |
| 📋 Symbol Table |
Displays all identifiers with name, type and line number |
| ✅ Syntax Checker |
Detects missing semicolons, unclosed braces and suspicious if/else blocks |
| 🌳 Parse Tree |
Generates a mock parse tree from tokenized output |
| 📁 File Loader |
Load .c, .cpp, or .txt files directly into the editor |
| 📋 Copy Tokens |
Copy full token list to clipboard with one click |
| 🎨 Modern GUI |
Clean and colorful Tkinter-based interface |
| Token Type |
Example |
Keyword |
int, if, else, return, while |
Identifier |
myVar, counter, total |
Number |
42, 100, 0 |
Operator |
+, -, *, /, = |
Special Character |
{, }, (, ), ; |
String |
"Hello World" |
Function |
printf, scanf |
| Technology |
Details |
| Language |
Python 3 |
| GUI |
Tkinter + ttk |
| Tree Rendering |
anytree |
| Clipboard |
pyperclip |
git clone https://github.com/AAbdullahRajput/LexiParse-Tools.git
cd LexiParse-Tools
py -m pip install anytree pyperclip
- Type or paste your C/C++ code in the left panel
- Click Tokenize to analyze and display tokens in the right panel
- Click Show Symbol Table to view all identifiers
- Click Check Syntax to detect basic syntax errors
- Click Generate Parse Tree to view a mock tree structure
- Click Load File to open a
.c, .cpp, or .txt file
- Click Copy Tokens to copy the token list to the clipboard
LexiParse-Tools/
│
├── LexiParse Tool.py # Main application file
├── LexiParse Tools Images/ # Screenshots
│ ├── Screenshot 1.png
│ └── Screenshot 2.png
└── README.md # Project documentation
Abdullah Rajput
GitHub: @AAbdullahRajput
Made with ❤️ — Compiler Construction Project
© 2026 — All rights reserved