mirror of
https://github.com/Ed94/LangStudies.git
synced 2025-01-22 04:23:45 -08:00
Fixed some formatting in notes.
This commit is contained in:
parent
17c3b8fe36
commit
77e9e0431e
@ -1,9 +1,8 @@
|
|||||||
# Basic NFA Fragments
|
# Basic NFA Fragments
|
||||||
|
|
||||||
### Single Character
|
### Single Character
|
||||||
RegExp: `/^A$/`
|
RegExp: `/^A$/`
|
||||||
Psuedo:
|
Psuedo: `start A end`
|
||||||
`str.start glyph(A) str.end`
|
|
||||||
|
|
||||||
^ : Beginning of string : Str.Start
|
^ : Beginning of string : Str.Start
|
||||||
$ : End of a string : Str.End
|
$ : End of a string : Str.End
|
||||||
@ -13,7 +12,7 @@ Machine:
|
|||||||
|
|
||||||
### Epsilon-Transition
|
### Epsilon-Transition
|
||||||
RegExp: `/^$/`
|
RegExp: `/^$/`
|
||||||
Psuedo: `str.start str.end`
|
Psuedo: `start end`
|
||||||
|
|
||||||
Machine:
|
Machine:
|
||||||
```
|
```
|
||||||
|
@ -9,7 +9,7 @@ SRegEx: `x y.repeat(0-) | z`
|
|||||||
|
|
||||||
### Stage 1: Union
|
### Stage 1: Union
|
||||||
```
|
```
|
||||||
->o.start (o)
|
->o.start (o)
|
||||||
\epsilon-> o --xy*-> o -epsilon-->/
|
\epsilon-> o --xy*-> o -epsilon-->/
|
||||||
\epsilon-> o --z---> o -epsilon->/
|
\epsilon-> o --z---> o -epsilon->/
|
||||||
```
|
```
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
Ex:
|
Ex:
|
||||||
|
|
||||||
RegEx : `/a+|[0-3]/`
|
RegEx : `/a+|[0-3]/`
|
||||||
SRegEx: `a.repeat(1-) | set(0-3)`
|
SRegEx: `a.repeat(1-) | set(0-3)`
|
||||||
|
|
||||||
`A+` === `AA*` === `A.repeat(1-)` === `AA.repeat(0-)`
|
`A+` === `AA*` === `A.repeat(1-)` === `AA.repeat(0-)`
|
||||||
`A?` === `A|ε` === `A.repeat(0-1)`
|
`A?` === `A|ε` === `A.repeat(0-1)`
|
||||||
|
|
||||||
`[0-9]` === `0|1|2|3|4|5|6|7|8|9` === `set(0-9)`
|
`[0-9]` === `0|1|2|3|4|5|6|7|8|9` === `set(0-9)`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user