Initialise
This commit is contained in:
29
ziffers/ebnf.py
Normal file
29
ziffers/ebnf.py
Normal file
@ -0,0 +1,29 @@
|
||||
ebnf = r"""
|
||||
expr = (number ws?)*
|
||||
number = factor additive*
|
||||
additive = ("+"/"-") factor
|
||||
factor = primary multiplicative*
|
||||
multiplicative = ("*" / "/") primary
|
||||
primary = parens / neg / number
|
||||
parens = "(" number ")"
|
||||
neg = "-" primary
|
||||
number = ((~"[0-9]"+ "."? ~"[0-9]"*) / ("." ~"[0-9]"+)) (("e"/"E") ("-"/"+") ~"[0-9]"+)?
|
||||
ws = ~"\s*"
|
||||
lpar = "("
|
||||
rpar = ")"
|
||||
lbra = "["
|
||||
rbra = "]"
|
||||
lcbra = "{"
|
||||
rcbra = "}"
|
||||
lt = "<"
|
||||
gt = ">"
|
||||
comma = ","
|
||||
octup = "^"
|
||||
octdown = "_"
|
||||
barsign = "|"
|
||||
plus = "+"
|
||||
minus = "-"
|
||||
times = "*"
|
||||
div = "/"
|
||||
emptyline = ws+
|
||||
"""
|
||||
Reference in New Issue
Block a user