-
-
Save ssube/8edcfcc359d00532f4196f6bbc5317e2 to your computer and use it in GitHub Desktop.
bot grammar example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request | |
= body:(next:Command WS ';' WS { return next; })* tail:Command { return body.concat(tail); } | |
Command | |
= verb:Verb WS noun:Noun WS params:Parameters { return {verb, noun, params}; } | |
Verb = $Word | |
Noun = $Word | |
Parameters | |
= '(' WS body:(next:$Word WS ',' WS { return next; })* tail:$Word WS ')' { return body.concat([tail]); } | |
Word | |
= [a-z]+ | |
Integer "integer" | |
= [0-9]+ { return parseInt(text(), 10); } | |
WS "whitespace" | |
= [ \t\n\r]* | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do some (foo, bar); do other (bis, nis) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment