mirror of
https://github.com/Ed94/LangStudies.git
synced 2025-06-15 03:21:46 -07:00
Worked on SRegex transpiler to RegEx,
This commit is contained in:
@ -9,7 +9,7 @@ Langauge : A set of strings over a particular alphabet.
|
||||
L1(Sigma) = { a, aa, b, ab, ba, bba, .. } (Infinite)
|
||||
L2(Sigma) = { aa, bb, ab, ba }; (Length = 2, Finite)
|
||||
|
||||
Any time you constraint a langauge you are
|
||||
Any time you constrain a langauge you are
|
||||
defining a formal grammar.
|
||||
|
||||
## Formal Grammars:
|
||||
|
@ -1,7 +1,7 @@
|
||||
## Concatenation
|
||||
|
||||
Regex : `/^AB%/`
|
||||
Psuedo: `str.start str(AB) str.end`
|
||||
Regex : `/^AB$/`
|
||||
Psuedo: `start str(AB) end`
|
||||
|
||||
Machine:
|
||||
```
|
||||
@ -13,7 +13,7 @@ Submachine_A --epsilon--> Submachine_B
|
||||
## Union
|
||||
|
||||
Regex : `/^A|B$/`
|
||||
Psuedo: `str.start glyph(A) | glyph(B) str.end`
|
||||
Psuedo: `start glyph(A) | glyph(B) end`
|
||||
|
||||
Machine:
|
||||
```
|
||||
@ -27,11 +27,11 @@ Machine:
|
||||
## Kleene Closure
|
||||
|
||||
Regex : `/^A*$/`
|
||||
Psuedo: `str.start glyph(A).repeating str.end`
|
||||
Psuedo: `start glyph(A).repeating end`
|
||||
|
||||
Machine:
|
||||
```
|
||||
<------episolon-------
|
||||
<------episilon-------
|
||||
/ \
|
||||
->o --epsilon--> o --A--> o --epsilon--> (o)
|
||||
\ /
|
||||
|
Reference in New Issue
Block a user