The Regex Analyser is an academic assignment given in the course of Languages and Compilers
CMPN403
at Cairo University - Faculty of Engineering - Credit Hours System - Communication and Computer Engineering Program.The assignment covers the different functionalities for a regex analyser which is a basic component in a lexical analyser.
- Regex Validation
The first component in the pipeline is the validation process.
- Regex Parsing
The regex is parsed into a feasible and programmer-friendly format for further processing.
- Creation of NFA states
NFA states are created using Thompson's Algorithm. The NFA states are presented visually using GraphViz python library and in a specific JSON format.
- Creation of DFA states
Based on the specific JSON format, the NFA states are read and transformed into DFA states.
- DFA minimization
The DFA is then reduced to a minimized DFA in which each state has a unique behaviour.
You can run the Regex-Analyser flow in the attached notebook.
Examples of test cases.