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 matchingset %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 matchingshow
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
| Trysay %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 excessfor 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 excessseconds
...
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
| Matchedsay %s for %n second
with excesss
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)
Comments