diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-06 12:00:30 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-06 12:00:30 +0100 |
commit | 2ccedaa09f7da6d4975164e6048ff6caa631c3e6 (patch) | |
tree | ddb8e9f15be918e1823495ef6a4f7dda1e12d7ba | |
parent | examples: add another example (diff) | |
download | interpreter-2ccedaa09f7da6d4975164e6048ff6caa631c3e6.tar.gz interpreter-2ccedaa09f7da6d4975164e6048ff6caa631c3e6.tar.bz2 interpreter-2ccedaa09f7da6d4975164e6048ff6caa631c3e6.zip |
Add language grammar
-rw-r--r-- | grammar.ebnf | 9 |
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 |