Skip to content

AAbdullahRajput/LexiParse-Tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

🔍 LexiParse Tool

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.


🖥️ Screenshots

Tokenizer Output


✨ Features

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

🔠 Supported Token Types

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

🛠️ Tech Stack

Technology Details
Language Python 3
GUI Tkinter + ttk
Tree Rendering anytree
Clipboard pyperclip

📦 Installation & Setup

1. Clone the repository

git clone https://github.com/AAbdullahRajput/LexiParse-Tools.git
cd LexiParse-Tools

2. Install dependencies

py -m pip install anytree pyperclip

3. Run the tool

py "LexiParse Tool.py"

🚀 How to Use

  1. Type or paste your C/C++ code in the left panel
  2. Click Tokenize to analyze and display tokens in the right panel
  3. Click Show Symbol Table to view all identifiers
  4. Click Check Syntax to detect basic syntax errors
  5. Click Generate Parse Tree to view a mock tree structure
  6. Click Load File to open a .c, .cpp, or .txt file
  7. Click Copy Tokens to copy the token list to the clipboard

📁 Project Structure

LexiParse-Tools/
│
├── LexiParse Tool.py          # Main application file
├── LexiParse Tools Images/    # Screenshots
│   ├── Screenshot 1.png
│   └── Screenshot 2.png
└── README.md                  # Project documentation

👨‍💻 Author

Abdullah Rajput
GitHub: @AAbdullahRajput
Made with ❤️ — Compiler Construction Project
© 2026 — All rights reserved

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages