Expand description
WQL parser — recursive descent parser for the Web Query Language.
Grammar:
query := SELECT fields FROM model [JOIN ...] [WHERE ...] [ACROSS ...] [ORDER BY ...] [LIMIT n]
fields := field (',' field)*
field := name [AS alias] | temporal_func
temporal_func := name '_' duration '_ago' | name '_trend' | 'predicted_' name '_' duration
model := IDENTIFIER
where := WHERE expr
expr := comparison ((AND | OR) comparison)*
comparison := field op value
op := '=' | '<' | '>' | '<=' | '>=' | '!='
across := ACROSS domain (',' domain)*
order := ORDER BY field (ASC | DESC)
limit := LIMIT numberStructs§
- Join
Clause - JOIN clause.
- Model
Ref - Model reference in FROM clause.
- Order
ByField - ORDER BY field with direction.
- Select
Field - A selected field with optional alias and temporal function.
- WqlQuery
- A parsed WQL query.
Enums§
- Comparison
Op - Comparison operator.
- Temporal
Func - Temporal function applied to a field.
- Where
Expr - WHERE expression (AND/OR tree of comparisons).
- WqlValue
- A literal value in a WQL expression.
Functions§
- parse
- Parse a WQL query string into an AST.