Compiler Design Project

Abstract Syntax Tree Generator

Enter your source code below and watch it transform into a beautiful tree structure. Our parser performs Lexical Analysis, Tokenization, and Recursive Descent Parsing to build the AST.

How It Works

📝
Source Code
Your input code
🔤
Lexer
Tokenization
🔍
Parser
Syntax Analysis
🌳
AST
Tree Structure
📄 code-input.js
1

Quick Examples

Press Ctrl + Enter to generate

🔤

Lexical Analysis

Breaks source code into tokens — identifiers, keywords, operators, and literals.

🌳

Tree Visualization

Interactive tree diagram showing parent-child relationships between AST nodes.

📊

Token Table

View all tokens generated by the lexer along with their types and values.