Skip to content

Commit

Permalink
Add syntax file
Browse files Browse the repository at this point in the history
  • Loading branch information
FourteenBrush committed Mar 2, 2024
1 parent b44d575 commit 82af28e
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion syntax.ebnf
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
digit: "0" | "1"
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
letter = "a" | "b" | "c" | "d" | "e" | "f" | "g"
| "h" | "i" | "j" | "k" | "l" | "m" | "n"
| "o" | "p" | "q" | "r" | "s" | "t" | "u"
| "v" | "w" | "x" | "y" | "z" ;
number = [ "-" ] , { digit }+ , [ "." { digit }+ ] ;
identifier = { letter }+ ;
operator = "*" | "/" | "%" | "+" | "-" | "<<" | ">>"
| "<" | ">" | "<=" | ">=" | "==" | "!=" | "&"
| "^" | "|" | "&&" | "||"

constant = "pi" | "e" | "tau" | "true" | "false"

function = identifier, "(" param list ")"

param list = ( ) | ( operand { ",", operand } )

operand = number | constant | function

expression = { operand, operator }, operand

0 comments on commit 82af28e

Please sign in to comment.