⚠️ Deprecated: Will not continue to adapt Unicode parsing.
A small program I written while learning F#.
- Generate AST from regular expression (LALR parser / SDT);
- Generate DFA from AST (Thompson's construction);
- Convert NFA to DFA (Subset construction);
- Minimize DFA (Hopcroft Algorithm);
- Support UTF-8;
Install .NET Core and run the following commands:
cd <path-to-proj-dir>
dotnet run
>>> parse (a|b)*|(c|d)*
ast "(a|b)*|(c|d)*"
`- alter |
|- alter |
| |- char 'a'
| `- char 'b'
`- alter |
|- char 'c'
`- char 'd'
>>> match (a|b)* ababbb
match
>>> match (a|b)* abbbc
mismatch
>>> match (a|b)*(c*|d) aabababbccc
match
>>> match (a|b)*(c*|d) aabababbd
match
>>> match (a|b)*(c*|d) aabababbcd
mismatch
Microsoft Reciprocal License (MS-RL), see LICENSE.txt for details.