Slide 36
Slide 36 text
Implementation
30
2. Use b
a
cktr
a
cking VM for regex m
a
tching. / Hiroy
a
Fujin
a
mi, "M
a
ke Your Own Regex Engine", 2024-05-17
Public API
p
a
rse
Choice[[
Repetition[
Literal['a'],
:star,
],
Concat[[
Literal['b'],
Abstr
a
ct synt
a
x tree
(AST)
compile
0 [:push, 5]
1 [:push, 4]
2 [:char, 'a']
3 [:jump, 1]
4 [:jump, 7]
5 [:char, 'b']
6 [:char, 'c']
7 [:match]
B
a
ckt
a
rcking VM
progr
a
m
exec
M
a
tching result
Input string
"aaabc"