mirror of
https://github.com/Ed94/LangStudies.git
synced 2024-11-10 12:24:53 -08:00
Ed94
17c3b8fe36
Its not a full flegged transpiler but it works at least on RDP's lexer. I can expand on demand.
40 lines
727 B
Markdown
40 lines
727 B
Markdown
## 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---------------->
|
|
```
|