How jayagarsi/regex-parser works
regex-parser is a C++ regular-expression parser and NFA-based matcher, exposed through both an interactive executable and WebAssembly bindings. The main workflow accepts a pattern, parses it into an AST, builds an NFA, and tests input strings against that automaton. The README also describes AST/NFA printing and a WebAssembly version; the sampled bindings additionally expose diagram generation. Web UI implementation and deployment wiring are not present in the sampled source, so those connections are not inferred.
Main entry points: wasm_bindings.cpp WASM bindings · RegExParser.cpp Regex facade · AutomataManager.cpp NFA builder · Parser.cpp Recursive parser
Components 10
User Interfaces
- Interactive CLI
src/main.cpp - Regex facade
src/RegExParser.cpp
Parsing
- Recursive parser
src/Parser.cpp - Regex AST
src/Parser.hh
Automata Engine
- NFA builder
src/AutomataManager.cpp - NFA states
src/AutomataManager.hh - NFA simulator
src/AutomataManager.cpp
WebAssembly API
- WASM bindings
src/wasm_bindings.cpp
Other components
- CLI user
- JavaScript caller
Connections 15
- CLI user → Interactive CLI: enters pattern
- Interactive CLI → Regex facade: calls
- Regex facade → Recursive parser: parses pattern
- Recursive parser → Regex AST: builds
- Regex facade → NFA builder: builds NFA
- NFA builder → Regex AST: traverses
- NFA builder → NFA states: creates states
- Regex facade → NFA simulator: checks input
- NFA simulator → NFA states: simulates
- JavaScript caller → WASM bindings: calls exports
- WASM bindings → Recursive parser: parses pattern
- WASM bindings → NFA builder: builds NFA
- WASM bindings → NFA simulator: checks input
- WASM bindings → Regex AST: renders AST diagram
- WASM bindings → NFA states: renders NFA diagram