summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--grammar.ebnf9
1 files changed, 9 insertions, 0 deletions
diff --git a/grammar.ebnf b/grammar.ebnf
new file mode 100644
index 0000000..cc087fe
--- /dev/null
+++ b/grammar.ebnf
@@ -0,0 +1,9 @@
+Program ::= Statement+
+
+Statement ::= (VariableStatement | PrintStatement) SEMICOLON
+
+VariableStatement ::= ("let" IDENTIFIER | IDENTIFIER) EQUALS Expression
+
+PrintStatement :== PRINT LPAREN Expression RPAREN
+
+Expression :== NUMBER | IDENTIFIER | LPAREN Expression RPAREN