realm-js/parser/query.abnf
2015-11-19 13:05:37 -08:00

24 lines
626 B
ABNF

pred = expr 1*WSP oper 1*WSP expr
;pred =/ "(" *WSP pred *WSP ")"
;pred =/ ("NOT" / "!") 1*WSP pred
;pred =/ pred 1*WSP ("OR" / "||") !*WSP pred
;pred =/ pred 1*WSP ("AND" / "&&") 1*WSP pred
oper = "=" / "==" / "!=" / "<" / "<=" / ">" / ">="
expr = string / num / key-path
key-path = key *("." key)
key = 1*(ALPHA / "_")
string = dq-string / sq-string
sq-string = "'" *(%x20-ffffffff) "'"
dq-string = DQUOTE *("\\" / %x20-21 / %x23-ffffffff) DQUOTE
num = ["-"] (float-num / int-num / hex-num)
float-num = (*DIGIT "." 1*DIGIT / "." 1*DIGIT)
int-num = 1*DIGIT
hex-num = ("0x" / "0X") 1*HEXDIG