🔗 Link: https://re-collide.github.io/ParserGen/
ParseGen is a compiler design project that automates the process of generating parsing structures from a given CFG.
It performs:
- FIRST set computation\
- FOLLOW set computation\
- LL(1) parsing table generation\
- Grammar augmentation for LR(0)\
- Canonical LR(0) item set generation\
- LR(0) ACTION & GOTO table construction
The core parsing logic is implemented in C, compiled into WebAssembly, and integrated into a web interface using HTML, CSS, and JavaScript.
/// a pic here
- CFG input support\
- FIRST set generation\
- FOLLOW set generation\
- LL(1) parse table creation\
- Grammar augmentation for LR(0)\
- Canonical LR(0) item set generation\
- LR(0) parsing table (ACTION / GOTO)\
- Clean web-based interface
- Parsing algorithms are implemented in C\
- The C code is compiled into WebAssembly (.wasm) using Emscripten\
- The .wasm module is integrated with JavaScript\
- The frontend (HTML/CSS) provides an interactive UI\
- The browser executes parsing logic via WebAssembly
flowchart TD
A[Start] --> B[Read grammar]
B --> C[Select non-terminal]
C --> D[Check productions]
D --> E[Starts with terminal? Add to FIRST]
E --> F[Starts with non-terminal? Recurse]
F --> G[Contains epsilon? Add epsilon]
G --> H[Repeat until stable]
H --> I[Output FIRST sets]
I --> J[End]
flowchart TD
A[Start] --> B[Read grammar]
B --> C[Add $ to start symbol]
C --> D[Scan productions]
D --> E[Find non-terminal in RHS]
E --> F[Add FIRST of next symbol]
F --> G[If epsilon, add FOLLOW of LHS]
G --> H[Repeat until stable]
H --> I[Output FOLLOW sets]
I --> J[End]
flowchart TD
A[Start] --> B[Read grammar]
B --> C[Create S']
C --> D[Add S' → S]
D --> E[Use augmented grammar]
E --> F[End]
flowchart TD
A[Start] --> B[Create initial item]
B --> C[Apply closure]
C --> D[Add to collection]
D --> E[Apply GOTO transitions]
E --> F[New state? Add]
F --> G[Repeat]
G --> H[Output item sets]
H --> I[End]
flowchart TD
A[Start] --> B[Canonical collection]
B --> C[Check items]
C --> D[Shift actions]
D --> E[Reduce actions]
E --> F[Accept state]
F --> G[Fill GOTO]
G --> H[Check conflicts]
H --> I[Output table]
I --> J[End]
- C -- Core parsing algorithms\
- Emscripten -- C → WebAssembly compilation\
- WebAssembly (WASM) -- High-performance execution\
- JavaScript -- WASM integration\
- HTML & CSS -- Frontend UI
- Enter a CFG in the input field\
- Click the desired operation\
- View generated outputs
This project operates under a split-licensing model to support open-source collaboration while preserving the integrity of our instructional materials. The software source code is strictly governed by the MIT License, permitting broad use and modification. Conversely, all project documentation is licensed under Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0), which allows for sharing but prohibits the distribution of modified versions. For the complete legal text and specific terms of these licenses, please refer to the LICENSE and LICENSE-docs files located in the root of our official source repository.
We welcome Pull Requests for code bug fixes and features, but please do not submit changes to the documentation text.
We sincerely thank our supervisor for guidance and support.
We also thank all team members for their dedication in completing ParseGen.

