diff options
| author | Baitinq <[email protected]> | 2025-01-06 12:00:30 +0100 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-01-06 12:00:30 +0100 |
| commit | 5c2ccb41a0df4ba95cb36bfb0c2ddda5237f99ab (patch) | |
| tree | ddb8e9f15be918e1823495ef6a4f7dda1e12d7ba | |
| parent | examples: add another example (diff) | |
| download | pry-lang-5c2ccb41a0df4ba95cb36bfb0c2ddda5237f99ab.tar.gz pry-lang-5c2ccb41a0df4ba95cb36bfb0c2ddda5237f99ab.tar.bz2 pry-lang-5c2ccb41a0df4ba95cb36bfb0c2ddda5237f99ab.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 |