-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueryLanguage.grammar
More file actions
43 lines (24 loc) · 844 Bytes
/
QueryLanguage.grammar
File metadata and controls
43 lines (24 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@top Query { Expression }
@precedence { binaryAnd @left, binaryOr @left }
Expression { AndExpression | OrExpression | ParenthesesExpression | NotExpression | Predicate }
ParenthesesExpression { OpenParenthesis Expression ClosingParenthesis }
NotExpression { NotOperator Expression }
AndExpression { Expression !binaryAnd LogicalAndOp Expression }
OrExpression { Expression !binaryOr LogicalOrOp Expression }
Predicate { Property Operator Value }
Operator { EqualOp | NotEqualOp }
@tokens {
Property { @asciiLetter+ }
Value { "@"? @asciiLetter+ ("." | "-" | "_" | @digit | @asciiLetter)+ }
LogicalAndOp { "and" }
LogicalOrOp { "or" }
EqualOp { "=" }
NotEqualOp { "!=" }
NotOperator { "!" }
OpenParenthesis { "(" }
ClosingParenthesis { ")" }
space { @whitespace+ }
}
@skip {
space
}