Skip to content

Instantly share code, notes, and snippets.

@lmuntaner
Last active January 13, 2022 14:37
Show Gist options
  • Save lmuntaner/091eb7f144401ee30cf6094f365e9d71 to your computer and use it in GitHub Desktop.
Save lmuntaner/091eb7f144401ee30cf6094f365e9d71 to your computer and use it in GitHub Desktop.
Turtle Talk EBNF
identifier := (A-Z,"_")
var_name := ":"<identifier>
command := "FD" | "BD" | "LT" | "RT" | "PEN"
positive_integer := \d+
expression := <positive_integer> | "UP" | "DOWN" | <var_name> | <positive_integer> ("+" | "-") <expression>
command_statement := (<command_key> | <identifier>) <expression>
loop_statement := "REPEAT" <positive_integer> { <command> } "END"
statement := <loop_statement> | <command_statement>
fun_definition := "TO" <identifier> [ <var_name> ] { "," <var_name> } { <statement> } "END"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment