Polyp = { Statement ";" } . Statement = Declaration | Call . Declaration = VariableDeclaration | FunctionDeclaration . VariableDeclaration = [ "var" ] VariableList ":=" ExpressionList . FunctionDeclaration = [ "def" ] Function ":=" Expression . VariableList = variable { "," variable } . ExpressionList = Expression { "," Expression } . // ForLoop = "for" Condition Block . // Block = "{" Polyp "}" . Function = identifier Parameters . Parameters = "(" [ ParameterList ] ")" . ParameterList = variable { "," variable } . Call = identifier "(" [ ExpressionList ] ")" . BuiltinCall = identifier "(" [ ExpressionList ] ")" . Expression = Expr { log_op Expr } . Expr = UnaryExpr | Expr binary_op UnaryExpr . UnaryExpr = [ "(" ] PrimaryExpr [ ")" ] | unary_op [ "(" ] PrimaryExpr [ ")" ] . PrimaryExpr = BuiltinCall | Call | Expr | Operand . Operand = Literal | identifier . Literal = int_lit | float_lit . binary_op = rel_op | math_op . log_op = "|" | "&" . rel_op = "=" | "!=" | "<" | ">" | "<=" | ">=" | "<>" . math_op = "+" | "-" | "*" | "/" | "%" | "^" | "**" . unary_op = "+" | "-" | "!" | "¬" | "~" . // Boolean = true | false . // true = "True" . // false = "False" . // none = "None" . variable = identifier . identifier = letter { letter | unicode_digit } . unicode_letter = "a" ... "z" | "A" ... "Z" . unicode_digit = decimal_digit . letter = unicode_letter | "_" . decimal_digit = "0" ... "9" . octal_digit = "0" ... "7" . hex_digit = "0" ... "9" | "A" ... "F" | "a" ... "f" . int_lit = decimal_lit | octal_lit | hex_lit . decimal_lit = ( "1" ... "9" ) { decimal_digit } | "0" . octal_lit = "0" octal_digit { octal_digit } . hex_lit = "0" ( "x" | "X" ) hex_digit { hex_digit } . float_lit = decimals "." [ decimals ] [ exponent ] | decimals exponent | "." decimals [ exponent ] | [ "+" | "-" ] "nan" | [ "+" | "-" ] "inf" . decimals = decimal_digit { decimal_digit } . exponent = ( "e" | "E" ) [ "+" | "-" ] decimals . // char_lit = "'" ( unicode_value | byte_value ) "'" . // unicode_value = unicode_char | little_u_value | big_u_value | escaped_char . // byte_value = octal_byte_value | hex_byte_value . // octal_byte_value = `\` octal_digit octal_digit octal_digit . // hex_byte_value = `\` "x" hex_digit hex_digit . // little_u_value = `\` "u" hex_digit hex_digit hex_digit hex_digit . // big_u_value = `\` "U" hex_digit hex_digit hex_digit hex_digit // hex_digit hex_digit hex_digit hex_digit . // escaped_char = `\` ( "a" | "b" | "f" | "n" | "r" | "t" | "v" | `\` | "'" | `"` ) . // StringLit = string_lit { string_lit } . // string_lit = raw_string_lit | interpreted_string_lit . // raw_string_lit = "`" { unicode_char } "`" . // interpreted_string_lit = `"` { unicode_value | byte_value } `"` .