mirror of
https://github.com/Ed94/LangStudies.git
synced 2024-11-13 21:54:52 -08:00
Ed94
17c3b8fe36
Its not a full flegged transpiler but it works at least on RDP's lexer. I can expand on demand.
727 B
727 B
Concatenation
Regex : /^AB$/
Psuedo: start AB end
Machine:
->o --A--> o --epsilon--> o --B--> (o)
Submachine_A --epsilon--> Submachine_B
Union
Regex : /^A|B$/
Psuedo: start A | B end
Machine:
epsilon--> o --A--> o --epsilon
/ \
->o ->(o)
\ /
epsilon--> o --B--> o --epsilon
Kleene Closure
Regex : /^A*$/
Psuedo: start A.repeat(0-) end
Machine:
<------episilon-------
/ \
->o --epsilon--> o --A--> o --epsilon--> (o)
\ /
-------------epsilon---------------->