skopy/doc/grammar.bnf

23 lines
406 B
BNF
Raw Normal View History

2024-03-31 21:10:56 +00:00
ROOT ::= EXPR*
EXPR ::=
2024-04-01 12:00:06 +00:00
| OR
| ASSERT
ASSERT ::= assert EXPR eq EXPR
2024-04-01 12:00:06 +00:00
OR ::= AND (or AND)*
2024-04-01 21:33:43 +00:00
AND ::= EQ (and EQ)*
EQ ::= CMP ((equal|not_equal) CMP)?
CMP ::= TERM ((lt|gt|le|ge) TERM)?
2024-03-31 23:32:47 +00:00
TERM ::= FACTOR ((add|sub) FACTOR)*
FACTOR ::= USUB ((mul|div|mod) USUB)*
2024-04-01 12:00:06 +00:00
USUB ::= sub* NOT
NOT ::= not* POW
2024-03-31 23:32:47 +00:00
POW ::= LITERAL (pow LITERAL)?
LITERAL ::=
| BUILTIN
| opar EXPR cpar
2024-03-31 21:10:56 +00:00
BUILTIN ::=
| int
2024-04-01 12:00:06 +00:00
| bool
2024-04-01 19:08:42 +00:00
| float
2024-04-01 19:42:36 +00:00
| string