Compiler Pipeline Visualizer Documentation
Complete Phase 1 Architecture, REST API Reference, Database Schema, and Team Deliverables.
Phase 1 Team Work Split & Ownership
Ebin (Backend Lead)
Core Engine & DB- Next.js 14+ TypeScript project architecture
- Neon PostgreSQL schema with connection pooling & Prisma ORM
- Lexical Analyzer (tokenization, regex, coordinates, error recovery)
- Symbol Table class with hierarchical scoping
- API route `/api/compile/lex`
Kevin (Backend)
Syntax & Semantics- Recursive descent parser for C-like language with operator precedence
- Abstract Syntax Tree (AST) structure generation
- Semantic Analyzer (type checking, redeclaration, undefined symbols)
- Comprehensive Error Management System with code snippets
- API routes `/api/compile/syntax`, `/api/compile/semantic`, `/api/compile/:id/errors`
Aadi (Frontend)
Layout & Editor- Next.js App Router layout with Tailwind CSS styling
- Monaco Editor integration with C-like syntax highlighting
- Editor shortcuts (`Ctrl+Enter` compile) and localStorage persistence
- Control panel with compile buttons, font size, and preset templates
- Responsive 2-column layout wrapper
Joel (Frontend)
Visualizer & State- Pipeline Visualizer flow framework with 6 phase cards
- TokenList component with syntax badge highlighting, search, and type filters
- SyntaxTreeViewer with interactive collapsible AST tree nodes
- SymbolTableViewer with scope filtering and column sorting
- Context-aware InfoPanel and Zustand global state management
REST API Reference
Tokenizes source code string into an array of lexical tokens with coordinates.
Parses tokens or source code into a hierarchical Abstract Syntax Tree (AST).
Runs type checking, scope resolution, and populates the scoped symbol table.
Executes the complete compilation pipeline end-to-end and persists results into the database.
Retrieves all compilation errors, warnings, and code snippets for a session.
Database Schema (PostgreSQL / Neon)
id (UUID PK), user_id, source_code, created_at
id (UUID PK), session_id (FK), type, value, line, column
id (UUID PK), session_id (FK), tree_json
id (UUID PK), session_id (FK), name, type, scope, metadata
id (UUID PK), session_id (FK), phase, error_msg, severity, line, column
id (UUID PK), session_id (FK), ir_code, line_number