A web-based interactive tool to visualize how a compiler works step-by-step, including:
- 🔍 Lexical Analysis (Tokenization)
- 🧠 Semantic Analysis (Symbol Table)
- ⚙️ Execution Engine (Runtime Simulation)
- 📊 Execution Trace (Step-by-step timeline)
- Built a complete compiler pipeline: Lexer → Parser → Semantic → Executor
- Supports Java-like syntax preprocessing
- Real-time token visualization
- Symbol table generation and memory tracking
- Execution trace timeline
- Monaco Editor integration
- Syntax, semantic, and type validation
- IDE-style resizable workspace
- Not a full Java compiler
- No object-oriented programming support
- No Scanner input support
- No array support
- No inheritance/polymorphism
- Designed primarily for compiler visualization and learning
- Function and method support
- Array handling
- String operations
- AST (Abstract Syntax Tree) visualization
- Optimization phase visualization
- Intermediate code generation
- Machine code generation simulation
- Monaco Editor: A full VS Code-like editing experience.
- Resizable Output Panel: A draggable divider to manage your workspace (similar to the VS Code terminal).
- Tabbed Visualization:
- Tokens: View every lexeme categorized by type and line number.
- Symbol Table: Track variables, their types, and their final memory states.
- Execution Trace: A chronological replay of every program action.
- Real-time Execution: Immediate feedback on code changes.
- Clean Output: Console results contain ONLY user-defined
printresults.
- This is not a full Java compiler.
- It supports beginner-level Java-like wrapper syntax.
- Boilerplate wrappers like
public class Mainandpublic static void main(String[] args)are preprocessed and automatically stripped. System.out.println(x)andSystem.out.print(x)are both preprocessed and treated as standardprintstatements.- Supported Syntax:
int,float, assignment, arithmetic,if,while,for,++,--, andprint/System.out.println. - Full advanced Java features such as classes, objects, arrays, methods, imports,
Scanner, and string concatenation are not fully supported.
int a = 10;
a = a + 1;
print a;11
Lexer → Parser → Semantic → Executor → WebServer → UI
-
Compile the source:
javac -d build src/*.java
-
Start the WebServer:
java -cp build WebServer -
Access the IDE: Open
index.htmlin your browser or navigate tohttp://localhost:8080(if serving locally).
Visual Compiler Studio - Visualizing the magic behind the code.