From 03fe10d7c09e4d4edcb6ba19f95938c9566aaddc Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sat, 30 Oct 2021 18:28:52 +0200 Subject: [PATCH] add grammar --- grammar.txt | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 grammar.txt diff --git a/grammar.txt b/grammar.txt new file mode 100644 index 0000000..d8013b4 --- /dev/null +++ b/grammar.txt @@ -0,0 +1,76 @@ +# todo: calls (property access and function calls) + + + ::= + + ::= "{" { } "}" + + ::= + | + | + | + | + | + | + | + | + + + ::= "let" "=" ";" + + + ::= "=" ";" + + + ::= "fn" + + ::= "(" { { "," } } ")" + + + ::= "if" { } + + ::= "else" ( | ) + + + ::= "loop" + + + ::= "while" + + + ::= "break" ";" + + + ::= "return" { } ";" + + + ::= ";" + + + ::= + + ::= { "or" } + + ::= { "and" } + + ::= { ("!=" | "==") } + + ::= { (">" | "<" | ">=" | "<=") } + + ::= { ("-" | "+") } + + ::= { ( "*" | "/" | "%" ) } + + ::= ( "not" | "-" ) + + ::= + | + | + | + | "false" + | "true" + | "null" + + = "{}" + + = "[" { { "," } } "]"