← go back

I've been struggling to find out a name of this parser I made on my Touchè source code

Is it a new thing? (doubt it) Is it a derivation of something else?

[say "Hello!" for 2 seconds | Try matching set %s to %n of non-terminal main

[say "Hello!" for 2 seconds | [set %s to %n

s[ay "Hello!" for 2 seconds | s[et %s to %n

sa[y "Hello!" for 2 seconds | se[t %s to %n, doesn't match

[say "Hello!" for 2 seconds | Try matching show of non-terminal main

s[ay "Hello!" for 2 seconds | s[how

sa[y "Hello!" for 2 seconds | sh[ow, doesn't match

...

[say "Hello!" for 2 seconds | Try say %s for %n second of non-terminal main

[say "Hello!" for 2 seconds | [say %s for %n second

s[ay "Hello!" for 2 seconds | s[ay %s for %n second

sa[y "Hello!" for 2 seconds | sa[y %s for %n second

say[ "Hello!" for 2 seconds | say[ %s for %n second

say ["Hello!" for 2 seconds | say [%s for %n second, non-terminal sigil found

say ["Hello!" for 2 seconds | Try matching regex ".*" of non-terminal s (string)

say "Hello!"[ for 2 seconds | Matched ".*" with excess for 2 seconds

say "Hello!"[ for 2 seconds | say %s[ for %n second

say "Hello!" [for 2 seconds | say %s [for %n second

...

say "Hello!" for [2 seconds | say %s for [%n second, non-terminal sigil found

say "Hello!" for [2 seconds | Try matching regex \d+ of non-terminal n (number)

say "Hello!" for 2[ seconds | Matched \d+ with excess seconds

...

say "Hello!" for 2 secon[ds | say %s for %n secon[d

say "Hello!" for 2 second[s | say %s for %n second[, end of rule

say "Hello!" for 2 second[s | Matched say %s for %n second with excess s

Using pseudocode would be nice but I can't transpile the code for being unreadable...

(yes I'm aware of the oversight [wait isn't that an oxymoron] but please ignore that)

Aug 20, 2023, 1:39 AM
2 0 0

Comments