Commit 8f49e33c authored by Christopher Silva's avatar Christopher Silva

work on better formula grammar

parent 599088bf
formula = _{ SOI ~ "=" ~ expr ~ EOI }
expr = _{ term ~ (infix_op ~ term)* }
term = {
"(" ~ expr ~ ")" |
number |
function
}
infix_op = { "+"|"-"|"*"|"/" }
function = { identifier ~ "(" ~ range ~ ("," ~ criteria)? ~")" }
range = { index ~ ":" ~ index }
index = { "r" ~ uint ~ "c" ~ uint }
criteria = { "\"" ~ comparison? ~ value ~ "\"" }
comparison = { ">"|"<"|"="|">="|"<="|"!=" }
value = { number | identifier }
uint = { ASCII_DIGIT+ }
number = { "-"? ~ ASCII_DIGIT+ ~ ("." ~ ASCII_DIGIT+)?}
identifier = { ASCII_ALPHA+ }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment