From c6a5d6946c28ae24cd29abf47e112135810c5423 Mon Sep 17 00:00:00 2001 From: Yann-Gael Gautheron Date: Tue, 17 Mar 2026 15:21:17 +0100 Subject: [PATCH 1/7] feat: enhance WebdaQL with DELETE and UPDATE support, add allowed fields validation --- packages/models/src/repositories/abstract.ts | 12 + packages/models/src/repositories/memory.ts | 26 +- packages/ql/README.md | 239 +++++++++++++- packages/ql/package.json | 1 + packages/ql/src/query.spec.ts | 254 +++++++++++++++ packages/ql/src/query.ts | 325 ++++++++++++++++++- packages/test/package.json | 7 +- 7 files changed, 847 insertions(+), 17 deletions(-) diff --git a/packages/models/src/repositories/abstract.ts b/packages/models/src/repositories/abstract.ts index 9a4206f6d..f815c408e 100644 --- a/packages/models/src/repositories/abstract.ts +++ b/packages/models/src/repositories/abstract.ts @@ -28,6 +28,18 @@ export abstract class AbstractRepository implements Reposi protected pks: string[], protected separator: string = "_" ) {} + + /** + * Get the list of allowed field names for this model from its JSON Schema metadata. + * Returns undefined if no schema is available (validation will be skipped). + */ + getAllowedFields(): string[] | undefined { + const schema = (this.model as any).Metadata?.Schema; + if (!schema?.properties) { + return undefined; + } + return Object.keys(schema.properties); + } /** * @inheritdoc */ diff --git a/packages/models/src/repositories/memory.ts b/packages/models/src/repositories/memory.ts index aebe59197..94f688570 100644 --- a/packages/models/src/repositories/memory.ts +++ b/packages/models/src/repositories/memory.ts @@ -15,6 +15,9 @@ export type Query = { limit: number; orderBy?: { field: string; direction: "ASC" | "DESC" }[]; continuationToken?: string; + type?: "DELETE" | "UPDATE" | "SELECT"; + fields?: string[]; + assignments?: { field: string; value: any }[]; filter: { eval: (item: any) => boolean; }; @@ -22,7 +25,7 @@ export type Query = { /** Lazily-loaded WebdaQL module for query parsing */ let WebdaQL: any & { - parse: (query: string) => Query; + parse: (query: string, allowedFields?: string[]) => Query; } = null; /** Result of a simulated find operation, including whether filtering was applied. */ @@ -155,8 +158,12 @@ export class MemoryRepository< */ async query(query: string | Query): Promise<{ results: InstanceType[]; continuationToken?: string }> { if (typeof query === "string") { - WebdaQL ??= await import("@webda/ql"); - query = WebdaQL.parse(query); + try { + WebdaQL ??= await import("@webda/ql"); + query = WebdaQL.parse(query, this.getAllowedFields()); + } catch (error) { + throw new Error(`Failed to parse query: ${error} - @webda/ql peer dependencies may be missing`); + } } return MemoryRepository.simulateFind(query as Query, [...this.storage.keys()], this); } @@ -240,11 +247,14 @@ export class MemoryRepository< */ async *iterate(query: string): AsyncGenerator, any, any> { let q: Query; - WebdaQL ??= await import("@webda/ql"); - /* c8 ignore next */ - q = WebdaQL.parse(query); // Ensure it is valid - if (!q.limit) { - q.limit = 100; // Default pagination size + try { + WebdaQL ??= await import("@webda/ql"); + q = WebdaQL.parse(query, this.getAllowedFields()); // Ensure it is valid + if (!q.limit) { + q.limit = 100; // Default pagination size + } + } catch (error) { + throw new Error(`Failed to parse query: ${error} - @webda/ql peer dependencies may be missing`); } do { const res = await this.query(q); diff --git a/packages/ql/README.md b/packages/ql/README.md index 87f12d021..d03713a40 100644 --- a/packages/ql/README.md +++ b/packages/ql/README.md @@ -1,3 +1,238 @@ -# @webda/webdaql +# @webda/ql -This is a package for WebdaQL, a query language for Webda. +WebdaQL is a SQL-inspired query language for [Webda](https://webda.io) models. It supports filtering, ordering, pagination, field projection, updates, and deletions. + +## Installation + +```bash +npm install @webda/ql +``` + +## Quick Start + +```ts +import { parse, QueryValidator } from "@webda/ql"; + +// Filter query +const query = parse("status = 'active' AND age > 18 ORDER BY name DESC LIMIT 50"); +query.filter.eval({ status: "active", age: 25 }); // true +query.limit; // 50 +query.orderBy; // [{ field: "name", direction: "DESC" }] +``` + +## Query Syntax + +### Filter Queries + +The base syntax is a filter expression with optional ordering and pagination: + +``` + [ORDER BY ASC|DESC, ...] [LIMIT ] [OFFSET ''] +``` + +#### Comparison Operators + +| Operator | Example | Description | +| ---------- | ------------------------------ | ---------------------------------- | +| `=` | `status = 'active'` | Equality (loose) | +| `!=` | `age != 0` | Inequality | +| `<` | `age < 18` | Less than | +| `<=` | `age <= 65` | Less than or equal | +| `>` | `score > 100` | Greater than | +| `>=` | `score >= 0` | Greater than or equal | +| `LIKE` | `name LIKE 'J%'` | Pattern match (`%` = any, `_` = one char) | +| `IN` | `role IN ['admin', 'editor']` | Membership in a set | +| `CONTAINS` | `tags CONTAINS 'urgent'` | Array contains value | + +#### Logical Operators + +Combine conditions with `AND` and `OR`. Use parentheses for grouping: + +``` +status = 'active' AND (role = 'admin' OR role = 'editor') +``` + +#### Values + +- Strings: single or double quotes (`'hello'`, `"hello"`) +- Integers: `42` +- Booleans: `TRUE`, `FALSE` + +#### Dot Notation + +Access nested attributes with dot notation: + +``` +user.profile.name = 'John' +``` + +### SELECT (Field Projection) + +Select specific fields to return. The `SELECT` keyword is optional when using a comma-separated field list: + +``` +name, age WHERE status = 'active' ORDER BY name ASC LIMIT 10 +``` + +Or with the explicit `SELECT` keyword: + +``` +SELECT name, age WHERE status = 'active' +``` + +Without a `WHERE` clause (select all items, specific fields): + +``` +name, email +``` + +Parsed result: + +```ts +const q = parse("name, age WHERE status = 'active'"); +q.type; // "SELECT" +q.fields; // ["name", "age"] +q.filter.eval({ status: "active" }); // true +``` + +### DELETE + +Delete items matching a condition: + +``` +DELETE WHERE status = 'inactive' +delete where age < 18 AND status = 'pending' LIMIT 100 +``` + +Parsed result: + +```ts +const q = parse("DELETE WHERE status = 'inactive'"); +q.type; // "DELETE" +q.filter.eval({ status: "inactive" }); // true +``` + +### UPDATE + +Update fields on items matching a condition: + +``` +UPDATE SET status = 'active' WHERE name = 'John' +update set status = 'active', age = 30 where name = 'John' +UPDATE SET profile.verified = true WHERE id = 1 +``` + +Parsed result: + +```ts +const q = parse("UPDATE SET status = 'active', age = 30 WHERE name = 'John'"); +q.type; // "UPDATE" +q.assignments; // [{ field: "status", value: "active" }, { field: "age", value: 30 }] +q.filter.eval({ name: "John" }); // true +``` + +## Field Validation + +The `parse()` function accepts an optional `allowedFields` parameter to validate SELECT fields and UPDATE SET targets at parse time: + +```ts +const allowed = ["name", "age", "status", "profile.email"]; + +// Valid fields pass +parse("name, age WHERE status = 'active'", allowed); + +// Unknown field throws SyntaxError +parse("name, unknown WHERE status = 'active'", allowed); +// => SyntaxError: Unknown field "unknown". Allowed fields: name, age, status, profile.email +``` + +You can also validate after parsing with `validateQueryFields()`: + +```ts +import { parse, validateQueryFields } from "@webda/ql"; + +const query = parse("name, age WHERE status = 'active'"); +validateQueryFields(query, ["name", "age", "status"]); // OK +validateQueryFields(query, ["status"]); // throws SyntaxError +``` + +When used with Webda repositories, field validation is automatic: the repository derives allowed fields from the model's JSON Schema metadata. + +## API Reference + +### `parse(query: string, allowedFields?: string[]): Query` + +Parse a query string into a `Query` object. Supports all statement types (filter, SELECT, DELETE, UPDATE). + +### `QueryValidator` + +Low-level parser for filter expressions. Use `parse()` for full statement support. + +```ts +const v = new QueryValidator("status = 'active' AND age > 18"); +v.eval({ status: "active", age: 25 }); // true +v.getExpression(); // Expression AST +v.getLimit(); // 1000 (default) +v.getOffset(); // "" +``` + +### `SetterValidator` + +Parse and apply assignment expressions: + +```ts +const target: any = {}; +new SetterValidator('name = "John" AND age = 30').eval(target); +// target = { name: "John", age: 30 } +``` + +### `PartialValidator` + +Evaluate queries with partial objects (missing fields are treated as matching): + +```ts +const v = new PartialValidator("name = 'John' AND age > 18"); +v.eval({ name: "John" }); // true (age undefined, skipped) +v.wasPartialMatch(); // true +v.eval({ name: "John" }, false); // false (strict mode) +``` + +### `PrependCondition(query, condition)` + +Merge a condition into an existing query: + +```ts +PrependCondition("status = 'active' ORDER BY name LIMIT 10", "age > 18"); +// => 'age > 18 AND status = "active" ORDER BY name ASC LIMIT 10' +``` + +### `validateQueryFields(query, allowedFields)` + +Validate SELECT fields and UPDATE assignments against an allowed field list. + +### `unsanitize(query)` + +Restore `<` and `>` from HTML-sanitized query strings (`<` / `>`). + +## Query Interface + +```ts +interface Query { + filter: Expression; + limit?: number; + continuationToken?: string; + orderBy?: { field: string; direction: "ASC" | "DESC" }[]; + type?: "DELETE" | "UPDATE" | "SELECT"; + fields?: string[]; + assignments?: { field: string; value: string | number | boolean }[]; + toString(): string; +} +``` + +## Grammar + +WebdaQL uses an [ANTLR4](https://www.antlr.org/) grammar for parsing filter expressions. The statement-level syntax (SELECT, DELETE, UPDATE) is handled by a TypeScript pre-parser that delegates the filter portion to the ANTLR engine. + +**Statement keywords are case-insensitive:** `DELETE`, `UPDATE`, `SET`, `SELECT`, `WHERE`, `TRUE`, `FALSE` can be written in any case (`delete where ...`, `Update Set ...`, etc.). + +**Filter-level keywords are case-sensitive and uppercase:** `AND`, `OR`, `LIKE`, `IN`, `CONTAINS`, `ORDER BY`, `ASC`, `DESC`, `LIMIT`, `OFFSET` must remain uppercase as they are handled by the ANTLR grammar. diff --git a/packages/ql/package.json b/packages/ql/package.json index f902c52a5..8e5de6c16 100644 --- a/packages/ql/package.json +++ b/packages/ql/package.json @@ -26,6 +26,7 @@ "antlr4ts": "^0.5.0-alpha.4" }, "devDependencies": { + "@webda/test": "workspace:*", "@testdeck/mocha": "^0.3.2", "@types/node": "22.0.0", "@webda/tsc-esm": "^4.0.0-beta.1", diff --git a/packages/ql/src/query.spec.ts b/packages/ql/src/query.spec.ts index 6a1041c56..2cd457c41 100644 --- a/packages/ql/src/query.spec.ts +++ b/packages/ql/src/query.spec.ts @@ -258,4 +258,258 @@ class QueryTest { ).eval({ attr1: "plop" }) ); } + + @test + deleteQuery() { + // Basic DELETE with WHERE condition + const q1 = WebdaQL.parse("DELETE WHERE status = 'inactive'"); + assert.strictEqual(q1.type, "DELETE"); + assert.ok(q1.filter.eval({ status: "inactive" })); + assert.ok(!q1.filter.eval({ status: "active" })); + + // DELETE with complex condition + const q2 = WebdaQL.parse("DELETE WHERE age < 18 AND status = 'pending'"); + assert.strictEqual(q2.type, "DELETE"); + assert.ok(q2.filter.eval({ age: 10, status: "pending" })); + assert.ok(!q2.filter.eval({ age: 20, status: "pending" })); + + // DELETE with LIMIT (delete at most N items) + const q3 = WebdaQL.parse("DELETE WHERE status = 'old' LIMIT 100"); + assert.strictEqual(q3.type, "DELETE"); + assert.strictEqual(q3.limit, 100); + + // toString round-trip + assert.ok(q1.toString().includes("DELETE")); + assert.ok(q1.toString().includes("status")); + } + + @test + updateQuery() { + // Basic UPDATE with SET and WHERE + const q1 = WebdaQL.parse("UPDATE SET status = 'active' WHERE name = 'John'"); + assert.strictEqual(q1.type, "UPDATE"); + assert.ok(q1.filter.eval({ name: "John" })); + assert.ok(!q1.filter.eval({ name: "Jane" })); + assert.deepStrictEqual(q1.assignments, [{ field: "status", value: "active" }]); + + // UPDATE with multiple SET assignments + const q2 = WebdaQL.parse("UPDATE SET status = 'active', age = 30 WHERE name = 'John'"); + assert.strictEqual(q2.type, "UPDATE"); + assert.deepStrictEqual(q2.assignments, [ + { field: "status", value: "active" }, + { field: "age", value: 30 } + ]); + + // UPDATE with nested attribute + const q3 = WebdaQL.parse("UPDATE SET profile.verified = TRUE WHERE id = 1"); + assert.strictEqual(q3.type, "UPDATE"); + assert.deepStrictEqual(q3.assignments, [{ field: "profile.verified", value: true }]); + + // UPDATE with LIMIT + const q4 = WebdaQL.parse("UPDATE SET status = 'archived' WHERE active = FALSE LIMIT 50"); + assert.strictEqual(q4.type, "UPDATE"); + assert.strictEqual(q4.limit, 50); + + // toString round-trip + assert.ok(q1.toString().includes("UPDATE")); + assert.ok(q1.toString().includes("SET")); + } + + @test + selectFields() { + // Implicit SELECT via field list (no SELECT keyword needed) + const q1 = WebdaQL.parse("name, age WHERE status = 'active'"); + assert.strictEqual(q1.type, "SELECT"); + assert.deepStrictEqual(q1.fields, ["name", "age"]); + assert.ok(q1.filter.eval({ status: "active" })); + + // Implicit SELECT with nested fields + const q2 = WebdaQL.parse("name, profile.email WHERE status = 'active'"); + assert.strictEqual(q2.type, "SELECT"); + assert.deepStrictEqual(q2.fields, ["name", "profile.email"]); + + // Implicit SELECT with ORDER BY, LIMIT, OFFSET + const q3 = WebdaQL.parse("name, age WHERE status = 'active' ORDER BY name ASC LIMIT 10 OFFSET 'token'"); + assert.strictEqual(q3.type, "SELECT"); + assert.deepStrictEqual(q3.fields, ["name", "age"]); + assert.strictEqual(q3.limit, 10); + assert.strictEqual(q3.continuationToken, "token"); + assert.deepStrictEqual(q3.orderBy, [{ field: "name", direction: "ASC" }]); + + // Implicit SELECT without WHERE (all items, specific fields) + const q4 = WebdaQL.parse("name, age"); + assert.strictEqual(q4.type, "SELECT"); + assert.deepStrictEqual(q4.fields, ["name", "age"]); + assert.ok(q4.filter instanceof WebdaQL.AndExpression); + assert.strictEqual((q4.filter as WebdaQL.AndExpression).children.length, 0); + + // Explicit SELECT keyword still works + const q4b = WebdaQL.parse("SELECT name, age WHERE status = 'active'"); + assert.strictEqual(q4b.type, "SELECT"); + assert.deepStrictEqual(q4b.fields, ["name", "age"]); + + // Regular query (no field list) should have type undefined + const q5 = WebdaQL.parse("status = 'active'"); + assert.strictEqual(q5.type, undefined); + assert.strictEqual(q5.fields, undefined); + + // Single field with WHERE — not a SELECT (no comma = could be a filter identifier) + const q6 = WebdaQL.parse("status = 'active' AND age > 18"); + assert.strictEqual(q6.type, undefined); + + // toString round-trip + assert.ok(q3.toString().includes("name")); + } + + @test + allowedFields() { + const allowed = ["name", "age", "status", "profile.email"]; + + // Valid SELECT fields pass + const q1 = WebdaQL.parse("name, age WHERE status = 'active'", allowed); + assert.strictEqual(q1.type, "SELECT"); + assert.deepStrictEqual(q1.fields, ["name", "age"]); + + // Unknown SELECT field throws + assert.throws( + () => WebdaQL.parse("name, unknown WHERE status = 'active'", allowed), + /Unknown field "unknown"/ + ); + + // Valid UPDATE assignment fields pass + const q2 = WebdaQL.parse("UPDATE SET status = 'active' WHERE name = 'John'", allowed); + assert.strictEqual(q2.type, "UPDATE"); + + // Unknown UPDATE assignment field throws + assert.throws( + () => WebdaQL.parse("UPDATE SET invalid = 'active' WHERE name = 'John'", allowed), + /Unknown assignment field "invalid"/ + ); + + // Dot-notation fields work + const q3 = WebdaQL.parse("name, profile.email WHERE status = 'active'", allowed); + assert.deepStrictEqual(q3.fields, ["name", "profile.email"]); + + // DELETE and plain queries are not affected by allowedFields + const q4 = WebdaQL.parse("DELETE WHERE status = 'old'", allowed); + assert.strictEqual(q4.type, "DELETE"); + + const q5 = WebdaQL.parse("status = 'active'", allowed); + assert.strictEqual(q5.type, undefined); + + // validateQueryFields can be called standalone + const parsed = WebdaQL.parse("name, age WHERE status = 'active'"); + WebdaQL.validateQueryFields(parsed, allowed); // should not throw + assert.throws( + () => WebdaQL.validateQueryFields(parsed, ["status"]), + /Unknown field "name"/ + ); + } + + @test + caseInsensitiveKeywords() { + // lowercase delete + const q1 = WebdaQL.parse("delete where status = 'inactive'"); + assert.strictEqual(q1.type, "DELETE"); + assert.ok(q1.filter.eval({ status: "inactive" })); + + // mixed case delete + const q1b = WebdaQL.parse("Delete Where status = 'old'"); + assert.strictEqual(q1b.type, "DELETE"); + + // lowercase update + const q2 = WebdaQL.parse("update set status = 'active' where name = 'John'"); + assert.strictEqual(q2.type, "UPDATE"); + assert.deepStrictEqual(q2.assignments, [{ field: "status", value: "active" }]); + assert.ok(q2.filter.eval({ name: "John" })); + + // mixed case update + const q2b = WebdaQL.parse("Update Set profile.verified = true Where id = 1"); + assert.strictEqual(q2b.type, "UPDATE"); + assert.deepStrictEqual(q2b.assignments, [{ field: "profile.verified", value: true }]); + + // lowercase select + const q3 = WebdaQL.parse("select name, age where status = 'active'"); + assert.strictEqual(q3.type, "SELECT"); + assert.deepStrictEqual(q3.fields, ["name", "age"]); + + // lowercase delete with limit (LIMIT is ANTLR-level, stays uppercase) + const q4 = WebdaQL.parse("delete where status = 'old' LIMIT 100"); + assert.strictEqual(q4.type, "DELETE"); + assert.strictEqual(q4.limit, 100); + + // lowercase boolean values in assignments + const q5 = WebdaQL.parse("UPDATE SET active = false WHERE id = 1"); + assert.deepStrictEqual(q5.assignments, [{ field: "active", value: false }]); + } + + @test + modelFieldValidation() { + // Simulate a model's JSON Schema properties (as getAllowedFields() would return) + const userFields = ["name", "email", "age", "status", "profile.bio", "profile.avatar"]; + + // SELECT: valid fields pass + const q1 = WebdaQL.parse("name, email WHERE status = 'active'", userFields); + assert.strictEqual(q1.type, "SELECT"); + assert.deepStrictEqual(q1.fields, ["name", "email"]); + + // SELECT: unknown field rejects + assert.throws( + () => WebdaQL.parse("name, password WHERE status = 'active'", userFields), + /Unknown field "password"/ + ); + + // SELECT: nested dot-notation field passes + const q2 = WebdaQL.parse("name, profile.bio WHERE age > 18", userFields); + assert.deepStrictEqual(q2.fields, ["name", "profile.bio"]); + + // SELECT: unknown nested field rejects + assert.throws( + () => WebdaQL.parse("name, profile.ssn WHERE age > 18", userFields), + /Unknown field "profile.ssn"/ + ); + + // UPDATE: valid assignment fields pass + const q3 = WebdaQL.parse("UPDATE SET status = 'banned', age = 0 WHERE name = 'spam'", userFields); + assert.strictEqual(q3.type, "UPDATE"); + assert.deepStrictEqual(q3.assignments, [ + { field: "status", value: "banned" }, + { field: "age", value: 0 } + ]); + + // UPDATE: unknown assignment field rejects + assert.throws( + () => WebdaQL.parse("UPDATE SET role = 'admin' WHERE name = 'hacker'", userFields), + /Unknown assignment field "role"/ + ); + + // UPDATE: nested assignment field validates + WebdaQL.parse("UPDATE SET profile.bio = 'hello' WHERE name = 'John'", userFields); + assert.throws( + () => WebdaQL.parse("UPDATE SET profile.secret = 'x' WHERE name = 'John'", userFields), + /Unknown assignment field "profile.secret"/ + ); + + // DELETE: not affected by allowedFields (no field projection) + const q4 = WebdaQL.parse("DELETE WHERE status = 'old'", userFields); + assert.strictEqual(q4.type, "DELETE"); + + // Plain filter: not affected by allowedFields + const q5 = WebdaQL.parse("status = 'active'", userFields); + assert.strictEqual(q5.type, undefined); + + // Standalone validateQueryFields works the same way + const parsed = WebdaQL.parse("name, age WHERE status = 'active'"); + WebdaQL.validateQueryFields(parsed, userFields); // passes + assert.throws( + () => WebdaQL.validateQueryFields(parsed, ["name"]), // age not allowed + /Unknown field "age"/ + ); + + // Empty allowedFields rejects everything + assert.throws( + () => WebdaQL.parse("name, email WHERE status = 'active'", []), + /Unknown field "name"/ + ); + } } diff --git a/packages/ql/src/query.ts b/packages/ql/src/query.ts index f0a3461f2..98474a7ad 100644 --- a/packages/ql/src/query.ts +++ b/packages/ql/src/query.ts @@ -307,6 +307,18 @@ export interface Query { * Order by clause */ orderBy?: OrderBy[]; + /** + * Statement type (DELETE, UPDATE, SELECT) or undefined for plain filter queries + */ + type?: "DELETE" | "UPDATE" | "SELECT"; + /** + * Projected field names for SELECT queries + */ + fields?: string[]; + /** + * Assignment list for UPDATE SET queries + */ + assignments?: { field: string; value: value }[]; /** * Get the string representation of the query */ @@ -1018,11 +1030,316 @@ export function unsanitize(query: string): string { return query.replace(/</g, "<").replace(/>/g, ">"); } +/** + * Find the index of an unquoted keyword in a string + * Tracks single and double quote state to avoid matching inside string literals. + * + * @param str - the string to search + * @param keyword - the keyword to find (must be surrounded by whitespace or at string boundaries) + * @returns index of the keyword, or -1 if not found + */ +function findUnquotedKeyword(str: string, keyword: string): number { + let inSingle = false; + let inDouble = false; + const upperKeyword = keyword.toUpperCase(); + for (let i = 0; i <= str.length - upperKeyword.length; i++) { + const ch = str[i]; + if (ch === "'" && !inDouble) { + inSingle = !inSingle; + } else if (ch === '"' && !inSingle) { + inDouble = !inDouble; + } else if (!inSingle && !inDouble) { + if ( + str.substring(i, i + upperKeyword.length).toUpperCase() === upperKeyword && + (i === 0 || /\s/.test(str[i - 1])) && + (i + upperKeyword.length === str.length || /\s/.test(str[i + upperKeyword.length])) + ) { + return i; + } + } + } + return -1; +} + +/** + * Parse a value literal string into its typed representation + * + * @param raw - trimmed value string (e.g. `"'hello'"`, `"42"`, `"TRUE"`) + * @returns the parsed value + */ +function parseValue(raw: string): value { + if ((raw.startsWith("'") && raw.endsWith("'")) || (raw.startsWith('"') && raw.endsWith('"'))) { + return raw.substring(1, raw.length - 1); + } + const upper = raw.toUpperCase(); + if (upper === "TRUE") return true; + if (upper === "FALSE") return false; + return parseInt(raw); +} + +/** + * Serialize a value to its WebdaQL string representation + */ +function formatValue(v: value): string { + if (typeof v === "string") return `"${v}"`; + if (typeof v === "boolean") return v ? "TRUE" : "FALSE"; + return String(v); +} + +/** + * Parse a comma-separated assignment list like `"status = 'active', age = 30"` + * + * @param str - the assignment list string + * @returns array of field/value assignment objects + */ +function parseAssignments(str: string): { field: string; value: value }[] { + const results: { field: string; value: value }[] = []; + // Split by unquoted commas + let current = ""; + let inSingle = false; + let inDouble = false; + for (const ch of str) { + if (ch === "'" && !inDouble) { + inSingle = !inSingle; + } else if (ch === '"' && !inSingle) { + inDouble = !inDouble; + } + if (ch === "," && !inSingle && !inDouble) { + results.push(parseOneAssignment(current)); + current = ""; + } else { + current += ch; + } + } + if (current.trim()) { + results.push(parseOneAssignment(current)); + } + return results; +} + +/** + * Parse a single assignment like `"status = 'active'"` into `{ field, value }` + */ +function parseOneAssignment(str: string): { field: string; value: value } { + const eqIdx = str.indexOf("="); + if (eqIdx === -1) { + throw new SyntaxError(`Invalid assignment: ${str}`); + } + return { + field: str.substring(0, eqIdx).trim(), + value: parseValue(str.substring(eqIdx + 1).trim()) + }; +} + +/** + * Parse the body after SELECT (or implicit select detection) into fields and remainder + */ +function parseSelectBody(body: string): StatementPrefix { + const whereIdx = findUnquotedKeyword(body, "WHERE"); + let fieldStr: string; + let remainder: string; + if (whereIdx === -1) { + // Check for ORDER BY, LIMIT, OFFSET without WHERE + let endOfFields = body.length; + for (const kw of ["ORDER BY", "LIMIT", "OFFSET"]) { + const idx = findUnquotedKeyword(body, kw); + if (idx !== -1 && idx < endOfFields) { + endOfFields = idx; + } + } + fieldStr = body.substring(0, endOfFields).trim(); + remainder = body.substring(endOfFields).trimStart(); + } else { + fieldStr = body.substring(0, whereIdx).trim(); + remainder = body.substring(whereIdx + 5).trimStart(); + } + const fields = fieldStr.split(",").map(f => f.trim()).filter(f => f.length > 0); + return { type: "SELECT", fields, remainder }; +} + +/** + * Detect if a query is an implicit SELECT (field list without the SELECT keyword). + * + * A query is an implicit SELECT if it contains an unquoted comma before any + * comparison operator or logical keyword. This distinguishes `name, age WHERE ...` + * from `name = 'John' AND ...`. + * + * @returns the query string (as the select body) if implicit SELECT, otherwise undefined + */ +function detectImplicitSelect(query: string): string | undefined { + let inSingle = false; + let inDouble = false; + for (let i = 0; i < query.length; i++) { + const ch = query[i]; + if (ch === "'" && !inDouble) { + inSingle = !inSingle; + } else if (ch === '"' && !inSingle) { + inDouble = !inDouble; + } else if (!inSingle && !inDouble) { + // If we hit a comma first, it's a field list + if (ch === ",") { + return query; + } + // If we hit an operator first, it's a filter expression + if (ch === "=" || ch === "!" || ch === "<" || ch === ">") { + return undefined; + } + // Check for keyword operators (AND, OR, LIKE, IN, CONTAINS) + for (const kw of ["AND", "OR", "LIKE", "IN", "CONTAINS"]) { + if ( + query.substring(i, i + kw.length) === kw && + (i === 0 || /\s/.test(query[i - 1])) && + (i + kw.length === query.length || /\s/.test(query[i + kw.length])) + ) { + return undefined; + } + } + } + } + return undefined; +} + +interface StatementPrefix { + type?: "DELETE" | "UPDATE" | "SELECT"; + fields?: string[]; + assignments?: { field: string; value: value }[]; + remainder: string; +} + +/** + * Extract statement prefix (DELETE/UPDATE/SELECT) from a query string + * and return the remainder for the ANTLR parser. + * + * @param query - full query string + * @returns parsed prefix info and the condition remainder + */ +function extractStatementPrefix(query: string): StatementPrefix { + const trimmed = query.trimStart(); + const upperTrimmed = trimmed.toUpperCase(); + + // DELETE WHERE + if (upperTrimmed.startsWith("DELETE")) { + const afterDelete = trimmed.substring(6).trimStart(); + if (afterDelete.toUpperCase().startsWith("WHERE")) { + return { type: "DELETE", remainder: afterDelete.substring(5).trimStart() }; + } + return { type: "DELETE", remainder: afterDelete }; + } + + // UPDATE SET WHERE + if (upperTrimmed.startsWith("UPDATE")) { + const afterUpdate = trimmed.substring(6).trimStart(); + if (!afterUpdate.toUpperCase().startsWith("SET")) { + throw new SyntaxError(`Expected SET after UPDATE (Query: ${query})`); + } + const afterSet = afterUpdate.substring(3).trimStart(); + const whereIdx = findUnquotedKeyword(afterSet, "WHERE"); + if (whereIdx === -1) { + // UPDATE SET assignments without WHERE → applies to all + return { + type: "UPDATE", + assignments: parseAssignments(afterSet), + remainder: "" + }; + } + const assignmentStr = afterSet.substring(0, whereIdx).trim(); + const remainder = afterSet.substring(whereIdx + 5).trimStart(); + return { + type: "UPDATE", + assignments: parseAssignments(assignmentStr), + remainder + }; + } + + // SELECT [WHERE ] — explicit or implicit + // Explicit: starts with SELECT keyword + // Implicit: starts with a comma-separated identifier list (contains a comma before any operator) + const selectBody = upperTrimmed.startsWith("SELECT") ? trimmed.substring(6).trimStart() : detectImplicitSelect(trimmed); + + if (selectBody !== undefined) { + return parseSelectBody(selectBody); + } + + return { remainder: query }; +} + +/** + * Validate that all fields and assignment targets in a query are within the allowed set. + * Checks SELECT fields, UPDATE SET assignment fields, and filter attribute references. + * + * @param query - parsed query to validate + * @param allowedFields - set of allowed field names (supports dot-notation) + * @throws {SyntaxError} if any field is not in the allowed set + */ +export function validateQueryFields(query: Query, allowedFields: string[]): void { + const allowed = new Set(allowedFields); + if (query.fields) { + for (const field of query.fields) { + if (!allowed.has(field)) { + throw new SyntaxError(`Unknown field "${field}". Allowed fields: ${allowedFields.join(", ")}`); + } + } + } + if (query.assignments) { + for (const assignment of query.assignments) { + if (!allowed.has(assignment.field)) { + throw new SyntaxError( + `Unknown assignment field "${assignment.field}". Allowed fields: ${allowedFields.join(", ")}` + ); + } + } + } +} + /** * Parse a query string into a Query object - * @param query - * @returns + * + * Supports plain filter queries, and statement prefixes: + * - `DELETE WHERE [LIMIT n]` + * - `UPDATE SET WHERE [LIMIT n]` + * - `SELECT [WHERE ] [ORDER BY ...] [LIMIT ...] [OFFSET ...]` + * - `, [WHERE ] ...` (implicit SELECT when comma-separated fields detected) + * + * @param query - the query string to parse + * @param allowedFields - optional list of allowed field names; if provided, SELECT fields + * and UPDATE SET targets are validated against this list and a SyntaxError is thrown for unknowns + * @returns parsed Query object */ -export function parse(query: string): Query { - return new QueryValidator(query).getQuery(); +export function parse(query: string, allowedFields?: string[]): Query { + const prefix = extractStatementPrefix(query); + const base = new QueryValidator(prefix.remainder).getQuery(); + if (!prefix.type) { + return base; + } + const result: Query = { + ...base, + type: prefix.type, + fields: prefix.fields, + assignments: prefix.assignments, + toString: () => { + const basePart = base.toString(); + switch (prefix.type) { + case "DELETE": { + const condition = basePart ? ` WHERE ${basePart}` : ""; + return `DELETE${condition}`.trim(); + } + case "UPDATE": { + const setPart = prefix.assignments!.map(a => `${a.field} = ${formatValue(a.value)}`).join(", "); + const condition = basePart ? ` WHERE ${basePart}` : ""; + return `UPDATE SET ${setPart}${condition}`.trim(); + } + case "SELECT": { + const fieldsPart = prefix.fields!.join(", "); + const condition = basePart ? ` WHERE ${basePart}` : ""; + return `SELECT ${fieldsPart}${condition}`.trim(); + } + default: + return basePart; + } + } + }; + if (allowedFields) { + validateQueryFields(result, allowedFields); + } + return result; } diff --git a/packages/test/package.json b/packages/test/package.json index 034d999e9..34dfae1bd 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -30,12 +30,13 @@ "codemod": "jscodeshift --parser=ts --extensions=tsx,ts -t ../codemod/current.mjs src" }, "dependencies": { - "@webda/decorators": "^4.0.0-beta.1", - "@webda/workout": "^4.0.0-beta.1" + "@webda/decorators": "workspace:*", + "@webda/workout": "workspace:*" }, "devDependencies": { "@types/node": "22.0.0", - "jscodeshift": "^17.0.0" + "jscodeshift": "^17.0.0", + "vitest": "^4.1.0" }, "peerDependenciesMeta": { "mocha": { From 577f002f0699ae9d4ceef46816f832a843a98c82 Mon Sep 17 00:00:00 2001 From: Yann-Gael Gautheron Date: Tue, 17 Mar 2026 15:30:16 +0100 Subject: [PATCH 2/7] feat: add TypeScript plugin for WebdaQL with query parsing and field extraction --- packages/ql-ts-plugin/README.md | 84 ++++++ packages/ql-ts-plugin/package.json | 33 +++ packages/ql-ts-plugin/src/index.ts | 339 +++++++++++++++++++++++ packages/ql-ts-plugin/src/parser.spec.ts | 114 ++++++++ packages/ql-ts-plugin/src/parser.ts | 154 ++++++++++ packages/ql-ts-plugin/tsconfig.json | 15 + 6 files changed, 739 insertions(+) create mode 100644 packages/ql-ts-plugin/README.md create mode 100644 packages/ql-ts-plugin/package.json create mode 100644 packages/ql-ts-plugin/src/index.ts create mode 100644 packages/ql-ts-plugin/src/parser.spec.ts create mode 100644 packages/ql-ts-plugin/src/parser.ts create mode 100644 packages/ql-ts-plugin/tsconfig.json diff --git a/packages/ql-ts-plugin/README.md b/packages/ql-ts-plugin/README.md new file mode 100644 index 000000000..6bf12395d --- /dev/null +++ b/packages/ql-ts-plugin/README.md @@ -0,0 +1,84 @@ +# @webda/ql-ts-plugin + +TypeScript language service plugin for [WebdaQL](../ql/README.md). Validates field names in query strings against your model types and provides autocompletion — all inside your IDE. + +## Setup + +Install the plugin: + +```bash +npm install -D @webda/ql-ts-plugin +``` + +Add it to your `tsconfig.json`: + +```json +{ + "compilerOptions": { + "plugins": [{ "name": "@webda/ql-ts-plugin" }] + } +} +``` + +> **VSCode users:** Make sure you're using the workspace TypeScript version (`TypeScript: Select TypeScript Version` → `Use Workspace Version`), as plugins only run in the language service, not in `tsc`. + +## Features + +### Field validation + +The plugin detects calls to `repo.query()`, `repo.iterate()`, and `parse()` with string literal arguments. It parses the WebdaQL query and checks that SELECT fields and UPDATE SET targets exist on the model type. + +```ts +interface User { + name: string; + age: number; + status: string; + profile: { bio: string; avatar: string }; +} + +const repo: MemoryRepository; + +repo.query("name, age WHERE status = 'active'"); // ✅ +repo.query("name, oops WHERE status = 'active'"); // ❌ Unknown field "oops" in SELECT +repo.query("UPDATE SET role = 'admin' WHERE id = 1"); // ❌ Unknown assignment field "role" in UPDATE SET +repo.query("DELETE WHERE status = 'old'"); // ✅ (DELETE has no field projection) +``` + +Nested dot-notation fields are supported: + +```ts +repo.query("name, profile.bio WHERE status = 'active'"); // ✅ +repo.query("name, profile.secret WHERE status = 'active'"); // ❌ Unknown field "profile.secret" +``` + +### Autocompletion + +When your cursor is inside a query string in a field-list position (after `SELECT`, `SET`, or at the start of an implicit field list), the plugin suggests model property names. + +```ts +repo.query("name, | WHERE status = 'active'"); +// ^ autocomplete: age, status, profile.bio, profile.avatar +``` + +## How it works + +1. **Intercepts** calls to `.query()`, `.iterate()`, or `parse()` where the first argument is a string literal +2. **Resolves** the model type from the repository's generic parameter (via the return type of `.get()`) +3. **Parses** the query string with a lightweight field extractor (no ANTLR dependency) +4. **Reports** diagnostics if SELECT fields or UPDATE SET targets are not valid property names +5. **Offers** completion entries when the cursor is in a field-list context + +## Supported call patterns + +| Pattern | Field resolution | +|---------|-----------------| +| `repo.query("...")` | Model type from `Repository` generic | +| `repo.iterate("...")` | Model type from `Repository` generic | +| `parse("...", ["name", "age"])` | Allowed fields from the literal array argument | + +## Limitations + +- Only works with **string literals** — dynamic query strings (`repo.query(variable)`) cannot be checked +- Runs in the **language service only** (IDE), not during `tsc` builds +- Filter-level field references (e.g. `WHERE unknownField = 1`) are not yet validated — only SELECT and UPDATE SET targets +- ANTLR-level keywords (`AND`, `OR`, `LIKE`, `IN`, `CONTAINS`) must still be uppercase diff --git a/packages/ql-ts-plugin/package.json b/packages/ql-ts-plugin/package.json new file mode 100644 index 000000000..49ae7e932 --- /dev/null +++ b/packages/ql-ts-plugin/package.json @@ -0,0 +1,33 @@ +{ + "name": "@webda/ql-ts-plugin", + "version": "4.0.0-beta.1", + "description": "TypeScript language service plugin for WebdaQL — validates field names and provides autocompletion inside query strings", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "type": "module", + "scripts": { + "build": "tsc", + "test": "vitest run" + }, + "keywords": [ + "typescript", + "plugin", + "webda", + "webdaql", + "language-service" + ], + "license": "LGPL-3.0-only", + "devDependencies": { + "typescript": "~5.8.0", + "vitest": "^3.0.0" + }, + "peerDependencies": { + "typescript": ">=5.0.0" + }, + "engines": { + "node": ">=22.0.0" + }, + "files": [ + "lib" + ] +} diff --git a/packages/ql-ts-plugin/src/index.ts b/packages/ql-ts-plugin/src/index.ts new file mode 100644 index 000000000..4cb0e3e5f --- /dev/null +++ b/packages/ql-ts-plugin/src/index.ts @@ -0,0 +1,339 @@ +/** + * @webda/ql-ts-plugin + * + * TypeScript language service plugin that validates WebdaQL query field names + * against model types and provides autocompletion inside query strings. + * + * Detects calls to: + * - repo.query("...") — repository query method + * - parse("...", ...) — WebdaQL parse function + * + * Resolves the model type from the repository generic parameter and checks + * that SELECT fields and UPDATE SET targets are valid property names. + * + * Setup in tsconfig.json: + * { + * "compilerOptions": { + * "plugins": [{ "name": "@webda/ql-ts-plugin" }] + * } + * } + */ + +import type tslib from "typescript/lib/tsserverlibrary"; +import { extractFields } from "./parser.js"; + +/** Target method names to intercept */ +const QUERY_METHODS = new Set(["query", "iterate"]); +const PARSE_FUNCTIONS = new Set(["parse"]); + +/** Custom diagnostic code */ +const DIAG_CODE = 99001; + +function init(modules: { typescript: typeof tslib }) { + const ts = modules.typescript; + + function create(info: tslib.server.PluginCreateInfo): tslib.LanguageService { + const langSvc = info.languageService; + + // ─── Helpers ─────────────────────────────────────────── + + /** + * Get the method name from a call expression + */ + function getCallName(node: tslib.CallExpression): string | undefined { + const expr = node.expression; + if (ts.isPropertyAccessExpression(expr)) { + return expr.name.text; + } + if (ts.isIdentifier(expr)) { + return expr.text; + } + return undefined; + } + + /** + * Recursively collect all property names from a type (top-level + nested with dot notation) + */ + function collectPropertyPaths(checker: tslib.TypeChecker, type: tslib.Type, prefix: string = "", depth: number = 0): string[] { + if (depth > 3) return []; // prevent infinite recursion + const paths: string[] = []; + for (const prop of type.getProperties()) { + const name = prefix ? `${prefix}.${prop.name}` : prop.name; + // Skip internal symbols + if (prop.name.startsWith("__") || prop.name.startsWith("_webda")) continue; + paths.push(name); + // Recurse into object types for dot-notation support + if (depth < 3) { + const propType = checker.getTypeOfSymbolAtLocation(prop, prop.valueDeclaration || prop.declarations![0]); + // Only recurse into plain object types (not arrays, primitives, etc.) + if (propType.getProperties().length > 0 && !(propType.flags & ts.TypeFlags.StringLike) && !checker.isArrayType(propType)) { + paths.push(...collectPropertyPaths(checker, propType, name, depth + 1)); + } + } + } + return paths; + } + + /** + * Resolve model field names from a repository.query() call. + * Walks up: Repository → InstanceType → property names + */ + function resolveFieldsFromRepoCall(checker: tslib.TypeChecker, node: tslib.CallExpression): string[] | undefined { + const expr = node.expression; + if (!ts.isPropertyAccessExpression(expr)) return undefined; + + const objType = checker.getTypeAtLocation(expr.expression); + // Look for a generic type argument that represents the model + // Repository → we want to get the properties of InstanceType + + // Strategy: find the return type of .get() on this object — that gives us Helpers> + const getMethod = objType.getProperty("get"); + if (!getMethod) return undefined; + + const getType = checker.getTypeOfSymbolAtLocation(getMethod, expr); + const signatures = getType.getCallSignatures(); + if (!signatures.length) return undefined; + + let returnType = checker.getReturnTypeOfSignature(signatures[0]); + // Unwrap Promise + if (returnType.symbol?.name === "Promise") { + const typeArgs = (returnType as tslib.TypeReference).typeArguments; + if (typeArgs?.length) returnType = typeArgs[0]; + } + + const props = collectPropertyPaths(checker, returnType); + return props.length > 0 ? props : undefined; + } + + /** + * Resolve model fields from a parse() call with allowedFields param. + * If the second argument is a type we can read, use that. + * Otherwise, try to infer from context. + */ + function resolveFieldsFromParseCall(checker: tslib.TypeChecker, node: tslib.CallExpression): string[] | undefined { + // If there's a second argument (allowedFields), resolve its type + if (node.arguments.length >= 2) { + const arg = node.arguments[1]; + const type = checker.getTypeAtLocation(arg); + // If it's a tuple of string literals, extract them + if (checker.isArrayType(type)) { + const typeArgs = (type as tslib.TypeReference).typeArguments; + if (typeArgs?.length) { + const elementType = typeArgs[0]; + if (elementType.isUnion()) { + const fields = elementType.types + .filter((t): t is tslib.StringLiteralType => !!(t.flags & ts.TypeFlags.StringLiteral)) + .map(t => t.value); + if (fields.length > 0) return fields; + } + if (elementType.flags & ts.TypeFlags.StringLiteral) { + return [(elementType as tslib.StringLiteralType).value]; + } + } + } + } + return undefined; + } + + /** + * Find the position of a field name within the query string for precise error highlighting + */ + function findFieldPosition(query: string, field: string, startSearch: number = 0): number { + // Find the field as a whole word + const idx = query.indexOf(field, startSearch); + if (idx === -1) return 0; + return idx; + } + + // ─── Diagnostics ────────────────────────────────────── + + const proxy: tslib.LanguageService = Object.create(null); + + proxy.getSemanticDiagnostics = (fileName: string): tslib.Diagnostic[] => { + const prior = langSvc.getSemanticDiagnostics(fileName); + const program = langSvc.getProgram(); + if (!program) return prior; + const sourceFile = program.getSourceFile(fileName); + if (!sourceFile) return prior; + const checker = program.getTypeChecker(); + const extra: tslib.Diagnostic[] = []; + + function visit(node: tslib.Node) { + if (ts.isCallExpression(node) && node.arguments.length >= 1) { + const firstArg = node.arguments[0]; + if (!ts.isStringLiteral(firstArg) && !ts.isNoSubstitutionTemplateLiteral(firstArg)) { + ts.forEachChild(node, visit); + return; + } + + const queryText = firstArg.text; + const callName = getCallName(node); + let allowedFields: string[] | undefined; + + if (callName && QUERY_METHODS.has(callName)) { + allowedFields = resolveFieldsFromRepoCall(checker, node); + } else if (callName && PARSE_FUNCTIONS.has(callName)) { + allowedFields = resolveFieldsFromParseCall(checker, node); + } + + if (allowedFields) { + const parsed = extractFields(queryText); + const allowedSet = new Set(allowedFields); + + const fieldsToCheck = [ + ...(parsed.fields || []).map(f => ({ field: f, kind: "field" as const })), + ...(parsed.assignmentFields || []).map(f => ({ field: f, kind: "assignment" as const })) + ]; + + for (const { field, kind } of fieldsToCheck) { + if (!allowedSet.has(field)) { + const offset = findFieldPosition(queryText, field); + const messageText = + kind === "assignment" + ? `Unknown assignment field "${field}" in UPDATE SET. Allowed: ${allowedFields.join(", ")}` + : `Unknown field "${field}" in SELECT. Allowed: ${allowedFields.join(", ")}`; + + extra.push({ + file: sourceFile, + start: firstArg.getStart() + 1 + offset, // +1 for the opening quote + length: field.length, + messageText, + category: ts.DiagnosticCategory.Error, + code: DIAG_CODE + }); + } + } + } + } + ts.forEachChild(node, visit); + } + + visit(sourceFile); + return [...prior, ...extra]; + }; + + // ─── Completions ────────────────────────────────────── + + proxy.getCompletionsAtPosition = ( + fileName: string, + position: number, + options: tslib.GetCompletionsAtPositionOptions | undefined + ): tslib.WithMetadata | undefined => { + const prior = langSvc.getCompletionsAtPosition(fileName, position, options); + const program = langSvc.getProgram(); + if (!program) return prior; + const sourceFile = program.getSourceFile(fileName); + if (!sourceFile) return prior; + const checker = program.getTypeChecker(); + + // Check if cursor is inside a string argument to query()/parse() + const token = findTokenAtPosition(sourceFile, position); + if (!token || (!ts.isStringLiteral(token) && !ts.isNoSubstitutionTemplateLiteral(token))) { + return prior; + } + + const callExpr = findParentCallExpression(token); + if (!callExpr || callExpr.arguments[0] !== token) return prior; + + const callName = getCallName(callExpr); + let allowedFields: string[] | undefined; + + if (callName && QUERY_METHODS.has(callName)) { + allowedFields = resolveFieldsFromRepoCall(checker, callExpr); + } else if (callName && PARSE_FUNCTIONS.has(callName)) { + allowedFields = resolveFieldsFromParseCall(checker, callExpr); + } + + if (!allowedFields) return prior; + + // Determine context: are we in a SELECT field list or UPDATE SET? + const queryText = token.text; + const cursorOffset = position - token.getStart() - 1; // -1 for opening quote + const textBeforeCursor = queryText.substring(0, cursorOffset); + + // Offer field completions if cursor is in a field-list or SET position + const upperBefore = textBeforeCursor.toUpperCase().trimStart(); + const isInFieldContext = + upperBefore.startsWith("SELECT") || + upperBefore.includes("SET") || + isImplicitSelectContext(textBeforeCursor); + + if (!isInFieldContext) return prior; + + const fieldEntries: tslib.CompletionEntry[] = allowedFields.map(field => ({ + name: field, + kind: ts.ScriptElementKind.memberVariableElement, + sortText: "0" + field, // sort before other completions + insertText: field + })); + + if (prior) { + return { + ...prior, + entries: [...fieldEntries, ...prior.entries] + }; + } + + return { + isGlobalCompletion: false, + isMemberCompletion: false, + isNewIdentifierLocation: false, + entries: fieldEntries + }; + }; + + // ─── Utility ────────────────────────────────────────── + + function findTokenAtPosition(sourceFile: tslib.SourceFile, position: number): tslib.Node | undefined { + function find(node: tslib.Node): tslib.Node | undefined { + if (position >= node.getStart() && position <= node.getEnd()) { + return ts.forEachChild(node, find) || node; + } + return undefined; + } + return find(sourceFile); + } + + function findParentCallExpression(node: tslib.Node): tslib.CallExpression | undefined { + let current = node.parent; + while (current) { + if (ts.isCallExpression(current)) return current; + current = current.parent; + } + return undefined; + } + + function isImplicitSelectContext(text: string): boolean { + // If text contains a comma before any operator, we're in an implicit SELECT + let inSingle = false; + let inDouble = false; + for (const ch of text) { + if (ch === "'" && !inDouble) inSingle = !inSingle; + else if (ch === '"' && !inSingle) inDouble = !inDouble; + else if (!inSingle && !inDouble) { + if (ch === ",") return true; + if (ch === "=" || ch === "!" || ch === "<" || ch === ">") return false; + } + } + // Also treat empty/identifier-only text as a potential field context + return /^\s*[a-zA-Z_.]*\s*$/.test(text); + } + + // ─── Proxy all other methods ────────────────────────── + + for (const k of Object.keys(langSvc) as (keyof tslib.LanguageService)[]) { + if (!(k in proxy)) { + const method = langSvc[k]; + if (typeof method === "function") { + (proxy as any)[k] = (...args: any[]) => (method as Function).apply(langSvc, args); + } + } + } + + return proxy; + } + + return { create }; +} + +export default init; diff --git a/packages/ql-ts-plugin/src/parser.spec.ts b/packages/ql-ts-plugin/src/parser.spec.ts new file mode 100644 index 000000000..1be71610b --- /dev/null +++ b/packages/ql-ts-plugin/src/parser.spec.ts @@ -0,0 +1,114 @@ +import { describe, it, expect } from "vitest"; +import { extractFields } from "./parser.js"; + +describe("extractFields", () => { + describe("SELECT", () => { + it("detects implicit SELECT (field list with comma)", () => { + const result = extractFields("name, age WHERE status = 'active'"); + expect(result.type).toBe("SELECT"); + expect(result.fields).toEqual(["name", "age"]); + }); + + it("detects explicit SELECT", () => { + const result = extractFields("SELECT name, age WHERE status = 'active'"); + expect(result.type).toBe("SELECT"); + expect(result.fields).toEqual(["name", "age"]); + }); + + it("handles lowercase select", () => { + const result = extractFields("select name, email where id = 1"); + expect(result.type).toBe("SELECT"); + expect(result.fields).toEqual(["name", "email"]); + }); + + it("handles nested dot-notation fields", () => { + const result = extractFields("name, profile.email WHERE active = TRUE"); + expect(result.type).toBe("SELECT"); + expect(result.fields).toEqual(["name", "profile.email"]); + }); + + it("handles SELECT without WHERE", () => { + const result = extractFields("name, age"); + expect(result.type).toBe("SELECT"); + expect(result.fields).toEqual(["name", "age"]); + }); + + it("handles SELECT with ORDER BY/LIMIT", () => { + const result = extractFields("name, age ORDER BY name ASC LIMIT 10"); + expect(result.type).toBe("SELECT"); + expect(result.fields).toEqual(["name", "age"]); + }); + }); + + describe("UPDATE", () => { + it("extracts assignment fields", () => { + const result = extractFields("UPDATE SET status = 'active' WHERE name = 'John'"); + expect(result.type).toBe("UPDATE"); + expect(result.assignmentFields).toEqual(["status"]); + }); + + it("extracts multiple assignment fields", () => { + const result = extractFields("UPDATE SET status = 'active', age = 30 WHERE id = 1"); + expect(result.type).toBe("UPDATE"); + expect(result.assignmentFields).toEqual(["status", "age"]); + }); + + it("extracts nested assignment fields", () => { + const result = extractFields("UPDATE SET profile.verified = TRUE WHERE id = 1"); + expect(result.type).toBe("UPDATE"); + expect(result.assignmentFields).toEqual(["profile.verified"]); + }); + + it("handles lowercase update set where", () => { + const result = extractFields("update set name = 'x' where id = 1"); + expect(result.type).toBe("UPDATE"); + expect(result.assignmentFields).toEqual(["name"]); + }); + }); + + describe("DELETE", () => { + it("returns DELETE type with no fields", () => { + const result = extractFields("DELETE WHERE status = 'old'"); + expect(result.type).toBe("DELETE"); + expect(result.fields).toBeUndefined(); + expect(result.assignmentFields).toBeUndefined(); + }); + + it("handles lowercase delete", () => { + const result = extractFields("delete where active = FALSE"); + expect(result.type).toBe("DELETE"); + }); + }); + + describe("plain filter", () => { + it("returns no type for plain filter queries", () => { + const result = extractFields("status = 'active' AND age > 18"); + expect(result.type).toBeUndefined(); + expect(result.fields).toBeUndefined(); + }); + + it("does not confuse a filter with an implicit SELECT", () => { + const result = extractFields("name = 'John'"); + expect(result.type).toBeUndefined(); + }); + }); + + describe("edge cases", () => { + it("does not match keywords inside quoted strings", () => { + const result = extractFields("name, age WHERE title = 'SELECT committee'"); + expect(result.type).toBe("SELECT"); + expect(result.fields).toEqual(["name", "age"]); + }); + + it("handles empty query", () => { + const result = extractFields(""); + expect(result.type).toBeUndefined(); + }); + + it("handles UPDATE without SET", () => { + const result = extractFields("UPDATE WHERE id = 1"); + expect(result.type).toBe("UPDATE"); + expect(result.assignmentFields).toBeUndefined(); + }); + }); +}); diff --git a/packages/ql-ts-plugin/src/parser.ts b/packages/ql-ts-plugin/src/parser.ts new file mode 100644 index 000000000..01c46419e --- /dev/null +++ b/packages/ql-ts-plugin/src/parser.ts @@ -0,0 +1,154 @@ +/** + * Lightweight WebdaQL query parser for the TS plugin. + * + * Extracts field names from SELECT and UPDATE SET clauses + * without needing the full ANTLR runtime. This is intentionally + * minimal — it only needs to identify which fields are referenced, + * not evaluate the query. + */ + +export interface ParsedFields { + type?: "DELETE" | "UPDATE" | "SELECT"; + /** Fields in a SELECT field list */ + fields?: string[]; + /** Assignment targets in UPDATE SET */ + assignmentFields?: string[]; +} + +/** + * Find the index of an unquoted keyword (case-insensitive) + */ +function findUnquotedKeyword(str: string, keyword: string): number { + let inSingle = false; + let inDouble = false; + const upper = keyword.toUpperCase(); + for (let i = 0; i <= str.length - upper.length; i++) { + const ch = str[i]; + if (ch === "'" && !inDouble) inSingle = !inSingle; + else if (ch === '"' && !inSingle) inDouble = !inDouble; + else if (!inSingle && !inDouble) { + if ( + str.substring(i, i + upper.length).toUpperCase() === upper && + (i === 0 || /\s/.test(str[i - 1])) && + (i + upper.length === str.length || /\s/.test(str[i + upper.length])) + ) { + return i; + } + } + } + return -1; +} + +/** + * Detect implicit SELECT: query has an unquoted comma before any operator + */ +function isImplicitSelect(query: string): boolean { + let inSingle = false; + let inDouble = false; + for (let i = 0; i < query.length; i++) { + const ch = query[i]; + if (ch === "'" && !inDouble) inSingle = !inSingle; + else if (ch === '"' && !inSingle) inDouble = !inDouble; + else if (!inSingle && !inDouble) { + if (ch === ",") return true; + if (ch === "=" || ch === "!" || ch === "<" || ch === ">") return false; + for (const kw of ["AND", "OR", "LIKE", "IN", "CONTAINS"]) { + if ( + query.substring(i, i + kw.length).toUpperCase() === kw && + (i === 0 || /\s/.test(query[i - 1])) && + (i + kw.length === query.length || /\s/.test(query[i + kw.length])) + ) { + return false; + } + } + } + } + return false; +} + +/** + * Parse comma-separated field names from a string, stopping at a boundary keyword + */ +function parseFieldList(str: string): string[] { + // Find end of field list (WHERE, ORDER BY, LIMIT, OFFSET or end of string) + let end = str.length; + for (const kw of ["WHERE", "ORDER BY", "LIMIT", "OFFSET"]) { + const idx = findUnquotedKeyword(str, kw); + if (idx !== -1 && idx < end) end = idx; + } + const fieldStr = str.substring(0, end).trim(); + if (!fieldStr) return []; + return fieldStr + .split(",") + .map(f => f.trim()) + .filter(f => f.length > 0); +} + +/** + * Parse assignment targets from UPDATE SET clause (field names only) + */ +function parseAssignmentFields(str: string): string[] { + const fields: string[] = []; + let current = ""; + let inSingle = false; + let inDouble = false; + for (const ch of str) { + if (ch === "'" && !inDouble) inSingle = !inSingle; + else if (ch === '"' && !inSingle) inDouble = !inDouble; + if (ch === "," && !inSingle && !inDouble) { + const eqIdx = current.indexOf("="); + if (eqIdx !== -1) fields.push(current.substring(0, eqIdx).trim()); + current = ""; + } else { + current += ch; + } + } + if (current.trim()) { + const eqIdx = current.indexOf("="); + if (eqIdx !== -1) fields.push(current.substring(0, eqIdx).trim()); + } + return fields; +} + +/** + * Extract field references from a WebdaQL query string. + * Returns the statement type and any field names that can be validated. + */ +export function extractFields(query: string): ParsedFields { + const trimmed = query.trimStart(); + const upper = trimmed.toUpperCase(); + + // DELETE WHERE ... + if (upper.startsWith("DELETE")) { + return { type: "DELETE" }; + } + + // UPDATE SET field = val, ... WHERE ... + if (upper.startsWith("UPDATE")) { + const afterUpdate = trimmed.substring(6).trimStart(); + if (!afterUpdate.toUpperCase().startsWith("SET")) { + return { type: "UPDATE" }; + } + const afterSet = afterUpdate.substring(3).trimStart(); + const whereIdx = findUnquotedKeyword(afterSet, "WHERE"); + const assignStr = whereIdx === -1 ? afterSet : afterSet.substring(0, whereIdx).trim(); + return { + type: "UPDATE", + assignmentFields: parseAssignmentFields(assignStr) + }; + } + + // Explicit SELECT + if (upper.startsWith("SELECT")) { + const body = trimmed.substring(6).trimStart(); + return { type: "SELECT", fields: parseFieldList(body) }; + } + + // Implicit SELECT (field list with commas before operators) + if (isImplicitSelect(trimmed)) { + return { type: "SELECT", fields: parseFieldList(trimmed) }; + } + + // Plain filter query — no fields to validate + return {}; +} diff --git a/packages/ql-ts-plugin/tsconfig.json b/packages/ql-ts-plugin/tsconfig.json new file mode 100644 index 000000000..7c1234f27 --- /dev/null +++ b/packages/ql-ts-plugin/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "es2020", + "moduleResolution": "node", + "outDir": "./lib", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true + }, + "include": ["src/**/*"] +} From 7312b48c232f538cee1ada17f105306cb3d5269b Mon Sep 17 00:00:00 2001 From: Yann-Gael Gautheron Date: Tue, 31 Mar 2026 13:48:38 -0700 Subject: [PATCH 3/7] feat: implement DELETE, UPDATE, and SELECT statements in WebdaQL grammar --- packages/ql/src/WebdaQLLexer.g4 | 10 ++++++++- packages/ql/src/WebdaQLParser.g4 | 36 +++++++++++++++++++++++++++++--- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/packages/ql/src/WebdaQLLexer.g4 b/packages/ql/src/WebdaQLLexer.g4 index 1eb35e6e0..0392af865 100644 --- a/packages/ql/src/WebdaQLLexer.g4 +++ b/packages/ql/src/WebdaQLLexer.g4 @@ -31,6 +31,14 @@ fragment QUOTE_SYMB : SINGLE_QUOTE_SYMB | DOUBLE_QUOTE_SYMB ; +// Statement keywords + +DELETE: 'DELETE'; +UPDATE: 'UPDATE'; +SELECT: 'SELECT'; +SET: 'SET'; +WHERE: 'WHERE'; + // Operators // - Logic @@ -76,4 +84,4 @@ INTEGER_LITERAL: INT_DIGIT+; IDENTIFIER: [a-zA-Z]+; IDENTIFIER_WITH_NUMBER: [a-zA-Z0-9._]+; -FUNCTION_IDENTIFIER_WITH_UNDERSCORE: [A-Z] [A-Z_]*; \ No newline at end of file +FUNCTION_IDENTIFIER_WITH_UNDERSCORE: [A-Z] [A-Z_]*; diff --git a/packages/ql/src/WebdaQLParser.g4 b/packages/ql/src/WebdaQLParser.g4 index 9def96985..bc81bd1c2 100644 --- a/packages/ql/src/WebdaQLParser.g4 +++ b/packages/ql/src/WebdaQLParser.g4 @@ -2,8 +2,38 @@ grammar WebdaQLParser; import WebdaQLLexer; -// Entrypoint -webdaql: expression? orderExpression? limitExpression? offsetExpression? EOF; +// Entrypoint — a statement or a plain filter query +webdaql: (statement | filterQuery) EOF; + +// Statement types +statement + : deleteStatement + | updateStatement + | selectStatement + ; + +// DELETE [WHERE ] [LIMIT n] +deleteStatement: DELETE (WHERE expression)? limitExpression?; + +// UPDATE SET [WHERE ] [LIMIT n] +updateStatement: UPDATE SET assignmentList (WHERE expression)? limitExpression?; + +// SELECT [WHERE ] [ORDER BY ...] [LIMIT ...] [OFFSET ...] +selectStatement: SELECT fieldList (WHERE expression)? orderExpression? limitExpression? offsetExpression?; + +// Implicit SELECT (comma-separated field list without SELECT keyword) +// is handled at the parser/runtime level since it requires disambiguation +// from plain filter expressions + +// Plain filter query (original grammar entry point) +filterQuery: expression? orderExpression? limitExpression? offsetExpression?; + +// Assignment list for UPDATE SET +assignmentList: assignment (COMMA assignment)*; +assignment: identifier EQUAL values; + +// Field list for SELECT +fieldList: identifier (COMMA identifier)*; limitExpression: LIMIT integerLiteral; offsetExpression: OFFSET stringLiteral; @@ -55,4 +85,4 @@ integerLiteral: INTEGER_LITERAL; setExpression : LR_SQ_BRACKET values ( COMMA values )* RR_SQ_BRACKET // Empty sets are not allowed - ; \ No newline at end of file + ; From 2276af9037fdeb0dcbf78a19d7043726f7843873 Mon Sep 17 00:00:00 2001 From: Yann-Gael Gautheron Date: Tue, 31 Mar 2026 13:56:19 -0700 Subject: [PATCH 4/7] Refactor WebdaQLParserVisitor and ExpressionBuilder - Updated the import statements in WebdaQLParserVisitor.ts for better readability by importing each context individually. - Added missing visit methods for various contexts in WebdaQLParserVisitor interface. - Modified the visitWebdaql method in ExpressionBuilder to handle both statement and filterQuery contexts. - Enhanced visitFilterQuery method to correctly process child nodes and handle empty filters. --- packages/ql/src/WebdaQLLexer.interp | 17 +- packages/ql/src/WebdaQLLexer.tokens | 94 +- packages/ql/src/WebdaQLLexer.ts | 525 ++- packages/ql/src/WebdaQLParser.interp | 20 +- packages/ql/src/WebdaQLParser.tokens | 94 +- packages/ql/src/WebdaQLParserLexer.interp | 17 +- packages/ql/src/WebdaQLParserLexer.tokens | 94 +- packages/ql/src/WebdaQLParserLexer.ts | 527 ++- packages/ql/src/WebdaQLParserListener.ts | 781 ++-- packages/ql/src/WebdaQLParserParser.ts | 4080 ++++++++++++--------- packages/ql/src/WebdaQLParserVisitor.ts | 513 +-- packages/ql/src/query.ts | 16 +- 12 files changed, 3767 insertions(+), 3011 deletions(-) diff --git a/packages/ql/src/WebdaQLLexer.interp b/packages/ql/src/WebdaQLLexer.interp index ffd6388a2..fd0246f95 100644 --- a/packages/ql/src/WebdaQLLexer.interp +++ b/packages/ql/src/WebdaQLLexer.interp @@ -8,6 +8,11 @@ null '"' '[' ']' +'DELETE' +'UPDATE' +'SELECT' +'SET' +'WHERE' 'AND' 'OR' '=' @@ -43,6 +48,11 @@ SINGLE_QUOTE_SYMB DOUBLE_QUOTE_SYMB LR_SQ_BRACKET RR_SQ_BRACKET +DELETE +UPDATE +SELECT +SET +WHERE AND OR EQUAL @@ -83,6 +93,11 @@ DOUBLE_QUOTE_SYMB LR_SQ_BRACKET RR_SQ_BRACKET QUOTE_SYMB +DELETE +UPDATE +SELECT +SET +WHERE AND OR EQUAL @@ -116,4 +131,4 @@ mode names: DEFAULT_MODE atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 34, 251, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 3, 2, 6, 2, 81, 10, 2, 13, 2, 14, 2, 82, 3, 2, 3, 2, 3, 3, 6, 3, 88, 10, 3, 13, 3, 14, 3, 89, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 98, 10, 4, 12, 4, 14, 4, 101, 11, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 7, 5, 111, 10, 5, 12, 5, 14, 5, 114, 11, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 7, 7, 122, 10, 7, 12, 7, 14, 7, 125, 11, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 5, 15, 143, 10, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 6, 36, 231, 10, 36, 13, 36, 14, 36, 232, 3, 37, 6, 37, 236, 10, 37, 13, 37, 14, 37, 237, 3, 38, 6, 38, 241, 10, 38, 13, 38, 14, 38, 242, 3, 39, 3, 39, 7, 39, 247, 10, 39, 12, 39, 14, 39, 250, 11, 39, 2, 2, 2, 40, 3, 2, 3, 5, 2, 2, 7, 2, 2, 9, 2, 2, 11, 2, 2, 13, 2, 2, 15, 2, 4, 17, 2, 5, 19, 2, 6, 21, 2, 7, 23, 2, 8, 25, 2, 9, 27, 2, 10, 29, 2, 2, 31, 2, 11, 33, 2, 12, 35, 2, 13, 37, 2, 14, 39, 2, 15, 41, 2, 16, 43, 2, 17, 45, 2, 18, 47, 2, 19, 49, 2, 20, 51, 2, 21, 53, 2, 22, 55, 2, 23, 57, 2, 24, 59, 2, 25, 61, 2, 26, 63, 2, 27, 65, 2, 28, 67, 2, 29, 69, 2, 30, 71, 2, 31, 73, 2, 32, 75, 2, 33, 77, 2, 34, 3, 2, 11, 5, 2, 11, 12, 15, 15, 34, 34, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 50, 59, 3, 2, 67, 92, 4, 2, 67, 92, 97, 97, 4, 2, 67, 92, 99, 124, 7, 2, 48, 48, 50, 59, 67, 92, 97, 97, 99, 124, 2, 258, 2, 3, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 3, 80, 3, 2, 2, 2, 5, 87, 3, 2, 2, 2, 7, 91, 3, 2, 2, 2, 9, 104, 3, 2, 2, 2, 11, 117, 3, 2, 2, 2, 13, 119, 3, 2, 2, 2, 15, 126, 3, 2, 2, 2, 17, 128, 3, 2, 2, 2, 19, 130, 3, 2, 2, 2, 21, 132, 3, 2, 2, 2, 23, 134, 3, 2, 2, 2, 25, 136, 3, 2, 2, 2, 27, 138, 3, 2, 2, 2, 29, 142, 3, 2, 2, 2, 31, 144, 3, 2, 2, 2, 33, 148, 3, 2, 2, 2, 35, 151, 3, 2, 2, 2, 37, 153, 3, 2, 2, 2, 39, 156, 3, 2, 2, 2, 41, 158, 3, 2, 2, 2, 43, 161, 3, 2, 2, 2, 45, 163, 3, 2, 2, 2, 47, 166, 3, 2, 2, 2, 49, 171, 3, 2, 2, 2, 51, 174, 3, 2, 2, 2, 53, 183, 3, 2, 2, 2, 55, 188, 3, 2, 2, 2, 57, 194, 3, 2, 2, 2, 59, 200, 3, 2, 2, 2, 61, 207, 3, 2, 2, 2, 63, 216, 3, 2, 2, 2, 65, 220, 3, 2, 2, 2, 67, 225, 3, 2, 2, 2, 69, 227, 3, 2, 2, 2, 71, 230, 3, 2, 2, 2, 73, 235, 3, 2, 2, 2, 75, 240, 3, 2, 2, 2, 77, 244, 3, 2, 2, 2, 79, 81, 9, 2, 2, 2, 80, 79, 3, 2, 2, 2, 81, 82, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 82, 83, 3, 2, 2, 2, 83, 84, 3, 2, 2, 2, 84, 85, 8, 2, 2, 2, 85, 4, 3, 2, 2, 2, 86, 88, 9, 3, 2, 2, 87, 86, 3, 2, 2, 2, 88, 89, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 6, 3, 2, 2, 2, 91, 99, 7, 36, 2, 2, 92, 93, 7, 94, 2, 2, 93, 98, 11, 2, 2, 2, 94, 95, 7, 36, 2, 2, 95, 98, 7, 36, 2, 2, 96, 98, 10, 4, 2, 2, 97, 92, 3, 2, 2, 2, 97, 94, 3, 2, 2, 2, 97, 96, 3, 2, 2, 2, 98, 101, 3, 2, 2, 2, 99, 97, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 102, 3, 2, 2, 2, 101, 99, 3, 2, 2, 2, 102, 103, 7, 36, 2, 2, 103, 8, 3, 2, 2, 2, 104, 112, 7, 41, 2, 2, 105, 106, 7, 94, 2, 2, 106, 111, 11, 2, 2, 2, 107, 108, 7, 41, 2, 2, 108, 111, 7, 41, 2, 2, 109, 111, 10, 5, 2, 2, 110, 105, 3, 2, 2, 2, 110, 107, 3, 2, 2, 2, 110, 109, 3, 2, 2, 2, 111, 114, 3, 2, 2, 2, 112, 110, 3, 2, 2, 2, 112, 113, 3, 2, 2, 2, 113, 115, 3, 2, 2, 2, 114, 112, 3, 2, 2, 2, 115, 116, 7, 41, 2, 2, 116, 10, 3, 2, 2, 2, 117, 118, 9, 6, 2, 2, 118, 12, 3, 2, 2, 2, 119, 123, 9, 7, 2, 2, 120, 122, 9, 8, 2, 2, 121, 120, 3, 2, 2, 2, 122, 125, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 123, 124, 3, 2, 2, 2, 124, 14, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 126, 127, 7, 42, 2, 2, 127, 16, 3, 2, 2, 2, 128, 129, 7, 43, 2, 2, 129, 18, 3, 2, 2, 2, 130, 131, 7, 46, 2, 2, 131, 20, 3, 2, 2, 2, 132, 133, 7, 41, 2, 2, 133, 22, 3, 2, 2, 2, 134, 135, 7, 36, 2, 2, 135, 24, 3, 2, 2, 2, 136, 137, 7, 93, 2, 2, 137, 26, 3, 2, 2, 2, 138, 139, 7, 95, 2, 2, 139, 28, 3, 2, 2, 2, 140, 143, 5, 21, 11, 2, 141, 143, 5, 23, 12, 2, 142, 140, 3, 2, 2, 2, 142, 141, 3, 2, 2, 2, 143, 30, 3, 2, 2, 2, 144, 145, 7, 67, 2, 2, 145, 146, 7, 80, 2, 2, 146, 147, 7, 70, 2, 2, 147, 32, 3, 2, 2, 2, 148, 149, 7, 81, 2, 2, 149, 150, 7, 84, 2, 2, 150, 34, 3, 2, 2, 2, 151, 152, 7, 63, 2, 2, 152, 36, 3, 2, 2, 2, 153, 154, 7, 35, 2, 2, 154, 155, 7, 63, 2, 2, 155, 38, 3, 2, 2, 2, 156, 157, 7, 64, 2, 2, 157, 40, 3, 2, 2, 2, 158, 159, 7, 64, 2, 2, 159, 160, 7, 63, 2, 2, 160, 42, 3, 2, 2, 2, 161, 162, 7, 62, 2, 2, 162, 44, 3, 2, 2, 2, 163, 164, 7, 62, 2, 2, 164, 165, 7, 63, 2, 2, 165, 46, 3, 2, 2, 2, 166, 167, 7, 78, 2, 2, 167, 168, 7, 75, 2, 2, 168, 169, 7, 77, 2, 2, 169, 170, 7, 71, 2, 2, 170, 48, 3, 2, 2, 2, 171, 172, 7, 75, 2, 2, 172, 173, 7, 80, 2, 2, 173, 50, 3, 2, 2, 2, 174, 175, 7, 69, 2, 2, 175, 176, 7, 81, 2, 2, 176, 177, 7, 80, 2, 2, 177, 178, 7, 86, 2, 2, 178, 179, 7, 67, 2, 2, 179, 180, 7, 75, 2, 2, 180, 181, 7, 80, 2, 2, 181, 182, 7, 85, 2, 2, 182, 52, 3, 2, 2, 2, 183, 184, 7, 86, 2, 2, 184, 185, 7, 84, 2, 2, 185, 186, 7, 87, 2, 2, 186, 187, 7, 71, 2, 2, 187, 54, 3, 2, 2, 2, 188, 189, 7, 72, 2, 2, 189, 190, 7, 67, 2, 2, 190, 191, 7, 78, 2, 2, 191, 192, 7, 85, 2, 2, 192, 193, 7, 71, 2, 2, 193, 56, 3, 2, 2, 2, 194, 195, 7, 78, 2, 2, 195, 196, 7, 75, 2, 2, 196, 197, 7, 79, 2, 2, 197, 198, 7, 75, 2, 2, 198, 199, 7, 86, 2, 2, 199, 58, 3, 2, 2, 2, 200, 201, 7, 81, 2, 2, 201, 202, 7, 72, 2, 2, 202, 203, 7, 72, 2, 2, 203, 204, 7, 85, 2, 2, 204, 205, 7, 71, 2, 2, 205, 206, 7, 86, 2, 2, 206, 60, 3, 2, 2, 2, 207, 208, 7, 81, 2, 2, 208, 209, 7, 84, 2, 2, 209, 210, 7, 70, 2, 2, 210, 211, 7, 71, 2, 2, 211, 212, 7, 84, 2, 2, 212, 213, 7, 34, 2, 2, 213, 214, 7, 68, 2, 2, 214, 215, 7, 91, 2, 2, 215, 62, 3, 2, 2, 2, 216, 217, 7, 67, 2, 2, 217, 218, 7, 85, 2, 2, 218, 219, 7, 69, 2, 2, 219, 64, 3, 2, 2, 2, 220, 221, 7, 70, 2, 2, 221, 222, 7, 71, 2, 2, 222, 223, 7, 85, 2, 2, 223, 224, 7, 69, 2, 2, 224, 66, 3, 2, 2, 2, 225, 226, 5, 7, 4, 2, 226, 68, 3, 2, 2, 2, 227, 228, 5, 9, 5, 2, 228, 70, 3, 2, 2, 2, 229, 231, 5, 11, 6, 2, 230, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 230, 3, 2, 2, 2, 232, 233, 3, 2, 2, 2, 233, 72, 3, 2, 2, 2, 234, 236, 9, 9, 2, 2, 235, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 74, 3, 2, 2, 2, 239, 241, 9, 10, 2, 2, 240, 239, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 76, 3, 2, 2, 2, 244, 248, 9, 7, 2, 2, 245, 247, 9, 8, 2, 2, 246, 245, 3, 2, 2, 2, 247, 250, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 78, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 15, 2, 82, 89, 97, 99, 110, 112, 123, 142, 232, 237, 242, 248, 3, 8, 2, 2] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 39, 292, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 3, 2, 6, 2, 91, 10, 2, 13, 2, 14, 2, 92, 3, 2, 3, 2, 3, 3, 6, 3, 98, 10, 3, 13, 3, 14, 3, 99, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 108, 10, 4, 12, 4, 14, 4, 111, 11, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 7, 5, 121, 10, 5, 12, 5, 14, 5, 124, 11, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 7, 7, 132, 10, 7, 12, 7, 14, 7, 135, 11, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 5, 15, 153, 10, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 6, 41, 272, 10, 41, 13, 41, 14, 41, 273, 3, 42, 6, 42, 277, 10, 42, 13, 42, 14, 42, 278, 3, 43, 6, 43, 282, 10, 43, 13, 43, 14, 43, 283, 3, 44, 3, 44, 7, 44, 288, 10, 44, 12, 44, 14, 44, 291, 11, 44, 2, 2, 2, 45, 3, 2, 3, 5, 2, 2, 7, 2, 2, 9, 2, 2, 11, 2, 2, 13, 2, 2, 15, 2, 4, 17, 2, 5, 19, 2, 6, 21, 2, 7, 23, 2, 8, 25, 2, 9, 27, 2, 10, 29, 2, 2, 31, 2, 11, 33, 2, 12, 35, 2, 13, 37, 2, 14, 39, 2, 15, 41, 2, 16, 43, 2, 17, 45, 2, 18, 47, 2, 19, 49, 2, 20, 51, 2, 21, 53, 2, 22, 55, 2, 23, 57, 2, 24, 59, 2, 25, 61, 2, 26, 63, 2, 27, 65, 2, 28, 67, 2, 29, 69, 2, 30, 71, 2, 31, 73, 2, 32, 75, 2, 33, 77, 2, 34, 79, 2, 35, 81, 2, 36, 83, 2, 37, 85, 2, 38, 87, 2, 39, 3, 2, 11, 5, 2, 11, 12, 15, 15, 34, 34, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 50, 59, 3, 2, 67, 92, 4, 2, 67, 92, 97, 97, 4, 2, 67, 92, 99, 124, 7, 2, 48, 48, 50, 59, 67, 92, 97, 97, 99, 124, 2, 299, 2, 3, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 3, 90, 3, 2, 2, 2, 5, 97, 3, 2, 2, 2, 7, 101, 3, 2, 2, 2, 9, 114, 3, 2, 2, 2, 11, 127, 3, 2, 2, 2, 13, 129, 3, 2, 2, 2, 15, 136, 3, 2, 2, 2, 17, 138, 3, 2, 2, 2, 19, 140, 3, 2, 2, 2, 21, 142, 3, 2, 2, 2, 23, 144, 3, 2, 2, 2, 25, 146, 3, 2, 2, 2, 27, 148, 3, 2, 2, 2, 29, 152, 3, 2, 2, 2, 31, 154, 3, 2, 2, 2, 33, 161, 3, 2, 2, 2, 35, 168, 3, 2, 2, 2, 37, 175, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 185, 3, 2, 2, 2, 43, 189, 3, 2, 2, 2, 45, 192, 3, 2, 2, 2, 47, 194, 3, 2, 2, 2, 49, 197, 3, 2, 2, 2, 51, 199, 3, 2, 2, 2, 53, 202, 3, 2, 2, 2, 55, 204, 3, 2, 2, 2, 57, 207, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 215, 3, 2, 2, 2, 63, 224, 3, 2, 2, 2, 65, 229, 3, 2, 2, 2, 67, 235, 3, 2, 2, 2, 69, 241, 3, 2, 2, 2, 71, 248, 3, 2, 2, 2, 73, 257, 3, 2, 2, 2, 75, 261, 3, 2, 2, 2, 77, 266, 3, 2, 2, 2, 79, 268, 3, 2, 2, 2, 81, 271, 3, 2, 2, 2, 83, 276, 3, 2, 2, 2, 85, 281, 3, 2, 2, 2, 87, 285, 3, 2, 2, 2, 89, 91, 9, 2, 2, 2, 90, 89, 3, 2, 2, 2, 91, 92, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 92, 93, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 95, 8, 2, 2, 2, 95, 4, 3, 2, 2, 2, 96, 98, 9, 3, 2, 2, 97, 96, 3, 2, 2, 2, 98, 99, 3, 2, 2, 2, 99, 97, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 6, 3, 2, 2, 2, 101, 109, 7, 36, 2, 2, 102, 103, 7, 94, 2, 2, 103, 108, 11, 2, 2, 2, 104, 105, 7, 36, 2, 2, 105, 108, 7, 36, 2, 2, 106, 108, 10, 4, 2, 2, 107, 102, 3, 2, 2, 2, 107, 104, 3, 2, 2, 2, 107, 106, 3, 2, 2, 2, 108, 111, 3, 2, 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 112, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 112, 113, 7, 36, 2, 2, 113, 8, 3, 2, 2, 2, 114, 122, 7, 41, 2, 2, 115, 116, 7, 94, 2, 2, 116, 121, 11, 2, 2, 2, 117, 118, 7, 41, 2, 2, 118, 121, 7, 41, 2, 2, 119, 121, 10, 5, 2, 2, 120, 115, 3, 2, 2, 2, 120, 117, 3, 2, 2, 2, 120, 119, 3, 2, 2, 2, 121, 124, 3, 2, 2, 2, 122, 120, 3, 2, 2, 2, 122, 123, 3, 2, 2, 2, 123, 125, 3, 2, 2, 2, 124, 122, 3, 2, 2, 2, 125, 126, 7, 41, 2, 2, 126, 10, 3, 2, 2, 2, 127, 128, 9, 6, 2, 2, 128, 12, 3, 2, 2, 2, 129, 133, 9, 7, 2, 2, 130, 132, 9, 8, 2, 2, 131, 130, 3, 2, 2, 2, 132, 135, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 14, 3, 2, 2, 2, 135, 133, 3, 2, 2, 2, 136, 137, 7, 42, 2, 2, 137, 16, 3, 2, 2, 2, 138, 139, 7, 43, 2, 2, 139, 18, 3, 2, 2, 2, 140, 141, 7, 46, 2, 2, 141, 20, 3, 2, 2, 2, 142, 143, 7, 41, 2, 2, 143, 22, 3, 2, 2, 2, 144, 145, 7, 36, 2, 2, 145, 24, 3, 2, 2, 2, 146, 147, 7, 93, 2, 2, 147, 26, 3, 2, 2, 2, 148, 149, 7, 95, 2, 2, 149, 28, 3, 2, 2, 2, 150, 153, 5, 21, 11, 2, 151, 153, 5, 23, 12, 2, 152, 150, 3, 2, 2, 2, 152, 151, 3, 2, 2, 2, 153, 30, 3, 2, 2, 2, 154, 155, 7, 70, 2, 2, 155, 156, 7, 71, 2, 2, 156, 157, 7, 78, 2, 2, 157, 158, 7, 71, 2, 2, 158, 159, 7, 86, 2, 2, 159, 160, 7, 71, 2, 2, 160, 32, 3, 2, 2, 2, 161, 162, 7, 87, 2, 2, 162, 163, 7, 82, 2, 2, 163, 164, 7, 70, 2, 2, 164, 165, 7, 67, 2, 2, 165, 166, 7, 86, 2, 2, 166, 167, 7, 71, 2, 2, 167, 34, 3, 2, 2, 2, 168, 169, 7, 85, 2, 2, 169, 170, 7, 71, 2, 2, 170, 171, 7, 78, 2, 2, 171, 172, 7, 71, 2, 2, 172, 173, 7, 69, 2, 2, 173, 174, 7, 86, 2, 2, 174, 36, 3, 2, 2, 2, 175, 176, 7, 85, 2, 2, 176, 177, 7, 71, 2, 2, 177, 178, 7, 86, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 89, 2, 2, 180, 181, 7, 74, 2, 2, 181, 182, 7, 71, 2, 2, 182, 183, 7, 84, 2, 2, 183, 184, 7, 71, 2, 2, 184, 40, 3, 2, 2, 2, 185, 186, 7, 67, 2, 2, 186, 187, 7, 80, 2, 2, 187, 188, 7, 70, 2, 2, 188, 42, 3, 2, 2, 2, 189, 190, 7, 81, 2, 2, 190, 191, 7, 84, 2, 2, 191, 44, 3, 2, 2, 2, 192, 193, 7, 63, 2, 2, 193, 46, 3, 2, 2, 2, 194, 195, 7, 35, 2, 2, 195, 196, 7, 63, 2, 2, 196, 48, 3, 2, 2, 2, 197, 198, 7, 64, 2, 2, 198, 50, 3, 2, 2, 2, 199, 200, 7, 64, 2, 2, 200, 201, 7, 63, 2, 2, 201, 52, 3, 2, 2, 2, 202, 203, 7, 62, 2, 2, 203, 54, 3, 2, 2, 2, 204, 205, 7, 62, 2, 2, 205, 206, 7, 63, 2, 2, 206, 56, 3, 2, 2, 2, 207, 208, 7, 78, 2, 2, 208, 209, 7, 75, 2, 2, 209, 210, 7, 77, 2, 2, 210, 211, 7, 71, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 75, 2, 2, 213, 214, 7, 80, 2, 2, 214, 60, 3, 2, 2, 2, 215, 216, 7, 69, 2, 2, 216, 217, 7, 81, 2, 2, 217, 218, 7, 80, 2, 2, 218, 219, 7, 86, 2, 2, 219, 220, 7, 67, 2, 2, 220, 221, 7, 75, 2, 2, 221, 222, 7, 80, 2, 2, 222, 223, 7, 85, 2, 2, 223, 62, 3, 2, 2, 2, 224, 225, 7, 86, 2, 2, 225, 226, 7, 84, 2, 2, 226, 227, 7, 87, 2, 2, 227, 228, 7, 71, 2, 2, 228, 64, 3, 2, 2, 2, 229, 230, 7, 72, 2, 2, 230, 231, 7, 67, 2, 2, 231, 232, 7, 78, 2, 2, 232, 233, 7, 85, 2, 2, 233, 234, 7, 71, 2, 2, 234, 66, 3, 2, 2, 2, 235, 236, 7, 78, 2, 2, 236, 237, 7, 75, 2, 2, 237, 238, 7, 79, 2, 2, 238, 239, 7, 75, 2, 2, 239, 240, 7, 86, 2, 2, 240, 68, 3, 2, 2, 2, 241, 242, 7, 81, 2, 2, 242, 243, 7, 72, 2, 2, 243, 244, 7, 72, 2, 2, 244, 245, 7, 85, 2, 2, 245, 246, 7, 71, 2, 2, 246, 247, 7, 86, 2, 2, 247, 70, 3, 2, 2, 2, 248, 249, 7, 81, 2, 2, 249, 250, 7, 84, 2, 2, 250, 251, 7, 70, 2, 2, 251, 252, 7, 71, 2, 2, 252, 253, 7, 84, 2, 2, 253, 254, 7, 34, 2, 2, 254, 255, 7, 68, 2, 2, 255, 256, 7, 91, 2, 2, 256, 72, 3, 2, 2, 2, 257, 258, 7, 67, 2, 2, 258, 259, 7, 85, 2, 2, 259, 260, 7, 69, 2, 2, 260, 74, 3, 2, 2, 2, 261, 262, 7, 70, 2, 2, 262, 263, 7, 71, 2, 2, 263, 264, 7, 85, 2, 2, 264, 265, 7, 69, 2, 2, 265, 76, 3, 2, 2, 2, 266, 267, 5, 7, 4, 2, 267, 78, 3, 2, 2, 2, 268, 269, 5, 9, 5, 2, 269, 80, 3, 2, 2, 2, 270, 272, 5, 11, 6, 2, 271, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 82, 3, 2, 2, 2, 275, 277, 9, 9, 2, 2, 276, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 84, 3, 2, 2, 2, 280, 282, 9, 10, 2, 2, 281, 280, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 86, 3, 2, 2, 2, 285, 289, 9, 7, 2, 2, 286, 288, 9, 8, 2, 2, 287, 286, 3, 2, 2, 2, 288, 291, 3, 2, 2, 2, 289, 287, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 88, 3, 2, 2, 2, 291, 289, 3, 2, 2, 2, 15, 2, 92, 99, 107, 109, 120, 122, 133, 152, 273, 278, 283, 289, 3, 8, 2, 2] \ No newline at end of file diff --git a/packages/ql/src/WebdaQLLexer.tokens b/packages/ql/src/WebdaQLLexer.tokens index d6427881e..cf8a82415 100644 --- a/packages/ql/src/WebdaQLLexer.tokens +++ b/packages/ql/src/WebdaQLLexer.tokens @@ -6,30 +6,35 @@ SINGLE_QUOTE_SYMB=5 DOUBLE_QUOTE_SYMB=6 LR_SQ_BRACKET=7 RR_SQ_BRACKET=8 -AND=9 -OR=10 -EQUAL=11 -NOT_EQUAL=12 -GREATER=13 -GREATER_OR_EQUAL=14 -LESS=15 -LESS_OR_EQUAL=16 -LIKE=17 -IN=18 -CONTAINS=19 -TRUE=20 -FALSE=21 -LIMIT=22 -OFFSET=23 -ORDER_BY=24 -ASC=25 -DESC=26 -DQUOTED_STRING_LITERAL=27 -SQUOTED_STRING_LITERAL=28 -INTEGER_LITERAL=29 -IDENTIFIER=30 -IDENTIFIER_WITH_NUMBER=31 -FUNCTION_IDENTIFIER_WITH_UNDERSCORE=32 +DELETE=9 +UPDATE=10 +SELECT=11 +SET=12 +WHERE=13 +AND=14 +OR=15 +EQUAL=16 +NOT_EQUAL=17 +GREATER=18 +GREATER_OR_EQUAL=19 +LESS=20 +LESS_OR_EQUAL=21 +LIKE=22 +IN=23 +CONTAINS=24 +TRUE=25 +FALSE=26 +LIMIT=27 +OFFSET=28 +ORDER_BY=29 +ASC=30 +DESC=31 +DQUOTED_STRING_LITERAL=32 +SQUOTED_STRING_LITERAL=33 +INTEGER_LITERAL=34 +IDENTIFIER=35 +IDENTIFIER_WITH_NUMBER=36 +FUNCTION_IDENTIFIER_WITH_UNDERSCORE=37 '('=2 ')'=3 ','=4 @@ -37,21 +42,26 @@ FUNCTION_IDENTIFIER_WITH_UNDERSCORE=32 '"'=6 '['=7 ']'=8 -'AND'=9 -'OR'=10 -'='=11 -'!='=12 -'>'=13 -'>='=14 -'<'=15 -'<='=16 -'LIKE'=17 -'IN'=18 -'CONTAINS'=19 -'TRUE'=20 -'FALSE'=21 -'LIMIT'=22 -'OFFSET'=23 -'ORDER BY'=24 -'ASC'=25 -'DESC'=26 +'DELETE'=9 +'UPDATE'=10 +'SELECT'=11 +'SET'=12 +'WHERE'=13 +'AND'=14 +'OR'=15 +'='=16 +'!='=17 +'>'=18 +'>='=19 +'<'=20 +'<='=21 +'LIKE'=22 +'IN'=23 +'CONTAINS'=24 +'TRUE'=25 +'FALSE'=26 +'LIMIT'=27 +'OFFSET'=28 +'ORDER BY'=29 +'ASC'=30 +'DESC'=31 diff --git a/packages/ql/src/WebdaQLLexer.ts b/packages/ql/src/WebdaQLLexer.ts index 19b30bcf6..9f369a817 100644 --- a/packages/ql/src/WebdaQLLexer.ts +++ b/packages/ql/src/WebdaQLLexer.ts @@ -1,4 +1,5 @@ -// Generated from src/stores/webdaql/WebdaQLLexer.g4 by ANTLR 4.9.0-SNAPSHOT +// Generated from src/WebdaQLLexer.g4 by ANTLR 4.9.0-SNAPSHOT + import { ATN } from "antlr4ts/atn/ATN.js"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer.js"; @@ -10,310 +11,248 @@ import { VocabularyImpl } from "antlr4ts/VocabularyImpl.js"; import * as Utils from "antlr4ts/misc/Utils.js"; + export class WebdaQLLexer extends Lexer { - public static readonly SPACE = 1; - public static readonly LR_BRACKET = 2; - public static readonly RR_BRACKET = 3; - public static readonly COMMA = 4; - public static readonly SINGLE_QUOTE_SYMB = 5; - public static readonly DOUBLE_QUOTE_SYMB = 6; - public static readonly LR_SQ_BRACKET = 7; - public static readonly RR_SQ_BRACKET = 8; - public static readonly AND = 9; - public static readonly OR = 10; - public static readonly EQUAL = 11; - public static readonly NOT_EQUAL = 12; - public static readonly GREATER = 13; - public static readonly GREATER_OR_EQUAL = 14; - public static readonly LESS = 15; - public static readonly LESS_OR_EQUAL = 16; - public static readonly LIKE = 17; - public static readonly IN = 18; - public static readonly CONTAINS = 19; - public static readonly TRUE = 20; - public static readonly FALSE = 21; - public static readonly LIMIT = 22; - public static readonly OFFSET = 23; - public static readonly ORDER_BY = 24; - public static readonly ASC = 25; - public static readonly DESC = 26; - public static readonly DQUOTED_STRING_LITERAL = 27; - public static readonly SQUOTED_STRING_LITERAL = 28; - public static readonly INTEGER_LITERAL = 29; - public static readonly IDENTIFIER = 30; - public static readonly IDENTIFIER_WITH_NUMBER = 31; - public static readonly FUNCTION_IDENTIFIER_WITH_UNDERSCORE = 32; + public static readonly SPACE = 1; + public static readonly LR_BRACKET = 2; + public static readonly RR_BRACKET = 3; + public static readonly COMMA = 4; + public static readonly SINGLE_QUOTE_SYMB = 5; + public static readonly DOUBLE_QUOTE_SYMB = 6; + public static readonly LR_SQ_BRACKET = 7; + public static readonly RR_SQ_BRACKET = 8; + public static readonly DELETE = 9; + public static readonly UPDATE = 10; + public static readonly SELECT = 11; + public static readonly SET = 12; + public static readonly WHERE = 13; + public static readonly AND = 14; + public static readonly OR = 15; + public static readonly EQUAL = 16; + public static readonly NOT_EQUAL = 17; + public static readonly GREATER = 18; + public static readonly GREATER_OR_EQUAL = 19; + public static readonly LESS = 20; + public static readonly LESS_OR_EQUAL = 21; + public static readonly LIKE = 22; + public static readonly IN = 23; + public static readonly CONTAINS = 24; + public static readonly TRUE = 25; + public static readonly FALSE = 26; + public static readonly LIMIT = 27; + public static readonly OFFSET = 28; + public static readonly ORDER_BY = 29; + public static readonly ASC = 30; + public static readonly DESC = 31; + public static readonly DQUOTED_STRING_LITERAL = 32; + public static readonly SQUOTED_STRING_LITERAL = 33; + public static readonly INTEGER_LITERAL = 34; + public static readonly IDENTIFIER = 35; + public static readonly IDENTIFIER_WITH_NUMBER = 36; + public static readonly FUNCTION_IDENTIFIER_WITH_UNDERSCORE = 37; + + // tslint:disable:no-trailing-whitespace + public static readonly channelNames: string[] = [ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN", + ]; - // tslint:disable:no-trailing-whitespace - public static readonly channelNames: string[] = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN"]; + // tslint:disable:no-trailing-whitespace + public static readonly modeNames: string[] = [ + "DEFAULT_MODE", + ]; - // tslint:disable:no-trailing-whitespace - public static readonly modeNames: string[] = ["DEFAULT_MODE"]; + public static readonly ruleNames: string[] = [ + "SPACE", "ID_LITERAL", "DQUOTA_STRING", "SQUOTA_STRING", "INT_DIGIT", + "FN_LITERAL", "LR_BRACKET", "RR_BRACKET", "COMMA", "SINGLE_QUOTE_SYMB", + "DOUBLE_QUOTE_SYMB", "LR_SQ_BRACKET", "RR_SQ_BRACKET", "QUOTE_SYMB", "DELETE", + "UPDATE", "SELECT", "SET", "WHERE", "AND", "OR", "EQUAL", "NOT_EQUAL", + "GREATER", "GREATER_OR_EQUAL", "LESS", "LESS_OR_EQUAL", "LIKE", "IN", + "CONTAINS", "TRUE", "FALSE", "LIMIT", "OFFSET", "ORDER_BY", "ASC", "DESC", + "DQUOTED_STRING_LITERAL", "SQUOTED_STRING_LITERAL", "INTEGER_LITERAL", + "IDENTIFIER", "IDENTIFIER_WITH_NUMBER", "FUNCTION_IDENTIFIER_WITH_UNDERSCORE", + ]; - public static readonly ruleNames: string[] = [ - "SPACE", - "ID_LITERAL", - "DQUOTA_STRING", - "SQUOTA_STRING", - "INT_DIGIT", - "FN_LITERAL", - "LR_BRACKET", - "RR_BRACKET", - "COMMA", - "SINGLE_QUOTE_SYMB", - "DOUBLE_QUOTE_SYMB", - "LR_SQ_BRACKET", - "RR_SQ_BRACKET", - "QUOTE_SYMB", - "AND", - "OR", - "EQUAL", - "NOT_EQUAL", - "GREATER", - "GREATER_OR_EQUAL", - "LESS", - "LESS_OR_EQUAL", - "LIKE", - "IN", - "CONTAINS", - "TRUE", - "FALSE", - "LIMIT", - "OFFSET", - "ORDER_BY", - "ASC", - "DESC", - "DQUOTED_STRING_LITERAL", - "SQUOTED_STRING_LITERAL", - "INTEGER_LITERAL", - "IDENTIFIER", - "IDENTIFIER_WITH_NUMBER", - "FUNCTION_IDENTIFIER_WITH_UNDERSCORE" - ]; + private static readonly _LITERAL_NAMES: Array = [ + undefined, undefined, "'('", "')'", "','", "'''", "'\"'", "'['", "']'", + "'DELETE'", "'UPDATE'", "'SELECT'", "'SET'", "'WHERE'", "'AND'", "'OR'", + "'='", "'!='", "'>'", "'>='", "'<'", "'<='", "'LIKE'", "'IN'", "'CONTAINS'", + "'TRUE'", "'FALSE'", "'LIMIT'", "'OFFSET'", "'ORDER BY'", "'ASC'", "'DESC'", + ]; + private static readonly _SYMBOLIC_NAMES: Array = [ + undefined, "SPACE", "LR_BRACKET", "RR_BRACKET", "COMMA", "SINGLE_QUOTE_SYMB", + "DOUBLE_QUOTE_SYMB", "LR_SQ_BRACKET", "RR_SQ_BRACKET", "DELETE", "UPDATE", + "SELECT", "SET", "WHERE", "AND", "OR", "EQUAL", "NOT_EQUAL", "GREATER", + "GREATER_OR_EQUAL", "LESS", "LESS_OR_EQUAL", "LIKE", "IN", "CONTAINS", + "TRUE", "FALSE", "LIMIT", "OFFSET", "ORDER_BY", "ASC", "DESC", "DQUOTED_STRING_LITERAL", + "SQUOTED_STRING_LITERAL", "INTEGER_LITERAL", "IDENTIFIER", "IDENTIFIER_WITH_NUMBER", + "FUNCTION_IDENTIFIER_WITH_UNDERSCORE", + ]; + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(WebdaQLLexer._LITERAL_NAMES, WebdaQLLexer._SYMBOLIC_NAMES, []); - private static readonly _LITERAL_NAMES: Array = [ - undefined, - undefined, - "'('", - "')'", - "','", - "'''", - "'\"'", - "'['", - "']'", - "'AND'", - "'OR'", - "'='", - "'!='", - "'>'", - "'>='", - "'<'", - "'<='", - "'LIKE'", - "'IN'", - "'CONTAINS'", - "'TRUE'", - "'FALSE'", - "'LIMIT'", - "'OFFSET'", - "'ORDER BY'", - "'ASC'", - "'DESC'" - ]; - private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, - "SPACE", - "LR_BRACKET", - "RR_BRACKET", - "COMMA", - "SINGLE_QUOTE_SYMB", - "DOUBLE_QUOTE_SYMB", - "LR_SQ_BRACKET", - "RR_SQ_BRACKET", - "AND", - "OR", - "EQUAL", - "NOT_EQUAL", - "GREATER", - "GREATER_OR_EQUAL", - "LESS", - "LESS_OR_EQUAL", - "LIKE", - "IN", - "CONTAINS", - "TRUE", - "FALSE", - "LIMIT", - "OFFSET", - "ORDER_BY", - "ASC", - "DESC", - "DQUOTED_STRING_LITERAL", - "SQUOTED_STRING_LITERAL", - "INTEGER_LITERAL", - "IDENTIFIER", - "IDENTIFIER_WITH_NUMBER", - "FUNCTION_IDENTIFIER_WITH_UNDERSCORE" - ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( - WebdaQLLexer._LITERAL_NAMES, - WebdaQLLexer._SYMBOLIC_NAMES, - [] - ); + // @Override + // @NotNull + public get vocabulary(): Vocabulary { + return WebdaQLLexer.VOCABULARY; + } + // tslint:enable:no-trailing-whitespace - // @Override - // @NotNull - public get vocabulary(): Vocabulary { - return WebdaQLLexer.VOCABULARY; - } - // tslint:enable:no-trailing-whitespace - constructor(input: CharStream) { - super(input); - this._interp = new LexerATNSimulator(WebdaQLLexer._ATN, this); - } + constructor(input: CharStream) { + super(input); + this._interp = new LexerATNSimulator(WebdaQLLexer._ATN, this); + } - // @Override - public get grammarFileName(): string { - return "WebdaQLLexer.g4"; - } + // @Override + public get grammarFileName(): string { return "WebdaQLLexer.g4"; } - // @Override - public get ruleNames(): string[] { - return WebdaQLLexer.ruleNames; - } + // @Override + public get ruleNames(): string[] { return WebdaQLLexer.ruleNames; } - // @Override - public get serializedATN(): string { - return WebdaQLLexer._serializedATN; - } + // @Override + public get serializedATN(): string { return WebdaQLLexer._serializedATN; } - // @Override - public get channelNames(): string[] { - return WebdaQLLexer.channelNames; - } + // @Override + public get channelNames(): string[] { return WebdaQLLexer.channelNames; } - // @Override - public get modeNames(): string[] { - return WebdaQLLexer.modeNames; - } + // @Override + public get modeNames(): string[] { return WebdaQLLexer.modeNames; } - public static readonly _serializedATN: string = - '\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02"\xFB\b\x01\x04' + - "\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04" + - "\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r" + - "\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12" + - "\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17" + - "\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t\x1C" + - '\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04"\t"\x04' + - "#\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x03\x02\x06\x02Q\n\x02\r\x02\x0E" + - "\x02R\x03\x02\x03\x02\x03\x03\x06\x03X\n\x03\r\x03\x0E\x03Y\x03\x04\x03" + - "\x04\x03\x04\x03\x04\x03\x04\x03\x04\x07\x04b\n\x04\f\x04\x0E\x04e\v\x04" + - "\x03\x04\x03\x04\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x07\x05" + - "o\n\x05\f\x05\x0E\x05r\v\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03\x07\x03" + - "\x07\x07\x07z\n\x07\f\x07\x0E\x07}\v\x07\x03\b\x03\b\x03\t\x03\t\x03\n" + - "\x03\n\x03\v\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0F\x03" + - "\x0F\x05\x0F\x8F\n\x0F\x03\x10\x03\x10\x03\x10\x03\x10\x03\x11\x03\x11" + - "\x03\x11\x03\x12\x03\x12\x03\x13\x03\x13\x03\x13\x03\x14\x03\x14\x03\x15" + - "\x03\x15\x03\x15\x03\x16\x03\x16\x03\x17\x03\x17\x03\x17\x03\x18\x03\x18" + - "\x03\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A" + - "\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1B" + - "\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1D" + - "\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03\x1E" + - "\x03\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F" + - "\x03\x1F\x03\x1F\x03\x1F\x03 \x03 \x03 \x03 \x03!\x03!\x03!\x03!\x03!" + - '\x03"\x03"\x03#\x03#\x03$\x06$\xE7\n$\r$\x0E$\xE8\x03%\x06%\xEC\n%\r' + - "%\x0E%\xED\x03&\x06&\xF1\n&\r&\x0E&\xF2\x03'\x03'\x07'\xF7\n'\f'" + - "\x0E'\xFA\v'\x02\x02\x02(\x03\x02\x03\x05\x02\x02\x07\x02\x02\t\x02" + - "\x02\v\x02\x02\r\x02\x02\x0F\x02\x04\x11\x02\x05\x13\x02\x06\x15\x02\x07" + - "\x17\x02\b\x19\x02\t\x1B\x02\n\x1D\x02\x02\x1F\x02\v!\x02\f#\x02\r%\x02" + - "\x0E'\x02\x0F)\x02\x10+\x02\x11-\x02\x12/\x02\x131\x02\x143\x02\x155" + - "\x02\x167\x02\x179\x02\x18;\x02\x19=\x02\x1A?\x02\x1BA\x02\x1CC\x02\x1D" + - 'E\x02\x1EG\x02\x1FI\x02 K\x02!M\x02"\x03\x02\v\x05\x02\v\f\x0F\x0F"' + - '"\x05\x022;C\\c|\x04\x02$$^^\x04\x02))^^\x03\x022;\x03\x02C\\\x04\x02' + - "C\\aa\x04\x02C\\c|\x07\x02002;C\\aac|\x02\u0102\x02\x03\x03\x02\x02\x02" + - "\x02\x0F\x03\x02\x02\x02\x02\x11\x03\x02\x02\x02\x02\x13\x03\x02\x02\x02" + - "\x02\x15\x03\x02\x02\x02\x02\x17\x03\x02\x02\x02\x02\x19\x03\x02\x02\x02" + - "\x02\x1B\x03\x02\x02\x02\x02\x1F\x03\x02\x02\x02\x02!\x03\x02\x02\x02" + - "\x02#\x03\x02\x02\x02\x02%\x03\x02\x02\x02\x02'\x03\x02\x02\x02\x02)" + - "\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02-\x03\x02\x02\x02\x02/\x03\x02" + - "\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02\x02\x02\x025\x03\x02\x02\x02" + - "\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02\x02;\x03\x02\x02\x02\x02=\x03" + - "\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03\x02\x02\x02\x02C\x03\x02\x02" + - "\x02\x02E\x03\x02\x02\x02\x02G\x03\x02\x02\x02\x02I\x03\x02\x02\x02\x02" + - "K\x03\x02\x02\x02\x02M\x03\x02\x02\x02\x03P\x03\x02\x02\x02\x05W\x03\x02" + - "\x02\x02\x07[\x03\x02\x02\x02\th\x03\x02\x02\x02\vu\x03\x02\x02\x02\r" + - "w\x03\x02\x02\x02\x0F~\x03\x02\x02\x02\x11\x80\x03\x02\x02\x02\x13\x82" + - "\x03\x02\x02\x02\x15\x84\x03\x02\x02\x02\x17\x86\x03\x02\x02\x02\x19\x88" + - "\x03\x02\x02\x02\x1B\x8A\x03\x02\x02\x02\x1D\x8E\x03\x02\x02\x02\x1F\x90" + - "\x03\x02\x02\x02!\x94\x03\x02\x02\x02#\x97\x03\x02\x02\x02%\x99\x03\x02" + - "\x02\x02'\x9C\x03\x02\x02\x02)\x9E\x03\x02\x02\x02+\xA1\x03\x02\x02\x02" + - "-\xA3\x03\x02\x02\x02/\xA6\x03\x02\x02\x021\xAB\x03\x02\x02\x023\xAE\x03" + - "\x02\x02\x025\xB7\x03\x02\x02\x027\xBC\x03\x02\x02\x029\xC2\x03\x02\x02" + - "\x02;\xC8\x03\x02\x02\x02=\xCF\x03\x02\x02\x02?\xD8\x03\x02\x02\x02A\xDC" + - "\x03\x02\x02\x02C\xE1\x03\x02\x02\x02E\xE3\x03\x02\x02\x02G\xE6\x03\x02" + - "\x02\x02I\xEB\x03\x02\x02\x02K\xF0\x03\x02\x02\x02M\xF4\x03\x02\x02\x02" + - "OQ\t\x02\x02\x02PO\x03\x02\x02\x02QR\x03\x02\x02\x02RP\x03\x02\x02\x02" + - "RS\x03\x02\x02\x02ST\x03\x02\x02\x02TU\b\x02\x02\x02U\x04\x03\x02\x02" + - "\x02VX\t\x03\x02\x02WV\x03\x02\x02\x02XY\x03\x02\x02\x02YW\x03\x02\x02" + - "\x02YZ\x03\x02\x02\x02Z\x06\x03\x02\x02\x02[c\x07$\x02\x02\\]\x07^\x02" + - "\x02]b\v\x02\x02\x02^_\x07$\x02\x02_b\x07$\x02\x02`b\n\x04\x02\x02a\\" + - "\x03\x02\x02\x02a^\x03\x02\x02\x02a`\x03\x02\x02\x02be\x03\x02\x02\x02" + - "ca\x03\x02\x02\x02cd\x03\x02\x02\x02df\x03\x02\x02\x02ec\x03\x02\x02\x02" + - "fg\x07$\x02\x02g\b\x03\x02\x02\x02hp\x07)\x02\x02ij\x07^\x02\x02jo\v\x02" + - "\x02\x02kl\x07)\x02\x02lo\x07)\x02\x02mo\n\x05\x02\x02ni\x03\x02\x02\x02" + - "nk\x03\x02\x02\x02nm\x03\x02\x02\x02or\x03\x02\x02\x02pn\x03\x02\x02\x02" + - "pq\x03\x02\x02\x02qs\x03\x02\x02\x02rp\x03\x02\x02\x02st\x07)\x02\x02" + - "t\n\x03\x02\x02\x02uv\t\x06\x02\x02v\f\x03\x02\x02\x02w{\t\x07\x02\x02" + - "xz\t\b\x02\x02yx\x03\x02\x02\x02z}\x03\x02\x02\x02{y\x03\x02\x02\x02{" + - "|\x03\x02\x02\x02|\x0E\x03\x02\x02\x02}{\x03\x02\x02\x02~\x7F\x07*\x02" + - "\x02\x7F\x10\x03\x02\x02\x02\x80\x81\x07+\x02\x02\x81\x12\x03\x02\x02" + - "\x02\x82\x83\x07.\x02\x02\x83\x14\x03\x02\x02\x02\x84\x85\x07)\x02\x02" + - "\x85\x16\x03\x02\x02\x02\x86\x87\x07$\x02\x02\x87\x18\x03\x02\x02\x02" + - "\x88\x89\x07]\x02\x02\x89\x1A\x03\x02\x02\x02\x8A\x8B\x07_\x02\x02\x8B" + - "\x1C\x03\x02\x02\x02\x8C\x8F\x05\x15\v\x02\x8D\x8F\x05\x17\f\x02\x8E\x8C" + - "\x03\x02\x02\x02\x8E\x8D\x03\x02\x02\x02\x8F\x1E\x03\x02\x02\x02\x90\x91" + - "\x07C\x02\x02\x91\x92\x07P\x02\x02\x92\x93\x07F\x02\x02\x93 \x03\x02\x02" + - '\x02\x94\x95\x07Q\x02\x02\x95\x96\x07T\x02\x02\x96"\x03\x02\x02\x02\x97' + - "\x98\x07?\x02\x02\x98$\x03\x02\x02\x02\x99\x9A\x07#\x02\x02\x9A\x9B\x07" + - "?\x02\x02\x9B&\x03\x02\x02\x02\x9C\x9D\x07@\x02\x02\x9D(\x03\x02\x02\x02" + - "\x9E\x9F\x07@\x02\x02\x9F\xA0\x07?\x02\x02\xA0*\x03\x02\x02\x02\xA1\xA2" + - "\x07>\x02\x02\xA2,\x03\x02\x02\x02\xA3\xA4\x07>\x02\x02\xA4\xA5\x07?\x02" + - "\x02\xA5.\x03\x02\x02\x02\xA6\xA7\x07N\x02\x02\xA7\xA8\x07K\x02\x02\xA8" + - "\xA9\x07M\x02\x02\xA9\xAA\x07G\x02\x02\xAA0\x03\x02\x02\x02\xAB\xAC\x07" + - "K\x02\x02\xAC\xAD\x07P\x02\x02\xAD2\x03\x02\x02\x02\xAE\xAF\x07E\x02\x02" + - "\xAF\xB0\x07Q\x02\x02\xB0\xB1\x07P\x02\x02\xB1\xB2\x07V\x02\x02\xB2\xB3" + - "\x07C\x02\x02\xB3\xB4\x07K\x02\x02\xB4\xB5\x07P\x02\x02\xB5\xB6\x07U\x02" + - "\x02\xB64\x03\x02\x02\x02\xB7\xB8\x07V\x02\x02\xB8\xB9\x07T\x02\x02\xB9" + - "\xBA\x07W\x02\x02\xBA\xBB\x07G\x02\x02\xBB6\x03\x02\x02\x02\xBC\xBD\x07" + - "H\x02\x02\xBD\xBE\x07C\x02\x02\xBE\xBF\x07N\x02\x02\xBF\xC0\x07U\x02\x02" + - "\xC0\xC1\x07G\x02\x02\xC18\x03\x02\x02\x02\xC2\xC3\x07N\x02\x02\xC3\xC4" + - "\x07K\x02\x02\xC4\xC5\x07O\x02\x02\xC5\xC6\x07K\x02\x02\xC6\xC7\x07V\x02" + - "\x02\xC7:\x03\x02\x02\x02\xC8\xC9\x07Q\x02\x02\xC9\xCA\x07H\x02\x02\xCA" + - "\xCB\x07H\x02\x02\xCB\xCC\x07U\x02\x02\xCC\xCD\x07G\x02\x02\xCD\xCE\x07" + - "V\x02\x02\xCE<\x03\x02\x02\x02\xCF\xD0\x07Q\x02\x02\xD0\xD1\x07T\x02\x02" + - "\xD1\xD2\x07F\x02\x02\xD2\xD3\x07G\x02\x02\xD3\xD4\x07T\x02\x02\xD4\xD5" + - '\x07"\x02\x02\xD5\xD6\x07D\x02\x02\xD6\xD7\x07[\x02\x02\xD7>\x03\x02' + - "\x02\x02\xD8\xD9\x07C\x02\x02\xD9\xDA\x07U\x02\x02\xDA\xDB\x07E\x02\x02" + - "\xDB@\x03\x02\x02\x02\xDC\xDD\x07F\x02\x02\xDD\xDE\x07G\x02\x02\xDE\xDF" + - "\x07U\x02\x02\xDF\xE0\x07E\x02\x02\xE0B\x03\x02\x02\x02\xE1\xE2\x05\x07" + - "\x04\x02\xE2D\x03\x02\x02\x02\xE3\xE4\x05\t\x05\x02\xE4F\x03\x02\x02\x02" + - "\xE5\xE7\x05\v\x06\x02\xE6\xE5\x03\x02\x02\x02\xE7\xE8\x03\x02\x02\x02" + - "\xE8\xE6\x03\x02\x02\x02\xE8\xE9\x03\x02\x02\x02\xE9H\x03\x02\x02\x02" + - "\xEA\xEC\t\t\x02\x02\xEB\xEA\x03\x02\x02\x02\xEC\xED\x03\x02\x02\x02\xED" + - "\xEB\x03\x02\x02\x02\xED\xEE\x03\x02\x02\x02\xEEJ\x03\x02\x02\x02\xEF" + - "\xF1\t\n\x02\x02\xF0\xEF\x03\x02\x02\x02\xF1\xF2\x03\x02\x02\x02\xF2\xF0" + - "\x03\x02\x02\x02\xF2\xF3\x03\x02\x02\x02\xF3L\x03\x02\x02\x02\xF4\xF8" + - "\t\x07\x02\x02\xF5\xF7\t\b\x02\x02\xF6\xF5\x03\x02\x02\x02\xF7\xFA\x03" + - "\x02\x02\x02\xF8\xF6\x03\x02\x02\x02\xF8\xF9\x03\x02\x02\x02\xF9N\x03" + - "\x02\x02\x02\xFA\xF8\x03\x02\x02\x02\x0F\x02RYacnp{\x8E\xE8\xED\xF2\xF8" + - "\x03\b\x02\x02"; - public static __ATN: ATN; - public static get _ATN(): ATN { - if (!WebdaQLLexer.__ATN) { - WebdaQLLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(WebdaQLLexer._serializedATN)); - } + public static readonly _serializedATN: string = + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02\'\u0124\b\x01" + + "\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06" + + "\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r" + + "\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t" + + "\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t" + + "\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t" + + "\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t" + + "\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t)\x04*\t*\x04" + + "+\t+\x04,\t,\x03\x02\x06\x02[\n\x02\r\x02\x0E\x02\\\x03\x02\x03\x02\x03" + + "\x03\x06\x03b\n\x03\r\x03\x0E\x03c\x03\x04\x03\x04\x03\x04\x03\x04\x03" + + "\x04\x03\x04\x07\x04l\n\x04\f\x04\x0E\x04o\v\x04\x03\x04\x03\x04\x03\x05" + + "\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x07\x05y\n\x05\f\x05\x0E\x05" + + "|\v\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03\x07\x03\x07\x07\x07\x84\n" + + "\x07\f\x07\x0E\x07\x87\v\x07\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\v" + + "\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x05\x0F" + + "\x99\n\x0F\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03" + + "\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x12\x03\x12\x03" + + "\x12\x03\x12\x03\x12\x03\x12\x03\x12\x03\x13\x03\x13\x03\x13\x03\x13\x03" + + "\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x15\x03" + + "\x15\x03\x16\x03\x16\x03\x16\x03\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03" + + "\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03" + + "\x1C\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03" + + "\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03" + + " \x03 \x03 \x03 \x03 \x03!\x03!\x03!\x03!\x03!\x03!\x03\"\x03\"\x03\"" + + "\x03\"\x03\"\x03\"\x03#\x03#\x03#\x03#\x03#\x03#\x03#\x03$\x03$\x03$\x03" + + "$\x03$\x03$\x03$\x03$\x03$\x03%\x03%\x03%\x03%\x03&\x03&\x03&\x03&\x03" + + "&\x03\'\x03\'\x03(\x03(\x03)\x06)\u0110\n)\r)\x0E)\u0111\x03*\x06*\u0115" + + "\n*\r*\x0E*\u0116\x03+\x06+\u011A\n+\r+\x0E+\u011B\x03,\x03,\x07,\u0120" + + "\n,\f,\x0E,\u0123\v,\x02\x02\x02-\x03\x02\x03\x05\x02\x02\x07\x02\x02" + + "\t\x02\x02\v\x02\x02\r\x02\x02\x0F\x02\x04\x11\x02\x05\x13\x02\x06\x15" + + "\x02\x07\x17\x02\b\x19\x02\t\x1B\x02\n\x1D\x02\x02\x1F\x02\v!\x02\f#\x02" + + "\r%\x02\x0E\'\x02\x0F)\x02\x10+\x02\x11-\x02\x12/\x02\x131\x02\x143\x02" + + "\x155\x02\x167\x02\x179\x02\x18;\x02\x19=\x02\x1A?\x02\x1BA\x02\x1CC\x02" + + "\x1DE\x02\x1EG\x02\x1FI\x02 K\x02!M\x02\"O\x02#Q\x02$S\x02%U\x02&W\x02" + + "\'\x03\x02\v\x05\x02\v\f\x0F\x0F\"\"\x05\x022;C\\c|\x04\x02$$^^\x04\x02" + + "))^^\x03\x022;\x03\x02C\\\x04\x02C\\aa\x04\x02C\\c|\x07\x02002;C\\aac" + + "|\x02\u012B\x02\x03\x03\x02\x02\x02\x02\x0F\x03\x02\x02\x02\x02\x11\x03" + + "\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17\x03" + + "\x02\x02\x02\x02\x19\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1F\x03" + + "\x02\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02\x02" + + "\x02\x02\'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02" + + "-\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02" + + "\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02" + + "\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03" + + "\x02\x02\x02\x02C\x03\x02\x02\x02\x02E\x03\x02\x02\x02\x02G\x03\x02\x02" + + "\x02\x02I\x03\x02\x02\x02\x02K\x03\x02\x02\x02\x02M\x03\x02\x02\x02\x02" + + "O\x03\x02\x02\x02\x02Q\x03\x02\x02\x02\x02S\x03\x02\x02\x02\x02U\x03\x02" + + "\x02\x02\x02W\x03\x02\x02\x02\x03Z\x03\x02\x02\x02\x05a\x03\x02\x02\x02" + + "\x07e\x03\x02\x02\x02\tr\x03\x02\x02\x02\v\x7F\x03\x02\x02\x02\r\x81\x03" + + "\x02\x02\x02\x0F\x88\x03\x02\x02\x02\x11\x8A\x03\x02\x02\x02\x13\x8C\x03" + + "\x02\x02\x02\x15\x8E\x03\x02\x02\x02\x17\x90\x03\x02\x02\x02\x19\x92\x03" + + "\x02\x02\x02\x1B\x94\x03\x02\x02\x02\x1D\x98\x03\x02\x02\x02\x1F\x9A\x03" + + "\x02\x02\x02!\xA1\x03\x02\x02\x02#\xA8\x03\x02\x02\x02%\xAF\x03\x02\x02" + + "\x02\'\xB3\x03\x02\x02\x02)\xB9\x03\x02\x02\x02+\xBD\x03\x02\x02\x02-" + + "\xC0\x03\x02\x02\x02/\xC2\x03\x02\x02\x021\xC5\x03\x02\x02\x023\xC7\x03" + + "\x02\x02\x025\xCA\x03\x02\x02\x027\xCC\x03\x02\x02\x029\xCF\x03\x02\x02" + + "\x02;\xD4\x03\x02\x02\x02=\xD7\x03\x02\x02\x02?\xE0\x03\x02\x02\x02A\xE5" + + "\x03\x02\x02\x02C\xEB\x03\x02\x02\x02E\xF1\x03\x02\x02\x02G\xF8\x03\x02" + + "\x02\x02I\u0101\x03\x02\x02\x02K\u0105\x03\x02\x02\x02M\u010A\x03\x02" + + "\x02\x02O\u010C\x03\x02\x02\x02Q\u010F\x03\x02\x02\x02S\u0114\x03\x02" + + "\x02\x02U\u0119\x03\x02\x02\x02W\u011D\x03\x02\x02\x02Y[\t\x02\x02\x02" + + "ZY\x03\x02\x02\x02[\\\x03\x02\x02\x02\\Z\x03\x02\x02\x02\\]\x03\x02\x02" + + "\x02]^\x03\x02\x02\x02^_\b\x02\x02\x02_\x04\x03\x02\x02\x02`b\t\x03\x02" + + "\x02a`\x03\x02\x02\x02bc\x03\x02\x02\x02ca\x03\x02\x02\x02cd\x03\x02\x02" + + "\x02d\x06\x03\x02\x02\x02em\x07$\x02\x02fg\x07^\x02\x02gl\v\x02\x02\x02" + + "hi\x07$\x02\x02il\x07$\x02\x02jl\n\x04\x02\x02kf\x03\x02\x02\x02kh\x03" + + "\x02\x02\x02kj\x03\x02\x02\x02lo\x03\x02\x02\x02mk\x03\x02\x02\x02mn\x03" + + "\x02\x02\x02np\x03\x02\x02\x02om\x03\x02\x02\x02pq\x07$\x02\x02q\b\x03" + + "\x02\x02\x02rz\x07)\x02\x02st\x07^\x02\x02ty\v\x02\x02\x02uv\x07)\x02" + + "\x02vy\x07)\x02\x02wy\n\x05\x02\x02xs\x03\x02\x02\x02xu\x03\x02\x02\x02" + + "xw\x03\x02\x02\x02y|\x03\x02\x02\x02zx\x03\x02\x02\x02z{\x03\x02\x02\x02" + + "{}\x03\x02\x02\x02|z\x03\x02\x02\x02}~\x07)\x02\x02~\n\x03\x02\x02\x02" + + "\x7F\x80\t\x06\x02\x02\x80\f\x03\x02\x02\x02\x81\x85\t\x07\x02\x02\x82" + + "\x84\t\b\x02\x02\x83\x82\x03\x02\x02\x02\x84\x87\x03\x02\x02\x02\x85\x83" + + "\x03\x02\x02\x02\x85\x86\x03\x02\x02\x02\x86\x0E\x03\x02\x02\x02\x87\x85" + + "\x03\x02\x02\x02\x88\x89\x07*\x02\x02\x89\x10\x03\x02\x02\x02\x8A\x8B" + + "\x07+\x02\x02\x8B\x12\x03\x02\x02\x02\x8C\x8D\x07.\x02\x02\x8D\x14\x03" + + "\x02\x02\x02\x8E\x8F\x07)\x02\x02\x8F\x16\x03\x02\x02\x02\x90\x91\x07" + + "$\x02\x02\x91\x18\x03\x02\x02\x02\x92\x93\x07]\x02\x02\x93\x1A\x03\x02" + + "\x02\x02\x94\x95\x07_\x02\x02\x95\x1C\x03\x02\x02\x02\x96\x99\x05\x15" + + "\v\x02\x97\x99\x05\x17\f\x02\x98\x96\x03\x02\x02\x02\x98\x97\x03\x02\x02" + + "\x02\x99\x1E\x03\x02\x02\x02\x9A\x9B\x07F\x02\x02\x9B\x9C\x07G\x02\x02" + + "\x9C\x9D\x07N\x02\x02\x9D\x9E\x07G\x02\x02\x9E\x9F\x07V\x02\x02\x9F\xA0" + + "\x07G\x02\x02\xA0 \x03\x02\x02\x02\xA1\xA2\x07W\x02\x02\xA2\xA3\x07R\x02" + + "\x02\xA3\xA4\x07F\x02\x02\xA4\xA5\x07C\x02\x02\xA5\xA6\x07V\x02\x02\xA6" + + "\xA7\x07G\x02\x02\xA7\"\x03\x02\x02\x02\xA8\xA9\x07U\x02\x02\xA9\xAA\x07" + + "G\x02\x02\xAA\xAB\x07N\x02\x02\xAB\xAC\x07G\x02\x02\xAC\xAD\x07E\x02\x02" + + "\xAD\xAE\x07V\x02\x02\xAE$\x03\x02\x02\x02\xAF\xB0\x07U\x02\x02\xB0\xB1" + + "\x07G\x02\x02\xB1\xB2\x07V\x02\x02\xB2&\x03\x02\x02\x02\xB3\xB4\x07Y\x02" + + "\x02\xB4\xB5\x07J\x02\x02\xB5\xB6\x07G\x02\x02\xB6\xB7\x07T\x02\x02\xB7" + + "\xB8\x07G\x02\x02\xB8(\x03\x02\x02\x02\xB9\xBA\x07C\x02\x02\xBA\xBB\x07" + + "P\x02\x02\xBB\xBC\x07F\x02\x02\xBC*\x03\x02\x02\x02\xBD\xBE\x07Q\x02\x02" + + "\xBE\xBF\x07T\x02\x02\xBF,\x03\x02\x02\x02\xC0\xC1\x07?\x02\x02\xC1.\x03" + + "\x02\x02\x02\xC2\xC3\x07#\x02\x02\xC3\xC4\x07?\x02\x02\xC40\x03\x02\x02" + + "\x02\xC5\xC6\x07@\x02\x02\xC62\x03\x02\x02\x02\xC7\xC8\x07@\x02\x02\xC8" + + "\xC9\x07?\x02\x02\xC94\x03\x02\x02\x02\xCA\xCB\x07>\x02\x02\xCB6\x03\x02" + + "\x02\x02\xCC\xCD\x07>\x02\x02\xCD\xCE\x07?\x02\x02\xCE8\x03\x02\x02\x02" + + "\xCF\xD0\x07N\x02\x02\xD0\xD1\x07K\x02\x02\xD1\xD2\x07M\x02\x02\xD2\xD3" + + "\x07G\x02\x02\xD3:\x03\x02\x02\x02\xD4\xD5\x07K\x02\x02\xD5\xD6\x07P\x02" + + "\x02\xD6<\x03\x02\x02\x02\xD7\xD8\x07E\x02\x02\xD8\xD9\x07Q\x02\x02\xD9" + + "\xDA\x07P\x02\x02\xDA\xDB\x07V\x02\x02\xDB\xDC\x07C\x02\x02\xDC\xDD\x07" + + "K\x02\x02\xDD\xDE\x07P\x02\x02\xDE\xDF\x07U\x02\x02\xDF>\x03\x02\x02\x02" + + "\xE0\xE1\x07V\x02\x02\xE1\xE2\x07T\x02\x02\xE2\xE3\x07W\x02\x02\xE3\xE4" + + "\x07G\x02\x02\xE4@\x03\x02\x02\x02\xE5\xE6\x07H\x02\x02\xE6\xE7\x07C\x02" + + "\x02\xE7\xE8\x07N\x02\x02\xE8\xE9\x07U\x02\x02\xE9\xEA\x07G\x02\x02\xEA" + + "B\x03\x02\x02\x02\xEB\xEC\x07N\x02\x02\xEC\xED\x07K\x02\x02\xED\xEE\x07" + + "O\x02\x02\xEE\xEF\x07K\x02\x02\xEF\xF0\x07V\x02\x02\xF0D\x03\x02\x02\x02" + + "\xF1\xF2\x07Q\x02\x02\xF2\xF3\x07H\x02\x02\xF3\xF4\x07H\x02\x02\xF4\xF5" + + "\x07U\x02\x02\xF5\xF6\x07G\x02\x02\xF6\xF7\x07V\x02\x02\xF7F\x03\x02\x02" + + "\x02\xF8\xF9\x07Q\x02\x02\xF9\xFA\x07T\x02\x02\xFA\xFB\x07F\x02\x02\xFB" + + "\xFC\x07G\x02\x02\xFC\xFD\x07T\x02\x02\xFD\xFE\x07\"\x02\x02\xFE\xFF\x07" + + "D\x02\x02\xFF\u0100\x07[\x02\x02\u0100H\x03\x02\x02\x02\u0101\u0102\x07" + + "C\x02\x02\u0102\u0103\x07U\x02\x02\u0103\u0104\x07E\x02\x02\u0104J\x03" + + "\x02\x02\x02\u0105\u0106\x07F\x02\x02\u0106\u0107\x07G\x02\x02\u0107\u0108" + + "\x07U\x02\x02\u0108\u0109\x07E\x02\x02\u0109L\x03\x02\x02\x02\u010A\u010B" + + "\x05\x07\x04\x02\u010BN\x03\x02\x02\x02\u010C\u010D\x05\t\x05\x02\u010D" + + "P\x03\x02\x02\x02\u010E\u0110\x05\v\x06\x02\u010F\u010E\x03\x02\x02\x02" + + "\u0110\u0111\x03\x02\x02\x02\u0111\u010F\x03\x02\x02\x02\u0111\u0112\x03" + + "\x02\x02\x02\u0112R\x03\x02\x02\x02\u0113\u0115\t\t\x02\x02\u0114\u0113" + + "\x03\x02\x02\x02\u0115\u0116\x03\x02\x02\x02\u0116\u0114\x03\x02\x02\x02" + + "\u0116\u0117\x03\x02\x02\x02\u0117T\x03\x02\x02\x02\u0118\u011A\t\n\x02" + + "\x02\u0119\u0118\x03\x02\x02\x02\u011A\u011B\x03\x02\x02\x02\u011B\u0119" + + "\x03\x02\x02\x02\u011B\u011C\x03\x02\x02\x02\u011CV\x03\x02\x02\x02\u011D" + + "\u0121\t\x07\x02\x02\u011E\u0120\t\b\x02\x02\u011F\u011E\x03\x02\x02\x02" + + "\u0120\u0123\x03\x02\x02\x02\u0121\u011F\x03\x02\x02\x02\u0121\u0122\x03" + + "\x02\x02\x02\u0122X\x03\x02\x02\x02\u0123\u0121\x03\x02\x02\x02\x0F\x02" + + "\\ckmxz\x85\x98\u0111\u0116\u011B\u0121\x03\b\x02\x02"; + public static __ATN: ATN; + public static get _ATN(): ATN { + if (!WebdaQLLexer.__ATN) { + WebdaQLLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(WebdaQLLexer._serializedATN)); + } + + return WebdaQLLexer.__ATN; + } - return WebdaQLLexer.__ATN; - } } + diff --git a/packages/ql/src/WebdaQLParser.interp b/packages/ql/src/WebdaQLParser.interp index 26d2431a0..4a61dde4f 100644 --- a/packages/ql/src/WebdaQLParser.interp +++ b/packages/ql/src/WebdaQLParser.interp @@ -8,6 +8,11 @@ null '"' '[' ']' +'DELETE' +'UPDATE' +'SELECT' +'SET' +'WHERE' 'AND' 'OR' '=' @@ -43,6 +48,11 @@ SINGLE_QUOTE_SYMB DOUBLE_QUOTE_SYMB LR_SQ_BRACKET RR_SQ_BRACKET +DELETE +UPDATE +SELECT +SET +WHERE AND OR EQUAL @@ -70,6 +80,14 @@ FUNCTION_IDENTIFIER_WITH_UNDERSCORE rule names: webdaql +statement +deleteStatement +updateStatement +selectStatement +filterQuery +assignmentList +assignment +fieldList limitExpression offsetExpression orderFieldExpression @@ -85,4 +103,4 @@ setExpression atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 34, 125, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 3, 2, 5, 2, 30, 10, 2, 3, 2, 5, 2, 33, 10, 2, 3, 2, 5, 2, 36, 10, 2, 3, 2, 5, 2, 39, 10, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 5, 5, 51, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 7, 6, 57, 10, 6, 12, 6, 14, 6, 60, 11, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 84, 10, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 7, 7, 92, 10, 7, 12, 7, 14, 7, 95, 11, 7, 3, 8, 3, 8, 3, 8, 5, 8, 100, 10, 8, 3, 9, 3, 9, 5, 9, 104, 10, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 7, 14, 118, 10, 14, 12, 14, 14, 14, 121, 11, 14, 3, 14, 3, 14, 3, 14, 2, 2, 3, 12, 15, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 2, 7, 3, 2, 27, 28, 3, 2, 13, 18, 3, 2, 32, 33, 3, 2, 22, 23, 3, 2, 29, 30, 2, 128, 2, 29, 3, 2, 2, 2, 4, 42, 3, 2, 2, 2, 6, 45, 3, 2, 2, 2, 8, 48, 3, 2, 2, 2, 10, 52, 3, 2, 2, 2, 12, 83, 3, 2, 2, 2, 14, 99, 3, 2, 2, 2, 16, 103, 3, 2, 2, 2, 18, 105, 3, 2, 2, 2, 20, 107, 3, 2, 2, 2, 22, 109, 3, 2, 2, 2, 24, 111, 3, 2, 2, 2, 26, 113, 3, 2, 2, 2, 28, 30, 5, 12, 7, 2, 29, 28, 3, 2, 2, 2, 29, 30, 3, 2, 2, 2, 30, 32, 3, 2, 2, 2, 31, 33, 5, 10, 6, 2, 32, 31, 3, 2, 2, 2, 32, 33, 3, 2, 2, 2, 33, 35, 3, 2, 2, 2, 34, 36, 5, 4, 3, 2, 35, 34, 3, 2, 2, 2, 35, 36, 3, 2, 2, 2, 36, 38, 3, 2, 2, 2, 37, 39, 5, 6, 4, 2, 38, 37, 3, 2, 2, 2, 38, 39, 3, 2, 2, 2, 39, 40, 3, 2, 2, 2, 40, 41, 7, 2, 2, 3, 41, 3, 3, 2, 2, 2, 42, 43, 7, 24, 2, 2, 43, 44, 5, 24, 13, 2, 44, 5, 3, 2, 2, 2, 45, 46, 7, 25, 2, 2, 46, 47, 5, 22, 12, 2, 47, 7, 3, 2, 2, 2, 48, 50, 5, 18, 10, 2, 49, 51, 9, 2, 2, 2, 50, 49, 3, 2, 2, 2, 50, 51, 3, 2, 2, 2, 51, 9, 3, 2, 2, 2, 52, 53, 7, 26, 2, 2, 53, 58, 5, 8, 5, 2, 54, 55, 7, 6, 2, 2, 55, 57, 5, 8, 5, 2, 56, 54, 3, 2, 2, 2, 57, 60, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 11, 3, 2, 2, 2, 60, 58, 3, 2, 2, 2, 61, 62, 8, 7, 1, 2, 62, 63, 5, 18, 10, 2, 63, 64, 7, 19, 2, 2, 64, 65, 5, 22, 12, 2, 65, 84, 3, 2, 2, 2, 66, 67, 5, 18, 10, 2, 67, 68, 7, 20, 2, 2, 68, 69, 5, 26, 14, 2, 69, 84, 3, 2, 2, 2, 70, 71, 5, 18, 10, 2, 71, 72, 7, 21, 2, 2, 72, 73, 5, 22, 12, 2, 73, 84, 3, 2, 2, 2, 74, 75, 5, 18, 10, 2, 75, 76, 9, 3, 2, 2, 76, 77, 5, 14, 8, 2, 77, 84, 3, 2, 2, 2, 78, 79, 7, 4, 2, 2, 79, 80, 5, 12, 7, 2, 80, 81, 7, 5, 2, 2, 81, 84, 3, 2, 2, 2, 82, 84, 5, 16, 9, 2, 83, 61, 3, 2, 2, 2, 83, 66, 3, 2, 2, 2, 83, 70, 3, 2, 2, 2, 83, 74, 3, 2, 2, 2, 83, 78, 3, 2, 2, 2, 83, 82, 3, 2, 2, 2, 84, 93, 3, 2, 2, 2, 85, 86, 12, 6, 2, 2, 86, 87, 7, 11, 2, 2, 87, 92, 5, 12, 7, 7, 88, 89, 12, 5, 2, 2, 89, 90, 7, 12, 2, 2, 90, 92, 5, 12, 7, 6, 91, 85, 3, 2, 2, 2, 91, 88, 3, 2, 2, 2, 92, 95, 3, 2, 2, 2, 93, 91, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 13, 3, 2, 2, 2, 95, 93, 3, 2, 2, 2, 96, 100, 5, 20, 11, 2, 97, 100, 5, 24, 13, 2, 98, 100, 5, 22, 12, 2, 99, 96, 3, 2, 2, 2, 99, 97, 3, 2, 2, 2, 99, 98, 3, 2, 2, 2, 100, 15, 3, 2, 2, 2, 101, 104, 5, 14, 8, 2, 102, 104, 5, 18, 10, 2, 103, 101, 3, 2, 2, 2, 103, 102, 3, 2, 2, 2, 104, 17, 3, 2, 2, 2, 105, 106, 9, 4, 2, 2, 106, 19, 3, 2, 2, 2, 107, 108, 9, 5, 2, 2, 108, 21, 3, 2, 2, 2, 109, 110, 9, 6, 2, 2, 110, 23, 3, 2, 2, 2, 111, 112, 7, 31, 2, 2, 112, 25, 3, 2, 2, 2, 113, 114, 7, 9, 2, 2, 114, 119, 5, 14, 8, 2, 115, 116, 7, 6, 2, 2, 116, 118, 5, 14, 8, 2, 117, 115, 3, 2, 2, 2, 118, 121, 3, 2, 2, 2, 119, 117, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 122, 3, 2, 2, 2, 121, 119, 3, 2, 2, 2, 122, 123, 7, 10, 2, 2, 123, 27, 3, 2, 2, 2, 14, 29, 32, 35, 38, 50, 58, 83, 91, 93, 99, 103, 119] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 39, 203, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 3, 2, 3, 2, 5, 2, 47, 10, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 5, 3, 54, 10, 3, 3, 4, 3, 4, 3, 4, 5, 4, 59, 10, 4, 3, 4, 5, 4, 62, 10, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 69, 10, 5, 3, 5, 5, 5, 72, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 78, 10, 6, 3, 6, 5, 6, 81, 10, 6, 3, 6, 5, 6, 84, 10, 6, 3, 6, 5, 6, 87, 10, 6, 3, 7, 5, 7, 90, 10, 7, 3, 7, 5, 7, 93, 10, 7, 3, 7, 5, 7, 96, 10, 7, 3, 7, 5, 7, 99, 10, 7, 3, 8, 3, 8, 3, 8, 7, 8, 104, 10, 8, 12, 8, 14, 8, 107, 11, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 7, 10, 116, 10, 10, 12, 10, 14, 10, 119, 11, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 5, 13, 129, 10, 13, 3, 14, 3, 14, 3, 14, 3, 14, 7, 14, 135, 10, 14, 12, 14, 14, 14, 138, 11, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 5, 15, 162, 10, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 170, 10, 15, 12, 15, 14, 15, 173, 11, 15, 3, 16, 3, 16, 3, 16, 5, 16, 178, 10, 16, 3, 17, 3, 17, 5, 17, 182, 10, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 196, 10, 22, 12, 22, 14, 22, 199, 11, 22, 3, 22, 3, 22, 3, 22, 2, 2, 3, 28, 23, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 2, 7, 3, 2, 32, 33, 3, 2, 18, 23, 3, 2, 37, 38, 3, 2, 27, 28, 3, 2, 34, 35, 2, 211, 2, 46, 3, 2, 2, 2, 4, 53, 3, 2, 2, 2, 6, 55, 3, 2, 2, 2, 8, 63, 3, 2, 2, 2, 10, 73, 3, 2, 2, 2, 12, 89, 3, 2, 2, 2, 14, 100, 3, 2, 2, 2, 16, 108, 3, 2, 2, 2, 18, 112, 3, 2, 2, 2, 20, 120, 3, 2, 2, 2, 22, 123, 3, 2, 2, 2, 24, 126, 3, 2, 2, 2, 26, 130, 3, 2, 2, 2, 28, 161, 3, 2, 2, 2, 30, 177, 3, 2, 2, 2, 32, 181, 3, 2, 2, 2, 34, 183, 3, 2, 2, 2, 36, 185, 3, 2, 2, 2, 38, 187, 3, 2, 2, 2, 40, 189, 3, 2, 2, 2, 42, 191, 3, 2, 2, 2, 44, 47, 5, 4, 3, 2, 45, 47, 5, 12, 7, 2, 46, 44, 3, 2, 2, 2, 46, 45, 3, 2, 2, 2, 47, 48, 3, 2, 2, 2, 48, 49, 7, 2, 2, 3, 49, 3, 3, 2, 2, 2, 50, 54, 5, 6, 4, 2, 51, 54, 5, 8, 5, 2, 52, 54, 5, 10, 6, 2, 53, 50, 3, 2, 2, 2, 53, 51, 3, 2, 2, 2, 53, 52, 3, 2, 2, 2, 54, 5, 3, 2, 2, 2, 55, 58, 7, 11, 2, 2, 56, 57, 7, 15, 2, 2, 57, 59, 5, 28, 15, 2, 58, 56, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 61, 3, 2, 2, 2, 60, 62, 5, 20, 11, 2, 61, 60, 3, 2, 2, 2, 61, 62, 3, 2, 2, 2, 62, 7, 3, 2, 2, 2, 63, 64, 7, 12, 2, 2, 64, 65, 7, 14, 2, 2, 65, 68, 5, 14, 8, 2, 66, 67, 7, 15, 2, 2, 67, 69, 5, 28, 15, 2, 68, 66, 3, 2, 2, 2, 68, 69, 3, 2, 2, 2, 69, 71, 3, 2, 2, 2, 70, 72, 5, 20, 11, 2, 71, 70, 3, 2, 2, 2, 71, 72, 3, 2, 2, 2, 72, 9, 3, 2, 2, 2, 73, 74, 7, 13, 2, 2, 74, 77, 5, 18, 10, 2, 75, 76, 7, 15, 2, 2, 76, 78, 5, 28, 15, 2, 77, 75, 3, 2, 2, 2, 77, 78, 3, 2, 2, 2, 78, 80, 3, 2, 2, 2, 79, 81, 5, 26, 14, 2, 80, 79, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 83, 3, 2, 2, 2, 82, 84, 5, 20, 11, 2, 83, 82, 3, 2, 2, 2, 83, 84, 3, 2, 2, 2, 84, 86, 3, 2, 2, 2, 85, 87, 5, 22, 12, 2, 86, 85, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 11, 3, 2, 2, 2, 88, 90, 5, 28, 15, 2, 89, 88, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 92, 3, 2, 2, 2, 91, 93, 5, 26, 14, 2, 92, 91, 3, 2, 2, 2, 92, 93, 3, 2, 2, 2, 93, 95, 3, 2, 2, 2, 94, 96, 5, 20, 11, 2, 95, 94, 3, 2, 2, 2, 95, 96, 3, 2, 2, 2, 96, 98, 3, 2, 2, 2, 97, 99, 5, 22, 12, 2, 98, 97, 3, 2, 2, 2, 98, 99, 3, 2, 2, 2, 99, 13, 3, 2, 2, 2, 100, 105, 5, 16, 9, 2, 101, 102, 7, 6, 2, 2, 102, 104, 5, 16, 9, 2, 103, 101, 3, 2, 2, 2, 104, 107, 3, 2, 2, 2, 105, 103, 3, 2, 2, 2, 105, 106, 3, 2, 2, 2, 106, 15, 3, 2, 2, 2, 107, 105, 3, 2, 2, 2, 108, 109, 5, 34, 18, 2, 109, 110, 7, 18, 2, 2, 110, 111, 5, 30, 16, 2, 111, 17, 3, 2, 2, 2, 112, 117, 5, 34, 18, 2, 113, 114, 7, 6, 2, 2, 114, 116, 5, 34, 18, 2, 115, 113, 3, 2, 2, 2, 116, 119, 3, 2, 2, 2, 117, 115, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 19, 3, 2, 2, 2, 119, 117, 3, 2, 2, 2, 120, 121, 7, 29, 2, 2, 121, 122, 5, 40, 21, 2, 122, 21, 3, 2, 2, 2, 123, 124, 7, 30, 2, 2, 124, 125, 5, 38, 20, 2, 125, 23, 3, 2, 2, 2, 126, 128, 5, 34, 18, 2, 127, 129, 9, 2, 2, 2, 128, 127, 3, 2, 2, 2, 128, 129, 3, 2, 2, 2, 129, 25, 3, 2, 2, 2, 130, 131, 7, 31, 2, 2, 131, 136, 5, 24, 13, 2, 132, 133, 7, 6, 2, 2, 133, 135, 5, 24, 13, 2, 134, 132, 3, 2, 2, 2, 135, 138, 3, 2, 2, 2, 136, 134, 3, 2, 2, 2, 136, 137, 3, 2, 2, 2, 137, 27, 3, 2, 2, 2, 138, 136, 3, 2, 2, 2, 139, 140, 8, 15, 1, 2, 140, 141, 5, 34, 18, 2, 141, 142, 7, 24, 2, 2, 142, 143, 5, 38, 20, 2, 143, 162, 3, 2, 2, 2, 144, 145, 5, 34, 18, 2, 145, 146, 7, 25, 2, 2, 146, 147, 5, 42, 22, 2, 147, 162, 3, 2, 2, 2, 148, 149, 5, 34, 18, 2, 149, 150, 7, 26, 2, 2, 150, 151, 5, 38, 20, 2, 151, 162, 3, 2, 2, 2, 152, 153, 5, 34, 18, 2, 153, 154, 9, 3, 2, 2, 154, 155, 5, 30, 16, 2, 155, 162, 3, 2, 2, 2, 156, 157, 7, 4, 2, 2, 157, 158, 5, 28, 15, 2, 158, 159, 7, 5, 2, 2, 159, 162, 3, 2, 2, 2, 160, 162, 5, 32, 17, 2, 161, 139, 3, 2, 2, 2, 161, 144, 3, 2, 2, 2, 161, 148, 3, 2, 2, 2, 161, 152, 3, 2, 2, 2, 161, 156, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 171, 3, 2, 2, 2, 163, 164, 12, 6, 2, 2, 164, 165, 7, 16, 2, 2, 165, 170, 5, 28, 15, 7, 166, 167, 12, 5, 2, 2, 167, 168, 7, 17, 2, 2, 168, 170, 5, 28, 15, 6, 169, 163, 3, 2, 2, 2, 169, 166, 3, 2, 2, 2, 170, 173, 3, 2, 2, 2, 171, 169, 3, 2, 2, 2, 171, 172, 3, 2, 2, 2, 172, 29, 3, 2, 2, 2, 173, 171, 3, 2, 2, 2, 174, 178, 5, 36, 19, 2, 175, 178, 5, 40, 21, 2, 176, 178, 5, 38, 20, 2, 177, 174, 3, 2, 2, 2, 177, 175, 3, 2, 2, 2, 177, 176, 3, 2, 2, 2, 178, 31, 3, 2, 2, 2, 179, 182, 5, 30, 16, 2, 180, 182, 5, 34, 18, 2, 181, 179, 3, 2, 2, 2, 181, 180, 3, 2, 2, 2, 182, 33, 3, 2, 2, 2, 183, 184, 9, 4, 2, 2, 184, 35, 3, 2, 2, 2, 185, 186, 9, 5, 2, 2, 186, 37, 3, 2, 2, 2, 187, 188, 9, 6, 2, 2, 188, 39, 3, 2, 2, 2, 189, 190, 7, 36, 2, 2, 190, 41, 3, 2, 2, 2, 191, 192, 7, 9, 2, 2, 192, 197, 5, 30, 16, 2, 193, 194, 7, 6, 2, 2, 194, 196, 5, 30, 16, 2, 195, 193, 3, 2, 2, 2, 196, 199, 3, 2, 2, 2, 197, 195, 3, 2, 2, 2, 197, 198, 3, 2, 2, 2, 198, 200, 3, 2, 2, 2, 199, 197, 3, 2, 2, 2, 200, 201, 7, 10, 2, 2, 201, 43, 3, 2, 2, 2, 26, 46, 53, 58, 61, 68, 71, 77, 80, 83, 86, 89, 92, 95, 98, 105, 117, 128, 136, 161, 169, 171, 177, 181, 197] \ No newline at end of file diff --git a/packages/ql/src/WebdaQLParser.tokens b/packages/ql/src/WebdaQLParser.tokens index d6427881e..cf8a82415 100644 --- a/packages/ql/src/WebdaQLParser.tokens +++ b/packages/ql/src/WebdaQLParser.tokens @@ -6,30 +6,35 @@ SINGLE_QUOTE_SYMB=5 DOUBLE_QUOTE_SYMB=6 LR_SQ_BRACKET=7 RR_SQ_BRACKET=8 -AND=9 -OR=10 -EQUAL=11 -NOT_EQUAL=12 -GREATER=13 -GREATER_OR_EQUAL=14 -LESS=15 -LESS_OR_EQUAL=16 -LIKE=17 -IN=18 -CONTAINS=19 -TRUE=20 -FALSE=21 -LIMIT=22 -OFFSET=23 -ORDER_BY=24 -ASC=25 -DESC=26 -DQUOTED_STRING_LITERAL=27 -SQUOTED_STRING_LITERAL=28 -INTEGER_LITERAL=29 -IDENTIFIER=30 -IDENTIFIER_WITH_NUMBER=31 -FUNCTION_IDENTIFIER_WITH_UNDERSCORE=32 +DELETE=9 +UPDATE=10 +SELECT=11 +SET=12 +WHERE=13 +AND=14 +OR=15 +EQUAL=16 +NOT_EQUAL=17 +GREATER=18 +GREATER_OR_EQUAL=19 +LESS=20 +LESS_OR_EQUAL=21 +LIKE=22 +IN=23 +CONTAINS=24 +TRUE=25 +FALSE=26 +LIMIT=27 +OFFSET=28 +ORDER_BY=29 +ASC=30 +DESC=31 +DQUOTED_STRING_LITERAL=32 +SQUOTED_STRING_LITERAL=33 +INTEGER_LITERAL=34 +IDENTIFIER=35 +IDENTIFIER_WITH_NUMBER=36 +FUNCTION_IDENTIFIER_WITH_UNDERSCORE=37 '('=2 ')'=3 ','=4 @@ -37,21 +42,26 @@ FUNCTION_IDENTIFIER_WITH_UNDERSCORE=32 '"'=6 '['=7 ']'=8 -'AND'=9 -'OR'=10 -'='=11 -'!='=12 -'>'=13 -'>='=14 -'<'=15 -'<='=16 -'LIKE'=17 -'IN'=18 -'CONTAINS'=19 -'TRUE'=20 -'FALSE'=21 -'LIMIT'=22 -'OFFSET'=23 -'ORDER BY'=24 -'ASC'=25 -'DESC'=26 +'DELETE'=9 +'UPDATE'=10 +'SELECT'=11 +'SET'=12 +'WHERE'=13 +'AND'=14 +'OR'=15 +'='=16 +'!='=17 +'>'=18 +'>='=19 +'<'=20 +'<='=21 +'LIKE'=22 +'IN'=23 +'CONTAINS'=24 +'TRUE'=25 +'FALSE'=26 +'LIMIT'=27 +'OFFSET'=28 +'ORDER BY'=29 +'ASC'=30 +'DESC'=31 diff --git a/packages/ql/src/WebdaQLParserLexer.interp b/packages/ql/src/WebdaQLParserLexer.interp index ffd6388a2..fd0246f95 100644 --- a/packages/ql/src/WebdaQLParserLexer.interp +++ b/packages/ql/src/WebdaQLParserLexer.interp @@ -8,6 +8,11 @@ null '"' '[' ']' +'DELETE' +'UPDATE' +'SELECT' +'SET' +'WHERE' 'AND' 'OR' '=' @@ -43,6 +48,11 @@ SINGLE_QUOTE_SYMB DOUBLE_QUOTE_SYMB LR_SQ_BRACKET RR_SQ_BRACKET +DELETE +UPDATE +SELECT +SET +WHERE AND OR EQUAL @@ -83,6 +93,11 @@ DOUBLE_QUOTE_SYMB LR_SQ_BRACKET RR_SQ_BRACKET QUOTE_SYMB +DELETE +UPDATE +SELECT +SET +WHERE AND OR EQUAL @@ -116,4 +131,4 @@ mode names: DEFAULT_MODE atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 34, 251, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 3, 2, 6, 2, 81, 10, 2, 13, 2, 14, 2, 82, 3, 2, 3, 2, 3, 3, 6, 3, 88, 10, 3, 13, 3, 14, 3, 89, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 98, 10, 4, 12, 4, 14, 4, 101, 11, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 7, 5, 111, 10, 5, 12, 5, 14, 5, 114, 11, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 7, 7, 122, 10, 7, 12, 7, 14, 7, 125, 11, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 5, 15, 143, 10, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 6, 36, 231, 10, 36, 13, 36, 14, 36, 232, 3, 37, 6, 37, 236, 10, 37, 13, 37, 14, 37, 237, 3, 38, 6, 38, 241, 10, 38, 13, 38, 14, 38, 242, 3, 39, 3, 39, 7, 39, 247, 10, 39, 12, 39, 14, 39, 250, 11, 39, 2, 2, 2, 40, 3, 2, 3, 5, 2, 2, 7, 2, 2, 9, 2, 2, 11, 2, 2, 13, 2, 2, 15, 2, 4, 17, 2, 5, 19, 2, 6, 21, 2, 7, 23, 2, 8, 25, 2, 9, 27, 2, 10, 29, 2, 2, 31, 2, 11, 33, 2, 12, 35, 2, 13, 37, 2, 14, 39, 2, 15, 41, 2, 16, 43, 2, 17, 45, 2, 18, 47, 2, 19, 49, 2, 20, 51, 2, 21, 53, 2, 22, 55, 2, 23, 57, 2, 24, 59, 2, 25, 61, 2, 26, 63, 2, 27, 65, 2, 28, 67, 2, 29, 69, 2, 30, 71, 2, 31, 73, 2, 32, 75, 2, 33, 77, 2, 34, 3, 2, 11, 5, 2, 11, 12, 15, 15, 34, 34, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 50, 59, 3, 2, 67, 92, 4, 2, 67, 92, 97, 97, 4, 2, 67, 92, 99, 124, 7, 2, 48, 48, 50, 59, 67, 92, 97, 97, 99, 124, 2, 258, 2, 3, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 3, 80, 3, 2, 2, 2, 5, 87, 3, 2, 2, 2, 7, 91, 3, 2, 2, 2, 9, 104, 3, 2, 2, 2, 11, 117, 3, 2, 2, 2, 13, 119, 3, 2, 2, 2, 15, 126, 3, 2, 2, 2, 17, 128, 3, 2, 2, 2, 19, 130, 3, 2, 2, 2, 21, 132, 3, 2, 2, 2, 23, 134, 3, 2, 2, 2, 25, 136, 3, 2, 2, 2, 27, 138, 3, 2, 2, 2, 29, 142, 3, 2, 2, 2, 31, 144, 3, 2, 2, 2, 33, 148, 3, 2, 2, 2, 35, 151, 3, 2, 2, 2, 37, 153, 3, 2, 2, 2, 39, 156, 3, 2, 2, 2, 41, 158, 3, 2, 2, 2, 43, 161, 3, 2, 2, 2, 45, 163, 3, 2, 2, 2, 47, 166, 3, 2, 2, 2, 49, 171, 3, 2, 2, 2, 51, 174, 3, 2, 2, 2, 53, 183, 3, 2, 2, 2, 55, 188, 3, 2, 2, 2, 57, 194, 3, 2, 2, 2, 59, 200, 3, 2, 2, 2, 61, 207, 3, 2, 2, 2, 63, 216, 3, 2, 2, 2, 65, 220, 3, 2, 2, 2, 67, 225, 3, 2, 2, 2, 69, 227, 3, 2, 2, 2, 71, 230, 3, 2, 2, 2, 73, 235, 3, 2, 2, 2, 75, 240, 3, 2, 2, 2, 77, 244, 3, 2, 2, 2, 79, 81, 9, 2, 2, 2, 80, 79, 3, 2, 2, 2, 81, 82, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 82, 83, 3, 2, 2, 2, 83, 84, 3, 2, 2, 2, 84, 85, 8, 2, 2, 2, 85, 4, 3, 2, 2, 2, 86, 88, 9, 3, 2, 2, 87, 86, 3, 2, 2, 2, 88, 89, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 6, 3, 2, 2, 2, 91, 99, 7, 36, 2, 2, 92, 93, 7, 94, 2, 2, 93, 98, 11, 2, 2, 2, 94, 95, 7, 36, 2, 2, 95, 98, 7, 36, 2, 2, 96, 98, 10, 4, 2, 2, 97, 92, 3, 2, 2, 2, 97, 94, 3, 2, 2, 2, 97, 96, 3, 2, 2, 2, 98, 101, 3, 2, 2, 2, 99, 97, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 102, 3, 2, 2, 2, 101, 99, 3, 2, 2, 2, 102, 103, 7, 36, 2, 2, 103, 8, 3, 2, 2, 2, 104, 112, 7, 41, 2, 2, 105, 106, 7, 94, 2, 2, 106, 111, 11, 2, 2, 2, 107, 108, 7, 41, 2, 2, 108, 111, 7, 41, 2, 2, 109, 111, 10, 5, 2, 2, 110, 105, 3, 2, 2, 2, 110, 107, 3, 2, 2, 2, 110, 109, 3, 2, 2, 2, 111, 114, 3, 2, 2, 2, 112, 110, 3, 2, 2, 2, 112, 113, 3, 2, 2, 2, 113, 115, 3, 2, 2, 2, 114, 112, 3, 2, 2, 2, 115, 116, 7, 41, 2, 2, 116, 10, 3, 2, 2, 2, 117, 118, 9, 6, 2, 2, 118, 12, 3, 2, 2, 2, 119, 123, 9, 7, 2, 2, 120, 122, 9, 8, 2, 2, 121, 120, 3, 2, 2, 2, 122, 125, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 123, 124, 3, 2, 2, 2, 124, 14, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 126, 127, 7, 42, 2, 2, 127, 16, 3, 2, 2, 2, 128, 129, 7, 43, 2, 2, 129, 18, 3, 2, 2, 2, 130, 131, 7, 46, 2, 2, 131, 20, 3, 2, 2, 2, 132, 133, 7, 41, 2, 2, 133, 22, 3, 2, 2, 2, 134, 135, 7, 36, 2, 2, 135, 24, 3, 2, 2, 2, 136, 137, 7, 93, 2, 2, 137, 26, 3, 2, 2, 2, 138, 139, 7, 95, 2, 2, 139, 28, 3, 2, 2, 2, 140, 143, 5, 21, 11, 2, 141, 143, 5, 23, 12, 2, 142, 140, 3, 2, 2, 2, 142, 141, 3, 2, 2, 2, 143, 30, 3, 2, 2, 2, 144, 145, 7, 67, 2, 2, 145, 146, 7, 80, 2, 2, 146, 147, 7, 70, 2, 2, 147, 32, 3, 2, 2, 2, 148, 149, 7, 81, 2, 2, 149, 150, 7, 84, 2, 2, 150, 34, 3, 2, 2, 2, 151, 152, 7, 63, 2, 2, 152, 36, 3, 2, 2, 2, 153, 154, 7, 35, 2, 2, 154, 155, 7, 63, 2, 2, 155, 38, 3, 2, 2, 2, 156, 157, 7, 64, 2, 2, 157, 40, 3, 2, 2, 2, 158, 159, 7, 64, 2, 2, 159, 160, 7, 63, 2, 2, 160, 42, 3, 2, 2, 2, 161, 162, 7, 62, 2, 2, 162, 44, 3, 2, 2, 2, 163, 164, 7, 62, 2, 2, 164, 165, 7, 63, 2, 2, 165, 46, 3, 2, 2, 2, 166, 167, 7, 78, 2, 2, 167, 168, 7, 75, 2, 2, 168, 169, 7, 77, 2, 2, 169, 170, 7, 71, 2, 2, 170, 48, 3, 2, 2, 2, 171, 172, 7, 75, 2, 2, 172, 173, 7, 80, 2, 2, 173, 50, 3, 2, 2, 2, 174, 175, 7, 69, 2, 2, 175, 176, 7, 81, 2, 2, 176, 177, 7, 80, 2, 2, 177, 178, 7, 86, 2, 2, 178, 179, 7, 67, 2, 2, 179, 180, 7, 75, 2, 2, 180, 181, 7, 80, 2, 2, 181, 182, 7, 85, 2, 2, 182, 52, 3, 2, 2, 2, 183, 184, 7, 86, 2, 2, 184, 185, 7, 84, 2, 2, 185, 186, 7, 87, 2, 2, 186, 187, 7, 71, 2, 2, 187, 54, 3, 2, 2, 2, 188, 189, 7, 72, 2, 2, 189, 190, 7, 67, 2, 2, 190, 191, 7, 78, 2, 2, 191, 192, 7, 85, 2, 2, 192, 193, 7, 71, 2, 2, 193, 56, 3, 2, 2, 2, 194, 195, 7, 78, 2, 2, 195, 196, 7, 75, 2, 2, 196, 197, 7, 79, 2, 2, 197, 198, 7, 75, 2, 2, 198, 199, 7, 86, 2, 2, 199, 58, 3, 2, 2, 2, 200, 201, 7, 81, 2, 2, 201, 202, 7, 72, 2, 2, 202, 203, 7, 72, 2, 2, 203, 204, 7, 85, 2, 2, 204, 205, 7, 71, 2, 2, 205, 206, 7, 86, 2, 2, 206, 60, 3, 2, 2, 2, 207, 208, 7, 81, 2, 2, 208, 209, 7, 84, 2, 2, 209, 210, 7, 70, 2, 2, 210, 211, 7, 71, 2, 2, 211, 212, 7, 84, 2, 2, 212, 213, 7, 34, 2, 2, 213, 214, 7, 68, 2, 2, 214, 215, 7, 91, 2, 2, 215, 62, 3, 2, 2, 2, 216, 217, 7, 67, 2, 2, 217, 218, 7, 85, 2, 2, 218, 219, 7, 69, 2, 2, 219, 64, 3, 2, 2, 2, 220, 221, 7, 70, 2, 2, 221, 222, 7, 71, 2, 2, 222, 223, 7, 85, 2, 2, 223, 224, 7, 69, 2, 2, 224, 66, 3, 2, 2, 2, 225, 226, 5, 7, 4, 2, 226, 68, 3, 2, 2, 2, 227, 228, 5, 9, 5, 2, 228, 70, 3, 2, 2, 2, 229, 231, 5, 11, 6, 2, 230, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 230, 3, 2, 2, 2, 232, 233, 3, 2, 2, 2, 233, 72, 3, 2, 2, 2, 234, 236, 9, 9, 2, 2, 235, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 74, 3, 2, 2, 2, 239, 241, 9, 10, 2, 2, 240, 239, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 76, 3, 2, 2, 2, 244, 248, 9, 7, 2, 2, 245, 247, 9, 8, 2, 2, 246, 245, 3, 2, 2, 2, 247, 250, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 78, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 15, 2, 82, 89, 97, 99, 110, 112, 123, 142, 232, 237, 242, 248, 3, 8, 2, 2] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 39, 292, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 3, 2, 6, 2, 91, 10, 2, 13, 2, 14, 2, 92, 3, 2, 3, 2, 3, 3, 6, 3, 98, 10, 3, 13, 3, 14, 3, 99, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 108, 10, 4, 12, 4, 14, 4, 111, 11, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 7, 5, 121, 10, 5, 12, 5, 14, 5, 124, 11, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 7, 7, 132, 10, 7, 12, 7, 14, 7, 135, 11, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 5, 15, 153, 10, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 6, 41, 272, 10, 41, 13, 41, 14, 41, 273, 3, 42, 6, 42, 277, 10, 42, 13, 42, 14, 42, 278, 3, 43, 6, 43, 282, 10, 43, 13, 43, 14, 43, 283, 3, 44, 3, 44, 7, 44, 288, 10, 44, 12, 44, 14, 44, 291, 11, 44, 2, 2, 2, 45, 3, 2, 3, 5, 2, 2, 7, 2, 2, 9, 2, 2, 11, 2, 2, 13, 2, 2, 15, 2, 4, 17, 2, 5, 19, 2, 6, 21, 2, 7, 23, 2, 8, 25, 2, 9, 27, 2, 10, 29, 2, 2, 31, 2, 11, 33, 2, 12, 35, 2, 13, 37, 2, 14, 39, 2, 15, 41, 2, 16, 43, 2, 17, 45, 2, 18, 47, 2, 19, 49, 2, 20, 51, 2, 21, 53, 2, 22, 55, 2, 23, 57, 2, 24, 59, 2, 25, 61, 2, 26, 63, 2, 27, 65, 2, 28, 67, 2, 29, 69, 2, 30, 71, 2, 31, 73, 2, 32, 75, 2, 33, 77, 2, 34, 79, 2, 35, 81, 2, 36, 83, 2, 37, 85, 2, 38, 87, 2, 39, 3, 2, 11, 5, 2, 11, 12, 15, 15, 34, 34, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 50, 59, 3, 2, 67, 92, 4, 2, 67, 92, 97, 97, 4, 2, 67, 92, 99, 124, 7, 2, 48, 48, 50, 59, 67, 92, 97, 97, 99, 124, 2, 299, 2, 3, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 3, 90, 3, 2, 2, 2, 5, 97, 3, 2, 2, 2, 7, 101, 3, 2, 2, 2, 9, 114, 3, 2, 2, 2, 11, 127, 3, 2, 2, 2, 13, 129, 3, 2, 2, 2, 15, 136, 3, 2, 2, 2, 17, 138, 3, 2, 2, 2, 19, 140, 3, 2, 2, 2, 21, 142, 3, 2, 2, 2, 23, 144, 3, 2, 2, 2, 25, 146, 3, 2, 2, 2, 27, 148, 3, 2, 2, 2, 29, 152, 3, 2, 2, 2, 31, 154, 3, 2, 2, 2, 33, 161, 3, 2, 2, 2, 35, 168, 3, 2, 2, 2, 37, 175, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 185, 3, 2, 2, 2, 43, 189, 3, 2, 2, 2, 45, 192, 3, 2, 2, 2, 47, 194, 3, 2, 2, 2, 49, 197, 3, 2, 2, 2, 51, 199, 3, 2, 2, 2, 53, 202, 3, 2, 2, 2, 55, 204, 3, 2, 2, 2, 57, 207, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 215, 3, 2, 2, 2, 63, 224, 3, 2, 2, 2, 65, 229, 3, 2, 2, 2, 67, 235, 3, 2, 2, 2, 69, 241, 3, 2, 2, 2, 71, 248, 3, 2, 2, 2, 73, 257, 3, 2, 2, 2, 75, 261, 3, 2, 2, 2, 77, 266, 3, 2, 2, 2, 79, 268, 3, 2, 2, 2, 81, 271, 3, 2, 2, 2, 83, 276, 3, 2, 2, 2, 85, 281, 3, 2, 2, 2, 87, 285, 3, 2, 2, 2, 89, 91, 9, 2, 2, 2, 90, 89, 3, 2, 2, 2, 91, 92, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 92, 93, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 95, 8, 2, 2, 2, 95, 4, 3, 2, 2, 2, 96, 98, 9, 3, 2, 2, 97, 96, 3, 2, 2, 2, 98, 99, 3, 2, 2, 2, 99, 97, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 6, 3, 2, 2, 2, 101, 109, 7, 36, 2, 2, 102, 103, 7, 94, 2, 2, 103, 108, 11, 2, 2, 2, 104, 105, 7, 36, 2, 2, 105, 108, 7, 36, 2, 2, 106, 108, 10, 4, 2, 2, 107, 102, 3, 2, 2, 2, 107, 104, 3, 2, 2, 2, 107, 106, 3, 2, 2, 2, 108, 111, 3, 2, 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 112, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 112, 113, 7, 36, 2, 2, 113, 8, 3, 2, 2, 2, 114, 122, 7, 41, 2, 2, 115, 116, 7, 94, 2, 2, 116, 121, 11, 2, 2, 2, 117, 118, 7, 41, 2, 2, 118, 121, 7, 41, 2, 2, 119, 121, 10, 5, 2, 2, 120, 115, 3, 2, 2, 2, 120, 117, 3, 2, 2, 2, 120, 119, 3, 2, 2, 2, 121, 124, 3, 2, 2, 2, 122, 120, 3, 2, 2, 2, 122, 123, 3, 2, 2, 2, 123, 125, 3, 2, 2, 2, 124, 122, 3, 2, 2, 2, 125, 126, 7, 41, 2, 2, 126, 10, 3, 2, 2, 2, 127, 128, 9, 6, 2, 2, 128, 12, 3, 2, 2, 2, 129, 133, 9, 7, 2, 2, 130, 132, 9, 8, 2, 2, 131, 130, 3, 2, 2, 2, 132, 135, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 14, 3, 2, 2, 2, 135, 133, 3, 2, 2, 2, 136, 137, 7, 42, 2, 2, 137, 16, 3, 2, 2, 2, 138, 139, 7, 43, 2, 2, 139, 18, 3, 2, 2, 2, 140, 141, 7, 46, 2, 2, 141, 20, 3, 2, 2, 2, 142, 143, 7, 41, 2, 2, 143, 22, 3, 2, 2, 2, 144, 145, 7, 36, 2, 2, 145, 24, 3, 2, 2, 2, 146, 147, 7, 93, 2, 2, 147, 26, 3, 2, 2, 2, 148, 149, 7, 95, 2, 2, 149, 28, 3, 2, 2, 2, 150, 153, 5, 21, 11, 2, 151, 153, 5, 23, 12, 2, 152, 150, 3, 2, 2, 2, 152, 151, 3, 2, 2, 2, 153, 30, 3, 2, 2, 2, 154, 155, 7, 70, 2, 2, 155, 156, 7, 71, 2, 2, 156, 157, 7, 78, 2, 2, 157, 158, 7, 71, 2, 2, 158, 159, 7, 86, 2, 2, 159, 160, 7, 71, 2, 2, 160, 32, 3, 2, 2, 2, 161, 162, 7, 87, 2, 2, 162, 163, 7, 82, 2, 2, 163, 164, 7, 70, 2, 2, 164, 165, 7, 67, 2, 2, 165, 166, 7, 86, 2, 2, 166, 167, 7, 71, 2, 2, 167, 34, 3, 2, 2, 2, 168, 169, 7, 85, 2, 2, 169, 170, 7, 71, 2, 2, 170, 171, 7, 78, 2, 2, 171, 172, 7, 71, 2, 2, 172, 173, 7, 69, 2, 2, 173, 174, 7, 86, 2, 2, 174, 36, 3, 2, 2, 2, 175, 176, 7, 85, 2, 2, 176, 177, 7, 71, 2, 2, 177, 178, 7, 86, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 89, 2, 2, 180, 181, 7, 74, 2, 2, 181, 182, 7, 71, 2, 2, 182, 183, 7, 84, 2, 2, 183, 184, 7, 71, 2, 2, 184, 40, 3, 2, 2, 2, 185, 186, 7, 67, 2, 2, 186, 187, 7, 80, 2, 2, 187, 188, 7, 70, 2, 2, 188, 42, 3, 2, 2, 2, 189, 190, 7, 81, 2, 2, 190, 191, 7, 84, 2, 2, 191, 44, 3, 2, 2, 2, 192, 193, 7, 63, 2, 2, 193, 46, 3, 2, 2, 2, 194, 195, 7, 35, 2, 2, 195, 196, 7, 63, 2, 2, 196, 48, 3, 2, 2, 2, 197, 198, 7, 64, 2, 2, 198, 50, 3, 2, 2, 2, 199, 200, 7, 64, 2, 2, 200, 201, 7, 63, 2, 2, 201, 52, 3, 2, 2, 2, 202, 203, 7, 62, 2, 2, 203, 54, 3, 2, 2, 2, 204, 205, 7, 62, 2, 2, 205, 206, 7, 63, 2, 2, 206, 56, 3, 2, 2, 2, 207, 208, 7, 78, 2, 2, 208, 209, 7, 75, 2, 2, 209, 210, 7, 77, 2, 2, 210, 211, 7, 71, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 75, 2, 2, 213, 214, 7, 80, 2, 2, 214, 60, 3, 2, 2, 2, 215, 216, 7, 69, 2, 2, 216, 217, 7, 81, 2, 2, 217, 218, 7, 80, 2, 2, 218, 219, 7, 86, 2, 2, 219, 220, 7, 67, 2, 2, 220, 221, 7, 75, 2, 2, 221, 222, 7, 80, 2, 2, 222, 223, 7, 85, 2, 2, 223, 62, 3, 2, 2, 2, 224, 225, 7, 86, 2, 2, 225, 226, 7, 84, 2, 2, 226, 227, 7, 87, 2, 2, 227, 228, 7, 71, 2, 2, 228, 64, 3, 2, 2, 2, 229, 230, 7, 72, 2, 2, 230, 231, 7, 67, 2, 2, 231, 232, 7, 78, 2, 2, 232, 233, 7, 85, 2, 2, 233, 234, 7, 71, 2, 2, 234, 66, 3, 2, 2, 2, 235, 236, 7, 78, 2, 2, 236, 237, 7, 75, 2, 2, 237, 238, 7, 79, 2, 2, 238, 239, 7, 75, 2, 2, 239, 240, 7, 86, 2, 2, 240, 68, 3, 2, 2, 2, 241, 242, 7, 81, 2, 2, 242, 243, 7, 72, 2, 2, 243, 244, 7, 72, 2, 2, 244, 245, 7, 85, 2, 2, 245, 246, 7, 71, 2, 2, 246, 247, 7, 86, 2, 2, 247, 70, 3, 2, 2, 2, 248, 249, 7, 81, 2, 2, 249, 250, 7, 84, 2, 2, 250, 251, 7, 70, 2, 2, 251, 252, 7, 71, 2, 2, 252, 253, 7, 84, 2, 2, 253, 254, 7, 34, 2, 2, 254, 255, 7, 68, 2, 2, 255, 256, 7, 91, 2, 2, 256, 72, 3, 2, 2, 2, 257, 258, 7, 67, 2, 2, 258, 259, 7, 85, 2, 2, 259, 260, 7, 69, 2, 2, 260, 74, 3, 2, 2, 2, 261, 262, 7, 70, 2, 2, 262, 263, 7, 71, 2, 2, 263, 264, 7, 85, 2, 2, 264, 265, 7, 69, 2, 2, 265, 76, 3, 2, 2, 2, 266, 267, 5, 7, 4, 2, 267, 78, 3, 2, 2, 2, 268, 269, 5, 9, 5, 2, 269, 80, 3, 2, 2, 2, 270, 272, 5, 11, 6, 2, 271, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 82, 3, 2, 2, 2, 275, 277, 9, 9, 2, 2, 276, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 84, 3, 2, 2, 2, 280, 282, 9, 10, 2, 2, 281, 280, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 86, 3, 2, 2, 2, 285, 289, 9, 7, 2, 2, 286, 288, 9, 8, 2, 2, 287, 286, 3, 2, 2, 2, 288, 291, 3, 2, 2, 2, 289, 287, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 88, 3, 2, 2, 2, 291, 289, 3, 2, 2, 2, 15, 2, 92, 99, 107, 109, 120, 122, 133, 152, 273, 278, 283, 289, 3, 8, 2, 2] \ No newline at end of file diff --git a/packages/ql/src/WebdaQLParserLexer.tokens b/packages/ql/src/WebdaQLParserLexer.tokens index d6427881e..cf8a82415 100644 --- a/packages/ql/src/WebdaQLParserLexer.tokens +++ b/packages/ql/src/WebdaQLParserLexer.tokens @@ -6,30 +6,35 @@ SINGLE_QUOTE_SYMB=5 DOUBLE_QUOTE_SYMB=6 LR_SQ_BRACKET=7 RR_SQ_BRACKET=8 -AND=9 -OR=10 -EQUAL=11 -NOT_EQUAL=12 -GREATER=13 -GREATER_OR_EQUAL=14 -LESS=15 -LESS_OR_EQUAL=16 -LIKE=17 -IN=18 -CONTAINS=19 -TRUE=20 -FALSE=21 -LIMIT=22 -OFFSET=23 -ORDER_BY=24 -ASC=25 -DESC=26 -DQUOTED_STRING_LITERAL=27 -SQUOTED_STRING_LITERAL=28 -INTEGER_LITERAL=29 -IDENTIFIER=30 -IDENTIFIER_WITH_NUMBER=31 -FUNCTION_IDENTIFIER_WITH_UNDERSCORE=32 +DELETE=9 +UPDATE=10 +SELECT=11 +SET=12 +WHERE=13 +AND=14 +OR=15 +EQUAL=16 +NOT_EQUAL=17 +GREATER=18 +GREATER_OR_EQUAL=19 +LESS=20 +LESS_OR_EQUAL=21 +LIKE=22 +IN=23 +CONTAINS=24 +TRUE=25 +FALSE=26 +LIMIT=27 +OFFSET=28 +ORDER_BY=29 +ASC=30 +DESC=31 +DQUOTED_STRING_LITERAL=32 +SQUOTED_STRING_LITERAL=33 +INTEGER_LITERAL=34 +IDENTIFIER=35 +IDENTIFIER_WITH_NUMBER=36 +FUNCTION_IDENTIFIER_WITH_UNDERSCORE=37 '('=2 ')'=3 ','=4 @@ -37,21 +42,26 @@ FUNCTION_IDENTIFIER_WITH_UNDERSCORE=32 '"'=6 '['=7 ']'=8 -'AND'=9 -'OR'=10 -'='=11 -'!='=12 -'>'=13 -'>='=14 -'<'=15 -'<='=16 -'LIKE'=17 -'IN'=18 -'CONTAINS'=19 -'TRUE'=20 -'FALSE'=21 -'LIMIT'=22 -'OFFSET'=23 -'ORDER BY'=24 -'ASC'=25 -'DESC'=26 +'DELETE'=9 +'UPDATE'=10 +'SELECT'=11 +'SET'=12 +'WHERE'=13 +'AND'=14 +'OR'=15 +'='=16 +'!='=17 +'>'=18 +'>='=19 +'<'=20 +'<='=21 +'LIKE'=22 +'IN'=23 +'CONTAINS'=24 +'TRUE'=25 +'FALSE'=26 +'LIMIT'=27 +'OFFSET'=28 +'ORDER BY'=29 +'ASC'=30 +'DESC'=31 diff --git a/packages/ql/src/WebdaQLParserLexer.ts b/packages/ql/src/WebdaQLParserLexer.ts index 1b0e13a5f..fa617e83e 100644 --- a/packages/ql/src/WebdaQLParserLexer.ts +++ b/packages/ql/src/WebdaQLParserLexer.ts @@ -1,4 +1,5 @@ -// Generated from src/stores/webdaql/WebdaQLParser.g4 by ANTLR 4.9.0-SNAPSHOT +// Generated from src/WebdaQLParser.g4 by ANTLR 4.9.0-SNAPSHOT + import { ATN } from "antlr4ts/atn/ATN.js"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer.js"; @@ -10,312 +11,248 @@ import { VocabularyImpl } from "antlr4ts/VocabularyImpl.js"; import * as Utils from "antlr4ts/misc/Utils"; + export class WebdaQLParserLexer extends Lexer { - public static readonly SPACE = 1; - public static readonly LR_BRACKET = 2; - public static readonly RR_BRACKET = 3; - public static readonly COMMA = 4; - public static readonly SINGLE_QUOTE_SYMB = 5; - public static readonly DOUBLE_QUOTE_SYMB = 6; - public static readonly LR_SQ_BRACKET = 7; - public static readonly RR_SQ_BRACKET = 8; - public static readonly AND = 9; - public static readonly OR = 10; - public static readonly EQUAL = 11; - public static readonly NOT_EQUAL = 12; - public static readonly GREATER = 13; - public static readonly GREATER_OR_EQUAL = 14; - public static readonly LESS = 15; - public static readonly LESS_OR_EQUAL = 16; - public static readonly LIKE = 17; - public static readonly IN = 18; - public static readonly CONTAINS = 19; - public static readonly TRUE = 20; - public static readonly FALSE = 21; - public static readonly LIMIT = 22; - public static readonly OFFSET = 23; - public static readonly ORDER_BY = 24; - public static readonly ASC = 25; - public static readonly DESC = 26; - public static readonly DQUOTED_STRING_LITERAL = 27; - public static readonly SQUOTED_STRING_LITERAL = 28; - public static readonly INTEGER_LITERAL = 29; - public static readonly IDENTIFIER = 30; - public static readonly IDENTIFIER_WITH_NUMBER = 31; - public static readonly FUNCTION_IDENTIFIER_WITH_UNDERSCORE = 32; + public static readonly SPACE = 1; + public static readonly LR_BRACKET = 2; + public static readonly RR_BRACKET = 3; + public static readonly COMMA = 4; + public static readonly SINGLE_QUOTE_SYMB = 5; + public static readonly DOUBLE_QUOTE_SYMB = 6; + public static readonly LR_SQ_BRACKET = 7; + public static readonly RR_SQ_BRACKET = 8; + public static readonly DELETE = 9; + public static readonly UPDATE = 10; + public static readonly SELECT = 11; + public static readonly SET = 12; + public static readonly WHERE = 13; + public static readonly AND = 14; + public static readonly OR = 15; + public static readonly EQUAL = 16; + public static readonly NOT_EQUAL = 17; + public static readonly GREATER = 18; + public static readonly GREATER_OR_EQUAL = 19; + public static readonly LESS = 20; + public static readonly LESS_OR_EQUAL = 21; + public static readonly LIKE = 22; + public static readonly IN = 23; + public static readonly CONTAINS = 24; + public static readonly TRUE = 25; + public static readonly FALSE = 26; + public static readonly LIMIT = 27; + public static readonly OFFSET = 28; + public static readonly ORDER_BY = 29; + public static readonly ASC = 30; + public static readonly DESC = 31; + public static readonly DQUOTED_STRING_LITERAL = 32; + public static readonly SQUOTED_STRING_LITERAL = 33; + public static readonly INTEGER_LITERAL = 34; + public static readonly IDENTIFIER = 35; + public static readonly IDENTIFIER_WITH_NUMBER = 36; + public static readonly FUNCTION_IDENTIFIER_WITH_UNDERSCORE = 37; + + // tslint:disable:no-trailing-whitespace + public static readonly channelNames: string[] = [ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN", + ]; - // tslint:disable:no-trailing-whitespace - public static readonly channelNames: string[] = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN"]; + // tslint:disable:no-trailing-whitespace + public static readonly modeNames: string[] = [ + "DEFAULT_MODE", + ]; - // tslint:disable:no-trailing-whitespace - public static readonly modeNames: string[] = ["DEFAULT_MODE"]; + public static readonly ruleNames: string[] = [ + "SPACE", "ID_LITERAL", "DQUOTA_STRING", "SQUOTA_STRING", "INT_DIGIT", + "FN_LITERAL", "LR_BRACKET", "RR_BRACKET", "COMMA", "SINGLE_QUOTE_SYMB", + "DOUBLE_QUOTE_SYMB", "LR_SQ_BRACKET", "RR_SQ_BRACKET", "QUOTE_SYMB", "DELETE", + "UPDATE", "SELECT", "SET", "WHERE", "AND", "OR", "EQUAL", "NOT_EQUAL", + "GREATER", "GREATER_OR_EQUAL", "LESS", "LESS_OR_EQUAL", "LIKE", "IN", + "CONTAINS", "TRUE", "FALSE", "LIMIT", "OFFSET", "ORDER_BY", "ASC", "DESC", + "DQUOTED_STRING_LITERAL", "SQUOTED_STRING_LITERAL", "INTEGER_LITERAL", + "IDENTIFIER", "IDENTIFIER_WITH_NUMBER", "FUNCTION_IDENTIFIER_WITH_UNDERSCORE", + ]; - public static readonly ruleNames: string[] = [ - "SPACE", - "ID_LITERAL", - "DQUOTA_STRING", - "SQUOTA_STRING", - "INT_DIGIT", - "FN_LITERAL", - "LR_BRACKET", - "RR_BRACKET", - "COMMA", - "SINGLE_QUOTE_SYMB", - "DOUBLE_QUOTE_SYMB", - "LR_SQ_BRACKET", - "RR_SQ_BRACKET", - "QUOTE_SYMB", - "AND", - "OR", - "EQUAL", - "NOT_EQUAL", - "GREATER", - "GREATER_OR_EQUAL", - "LESS", - "LESS_OR_EQUAL", - "LIKE", - "IN", - "CONTAINS", - "TRUE", - "FALSE", - "LIMIT", - "OFFSET", - "ORDER_BY", - "ASC", - "DESC", - "DQUOTED_STRING_LITERAL", - "SQUOTED_STRING_LITERAL", - "INTEGER_LITERAL", - "IDENTIFIER", - "IDENTIFIER_WITH_NUMBER", - "FUNCTION_IDENTIFIER_WITH_UNDERSCORE" - ]; + private static readonly _LITERAL_NAMES: Array = [ + undefined, undefined, "'('", "')'", "','", "'''", "'\"'", "'['", "']'", + "'DELETE'", "'UPDATE'", "'SELECT'", "'SET'", "'WHERE'", "'AND'", "'OR'", + "'='", "'!='", "'>'", "'>='", "'<'", "'<='", "'LIKE'", "'IN'", "'CONTAINS'", + "'TRUE'", "'FALSE'", "'LIMIT'", "'OFFSET'", "'ORDER BY'", "'ASC'", "'DESC'", + ]; + private static readonly _SYMBOLIC_NAMES: Array = [ + undefined, "SPACE", "LR_BRACKET", "RR_BRACKET", "COMMA", "SINGLE_QUOTE_SYMB", + "DOUBLE_QUOTE_SYMB", "LR_SQ_BRACKET", "RR_SQ_BRACKET", "DELETE", "UPDATE", + "SELECT", "SET", "WHERE", "AND", "OR", "EQUAL", "NOT_EQUAL", "GREATER", + "GREATER_OR_EQUAL", "LESS", "LESS_OR_EQUAL", "LIKE", "IN", "CONTAINS", + "TRUE", "FALSE", "LIMIT", "OFFSET", "ORDER_BY", "ASC", "DESC", "DQUOTED_STRING_LITERAL", + "SQUOTED_STRING_LITERAL", "INTEGER_LITERAL", "IDENTIFIER", "IDENTIFIER_WITH_NUMBER", + "FUNCTION_IDENTIFIER_WITH_UNDERSCORE", + ]; + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(WebdaQLParserLexer._LITERAL_NAMES, WebdaQLParserLexer._SYMBOLIC_NAMES, []); - private static readonly _LITERAL_NAMES: Array = [ - undefined, - undefined, - "'('", - "')'", - "','", - "'''", - "'\"'", - "'['", - "']'", - "'AND'", - "'OR'", - "'='", - "'!='", - "'>'", - "'>='", - "'<'", - "'<='", - "'LIKE'", - "'IN'", - "'CONTAINS'", - "'TRUE'", - "'FALSE'", - "'LIMIT'", - "'OFFSET'", - "'ORDER BY'", - "'ASC'", - "'DESC'" - ]; - private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, - "SPACE", - "LR_BRACKET", - "RR_BRACKET", - "COMMA", - "SINGLE_QUOTE_SYMB", - "DOUBLE_QUOTE_SYMB", - "LR_SQ_BRACKET", - "RR_SQ_BRACKET", - "AND", - "OR", - "EQUAL", - "NOT_EQUAL", - "GREATER", - "GREATER_OR_EQUAL", - "LESS", - "LESS_OR_EQUAL", - "LIKE", - "IN", - "CONTAINS", - "TRUE", - "FALSE", - "LIMIT", - "OFFSET", - "ORDER_BY", - "ASC", - "DESC", - "DQUOTED_STRING_LITERAL", - "SQUOTED_STRING_LITERAL", - "INTEGER_LITERAL", - "IDENTIFIER", - "IDENTIFIER_WITH_NUMBER", - "FUNCTION_IDENTIFIER_WITH_UNDERSCORE" - ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( - WebdaQLParserLexer._LITERAL_NAMES, - WebdaQLParserLexer._SYMBOLIC_NAMES, - [] - ); + // @Override + // @NotNull + public get vocabulary(): Vocabulary { + return WebdaQLParserLexer.VOCABULARY; + } + // tslint:enable:no-trailing-whitespace - // @Override - // @NotNull - public get vocabulary(): Vocabulary { - return WebdaQLParserLexer.VOCABULARY; - } - // tslint:enable:no-trailing-whitespace - constructor(input: CharStream) { - super(input); - this._interp = new LexerATNSimulator(WebdaQLParserLexer._ATN, this); - } + constructor(input: CharStream) { + super(input); + this._interp = new LexerATNSimulator(WebdaQLParserLexer._ATN, this); + } - // @Override - public get grammarFileName(): string { - return "WebdaQLParser.g4"; - } + // @Override + public get grammarFileName(): string { return "WebdaQLParser.g4"; } - // @Override - public get ruleNames(): string[] { - return WebdaQLParserLexer.ruleNames; - } + // @Override + public get ruleNames(): string[] { return WebdaQLParserLexer.ruleNames; } - // @Override - public get serializedATN(): string { - return WebdaQLParserLexer._serializedATN; - } + // @Override + public get serializedATN(): string { return WebdaQLParserLexer._serializedATN; } - // @Override - public get channelNames(): string[] { - return WebdaQLParserLexer.channelNames; - } + // @Override + public get channelNames(): string[] { return WebdaQLParserLexer.channelNames; } - // @Override - public get modeNames(): string[] { - return WebdaQLParserLexer.modeNames; - } + // @Override + public get modeNames(): string[] { return WebdaQLParserLexer.modeNames; } - public static readonly _serializedATN: string = - '\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02"\xFB\b\x01\x04' + - "\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04" + - "\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r" + - "\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12" + - "\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17" + - "\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t\x1C" + - '\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04"\t"\x04' + - "#\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x03\x02\x06\x02Q\n\x02\r\x02\x0E" + - "\x02R\x03\x02\x03\x02\x03\x03\x06\x03X\n\x03\r\x03\x0E\x03Y\x03\x04\x03" + - "\x04\x03\x04\x03\x04\x03\x04\x03\x04\x07\x04b\n\x04\f\x04\x0E\x04e\v\x04" + - "\x03\x04\x03\x04\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x07\x05" + - "o\n\x05\f\x05\x0E\x05r\v\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03\x07\x03" + - "\x07\x07\x07z\n\x07\f\x07\x0E\x07}\v\x07\x03\b\x03\b\x03\t\x03\t\x03\n" + - "\x03\n\x03\v\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0F\x03" + - "\x0F\x05\x0F\x8F\n\x0F\x03\x10\x03\x10\x03\x10\x03\x10\x03\x11\x03\x11" + - "\x03\x11\x03\x12\x03\x12\x03\x13\x03\x13\x03\x13\x03\x14\x03\x14\x03\x15" + - "\x03\x15\x03\x15\x03\x16\x03\x16\x03\x17\x03\x17\x03\x17\x03\x18\x03\x18" + - "\x03\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A" + - "\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1B" + - "\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1D" + - "\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03\x1E" + - "\x03\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F" + - "\x03\x1F\x03\x1F\x03\x1F\x03 \x03 \x03 \x03 \x03!\x03!\x03!\x03!\x03!" + - '\x03"\x03"\x03#\x03#\x03$\x06$\xE7\n$\r$\x0E$\xE8\x03%\x06%\xEC\n%\r' + - "%\x0E%\xED\x03&\x06&\xF1\n&\r&\x0E&\xF2\x03'\x03'\x07'\xF7\n'\f'" + - "\x0E'\xFA\v'\x02\x02\x02(\x03\x02\x03\x05\x02\x02\x07\x02\x02\t\x02" + - "\x02\v\x02\x02\r\x02\x02\x0F\x02\x04\x11\x02\x05\x13\x02\x06\x15\x02\x07" + - "\x17\x02\b\x19\x02\t\x1B\x02\n\x1D\x02\x02\x1F\x02\v!\x02\f#\x02\r%\x02" + - "\x0E'\x02\x0F)\x02\x10+\x02\x11-\x02\x12/\x02\x131\x02\x143\x02\x155" + - "\x02\x167\x02\x179\x02\x18;\x02\x19=\x02\x1A?\x02\x1BA\x02\x1CC\x02\x1D" + - 'E\x02\x1EG\x02\x1FI\x02 K\x02!M\x02"\x03\x02\v\x05\x02\v\f\x0F\x0F"' + - '"\x05\x022;C\\c|\x04\x02$$^^\x04\x02))^^\x03\x022;\x03\x02C\\\x04\x02' + - "C\\aa\x04\x02C\\c|\x07\x02002;C\\aac|\x02\u0102\x02\x03\x03\x02\x02\x02" + - "\x02\x0F\x03\x02\x02\x02\x02\x11\x03\x02\x02\x02\x02\x13\x03\x02\x02\x02" + - "\x02\x15\x03\x02\x02\x02\x02\x17\x03\x02\x02\x02\x02\x19\x03\x02\x02\x02" + - "\x02\x1B\x03\x02\x02\x02\x02\x1F\x03\x02\x02\x02\x02!\x03\x02\x02\x02" + - "\x02#\x03\x02\x02\x02\x02%\x03\x02\x02\x02\x02'\x03\x02\x02\x02\x02)" + - "\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02-\x03\x02\x02\x02\x02/\x03\x02" + - "\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02\x02\x02\x025\x03\x02\x02\x02" + - "\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02\x02;\x03\x02\x02\x02\x02=\x03" + - "\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03\x02\x02\x02\x02C\x03\x02\x02" + - "\x02\x02E\x03\x02\x02\x02\x02G\x03\x02\x02\x02\x02I\x03\x02\x02\x02\x02" + - "K\x03\x02\x02\x02\x02M\x03\x02\x02\x02\x03P\x03\x02\x02\x02\x05W\x03\x02" + - "\x02\x02\x07[\x03\x02\x02\x02\th\x03\x02\x02\x02\vu\x03\x02\x02\x02\r" + - "w\x03\x02\x02\x02\x0F~\x03\x02\x02\x02\x11\x80\x03\x02\x02\x02\x13\x82" + - "\x03\x02\x02\x02\x15\x84\x03\x02\x02\x02\x17\x86\x03\x02\x02\x02\x19\x88" + - "\x03\x02\x02\x02\x1B\x8A\x03\x02\x02\x02\x1D\x8E\x03\x02\x02\x02\x1F\x90" + - "\x03\x02\x02\x02!\x94\x03\x02\x02\x02#\x97\x03\x02\x02\x02%\x99\x03\x02" + - "\x02\x02'\x9C\x03\x02\x02\x02)\x9E\x03\x02\x02\x02+\xA1\x03\x02\x02\x02" + - "-\xA3\x03\x02\x02\x02/\xA6\x03\x02\x02\x021\xAB\x03\x02\x02\x023\xAE\x03" + - "\x02\x02\x025\xB7\x03\x02\x02\x027\xBC\x03\x02\x02\x029\xC2\x03\x02\x02" + - "\x02;\xC8\x03\x02\x02\x02=\xCF\x03\x02\x02\x02?\xD8\x03\x02\x02\x02A\xDC" + - "\x03\x02\x02\x02C\xE1\x03\x02\x02\x02E\xE3\x03\x02\x02\x02G\xE6\x03\x02" + - "\x02\x02I\xEB\x03\x02\x02\x02K\xF0\x03\x02\x02\x02M\xF4\x03\x02\x02\x02" + - "OQ\t\x02\x02\x02PO\x03\x02\x02\x02QR\x03\x02\x02\x02RP\x03\x02\x02\x02" + - "RS\x03\x02\x02\x02ST\x03\x02\x02\x02TU\b\x02\x02\x02U\x04\x03\x02\x02" + - "\x02VX\t\x03\x02\x02WV\x03\x02\x02\x02XY\x03\x02\x02\x02YW\x03\x02\x02" + - "\x02YZ\x03\x02\x02\x02Z\x06\x03\x02\x02\x02[c\x07$\x02\x02\\]\x07^\x02" + - "\x02]b\v\x02\x02\x02^_\x07$\x02\x02_b\x07$\x02\x02`b\n\x04\x02\x02a\\" + - "\x03\x02\x02\x02a^\x03\x02\x02\x02a`\x03\x02\x02\x02be\x03\x02\x02\x02" + - "ca\x03\x02\x02\x02cd\x03\x02\x02\x02df\x03\x02\x02\x02ec\x03\x02\x02\x02" + - "fg\x07$\x02\x02g\b\x03\x02\x02\x02hp\x07)\x02\x02ij\x07^\x02\x02jo\v\x02" + - "\x02\x02kl\x07)\x02\x02lo\x07)\x02\x02mo\n\x05\x02\x02ni\x03\x02\x02\x02" + - "nk\x03\x02\x02\x02nm\x03\x02\x02\x02or\x03\x02\x02\x02pn\x03\x02\x02\x02" + - "pq\x03\x02\x02\x02qs\x03\x02\x02\x02rp\x03\x02\x02\x02st\x07)\x02\x02" + - "t\n\x03\x02\x02\x02uv\t\x06\x02\x02v\f\x03\x02\x02\x02w{\t\x07\x02\x02" + - "xz\t\b\x02\x02yx\x03\x02\x02\x02z}\x03\x02\x02\x02{y\x03\x02\x02\x02{" + - "|\x03\x02\x02\x02|\x0E\x03\x02\x02\x02}{\x03\x02\x02\x02~\x7F\x07*\x02" + - "\x02\x7F\x10\x03\x02\x02\x02\x80\x81\x07+\x02\x02\x81\x12\x03\x02\x02" + - "\x02\x82\x83\x07.\x02\x02\x83\x14\x03\x02\x02\x02\x84\x85\x07)\x02\x02" + - "\x85\x16\x03\x02\x02\x02\x86\x87\x07$\x02\x02\x87\x18\x03\x02\x02\x02" + - "\x88\x89\x07]\x02\x02\x89\x1A\x03\x02\x02\x02\x8A\x8B\x07_\x02\x02\x8B" + - "\x1C\x03\x02\x02\x02\x8C\x8F\x05\x15\v\x02\x8D\x8F\x05\x17\f\x02\x8E\x8C" + - "\x03\x02\x02\x02\x8E\x8D\x03\x02\x02\x02\x8F\x1E\x03\x02\x02\x02\x90\x91" + - "\x07C\x02\x02\x91\x92\x07P\x02\x02\x92\x93\x07F\x02\x02\x93 \x03\x02\x02" + - '\x02\x94\x95\x07Q\x02\x02\x95\x96\x07T\x02\x02\x96"\x03\x02\x02\x02\x97' + - "\x98\x07?\x02\x02\x98$\x03\x02\x02\x02\x99\x9A\x07#\x02\x02\x9A\x9B\x07" + - "?\x02\x02\x9B&\x03\x02\x02\x02\x9C\x9D\x07@\x02\x02\x9D(\x03\x02\x02\x02" + - "\x9E\x9F\x07@\x02\x02\x9F\xA0\x07?\x02\x02\xA0*\x03\x02\x02\x02\xA1\xA2" + - "\x07>\x02\x02\xA2,\x03\x02\x02\x02\xA3\xA4\x07>\x02\x02\xA4\xA5\x07?\x02" + - "\x02\xA5.\x03\x02\x02\x02\xA6\xA7\x07N\x02\x02\xA7\xA8\x07K\x02\x02\xA8" + - "\xA9\x07M\x02\x02\xA9\xAA\x07G\x02\x02\xAA0\x03\x02\x02\x02\xAB\xAC\x07" + - "K\x02\x02\xAC\xAD\x07P\x02\x02\xAD2\x03\x02\x02\x02\xAE\xAF\x07E\x02\x02" + - "\xAF\xB0\x07Q\x02\x02\xB0\xB1\x07P\x02\x02\xB1\xB2\x07V\x02\x02\xB2\xB3" + - "\x07C\x02\x02\xB3\xB4\x07K\x02\x02\xB4\xB5\x07P\x02\x02\xB5\xB6\x07U\x02" + - "\x02\xB64\x03\x02\x02\x02\xB7\xB8\x07V\x02\x02\xB8\xB9\x07T\x02\x02\xB9" + - "\xBA\x07W\x02\x02\xBA\xBB\x07G\x02\x02\xBB6\x03\x02\x02\x02\xBC\xBD\x07" + - "H\x02\x02\xBD\xBE\x07C\x02\x02\xBE\xBF\x07N\x02\x02\xBF\xC0\x07U\x02\x02" + - "\xC0\xC1\x07G\x02\x02\xC18\x03\x02\x02\x02\xC2\xC3\x07N\x02\x02\xC3\xC4" + - "\x07K\x02\x02\xC4\xC5\x07O\x02\x02\xC5\xC6\x07K\x02\x02\xC6\xC7\x07V\x02" + - "\x02\xC7:\x03\x02\x02\x02\xC8\xC9\x07Q\x02\x02\xC9\xCA\x07H\x02\x02\xCA" + - "\xCB\x07H\x02\x02\xCB\xCC\x07U\x02\x02\xCC\xCD\x07G\x02\x02\xCD\xCE\x07" + - "V\x02\x02\xCE<\x03\x02\x02\x02\xCF\xD0\x07Q\x02\x02\xD0\xD1\x07T\x02\x02" + - "\xD1\xD2\x07F\x02\x02\xD2\xD3\x07G\x02\x02\xD3\xD4\x07T\x02\x02\xD4\xD5" + - '\x07"\x02\x02\xD5\xD6\x07D\x02\x02\xD6\xD7\x07[\x02\x02\xD7>\x03\x02' + - "\x02\x02\xD8\xD9\x07C\x02\x02\xD9\xDA\x07U\x02\x02\xDA\xDB\x07E\x02\x02" + - "\xDB@\x03\x02\x02\x02\xDC\xDD\x07F\x02\x02\xDD\xDE\x07G\x02\x02\xDE\xDF" + - "\x07U\x02\x02\xDF\xE0\x07E\x02\x02\xE0B\x03\x02\x02\x02\xE1\xE2\x05\x07" + - "\x04\x02\xE2D\x03\x02\x02\x02\xE3\xE4\x05\t\x05\x02\xE4F\x03\x02\x02\x02" + - "\xE5\xE7\x05\v\x06\x02\xE6\xE5\x03\x02\x02\x02\xE7\xE8\x03\x02\x02\x02" + - "\xE8\xE6\x03\x02\x02\x02\xE8\xE9\x03\x02\x02\x02\xE9H\x03\x02\x02\x02" + - "\xEA\xEC\t\t\x02\x02\xEB\xEA\x03\x02\x02\x02\xEC\xED\x03\x02\x02\x02\xED" + - "\xEB\x03\x02\x02\x02\xED\xEE\x03\x02\x02\x02\xEEJ\x03\x02\x02\x02\xEF" + - "\xF1\t\n\x02\x02\xF0\xEF\x03\x02\x02\x02\xF1\xF2\x03\x02\x02\x02\xF2\xF0" + - "\x03\x02\x02\x02\xF2\xF3\x03\x02\x02\x02\xF3L\x03\x02\x02\x02\xF4\xF8" + - "\t\x07\x02\x02\xF5\xF7\t\b\x02\x02\xF6\xF5\x03\x02\x02\x02\xF7\xFA\x03" + - "\x02\x02\x02\xF8\xF6\x03\x02\x02\x02\xF8\xF9\x03\x02\x02\x02\xF9N\x03" + - "\x02\x02\x02\xFA\xF8\x03\x02\x02\x02\x0F\x02RYacnp{\x8E\xE8\xED\xF2\xF8" + - "\x03\b\x02\x02"; - public static __ATN: ATN; - public static get _ATN(): ATN { - if (!WebdaQLParserLexer.__ATN) { - WebdaQLParserLexer.__ATN = new ATNDeserializer().deserialize( - Utils.toCharArray(WebdaQLParserLexer._serializedATN) - ); - } + public static readonly _serializedATN: string = + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02\'\u0124\b\x01" + + "\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06" + + "\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r" + + "\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t" + + "\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t" + + "\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t" + + "\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t" + + "\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t)\x04*\t*\x04" + + "+\t+\x04,\t,\x03\x02\x06\x02[\n\x02\r\x02\x0E\x02\\\x03\x02\x03\x02\x03" + + "\x03\x06\x03b\n\x03\r\x03\x0E\x03c\x03\x04\x03\x04\x03\x04\x03\x04\x03" + + "\x04\x03\x04\x07\x04l\n\x04\f\x04\x0E\x04o\v\x04\x03\x04\x03\x04\x03\x05" + + "\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x07\x05y\n\x05\f\x05\x0E\x05" + + "|\v\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03\x07\x03\x07\x07\x07\x84\n" + + "\x07\f\x07\x0E\x07\x87\v\x07\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\v" + + "\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x05\x0F" + + "\x99\n\x0F\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03" + + "\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x12\x03\x12\x03" + + "\x12\x03\x12\x03\x12\x03\x12\x03\x12\x03\x13\x03\x13\x03\x13\x03\x13\x03" + + "\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x15\x03" + + "\x15\x03\x16\x03\x16\x03\x16\x03\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03" + + "\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03" + + "\x1C\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03" + + "\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03" + + " \x03 \x03 \x03 \x03 \x03!\x03!\x03!\x03!\x03!\x03!\x03\"\x03\"\x03\"" + + "\x03\"\x03\"\x03\"\x03#\x03#\x03#\x03#\x03#\x03#\x03#\x03$\x03$\x03$\x03" + + "$\x03$\x03$\x03$\x03$\x03$\x03%\x03%\x03%\x03%\x03&\x03&\x03&\x03&\x03" + + "&\x03\'\x03\'\x03(\x03(\x03)\x06)\u0110\n)\r)\x0E)\u0111\x03*\x06*\u0115" + + "\n*\r*\x0E*\u0116\x03+\x06+\u011A\n+\r+\x0E+\u011B\x03,\x03,\x07,\u0120" + + "\n,\f,\x0E,\u0123\v,\x02\x02\x02-\x03\x02\x03\x05\x02\x02\x07\x02\x02" + + "\t\x02\x02\v\x02\x02\r\x02\x02\x0F\x02\x04\x11\x02\x05\x13\x02\x06\x15" + + "\x02\x07\x17\x02\b\x19\x02\t\x1B\x02\n\x1D\x02\x02\x1F\x02\v!\x02\f#\x02" + + "\r%\x02\x0E\'\x02\x0F)\x02\x10+\x02\x11-\x02\x12/\x02\x131\x02\x143\x02" + + "\x155\x02\x167\x02\x179\x02\x18;\x02\x19=\x02\x1A?\x02\x1BA\x02\x1CC\x02" + + "\x1DE\x02\x1EG\x02\x1FI\x02 K\x02!M\x02\"O\x02#Q\x02$S\x02%U\x02&W\x02" + + "\'\x03\x02\v\x05\x02\v\f\x0F\x0F\"\"\x05\x022;C\\c|\x04\x02$$^^\x04\x02" + + "))^^\x03\x022;\x03\x02C\\\x04\x02C\\aa\x04\x02C\\c|\x07\x02002;C\\aac" + + "|\x02\u012B\x02\x03\x03\x02\x02\x02\x02\x0F\x03\x02\x02\x02\x02\x11\x03" + + "\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17\x03" + + "\x02\x02\x02\x02\x19\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1F\x03" + + "\x02\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02\x02" + + "\x02\x02\'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02" + + "-\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02" + + "\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02" + + "\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03" + + "\x02\x02\x02\x02C\x03\x02\x02\x02\x02E\x03\x02\x02\x02\x02G\x03\x02\x02" + + "\x02\x02I\x03\x02\x02\x02\x02K\x03\x02\x02\x02\x02M\x03\x02\x02\x02\x02" + + "O\x03\x02\x02\x02\x02Q\x03\x02\x02\x02\x02S\x03\x02\x02\x02\x02U\x03\x02" + + "\x02\x02\x02W\x03\x02\x02\x02\x03Z\x03\x02\x02\x02\x05a\x03\x02\x02\x02" + + "\x07e\x03\x02\x02\x02\tr\x03\x02\x02\x02\v\x7F\x03\x02\x02\x02\r\x81\x03" + + "\x02\x02\x02\x0F\x88\x03\x02\x02\x02\x11\x8A\x03\x02\x02\x02\x13\x8C\x03" + + "\x02\x02\x02\x15\x8E\x03\x02\x02\x02\x17\x90\x03\x02\x02\x02\x19\x92\x03" + + "\x02\x02\x02\x1B\x94\x03\x02\x02\x02\x1D\x98\x03\x02\x02\x02\x1F\x9A\x03" + + "\x02\x02\x02!\xA1\x03\x02\x02\x02#\xA8\x03\x02\x02\x02%\xAF\x03\x02\x02" + + "\x02\'\xB3\x03\x02\x02\x02)\xB9\x03\x02\x02\x02+\xBD\x03\x02\x02\x02-" + + "\xC0\x03\x02\x02\x02/\xC2\x03\x02\x02\x021\xC5\x03\x02\x02\x023\xC7\x03" + + "\x02\x02\x025\xCA\x03\x02\x02\x027\xCC\x03\x02\x02\x029\xCF\x03\x02\x02" + + "\x02;\xD4\x03\x02\x02\x02=\xD7\x03\x02\x02\x02?\xE0\x03\x02\x02\x02A\xE5" + + "\x03\x02\x02\x02C\xEB\x03\x02\x02\x02E\xF1\x03\x02\x02\x02G\xF8\x03\x02" + + "\x02\x02I\u0101\x03\x02\x02\x02K\u0105\x03\x02\x02\x02M\u010A\x03\x02" + + "\x02\x02O\u010C\x03\x02\x02\x02Q\u010F\x03\x02\x02\x02S\u0114\x03\x02" + + "\x02\x02U\u0119\x03\x02\x02\x02W\u011D\x03\x02\x02\x02Y[\t\x02\x02\x02" + + "ZY\x03\x02\x02\x02[\\\x03\x02\x02\x02\\Z\x03\x02\x02\x02\\]\x03\x02\x02" + + "\x02]^\x03\x02\x02\x02^_\b\x02\x02\x02_\x04\x03\x02\x02\x02`b\t\x03\x02" + + "\x02a`\x03\x02\x02\x02bc\x03\x02\x02\x02ca\x03\x02\x02\x02cd\x03\x02\x02" + + "\x02d\x06\x03\x02\x02\x02em\x07$\x02\x02fg\x07^\x02\x02gl\v\x02\x02\x02" + + "hi\x07$\x02\x02il\x07$\x02\x02jl\n\x04\x02\x02kf\x03\x02\x02\x02kh\x03" + + "\x02\x02\x02kj\x03\x02\x02\x02lo\x03\x02\x02\x02mk\x03\x02\x02\x02mn\x03" + + "\x02\x02\x02np\x03\x02\x02\x02om\x03\x02\x02\x02pq\x07$\x02\x02q\b\x03" + + "\x02\x02\x02rz\x07)\x02\x02st\x07^\x02\x02ty\v\x02\x02\x02uv\x07)\x02" + + "\x02vy\x07)\x02\x02wy\n\x05\x02\x02xs\x03\x02\x02\x02xu\x03\x02\x02\x02" + + "xw\x03\x02\x02\x02y|\x03\x02\x02\x02zx\x03\x02\x02\x02z{\x03\x02\x02\x02" + + "{}\x03\x02\x02\x02|z\x03\x02\x02\x02}~\x07)\x02\x02~\n\x03\x02\x02\x02" + + "\x7F\x80\t\x06\x02\x02\x80\f\x03\x02\x02\x02\x81\x85\t\x07\x02\x02\x82" + + "\x84\t\b\x02\x02\x83\x82\x03\x02\x02\x02\x84\x87\x03\x02\x02\x02\x85\x83" + + "\x03\x02\x02\x02\x85\x86\x03\x02\x02\x02\x86\x0E\x03\x02\x02\x02\x87\x85" + + "\x03\x02\x02\x02\x88\x89\x07*\x02\x02\x89\x10\x03\x02\x02\x02\x8A\x8B" + + "\x07+\x02\x02\x8B\x12\x03\x02\x02\x02\x8C\x8D\x07.\x02\x02\x8D\x14\x03" + + "\x02\x02\x02\x8E\x8F\x07)\x02\x02\x8F\x16\x03\x02\x02\x02\x90\x91\x07" + + "$\x02\x02\x91\x18\x03\x02\x02\x02\x92\x93\x07]\x02\x02\x93\x1A\x03\x02" + + "\x02\x02\x94\x95\x07_\x02\x02\x95\x1C\x03\x02\x02\x02\x96\x99\x05\x15" + + "\v\x02\x97\x99\x05\x17\f\x02\x98\x96\x03\x02\x02\x02\x98\x97\x03\x02\x02" + + "\x02\x99\x1E\x03\x02\x02\x02\x9A\x9B\x07F\x02\x02\x9B\x9C\x07G\x02\x02" + + "\x9C\x9D\x07N\x02\x02\x9D\x9E\x07G\x02\x02\x9E\x9F\x07V\x02\x02\x9F\xA0" + + "\x07G\x02\x02\xA0 \x03\x02\x02\x02\xA1\xA2\x07W\x02\x02\xA2\xA3\x07R\x02" + + "\x02\xA3\xA4\x07F\x02\x02\xA4\xA5\x07C\x02\x02\xA5\xA6\x07V\x02\x02\xA6" + + "\xA7\x07G\x02\x02\xA7\"\x03\x02\x02\x02\xA8\xA9\x07U\x02\x02\xA9\xAA\x07" + + "G\x02\x02\xAA\xAB\x07N\x02\x02\xAB\xAC\x07G\x02\x02\xAC\xAD\x07E\x02\x02" + + "\xAD\xAE\x07V\x02\x02\xAE$\x03\x02\x02\x02\xAF\xB0\x07U\x02\x02\xB0\xB1" + + "\x07G\x02\x02\xB1\xB2\x07V\x02\x02\xB2&\x03\x02\x02\x02\xB3\xB4\x07Y\x02" + + "\x02\xB4\xB5\x07J\x02\x02\xB5\xB6\x07G\x02\x02\xB6\xB7\x07T\x02\x02\xB7" + + "\xB8\x07G\x02\x02\xB8(\x03\x02\x02\x02\xB9\xBA\x07C\x02\x02\xBA\xBB\x07" + + "P\x02\x02\xBB\xBC\x07F\x02\x02\xBC*\x03\x02\x02\x02\xBD\xBE\x07Q\x02\x02" + + "\xBE\xBF\x07T\x02\x02\xBF,\x03\x02\x02\x02\xC0\xC1\x07?\x02\x02\xC1.\x03" + + "\x02\x02\x02\xC2\xC3\x07#\x02\x02\xC3\xC4\x07?\x02\x02\xC40\x03\x02\x02" + + "\x02\xC5\xC6\x07@\x02\x02\xC62\x03\x02\x02\x02\xC7\xC8\x07@\x02\x02\xC8" + + "\xC9\x07?\x02\x02\xC94\x03\x02\x02\x02\xCA\xCB\x07>\x02\x02\xCB6\x03\x02" + + "\x02\x02\xCC\xCD\x07>\x02\x02\xCD\xCE\x07?\x02\x02\xCE8\x03\x02\x02\x02" + + "\xCF\xD0\x07N\x02\x02\xD0\xD1\x07K\x02\x02\xD1\xD2\x07M\x02\x02\xD2\xD3" + + "\x07G\x02\x02\xD3:\x03\x02\x02\x02\xD4\xD5\x07K\x02\x02\xD5\xD6\x07P\x02" + + "\x02\xD6<\x03\x02\x02\x02\xD7\xD8\x07E\x02\x02\xD8\xD9\x07Q\x02\x02\xD9" + + "\xDA\x07P\x02\x02\xDA\xDB\x07V\x02\x02\xDB\xDC\x07C\x02\x02\xDC\xDD\x07" + + "K\x02\x02\xDD\xDE\x07P\x02\x02\xDE\xDF\x07U\x02\x02\xDF>\x03\x02\x02\x02" + + "\xE0\xE1\x07V\x02\x02\xE1\xE2\x07T\x02\x02\xE2\xE3\x07W\x02\x02\xE3\xE4" + + "\x07G\x02\x02\xE4@\x03\x02\x02\x02\xE5\xE6\x07H\x02\x02\xE6\xE7\x07C\x02" + + "\x02\xE7\xE8\x07N\x02\x02\xE8\xE9\x07U\x02\x02\xE9\xEA\x07G\x02\x02\xEA" + + "B\x03\x02\x02\x02\xEB\xEC\x07N\x02\x02\xEC\xED\x07K\x02\x02\xED\xEE\x07" + + "O\x02\x02\xEE\xEF\x07K\x02\x02\xEF\xF0\x07V\x02\x02\xF0D\x03\x02\x02\x02" + + "\xF1\xF2\x07Q\x02\x02\xF2\xF3\x07H\x02\x02\xF3\xF4\x07H\x02\x02\xF4\xF5" + + "\x07U\x02\x02\xF5\xF6\x07G\x02\x02\xF6\xF7\x07V\x02\x02\xF7F\x03\x02\x02" + + "\x02\xF8\xF9\x07Q\x02\x02\xF9\xFA\x07T\x02\x02\xFA\xFB\x07F\x02\x02\xFB" + + "\xFC\x07G\x02\x02\xFC\xFD\x07T\x02\x02\xFD\xFE\x07\"\x02\x02\xFE\xFF\x07" + + "D\x02\x02\xFF\u0100\x07[\x02\x02\u0100H\x03\x02\x02\x02\u0101\u0102\x07" + + "C\x02\x02\u0102\u0103\x07U\x02\x02\u0103\u0104\x07E\x02\x02\u0104J\x03" + + "\x02\x02\x02\u0105\u0106\x07F\x02\x02\u0106\u0107\x07G\x02\x02\u0107\u0108" + + "\x07U\x02\x02\u0108\u0109\x07E\x02\x02\u0109L\x03\x02\x02\x02\u010A\u010B" + + "\x05\x07\x04\x02\u010BN\x03\x02\x02\x02\u010C\u010D\x05\t\x05\x02\u010D" + + "P\x03\x02\x02\x02\u010E\u0110\x05\v\x06\x02\u010F\u010E\x03\x02\x02\x02" + + "\u0110\u0111\x03\x02\x02\x02\u0111\u010F\x03\x02\x02\x02\u0111\u0112\x03" + + "\x02\x02\x02\u0112R\x03\x02\x02\x02\u0113\u0115\t\t\x02\x02\u0114\u0113" + + "\x03\x02\x02\x02\u0115\u0116\x03\x02\x02\x02\u0116\u0114\x03\x02\x02\x02" + + "\u0116\u0117\x03\x02\x02\x02\u0117T\x03\x02\x02\x02\u0118\u011A\t\n\x02" + + "\x02\u0119\u0118\x03\x02\x02\x02\u011A\u011B\x03\x02\x02\x02\u011B\u0119" + + "\x03\x02\x02\x02\u011B\u011C\x03\x02\x02\x02\u011CV\x03\x02\x02\x02\u011D" + + "\u0121\t\x07\x02\x02\u011E\u0120\t\b\x02\x02\u011F\u011E\x03\x02\x02\x02" + + "\u0120\u0123\x03\x02\x02\x02\u0121\u011F\x03\x02\x02\x02\u0121\u0122\x03" + + "\x02\x02\x02\u0122X\x03\x02\x02\x02\u0123\u0121\x03\x02\x02\x02\x0F\x02" + + "\\ckmxz\x85\x98\u0111\u0116\u011B\u0121\x03\b\x02\x02"; + public static __ATN: ATN; + public static get _ATN(): ATN { + if (!WebdaQLParserLexer.__ATN) { + WebdaQLParserLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(WebdaQLParserLexer._serializedATN)); + } + + return WebdaQLParserLexer.__ATN; + } - return WebdaQLParserLexer.__ATN; - } } + diff --git a/packages/ql/src/WebdaQLParserListener.ts b/packages/ql/src/WebdaQLParserListener.ts index 35481e9ce..83bdf17fe 100644 --- a/packages/ql/src/WebdaQLParserListener.ts +++ b/packages/ql/src/WebdaQLParserListener.ts @@ -1,352 +1,449 @@ -// Generated from src/stores/webdaql/WebdaQLParser.g4 by ANTLR 4.9.0-SNAPSHOT +// Generated from src/WebdaQLParser.g4 by ANTLR 4.9.0-SNAPSHOT + import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; -import { - AndLogicExpressionContext, - AtomContext, - AtomExpressionContext, - BinaryComparisonExpressionContext, - BooleanAtomContext, - BooleanLiteralContext, - ContainsExpressionContext, - ExpressionContext, - IdentifierAtomContext, - IdentifierContext, - InExpressionContext, - IntegerAtomContext, - IntegerLiteralContext, - LikeExpressionContext, - LimitExpressionContext, - OffsetExpressionContext, - OrderExpressionContext, - OrderFieldExpressionContext, - OrLogicExpressionContext, - SetExpressionContext, - StringAtomContext, - StringLiteralContext, - SubExpressionContext, - ValuesAtomContext, - ValuesContext, - WebdaqlContext -} from "./WebdaQLParserParser"; +import { LikeExpressionContext } from "./WebdaQLParserParser"; +import { InExpressionContext } from "./WebdaQLParserParser"; +import { ContainsExpressionContext } from "./WebdaQLParserParser"; +import { BinaryComparisonExpressionContext } from "./WebdaQLParserParser"; +import { AndLogicExpressionContext } from "./WebdaQLParserParser"; +import { OrLogicExpressionContext } from "./WebdaQLParserParser"; +import { SubExpressionContext } from "./WebdaQLParserParser"; +import { AtomExpressionContext } from "./WebdaQLParserParser"; +import { BooleanAtomContext } from "./WebdaQLParserParser"; +import { IntegerAtomContext } from "./WebdaQLParserParser"; +import { StringAtomContext } from "./WebdaQLParserParser"; +import { ValuesAtomContext } from "./WebdaQLParserParser"; +import { IdentifierAtomContext } from "./WebdaQLParserParser"; +import { WebdaqlContext } from "./WebdaQLParserParser"; +import { StatementContext } from "./WebdaQLParserParser"; +import { DeleteStatementContext } from "./WebdaQLParserParser"; +import { UpdateStatementContext } from "./WebdaQLParserParser"; +import { SelectStatementContext } from "./WebdaQLParserParser"; +import { FilterQueryContext } from "./WebdaQLParserParser"; +import { AssignmentListContext } from "./WebdaQLParserParser"; +import { AssignmentContext } from "./WebdaQLParserParser"; +import { FieldListContext } from "./WebdaQLParserParser"; +import { LimitExpressionContext } from "./WebdaQLParserParser"; +import { OffsetExpressionContext } from "./WebdaQLParserParser"; +import { OrderFieldExpressionContext } from "./WebdaQLParserParser"; +import { OrderExpressionContext } from "./WebdaQLParserParser"; +import { ExpressionContext } from "./WebdaQLParserParser"; +import { ValuesContext } from "./WebdaQLParserParser"; +import { AtomContext } from "./WebdaQLParserParser"; +import { IdentifierContext } from "./WebdaQLParserParser"; +import { BooleanLiteralContext } from "./WebdaQLParserParser"; +import { StringLiteralContext } from "./WebdaQLParserParser"; +import { IntegerLiteralContext } from "./WebdaQLParserParser"; +import { SetExpressionContext } from "./WebdaQLParserParser"; + /** * This interface defines a complete listener for a parse tree produced by * `WebdaQLParserParser`. */ export interface WebdaQLParserListener extends ParseTreeListener { - /** - * Enter a parse tree produced by the `likeExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - enterLikeExpression?: (ctx: LikeExpressionContext) => void; - /** - * Exit a parse tree produced by the `likeExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - exitLikeExpression?: (ctx: LikeExpressionContext) => void; - - /** - * Enter a parse tree produced by the `inExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - enterInExpression?: (ctx: InExpressionContext) => void; - /** - * Exit a parse tree produced by the `inExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - exitInExpression?: (ctx: InExpressionContext) => void; - - /** - * Enter a parse tree produced by the `containsExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - enterContainsExpression?: (ctx: ContainsExpressionContext) => void; - /** - * Exit a parse tree produced by the `containsExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - exitContainsExpression?: (ctx: ContainsExpressionContext) => void; - - /** - * Enter a parse tree produced by the `binaryComparisonExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - enterBinaryComparisonExpression?: (ctx: BinaryComparisonExpressionContext) => void; - /** - * Exit a parse tree produced by the `binaryComparisonExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - exitBinaryComparisonExpression?: (ctx: BinaryComparisonExpressionContext) => void; - - /** - * Enter a parse tree produced by the `andLogicExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - enterAndLogicExpression?: (ctx: AndLogicExpressionContext) => void; - /** - * Exit a parse tree produced by the `andLogicExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - exitAndLogicExpression?: (ctx: AndLogicExpressionContext) => void; - - /** - * Enter a parse tree produced by the `orLogicExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - enterOrLogicExpression?: (ctx: OrLogicExpressionContext) => void; - /** - * Exit a parse tree produced by the `orLogicExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - exitOrLogicExpression?: (ctx: OrLogicExpressionContext) => void; - - /** - * Enter a parse tree produced by the `subExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - enterSubExpression?: (ctx: SubExpressionContext) => void; - /** - * Exit a parse tree produced by the `subExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - exitSubExpression?: (ctx: SubExpressionContext) => void; - - /** - * Enter a parse tree produced by the `atomExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - enterAtomExpression?: (ctx: AtomExpressionContext) => void; - /** - * Exit a parse tree produced by the `atomExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - exitAtomExpression?: (ctx: AtomExpressionContext) => void; - - /** - * Enter a parse tree produced by the `booleanAtom` - * labeled alternative in `WebdaQLParserParser.values`. - * @param ctx the parse tree - */ - enterBooleanAtom?: (ctx: BooleanAtomContext) => void; - /** - * Exit a parse tree produced by the `booleanAtom` - * labeled alternative in `WebdaQLParserParser.values`. - * @param ctx the parse tree - */ - exitBooleanAtom?: (ctx: BooleanAtomContext) => void; - - /** - * Enter a parse tree produced by the `integerAtom` - * labeled alternative in `WebdaQLParserParser.values`. - * @param ctx the parse tree - */ - enterIntegerAtom?: (ctx: IntegerAtomContext) => void; - /** - * Exit a parse tree produced by the `integerAtom` - * labeled alternative in `WebdaQLParserParser.values`. - * @param ctx the parse tree - */ - exitIntegerAtom?: (ctx: IntegerAtomContext) => void; - - /** - * Enter a parse tree produced by the `stringAtom` - * labeled alternative in `WebdaQLParserParser.values`. - * @param ctx the parse tree - */ - enterStringAtom?: (ctx: StringAtomContext) => void; - /** - * Exit a parse tree produced by the `stringAtom` - * labeled alternative in `WebdaQLParserParser.values`. - * @param ctx the parse tree - */ - exitStringAtom?: (ctx: StringAtomContext) => void; - - /** - * Enter a parse tree produced by the `valuesAtom` - * labeled alternative in `WebdaQLParserParser.atom`. - * @param ctx the parse tree - */ - enterValuesAtom?: (ctx: ValuesAtomContext) => void; - /** - * Exit a parse tree produced by the `valuesAtom` - * labeled alternative in `WebdaQLParserParser.atom`. - * @param ctx the parse tree - */ - exitValuesAtom?: (ctx: ValuesAtomContext) => void; - - /** - * Enter a parse tree produced by the `identifierAtom` - * labeled alternative in `WebdaQLParserParser.atom`. - * @param ctx the parse tree - */ - enterIdentifierAtom?: (ctx: IdentifierAtomContext) => void; - /** - * Exit a parse tree produced by the `identifierAtom` - * labeled alternative in `WebdaQLParserParser.atom`. - * @param ctx the parse tree - */ - exitIdentifierAtom?: (ctx: IdentifierAtomContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.webdaql`. - * @param ctx the parse tree - */ - enterWebdaql?: (ctx: WebdaqlContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.webdaql`. - * @param ctx the parse tree - */ - exitWebdaql?: (ctx: WebdaqlContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.limitExpression`. - * @param ctx the parse tree - */ - enterLimitExpression?: (ctx: LimitExpressionContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.limitExpression`. - * @param ctx the parse tree - */ - exitLimitExpression?: (ctx: LimitExpressionContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.offsetExpression`. - * @param ctx the parse tree - */ - enterOffsetExpression?: (ctx: OffsetExpressionContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.offsetExpression`. - * @param ctx the parse tree - */ - exitOffsetExpression?: (ctx: OffsetExpressionContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.orderFieldExpression`. - * @param ctx the parse tree - */ - enterOrderFieldExpression?: (ctx: OrderFieldExpressionContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.orderFieldExpression`. - * @param ctx the parse tree - */ - exitOrderFieldExpression?: (ctx: OrderFieldExpressionContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.orderExpression`. - * @param ctx the parse tree - */ - enterOrderExpression?: (ctx: OrderExpressionContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.orderExpression`. - * @param ctx the parse tree - */ - exitOrderExpression?: (ctx: OrderExpressionContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - enterExpression?: (ctx: ExpressionContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.expression`. - * @param ctx the parse tree - */ - exitExpression?: (ctx: ExpressionContext) => void; - - /** - * Enter a parse tree produced by the `values` - * labeled alternative in `WebdaQLParserParser.expressionexpressionexpressionexpressionexpressionexpressionexpressionexpressionvaluesvaluesvaluesatomatom`. - * @param ctx the parse tree - */ - enterValues?: (ctx: ValuesContext) => void; - /** - * Exit a parse tree produced by the `values` - * labeled alternative in `WebdaQLParserParser.expressionexpressionexpressionexpressionexpressionexpressionexpressionexpressionvaluesvaluesvaluesatomatom`. - * @param ctx the parse tree - */ - exitValues?: (ctx: ValuesContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.atom`. - * @param ctx the parse tree - */ - enterAtom?: (ctx: AtomContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.atom`. - * @param ctx the parse tree - */ - exitAtom?: (ctx: AtomContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.identifier`. - * @param ctx the parse tree - */ - enterIdentifier?: (ctx: IdentifierContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.identifier`. - * @param ctx the parse tree - */ - exitIdentifier?: (ctx: IdentifierContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.booleanLiteral`. - * @param ctx the parse tree - */ - enterBooleanLiteral?: (ctx: BooleanLiteralContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.booleanLiteral`. - * @param ctx the parse tree - */ - exitBooleanLiteral?: (ctx: BooleanLiteralContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.stringLiteral`. - * @param ctx the parse tree - */ - enterStringLiteral?: (ctx: StringLiteralContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.stringLiteral`. - * @param ctx the parse tree - */ - exitStringLiteral?: (ctx: StringLiteralContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.integerLiteral`. - * @param ctx the parse tree - */ - enterIntegerLiteral?: (ctx: IntegerLiteralContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.integerLiteral`. - * @param ctx the parse tree - */ - exitIntegerLiteral?: (ctx: IntegerLiteralContext) => void; - - /** - * Enter a parse tree produced by `WebdaQLParserParser.setExpression`. - * @param ctx the parse tree - */ - enterSetExpression?: (ctx: SetExpressionContext) => void; - /** - * Exit a parse tree produced by `WebdaQLParserParser.setExpression`. - * @param ctx the parse tree - */ - exitSetExpression?: (ctx: SetExpressionContext) => void; + /** + * Enter a parse tree produced by the `likeExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + enterLikeExpression?: (ctx: LikeExpressionContext) => void; + /** + * Exit a parse tree produced by the `likeExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + exitLikeExpression?: (ctx: LikeExpressionContext) => void; + + /** + * Enter a parse tree produced by the `inExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + enterInExpression?: (ctx: InExpressionContext) => void; + /** + * Exit a parse tree produced by the `inExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + exitInExpression?: (ctx: InExpressionContext) => void; + + /** + * Enter a parse tree produced by the `containsExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + enterContainsExpression?: (ctx: ContainsExpressionContext) => void; + /** + * Exit a parse tree produced by the `containsExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + exitContainsExpression?: (ctx: ContainsExpressionContext) => void; + + /** + * Enter a parse tree produced by the `binaryComparisonExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + enterBinaryComparisonExpression?: (ctx: BinaryComparisonExpressionContext) => void; + /** + * Exit a parse tree produced by the `binaryComparisonExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + exitBinaryComparisonExpression?: (ctx: BinaryComparisonExpressionContext) => void; + + /** + * Enter a parse tree produced by the `andLogicExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + enterAndLogicExpression?: (ctx: AndLogicExpressionContext) => void; + /** + * Exit a parse tree produced by the `andLogicExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + exitAndLogicExpression?: (ctx: AndLogicExpressionContext) => void; + + /** + * Enter a parse tree produced by the `orLogicExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + enterOrLogicExpression?: (ctx: OrLogicExpressionContext) => void; + /** + * Exit a parse tree produced by the `orLogicExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + exitOrLogicExpression?: (ctx: OrLogicExpressionContext) => void; + + /** + * Enter a parse tree produced by the `subExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + enterSubExpression?: (ctx: SubExpressionContext) => void; + /** + * Exit a parse tree produced by the `subExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + exitSubExpression?: (ctx: SubExpressionContext) => void; + + /** + * Enter a parse tree produced by the `atomExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + enterAtomExpression?: (ctx: AtomExpressionContext) => void; + /** + * Exit a parse tree produced by the `atomExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + exitAtomExpression?: (ctx: AtomExpressionContext) => void; + + /** + * Enter a parse tree produced by the `booleanAtom` + * labeled alternative in `WebdaQLParserParser.values`. + * @param ctx the parse tree + */ + enterBooleanAtom?: (ctx: BooleanAtomContext) => void; + /** + * Exit a parse tree produced by the `booleanAtom` + * labeled alternative in `WebdaQLParserParser.values`. + * @param ctx the parse tree + */ + exitBooleanAtom?: (ctx: BooleanAtomContext) => void; + + /** + * Enter a parse tree produced by the `integerAtom` + * labeled alternative in `WebdaQLParserParser.values`. + * @param ctx the parse tree + */ + enterIntegerAtom?: (ctx: IntegerAtomContext) => void; + /** + * Exit a parse tree produced by the `integerAtom` + * labeled alternative in `WebdaQLParserParser.values`. + * @param ctx the parse tree + */ + exitIntegerAtom?: (ctx: IntegerAtomContext) => void; + + /** + * Enter a parse tree produced by the `stringAtom` + * labeled alternative in `WebdaQLParserParser.values`. + * @param ctx the parse tree + */ + enterStringAtom?: (ctx: StringAtomContext) => void; + /** + * Exit a parse tree produced by the `stringAtom` + * labeled alternative in `WebdaQLParserParser.values`. + * @param ctx the parse tree + */ + exitStringAtom?: (ctx: StringAtomContext) => void; + + /** + * Enter a parse tree produced by the `valuesAtom` + * labeled alternative in `WebdaQLParserParser.atom`. + * @param ctx the parse tree + */ + enterValuesAtom?: (ctx: ValuesAtomContext) => void; + /** + * Exit a parse tree produced by the `valuesAtom` + * labeled alternative in `WebdaQLParserParser.atom`. + * @param ctx the parse tree + */ + exitValuesAtom?: (ctx: ValuesAtomContext) => void; + + /** + * Enter a parse tree produced by the `identifierAtom` + * labeled alternative in `WebdaQLParserParser.atom`. + * @param ctx the parse tree + */ + enterIdentifierAtom?: (ctx: IdentifierAtomContext) => void; + /** + * Exit a parse tree produced by the `identifierAtom` + * labeled alternative in `WebdaQLParserParser.atom`. + * @param ctx the parse tree + */ + exitIdentifierAtom?: (ctx: IdentifierAtomContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.webdaql`. + * @param ctx the parse tree + */ + enterWebdaql?: (ctx: WebdaqlContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.webdaql`. + * @param ctx the parse tree + */ + exitWebdaql?: (ctx: WebdaqlContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.statement`. + * @param ctx the parse tree + */ + enterStatement?: (ctx: StatementContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.statement`. + * @param ctx the parse tree + */ + exitStatement?: (ctx: StatementContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.deleteStatement`. + * @param ctx the parse tree + */ + enterDeleteStatement?: (ctx: DeleteStatementContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.deleteStatement`. + * @param ctx the parse tree + */ + exitDeleteStatement?: (ctx: DeleteStatementContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.updateStatement`. + * @param ctx the parse tree + */ + enterUpdateStatement?: (ctx: UpdateStatementContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.updateStatement`. + * @param ctx the parse tree + */ + exitUpdateStatement?: (ctx: UpdateStatementContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.selectStatement`. + * @param ctx the parse tree + */ + enterSelectStatement?: (ctx: SelectStatementContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.selectStatement`. + * @param ctx the parse tree + */ + exitSelectStatement?: (ctx: SelectStatementContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.filterQuery`. + * @param ctx the parse tree + */ + enterFilterQuery?: (ctx: FilterQueryContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.filterQuery`. + * @param ctx the parse tree + */ + exitFilterQuery?: (ctx: FilterQueryContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.assignmentList`. + * @param ctx the parse tree + */ + enterAssignmentList?: (ctx: AssignmentListContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.assignmentList`. + * @param ctx the parse tree + */ + exitAssignmentList?: (ctx: AssignmentListContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.assignment`. + * @param ctx the parse tree + */ + enterAssignment?: (ctx: AssignmentContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.assignment`. + * @param ctx the parse tree + */ + exitAssignment?: (ctx: AssignmentContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.fieldList`. + * @param ctx the parse tree + */ + enterFieldList?: (ctx: FieldListContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.fieldList`. + * @param ctx the parse tree + */ + exitFieldList?: (ctx: FieldListContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.limitExpression`. + * @param ctx the parse tree + */ + enterLimitExpression?: (ctx: LimitExpressionContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.limitExpression`. + * @param ctx the parse tree + */ + exitLimitExpression?: (ctx: LimitExpressionContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.offsetExpression`. + * @param ctx the parse tree + */ + enterOffsetExpression?: (ctx: OffsetExpressionContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.offsetExpression`. + * @param ctx the parse tree + */ + exitOffsetExpression?: (ctx: OffsetExpressionContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.orderFieldExpression`. + * @param ctx the parse tree + */ + enterOrderFieldExpression?: (ctx: OrderFieldExpressionContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.orderFieldExpression`. + * @param ctx the parse tree + */ + exitOrderFieldExpression?: (ctx: OrderFieldExpressionContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.orderExpression`. + * @param ctx the parse tree + */ + enterOrderExpression?: (ctx: OrderExpressionContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.orderExpression`. + * @param ctx the parse tree + */ + exitOrderExpression?: (ctx: OrderExpressionContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + enterExpression?: (ctx: ExpressionContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.expression`. + * @param ctx the parse tree + */ + exitExpression?: (ctx: ExpressionContext) => void; + + /** + * Enter a parse tree produced by the `values` + * labeled alternative in `WebdaQLParserParser.expressionexpressionexpressionexpressionexpressionexpressionexpressionexpressionvaluesvaluesvaluesatomatom`. + * @param ctx the parse tree + */ + enterValues?: (ctx: ValuesContext) => void; + /** + * Exit a parse tree produced by the `values` + * labeled alternative in `WebdaQLParserParser.expressionexpressionexpressionexpressionexpressionexpressionexpressionexpressionvaluesvaluesvaluesatomatom`. + * @param ctx the parse tree + */ + exitValues?: (ctx: ValuesContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.atom`. + * @param ctx the parse tree + */ + enterAtom?: (ctx: AtomContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.atom`. + * @param ctx the parse tree + */ + exitAtom?: (ctx: AtomContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.identifier`. + * @param ctx the parse tree + */ + enterIdentifier?: (ctx: IdentifierContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.identifier`. + * @param ctx the parse tree + */ + exitIdentifier?: (ctx: IdentifierContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.booleanLiteral`. + * @param ctx the parse tree + */ + enterBooleanLiteral?: (ctx: BooleanLiteralContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.booleanLiteral`. + * @param ctx the parse tree + */ + exitBooleanLiteral?: (ctx: BooleanLiteralContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.stringLiteral`. + * @param ctx the parse tree + */ + enterStringLiteral?: (ctx: StringLiteralContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.stringLiteral`. + * @param ctx the parse tree + */ + exitStringLiteral?: (ctx: StringLiteralContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.integerLiteral`. + * @param ctx the parse tree + */ + enterIntegerLiteral?: (ctx: IntegerLiteralContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.integerLiteral`. + * @param ctx the parse tree + */ + exitIntegerLiteral?: (ctx: IntegerLiteralContext) => void; + + /** + * Enter a parse tree produced by `WebdaQLParserParser.setExpression`. + * @param ctx the parse tree + */ + enterSetExpression?: (ctx: SetExpressionContext) => void; + /** + * Exit a parse tree produced by `WebdaQLParserParser.setExpression`. + * @param ctx the parse tree + */ + exitSetExpression?: (ctx: SetExpressionContext) => void; } + diff --git a/packages/ql/src/WebdaQLParserParser.ts b/packages/ql/src/WebdaQLParserParser.ts index 0c509757f..81c569a40 100644 --- a/packages/ql/src/WebdaQLParserParser.ts +++ b/packages/ql/src/WebdaQLParserParser.ts @@ -1,4 +1,5 @@ -// Generated from src/stores/webdaql/WebdaQLParser.g4 by ANTLR 4.9.0-SNAPSHOT +// Generated from src/WebdaQLParser.g4 by ANTLR 4.9.0-SNAPSHOT + import { ATN } from "antlr4ts/atn/ATN.js"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer.js"; @@ -21,1795 +22,2422 @@ import * as Utils from "antlr4ts/misc/Utils.js"; import { WebdaQLParserListener } from "./WebdaQLParserListener"; import { WebdaQLParserVisitor } from "./WebdaQLParserVisitor"; + export class WebdaQLParserParser extends Parser { - public static readonly SPACE = 1; - public static readonly LR_BRACKET = 2; - public static readonly RR_BRACKET = 3; - public static readonly COMMA = 4; - public static readonly SINGLE_QUOTE_SYMB = 5; - public static readonly DOUBLE_QUOTE_SYMB = 6; - public static readonly LR_SQ_BRACKET = 7; - public static readonly RR_SQ_BRACKET = 8; - public static readonly AND = 9; - public static readonly OR = 10; - public static readonly EQUAL = 11; - public static readonly NOT_EQUAL = 12; - public static readonly GREATER = 13; - public static readonly GREATER_OR_EQUAL = 14; - public static readonly LESS = 15; - public static readonly LESS_OR_EQUAL = 16; - public static readonly LIKE = 17; - public static readonly IN = 18; - public static readonly CONTAINS = 19; - public static readonly TRUE = 20; - public static readonly FALSE = 21; - public static readonly LIMIT = 22; - public static readonly OFFSET = 23; - public static readonly ORDER_BY = 24; - public static readonly ASC = 25; - public static readonly DESC = 26; - public static readonly DQUOTED_STRING_LITERAL = 27; - public static readonly SQUOTED_STRING_LITERAL = 28; - public static readonly INTEGER_LITERAL = 29; - public static readonly IDENTIFIER = 30; - public static readonly IDENTIFIER_WITH_NUMBER = 31; - public static readonly FUNCTION_IDENTIFIER_WITH_UNDERSCORE = 32; - public static readonly RULE_webdaql = 0; - public static readonly RULE_limitExpression = 1; - public static readonly RULE_offsetExpression = 2; - public static readonly RULE_orderFieldExpression = 3; - public static readonly RULE_orderExpression = 4; - public static readonly RULE_expression = 5; - public static readonly RULE_values = 6; - public static readonly RULE_atom = 7; - public static readonly RULE_identifier = 8; - public static readonly RULE_booleanLiteral = 9; - public static readonly RULE_stringLiteral = 10; - public static readonly RULE_integerLiteral = 11; - public static readonly RULE_setExpression = 12; - // tslint:disable:no-trailing-whitespace - public static readonly ruleNames: string[] = [ - "webdaql", - "limitExpression", - "offsetExpression", - "orderFieldExpression", - "orderExpression", - "expression", - "values", - "atom", - "identifier", - "booleanLiteral", - "stringLiteral", - "integerLiteral", - "setExpression" - ]; - - private static readonly _LITERAL_NAMES: Array = [ - undefined, - undefined, - "'('", - "')'", - "','", - "'''", - "'\"'", - "'['", - "']'", - "'AND'", - "'OR'", - "'='", - "'!='", - "'>'", - "'>='", - "'<'", - "'<='", - "'LIKE'", - "'IN'", - "'CONTAINS'", - "'TRUE'", - "'FALSE'", - "'LIMIT'", - "'OFFSET'", - "'ORDER BY'", - "'ASC'", - "'DESC'" - ]; - private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, - "SPACE", - "LR_BRACKET", - "RR_BRACKET", - "COMMA", - "SINGLE_QUOTE_SYMB", - "DOUBLE_QUOTE_SYMB", - "LR_SQ_BRACKET", - "RR_SQ_BRACKET", - "AND", - "OR", - "EQUAL", - "NOT_EQUAL", - "GREATER", - "GREATER_OR_EQUAL", - "LESS", - "LESS_OR_EQUAL", - "LIKE", - "IN", - "CONTAINS", - "TRUE", - "FALSE", - "LIMIT", - "OFFSET", - "ORDER_BY", - "ASC", - "DESC", - "DQUOTED_STRING_LITERAL", - "SQUOTED_STRING_LITERAL", - "INTEGER_LITERAL", - "IDENTIFIER", - "IDENTIFIER_WITH_NUMBER", - "FUNCTION_IDENTIFIER_WITH_UNDERSCORE" - ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( - WebdaQLParserParser._LITERAL_NAMES, - WebdaQLParserParser._SYMBOLIC_NAMES, - [] - ); - - // @Override - // @NotNull - public get vocabulary(): Vocabulary { - return WebdaQLParserParser.VOCABULARY; - } - // tslint:enable:no-trailing-whitespace - - // @Override - public get grammarFileName(): string { - return "WebdaQLParser.g4"; - } - - // @Override - public get ruleNames(): string[] { - return WebdaQLParserParser.ruleNames; - } - - // @Override - public get serializedATN(): string { - return WebdaQLParserParser._serializedATN; - } - - protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException { - return new FailedPredicateException(this, predicate, message); - } - - constructor(input: TokenStream) { - super(input); - this._interp = new ParserATNSimulator(WebdaQLParserParser._ATN, this); - } - // @RuleVersion(0) - public webdaql(): WebdaqlContext { - const _localctx: WebdaqlContext = new WebdaqlContext(this._ctx, this.state); - this.enterRule(_localctx, 0, WebdaQLParserParser.RULE_webdaql); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 27; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (_la & ~0x1f) === 0 && - ((1 << _la) & - ((1 << WebdaQLParserParser.LR_BRACKET) | - (1 << WebdaQLParserParser.TRUE) | - (1 << WebdaQLParserParser.FALSE) | - (1 << WebdaQLParserParser.DQUOTED_STRING_LITERAL) | - (1 << WebdaQLParserParser.SQUOTED_STRING_LITERAL) | - (1 << WebdaQLParserParser.INTEGER_LITERAL) | - (1 << WebdaQLParserParser.IDENTIFIER) | - (1 << WebdaQLParserParser.IDENTIFIER_WITH_NUMBER))) !== - 0 - ) { - { - this.state = 26; - this.expression(0); - } - } - - this.state = 30; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === WebdaQLParserParser.ORDER_BY) { - { - this.state = 29; - this.orderExpression(); - } - } - - this.state = 33; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === WebdaQLParserParser.LIMIT) { - { - this.state = 32; - this.limitExpression(); - } - } - - this.state = 36; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === WebdaQLParserParser.OFFSET) { - { - this.state = 35; - this.offsetExpression(); - } - } - - this.state = 38; - this.match(WebdaQLParserParser.EOF); - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public limitExpression(): LimitExpressionContext { - const _localctx: LimitExpressionContext = new LimitExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 2, WebdaQLParserParser.RULE_limitExpression); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 40; - this.match(WebdaQLParserParser.LIMIT); - this.state = 41; - this.integerLiteral(); - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public offsetExpression(): OffsetExpressionContext { - const _localctx: OffsetExpressionContext = new OffsetExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 4, WebdaQLParserParser.RULE_offsetExpression); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 43; - this.match(WebdaQLParserParser.OFFSET); - this.state = 44; - this.stringLiteral(); - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public orderFieldExpression(): OrderFieldExpressionContext { - const _localctx: OrderFieldExpressionContext = new OrderFieldExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 6, WebdaQLParserParser.RULE_orderFieldExpression); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 46; - this.identifier(); - this.state = 48; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === WebdaQLParserParser.ASC || _la === WebdaQLParserParser.DESC) { - { - this.state = 47; - _la = this._input.LA(1); - if (!(_la === WebdaQLParserParser.ASC || _la === WebdaQLParserParser.DESC)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - } - } - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public orderExpression(): OrderExpressionContext { - const _localctx: OrderExpressionContext = new OrderExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 8, WebdaQLParserParser.RULE_orderExpression); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 50; - this.match(WebdaQLParserParser.ORDER_BY); - this.state = 51; - this.orderFieldExpression(); - this.state = 56; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === WebdaQLParserParser.COMMA) { - { - { - this.state = 52; - this.match(WebdaQLParserParser.COMMA); - this.state = 53; - this.orderFieldExpression(); - } - } - this.state = 58; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - - public expression(): ExpressionContext; - public expression(_p: number): ExpressionContext; - // @RuleVersion(0) - public expression(_p?: number): ExpressionContext { - if (_p === undefined) { - _p = 0; - } - - const _parentctx: ParserRuleContext = this._ctx; - const _parentState: number = this.state; - let _localctx: ExpressionContext = new ExpressionContext(this._ctx, _parentState); - let _prevctx: ExpressionContext = _localctx; - const _startState: number = 10; - this.enterRecursionRule(_localctx, 10, WebdaQLParserParser.RULE_expression, _p); - let _la: number; - try { - let _alt: number; - this.enterOuterAlt(_localctx, 1); - { - this.state = 81; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 6, this._ctx)) { - case 1: - { - _localctx = new LikeExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 60; - this.identifier(); - this.state = 61; - this.match(WebdaQLParserParser.LIKE); - this.state = 62; - this.stringLiteral(); - } - break; - - case 2: - { - _localctx = new InExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 64; - this.identifier(); - this.state = 65; - this.match(WebdaQLParserParser.IN); - this.state = 66; - this.setExpression(); - } - break; - - case 3: - { - _localctx = new ContainsExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 68; - this.identifier(); - this.state = 69; - this.match(WebdaQLParserParser.CONTAINS); - this.state = 70; - this.stringLiteral(); - } - break; - - case 4: - { - _localctx = new BinaryComparisonExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 72; - this.identifier(); - this.state = 73; - _la = this._input.LA(1); - if ( - !( - (_la & ~0x1f) === 0 && - ((1 << _la) & - ((1 << WebdaQLParserParser.EQUAL) | - (1 << WebdaQLParserParser.NOT_EQUAL) | - (1 << WebdaQLParserParser.GREATER) | - (1 << WebdaQLParserParser.GREATER_OR_EQUAL) | - (1 << WebdaQLParserParser.LESS) | - (1 << WebdaQLParserParser.LESS_OR_EQUAL))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 74; - this.values(); - } - break; - - case 5: - { - _localctx = new SubExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 76; - this.match(WebdaQLParserParser.LR_BRACKET); - this.state = 77; - this.expression(0); - this.state = 78; - this.match(WebdaQLParserParser.RR_BRACKET); - } - break; - - case 6: - { - _localctx = new AtomExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 80; - this.atom(); - } - break; - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 91; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 8, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - this.state = 89; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 7, this._ctx)) { - case 1: - { - _localctx = new AndLogicExpressionContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, WebdaQLParserParser.RULE_expression); - this.state = 83; - if (!this.precpred(this._ctx, 4)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 4)"); - } - this.state = 84; - this.match(WebdaQLParserParser.AND); - this.state = 85; - this.expression(5); - } - break; - - case 2: - { - _localctx = new OrLogicExpressionContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, WebdaQLParserParser.RULE_expression); - this.state = 86; - if (!this.precpred(this._ctx, 3)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); - } - this.state = 87; - this.match(WebdaQLParserParser.OR); - this.state = 88; - this.expression(4); - } - break; - } - } - } - this.state = 93; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 8, this._ctx); - } - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.unrollRecursionContexts(_parentctx); - } - return _localctx; - } - // @RuleVersion(0) - public values(): ValuesContext { - let _localctx: ValuesContext = new ValuesContext(this._ctx, this.state); - this.enterRule(_localctx, 12, WebdaQLParserParser.RULE_values); - try { - this.state = 97; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case WebdaQLParserParser.TRUE: - case WebdaQLParserParser.FALSE: - _localctx = new BooleanAtomContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 94; - this.booleanLiteral(); - } - break; - case WebdaQLParserParser.INTEGER_LITERAL: - _localctx = new IntegerAtomContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 95; - this.integerLiteral(); - } - break; - case WebdaQLParserParser.DQUOTED_STRING_LITERAL: - case WebdaQLParserParser.SQUOTED_STRING_LITERAL: - _localctx = new StringAtomContext(_localctx); - this.enterOuterAlt(_localctx, 3); - { - this.state = 96; - this.stringLiteral(); - } - break; - default: - throw new NoViableAltException(this); - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public atom(): AtomContext { - let _localctx: AtomContext = new AtomContext(this._ctx, this.state); - this.enterRule(_localctx, 14, WebdaQLParserParser.RULE_atom); - try { - this.state = 101; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case WebdaQLParserParser.TRUE: - case WebdaQLParserParser.FALSE: - case WebdaQLParserParser.DQUOTED_STRING_LITERAL: - case WebdaQLParserParser.SQUOTED_STRING_LITERAL: - case WebdaQLParserParser.INTEGER_LITERAL: - _localctx = new ValuesAtomContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 99; - this.values(); - } - break; - case WebdaQLParserParser.IDENTIFIER: - case WebdaQLParserParser.IDENTIFIER_WITH_NUMBER: - _localctx = new IdentifierAtomContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 100; - this.identifier(); - } - break; - default: - throw new NoViableAltException(this); - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public identifier(): IdentifierContext { - const _localctx: IdentifierContext = new IdentifierContext(this._ctx, this.state); - this.enterRule(_localctx, 16, WebdaQLParserParser.RULE_identifier); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 103; - _la = this._input.LA(1); - if (!(_la === WebdaQLParserParser.IDENTIFIER || _la === WebdaQLParserParser.IDENTIFIER_WITH_NUMBER)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public booleanLiteral(): BooleanLiteralContext { - const _localctx: BooleanLiteralContext = new BooleanLiteralContext(this._ctx, this.state); - this.enterRule(_localctx, 18, WebdaQLParserParser.RULE_booleanLiteral); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 105; - _la = this._input.LA(1); - if (!(_la === WebdaQLParserParser.TRUE || _la === WebdaQLParserParser.FALSE)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public stringLiteral(): StringLiteralContext { - const _localctx: StringLiteralContext = new StringLiteralContext(this._ctx, this.state); - this.enterRule(_localctx, 20, WebdaQLParserParser.RULE_stringLiteral); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 107; - _la = this._input.LA(1); - if ( - !(_la === WebdaQLParserParser.DQUOTED_STRING_LITERAL || _la === WebdaQLParserParser.SQUOTED_STRING_LITERAL) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public integerLiteral(): IntegerLiteralContext { - const _localctx: IntegerLiteralContext = new IntegerLiteralContext(this._ctx, this.state); - this.enterRule(_localctx, 22, WebdaQLParserParser.RULE_integerLiteral); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 109; - this.match(WebdaQLParserParser.INTEGER_LITERAL); - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public setExpression(): SetExpressionContext { - const _localctx: SetExpressionContext = new SetExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 24, WebdaQLParserParser.RULE_setExpression); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 111; - this.match(WebdaQLParserParser.LR_SQ_BRACKET); - this.state = 112; - this.values(); - this.state = 117; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === WebdaQLParserParser.COMMA) { - { - { - this.state = 113; - this.match(WebdaQLParserParser.COMMA); - this.state = 114; - this.values(); - } - } - this.state = 119; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 120; - this.match(WebdaQLParserParser.RR_SQ_BRACKET); - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - - public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { - switch (ruleIndex) { - case 5: - return this.expression_sempred(_localctx as ExpressionContext, predIndex); - } - return true; - } - private expression_sempred(_localctx: ExpressionContext, predIndex: number): boolean { - switch (predIndex) { - case 0: - return this.precpred(this._ctx, 4); - - case 1: - return this.precpred(this._ctx, 3); - } - return true; - } - - public static readonly _serializedATN: string = - '\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03"}\x04\x02\t' + - "\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07\t" + - "\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04\x0E" + - "\t\x0E\x03\x02\x05\x02\x1E\n\x02\x03\x02\x05\x02!\n\x02\x03\x02\x05\x02" + - "$\n\x02\x03\x02\x05\x02'\n\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03" + - "\x03\x04\x03\x04\x03\x04\x03\x05\x03\x05\x05\x053\n\x05\x03\x06\x03\x06" + - "\x03\x06\x03\x06\x07\x069\n\x06\f\x06\x0E\x06<\v\x06\x03\x07\x03\x07\x03" + - "\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03" + - "\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03" + - "\x07\x03\x07\x05\x07T\n\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03" + - "\x07\x07\x07\\\n\x07\f\x07\x0E\x07_\v\x07\x03\b\x03\b\x03\b\x05\bd\n\b" + - "\x03\t\x03\t\x05\th\n\t\x03\n\x03\n\x03\v\x03\v\x03\f\x03\f\x03\r\x03" + - "\r\x03\x0E\x03\x0E\x03\x0E\x03\x0E\x07\x0Ev\n\x0E\f\x0E\x0E\x0Ey\v\x0E" + - "\x03\x0E\x03\x0E\x03\x0E\x02\x02\x03\f\x0F\x02\x02\x04\x02\x06\x02\b\x02" + - "\n\x02\f\x02\x0E\x02\x10\x02\x12\x02\x14\x02\x16\x02\x18\x02\x1A\x02\x02" + - "\x07\x03\x02\x1B\x1C\x03\x02\r\x12\x03\x02 !\x03\x02\x16\x17\x03\x02\x1D" + - "\x1E\x02\x80\x02\x1D\x03\x02\x02\x02\x04*\x03\x02\x02\x02\x06-\x03\x02" + - "\x02\x02\b0\x03\x02\x02\x02\n4\x03\x02\x02\x02\fS\x03\x02\x02\x02\x0E" + - "c\x03\x02\x02\x02\x10g\x03\x02\x02\x02\x12i\x03\x02\x02\x02\x14k\x03\x02" + - "\x02\x02\x16m\x03\x02\x02\x02\x18o\x03\x02\x02\x02\x1Aq\x03\x02\x02\x02" + - "\x1C\x1E\x05\f\x07\x02\x1D\x1C\x03\x02\x02\x02\x1D\x1E\x03\x02\x02\x02" + - "\x1E \x03\x02\x02\x02\x1F!\x05\n\x06\x02 \x1F\x03\x02\x02\x02 !\x03\x02" + - '\x02\x02!#\x03\x02\x02\x02"$\x05\x04\x03\x02#"\x03\x02\x02\x02#$\x03' + - "\x02\x02\x02$&\x03\x02\x02\x02%'\x05\x06\x04\x02&%\x03\x02\x02\x02&'" + - "\x03\x02\x02\x02'(\x03\x02\x02\x02()\x07\x02\x02\x03)\x03\x03\x02\x02" + - "\x02*+\x07\x18\x02\x02+,\x05\x18\r\x02,\x05\x03\x02\x02\x02-.\x07\x19" + - "\x02\x02./\x05\x16\f\x02/\x07\x03\x02\x02\x0202\x05\x12\n\x0213\t\x02" + - "\x02\x0221\x03\x02\x02\x0223\x03\x02\x02\x023\t\x03\x02\x02\x0245\x07" + - "\x1A\x02\x025:\x05\b\x05\x0267\x07\x06\x02\x0279\x05\b\x05\x0286\x03\x02" + - "\x02\x029<\x03\x02\x02\x02:8\x03\x02\x02\x02:;\x03\x02\x02\x02;\v\x03" + - "\x02\x02\x02<:\x03\x02\x02\x02=>\b\x07\x01\x02>?\x05\x12\n\x02?@\x07\x13" + - "\x02\x02@A\x05\x16\f\x02AT\x03\x02\x02\x02BC\x05\x12\n\x02CD\x07\x14\x02" + - "\x02DE\x05\x1A\x0E\x02ET\x03\x02\x02\x02FG\x05\x12\n\x02GH\x07\x15\x02" + - "\x02HI\x05\x16\f\x02IT\x03\x02\x02\x02JK\x05\x12\n\x02KL\t\x03\x02\x02" + - "LM\x05\x0E\b\x02MT\x03\x02\x02\x02NO\x07\x04\x02\x02OP\x05\f\x07\x02P" + - "Q\x07\x05\x02\x02QT\x03\x02\x02\x02RT\x05\x10\t\x02S=\x03\x02\x02\x02" + - "SB\x03\x02\x02\x02SF\x03\x02\x02\x02SJ\x03\x02\x02\x02SN\x03\x02\x02\x02" + - "SR\x03\x02\x02\x02T]\x03\x02\x02\x02UV\f\x06\x02\x02VW\x07\v\x02\x02W" + - "\\\x05\f\x07\x07XY\f\x05\x02\x02YZ\x07\f\x02\x02Z\\\x05\f\x07\x06[U\x03" + - "\x02\x02\x02[X\x03\x02\x02\x02\\_\x03\x02\x02\x02][\x03\x02\x02\x02]^" + - "\x03\x02\x02\x02^\r\x03\x02\x02\x02_]\x03\x02\x02\x02`d\x05\x14\v\x02" + - "ad\x05\x18\r\x02bd\x05\x16\f\x02c`\x03\x02\x02\x02ca\x03\x02\x02\x02c" + - "b\x03\x02\x02\x02d\x0F\x03\x02\x02\x02eh\x05\x0E\b\x02fh\x05\x12\n\x02" + - "ge\x03\x02\x02\x02gf\x03\x02\x02\x02h\x11\x03\x02\x02\x02ij\t\x04\x02" + - "\x02j\x13\x03\x02\x02\x02kl\t\x05\x02\x02l\x15\x03\x02\x02\x02mn\t\x06" + - "\x02\x02n\x17\x03\x02\x02\x02op\x07\x1F\x02\x02p\x19\x03\x02\x02\x02q" + - "r\x07\t\x02\x02rw\x05\x0E\b\x02st\x07\x06\x02\x02tv\x05\x0E\b\x02us\x03" + - "\x02\x02\x02vy\x03\x02\x02\x02wu\x03\x02\x02\x02wx\x03\x02\x02\x02xz\x03" + - "\x02\x02\x02yw\x03\x02\x02\x02z{\x07\n\x02\x02{\x1B\x03\x02\x02\x02\x0E" + - "\x1D #&2:S[]cgw"; - public static __ATN: ATN; - public static get _ATN(): ATN { - if (!WebdaQLParserParser.__ATN) { - WebdaQLParserParser.__ATN = new ATNDeserializer().deserialize( - Utils.toCharArray(WebdaQLParserParser._serializedATN) - ); - } - - return WebdaQLParserParser.__ATN; - } + public static readonly SPACE = 1; + public static readonly LR_BRACKET = 2; + public static readonly RR_BRACKET = 3; + public static readonly COMMA = 4; + public static readonly SINGLE_QUOTE_SYMB = 5; + public static readonly DOUBLE_QUOTE_SYMB = 6; + public static readonly LR_SQ_BRACKET = 7; + public static readonly RR_SQ_BRACKET = 8; + public static readonly DELETE = 9; + public static readonly UPDATE = 10; + public static readonly SELECT = 11; + public static readonly SET = 12; + public static readonly WHERE = 13; + public static readonly AND = 14; + public static readonly OR = 15; + public static readonly EQUAL = 16; + public static readonly NOT_EQUAL = 17; + public static readonly GREATER = 18; + public static readonly GREATER_OR_EQUAL = 19; + public static readonly LESS = 20; + public static readonly LESS_OR_EQUAL = 21; + public static readonly LIKE = 22; + public static readonly IN = 23; + public static readonly CONTAINS = 24; + public static readonly TRUE = 25; + public static readonly FALSE = 26; + public static readonly LIMIT = 27; + public static readonly OFFSET = 28; + public static readonly ORDER_BY = 29; + public static readonly ASC = 30; + public static readonly DESC = 31; + public static readonly DQUOTED_STRING_LITERAL = 32; + public static readonly SQUOTED_STRING_LITERAL = 33; + public static readonly INTEGER_LITERAL = 34; + public static readonly IDENTIFIER = 35; + public static readonly IDENTIFIER_WITH_NUMBER = 36; + public static readonly FUNCTION_IDENTIFIER_WITH_UNDERSCORE = 37; + public static readonly RULE_webdaql = 0; + public static readonly RULE_statement = 1; + public static readonly RULE_deleteStatement = 2; + public static readonly RULE_updateStatement = 3; + public static readonly RULE_selectStatement = 4; + public static readonly RULE_filterQuery = 5; + public static readonly RULE_assignmentList = 6; + public static readonly RULE_assignment = 7; + public static readonly RULE_fieldList = 8; + public static readonly RULE_limitExpression = 9; + public static readonly RULE_offsetExpression = 10; + public static readonly RULE_orderFieldExpression = 11; + public static readonly RULE_orderExpression = 12; + public static readonly RULE_expression = 13; + public static readonly RULE_values = 14; + public static readonly RULE_atom = 15; + public static readonly RULE_identifier = 16; + public static readonly RULE_booleanLiteral = 17; + public static readonly RULE_stringLiteral = 18; + public static readonly RULE_integerLiteral = 19; + public static readonly RULE_setExpression = 20; + // tslint:disable:no-trailing-whitespace + public static readonly ruleNames: string[] = [ + "webdaql", "statement", "deleteStatement", "updateStatement", "selectStatement", + "filterQuery", "assignmentList", "assignment", "fieldList", "limitExpression", + "offsetExpression", "orderFieldExpression", "orderExpression", "expression", + "values", "atom", "identifier", "booleanLiteral", "stringLiteral", "integerLiteral", + "setExpression", + ]; + + private static readonly _LITERAL_NAMES: Array = [ + undefined, undefined, "'('", "')'", "','", "'''", "'\"'", "'['", "']'", + "'DELETE'", "'UPDATE'", "'SELECT'", "'SET'", "'WHERE'", "'AND'", "'OR'", + "'='", "'!='", "'>'", "'>='", "'<'", "'<='", "'LIKE'", "'IN'", "'CONTAINS'", + "'TRUE'", "'FALSE'", "'LIMIT'", "'OFFSET'", "'ORDER BY'", "'ASC'", "'DESC'", + ]; + private static readonly _SYMBOLIC_NAMES: Array = [ + undefined, "SPACE", "LR_BRACKET", "RR_BRACKET", "COMMA", "SINGLE_QUOTE_SYMB", + "DOUBLE_QUOTE_SYMB", "LR_SQ_BRACKET", "RR_SQ_BRACKET", "DELETE", "UPDATE", + "SELECT", "SET", "WHERE", "AND", "OR", "EQUAL", "NOT_EQUAL", "GREATER", + "GREATER_OR_EQUAL", "LESS", "LESS_OR_EQUAL", "LIKE", "IN", "CONTAINS", + "TRUE", "FALSE", "LIMIT", "OFFSET", "ORDER_BY", "ASC", "DESC", "DQUOTED_STRING_LITERAL", + "SQUOTED_STRING_LITERAL", "INTEGER_LITERAL", "IDENTIFIER", "IDENTIFIER_WITH_NUMBER", + "FUNCTION_IDENTIFIER_WITH_UNDERSCORE", + ]; + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(WebdaQLParserParser._LITERAL_NAMES, WebdaQLParserParser._SYMBOLIC_NAMES, []); + + // @Override + // @NotNull + public get vocabulary(): Vocabulary { + return WebdaQLParserParser.VOCABULARY; + } + // tslint:enable:no-trailing-whitespace + + // @Override + public get grammarFileName(): string { return "WebdaQLParser.g4"; } + + // @Override + public get ruleNames(): string[] { return WebdaQLParserParser.ruleNames; } + + // @Override + public get serializedATN(): string { return WebdaQLParserParser._serializedATN; } + + protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException { + return new FailedPredicateException(this, predicate, message); + } + + constructor(input: TokenStream) { + super(input); + this._interp = new ParserATNSimulator(WebdaQLParserParser._ATN, this); + } + // @RuleVersion(0) + public webdaql(): WebdaqlContext { + let _localctx: WebdaqlContext = new WebdaqlContext(this._ctx, this.state); + this.enterRule(_localctx, 0, WebdaQLParserParser.RULE_webdaql); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 44; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case WebdaQLParserParser.DELETE: + case WebdaQLParserParser.UPDATE: + case WebdaQLParserParser.SELECT: + { + this.state = 42; + this.statement(); + } + break; + case WebdaQLParserParser.EOF: + case WebdaQLParserParser.LR_BRACKET: + case WebdaQLParserParser.TRUE: + case WebdaQLParserParser.FALSE: + case WebdaQLParserParser.LIMIT: + case WebdaQLParserParser.OFFSET: + case WebdaQLParserParser.ORDER_BY: + case WebdaQLParserParser.DQUOTED_STRING_LITERAL: + case WebdaQLParserParser.SQUOTED_STRING_LITERAL: + case WebdaQLParserParser.INTEGER_LITERAL: + case WebdaQLParserParser.IDENTIFIER: + case WebdaQLParserParser.IDENTIFIER_WITH_NUMBER: + { + this.state = 43; + this.filterQuery(); + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 46; + this.match(WebdaQLParserParser.EOF); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public statement(): StatementContext { + let _localctx: StatementContext = new StatementContext(this._ctx, this.state); + this.enterRule(_localctx, 2, WebdaQLParserParser.RULE_statement); + try { + this.state = 51; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case WebdaQLParserParser.DELETE: + this.enterOuterAlt(_localctx, 1); + { + this.state = 48; + this.deleteStatement(); + } + break; + case WebdaQLParserParser.UPDATE: + this.enterOuterAlt(_localctx, 2); + { + this.state = 49; + this.updateStatement(); + } + break; + case WebdaQLParserParser.SELECT: + this.enterOuterAlt(_localctx, 3); + { + this.state = 50; + this.selectStatement(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public deleteStatement(): DeleteStatementContext { + let _localctx: DeleteStatementContext = new DeleteStatementContext(this._ctx, this.state); + this.enterRule(_localctx, 4, WebdaQLParserParser.RULE_deleteStatement); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 53; + this.match(WebdaQLParserParser.DELETE); + this.state = 56; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.WHERE) { + { + this.state = 54; + this.match(WebdaQLParserParser.WHERE); + this.state = 55; + this.expression(0); + } + } + + this.state = 59; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.LIMIT) { + { + this.state = 58; + this.limitExpression(); + } + } + + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public updateStatement(): UpdateStatementContext { + let _localctx: UpdateStatementContext = new UpdateStatementContext(this._ctx, this.state); + this.enterRule(_localctx, 6, WebdaQLParserParser.RULE_updateStatement); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 61; + this.match(WebdaQLParserParser.UPDATE); + this.state = 62; + this.match(WebdaQLParserParser.SET); + this.state = 63; + this.assignmentList(); + this.state = 66; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.WHERE) { + { + this.state = 64; + this.match(WebdaQLParserParser.WHERE); + this.state = 65; + this.expression(0); + } + } + + this.state = 69; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.LIMIT) { + { + this.state = 68; + this.limitExpression(); + } + } + + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public selectStatement(): SelectStatementContext { + let _localctx: SelectStatementContext = new SelectStatementContext(this._ctx, this.state); + this.enterRule(_localctx, 8, WebdaQLParserParser.RULE_selectStatement); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 71; + this.match(WebdaQLParserParser.SELECT); + this.state = 72; + this.fieldList(); + this.state = 75; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.WHERE) { + { + this.state = 73; + this.match(WebdaQLParserParser.WHERE); + this.state = 74; + this.expression(0); + } + } + + this.state = 78; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.ORDER_BY) { + { + this.state = 77; + this.orderExpression(); + } + } + + this.state = 81; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.LIMIT) { + { + this.state = 80; + this.limitExpression(); + } + } + + this.state = 84; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.OFFSET) { + { + this.state = 83; + this.offsetExpression(); + } + } + + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public filterQuery(): FilterQueryContext { + let _localctx: FilterQueryContext = new FilterQueryContext(this._ctx, this.state); + this.enterRule(_localctx, 10, WebdaQLParserParser.RULE_filterQuery); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 87; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << WebdaQLParserParser.LR_BRACKET) | (1 << WebdaQLParserParser.TRUE) | (1 << WebdaQLParserParser.FALSE))) !== 0) || ((((_la - 32)) & ~0x1F) === 0 && ((1 << (_la - 32)) & ((1 << (WebdaQLParserParser.DQUOTED_STRING_LITERAL - 32)) | (1 << (WebdaQLParserParser.SQUOTED_STRING_LITERAL - 32)) | (1 << (WebdaQLParserParser.INTEGER_LITERAL - 32)) | (1 << (WebdaQLParserParser.IDENTIFIER - 32)) | (1 << (WebdaQLParserParser.IDENTIFIER_WITH_NUMBER - 32)))) !== 0)) { + { + this.state = 86; + this.expression(0); + } + } + + this.state = 90; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.ORDER_BY) { + { + this.state = 89; + this.orderExpression(); + } + } + + this.state = 93; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.LIMIT) { + { + this.state = 92; + this.limitExpression(); + } + } + + this.state = 96; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.OFFSET) { + { + this.state = 95; + this.offsetExpression(); + } + } + + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public assignmentList(): AssignmentListContext { + let _localctx: AssignmentListContext = new AssignmentListContext(this._ctx, this.state); + this.enterRule(_localctx, 12, WebdaQLParserParser.RULE_assignmentList); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 98; + this.assignment(); + this.state = 103; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === WebdaQLParserParser.COMMA) { + { + { + this.state = 99; + this.match(WebdaQLParserParser.COMMA); + this.state = 100; + this.assignment(); + } + } + this.state = 105; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public assignment(): AssignmentContext { + let _localctx: AssignmentContext = new AssignmentContext(this._ctx, this.state); + this.enterRule(_localctx, 14, WebdaQLParserParser.RULE_assignment); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 106; + this.identifier(); + this.state = 107; + this.match(WebdaQLParserParser.EQUAL); + this.state = 108; + this.values(); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public fieldList(): FieldListContext { + let _localctx: FieldListContext = new FieldListContext(this._ctx, this.state); + this.enterRule(_localctx, 16, WebdaQLParserParser.RULE_fieldList); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 110; + this.identifier(); + this.state = 115; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === WebdaQLParserParser.COMMA) { + { + { + this.state = 111; + this.match(WebdaQLParserParser.COMMA); + this.state = 112; + this.identifier(); + } + } + this.state = 117; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public limitExpression(): LimitExpressionContext { + let _localctx: LimitExpressionContext = new LimitExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 18, WebdaQLParserParser.RULE_limitExpression); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 118; + this.match(WebdaQLParserParser.LIMIT); + this.state = 119; + this.integerLiteral(); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public offsetExpression(): OffsetExpressionContext { + let _localctx: OffsetExpressionContext = new OffsetExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 20, WebdaQLParserParser.RULE_offsetExpression); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 121; + this.match(WebdaQLParserParser.OFFSET); + this.state = 122; + this.stringLiteral(); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public orderFieldExpression(): OrderFieldExpressionContext { + let _localctx: OrderFieldExpressionContext = new OrderFieldExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 22, WebdaQLParserParser.RULE_orderFieldExpression); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 124; + this.identifier(); + this.state = 126; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === WebdaQLParserParser.ASC || _la === WebdaQLParserParser.DESC) { + { + this.state = 125; + _la = this._input.LA(1); + if (!(_la === WebdaQLParserParser.ASC || _la === WebdaQLParserParser.DESC)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public orderExpression(): OrderExpressionContext { + let _localctx: OrderExpressionContext = new OrderExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 24, WebdaQLParserParser.RULE_orderExpression); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 128; + this.match(WebdaQLParserParser.ORDER_BY); + this.state = 129; + this.orderFieldExpression(); + this.state = 134; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === WebdaQLParserParser.COMMA) { + { + { + this.state = 130; + this.match(WebdaQLParserParser.COMMA); + this.state = 131; + this.orderFieldExpression(); + } + } + this.state = 136; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + + public expression(): ExpressionContext; + public expression(_p: number): ExpressionContext; + // @RuleVersion(0) + public expression(_p?: number): ExpressionContext { + if (_p === undefined) { + _p = 0; + } + + let _parentctx: ParserRuleContext = this._ctx; + let _parentState: number = this.state; + let _localctx: ExpressionContext = new ExpressionContext(this._ctx, _parentState); + let _prevctx: ExpressionContext = _localctx; + let _startState: number = 26; + this.enterRecursionRule(_localctx, 26, WebdaQLParserParser.RULE_expression, _p); + let _la: number; + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 159; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 18, this._ctx) ) { + case 1: + { + _localctx = new LikeExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 138; + this.identifier(); + this.state = 139; + this.match(WebdaQLParserParser.LIKE); + this.state = 140; + this.stringLiteral(); + } + break; + + case 2: + { + _localctx = new InExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 142; + this.identifier(); + this.state = 143; + this.match(WebdaQLParserParser.IN); + this.state = 144; + this.setExpression(); + } + break; + + case 3: + { + _localctx = new ContainsExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 146; + this.identifier(); + this.state = 147; + this.match(WebdaQLParserParser.CONTAINS); + this.state = 148; + this.stringLiteral(); + } + break; + + case 4: + { + _localctx = new BinaryComparisonExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 150; + this.identifier(); + this.state = 151; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << WebdaQLParserParser.EQUAL) | (1 << WebdaQLParserParser.NOT_EQUAL) | (1 << WebdaQLParserParser.GREATER) | (1 << WebdaQLParserParser.GREATER_OR_EQUAL) | (1 << WebdaQLParserParser.LESS) | (1 << WebdaQLParserParser.LESS_OR_EQUAL))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 152; + this.values(); + } + break; + + case 5: + { + _localctx = new SubExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 154; + this.match(WebdaQLParserParser.LR_BRACKET); + this.state = 155; + this.expression(0); + this.state = 156; + this.match(WebdaQLParserParser.RR_BRACKET); + } + break; + + case 6: + { + _localctx = new AtomExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 158; + this.atom(); + } + break; + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 169; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 20, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + this.state = 167; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 19, this._ctx) ) { + case 1: + { + _localctx = new AndLogicExpressionContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, WebdaQLParserParser.RULE_expression); + this.state = 161; + if (!(this.precpred(this._ctx, 4))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 4)"); + } + this.state = 162; + this.match(WebdaQLParserParser.AND); + this.state = 163; + this.expression(5); + } + break; + + case 2: + { + _localctx = new OrLogicExpressionContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, WebdaQLParserParser.RULE_expression); + this.state = 164; + if (!(this.precpred(this._ctx, 3))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); + } + this.state = 165; + this.match(WebdaQLParserParser.OR); + this.state = 166; + this.expression(4); + } + break; + } + } + } + this.state = 171; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 20, this._ctx); + } + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.unrollRecursionContexts(_parentctx); + } + return _localctx; + } + // @RuleVersion(0) + public values(): ValuesContext { + let _localctx: ValuesContext = new ValuesContext(this._ctx, this.state); + this.enterRule(_localctx, 28, WebdaQLParserParser.RULE_values); + try { + this.state = 175; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case WebdaQLParserParser.TRUE: + case WebdaQLParserParser.FALSE: + _localctx = new BooleanAtomContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 172; + this.booleanLiteral(); + } + break; + case WebdaQLParserParser.INTEGER_LITERAL: + _localctx = new IntegerAtomContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 173; + this.integerLiteral(); + } + break; + case WebdaQLParserParser.DQUOTED_STRING_LITERAL: + case WebdaQLParserParser.SQUOTED_STRING_LITERAL: + _localctx = new StringAtomContext(_localctx); + this.enterOuterAlt(_localctx, 3); + { + this.state = 174; + this.stringLiteral(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public atom(): AtomContext { + let _localctx: AtomContext = new AtomContext(this._ctx, this.state); + this.enterRule(_localctx, 30, WebdaQLParserParser.RULE_atom); + try { + this.state = 179; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case WebdaQLParserParser.TRUE: + case WebdaQLParserParser.FALSE: + case WebdaQLParserParser.DQUOTED_STRING_LITERAL: + case WebdaQLParserParser.SQUOTED_STRING_LITERAL: + case WebdaQLParserParser.INTEGER_LITERAL: + _localctx = new ValuesAtomContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 177; + this.values(); + } + break; + case WebdaQLParserParser.IDENTIFIER: + case WebdaQLParserParser.IDENTIFIER_WITH_NUMBER: + _localctx = new IdentifierAtomContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 178; + this.identifier(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public identifier(): IdentifierContext { + let _localctx: IdentifierContext = new IdentifierContext(this._ctx, this.state); + this.enterRule(_localctx, 32, WebdaQLParserParser.RULE_identifier); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 181; + _la = this._input.LA(1); + if (!(_la === WebdaQLParserParser.IDENTIFIER || _la === WebdaQLParserParser.IDENTIFIER_WITH_NUMBER)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public booleanLiteral(): BooleanLiteralContext { + let _localctx: BooleanLiteralContext = new BooleanLiteralContext(this._ctx, this.state); + this.enterRule(_localctx, 34, WebdaQLParserParser.RULE_booleanLiteral); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 183; + _la = this._input.LA(1); + if (!(_la === WebdaQLParserParser.TRUE || _la === WebdaQLParserParser.FALSE)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public stringLiteral(): StringLiteralContext { + let _localctx: StringLiteralContext = new StringLiteralContext(this._ctx, this.state); + this.enterRule(_localctx, 36, WebdaQLParserParser.RULE_stringLiteral); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 185; + _la = this._input.LA(1); + if (!(_la === WebdaQLParserParser.DQUOTED_STRING_LITERAL || _la === WebdaQLParserParser.SQUOTED_STRING_LITERAL)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public integerLiteral(): IntegerLiteralContext { + let _localctx: IntegerLiteralContext = new IntegerLiteralContext(this._ctx, this.state); + this.enterRule(_localctx, 38, WebdaQLParserParser.RULE_integerLiteral); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 187; + this.match(WebdaQLParserParser.INTEGER_LITERAL); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public setExpression(): SetExpressionContext { + let _localctx: SetExpressionContext = new SetExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 40, WebdaQLParserParser.RULE_setExpression); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 189; + this.match(WebdaQLParserParser.LR_SQ_BRACKET); + this.state = 190; + this.values(); + this.state = 195; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === WebdaQLParserParser.COMMA) { + { + { + this.state = 191; + this.match(WebdaQLParserParser.COMMA); + this.state = 192; + this.values(); + } + } + this.state = 197; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 198; + this.match(WebdaQLParserParser.RR_SQ_BRACKET); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + + public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { + switch (ruleIndex) { + case 13: + return this.expression_sempred(_localctx as ExpressionContext, predIndex); + } + return true; + } + private expression_sempred(_localctx: ExpressionContext, predIndex: number): boolean { + switch (predIndex) { + case 0: + return this.precpred(this._ctx, 4); + + case 1: + return this.precpred(this._ctx, 3); + } + return true; + } + + public static readonly _serializedATN: string = + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03\'\xCB\x04\x02" + + "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" + + "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04" + + "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + + "\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x03\x02\x03\x02\x05" + + "\x02/\n\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x05\x036\n\x03\x03" + + "\x04\x03\x04\x03\x04\x05\x04;\n\x04\x03\x04\x05\x04>\n\x04\x03\x05\x03" + + "\x05\x03\x05\x03\x05\x03\x05\x05\x05E\n\x05\x03\x05\x05\x05H\n\x05\x03" + + "\x06\x03\x06\x03\x06\x03\x06\x05\x06N\n\x06\x03\x06\x05\x06Q\n\x06\x03" + + "\x06\x05\x06T\n\x06\x03\x06\x05\x06W\n\x06\x03\x07\x05\x07Z\n\x07\x03" + + "\x07\x05\x07]\n\x07\x03\x07\x05\x07`\n\x07\x03\x07\x05\x07c\n\x07\x03" + + "\b\x03\b\x03\b\x07\bh\n\b\f\b\x0E\bk\v\b\x03\t\x03\t\x03\t\x03\t\x03\n" + + "\x03\n\x03\n\x07\nt\n\n\f\n\x0E\nw\v\n\x03\v\x03\v\x03\v\x03\f\x03\f\x03" + + "\f\x03\r\x03\r\x05\r\x81\n\r\x03\x0E\x03\x0E\x03\x0E\x03\x0E\x07\x0E\x87" + + "\n\x0E\f\x0E\x0E\x0E\x8A\v\x0E\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F" + + "\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F" + + "\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x05\x0F" + + "\xA2\n\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x07\x0F\xAA" + + "\n\x0F\f\x0F\x0E\x0F\xAD\v\x0F\x03\x10\x03\x10\x03\x10\x05\x10\xB2\n\x10" + + "\x03\x11\x03\x11\x05\x11\xB6\n\x11\x03\x12\x03\x12\x03\x13\x03\x13\x03" + + "\x14\x03\x14\x03\x15\x03\x15\x03\x16\x03\x16\x03\x16\x03\x16\x07\x16\xC4" + + "\n\x16\f\x16\x0E\x16\xC7\v\x16\x03\x16\x03\x16\x03\x16\x02\x02\x03\x1C" + + "\x17\x02\x02\x04\x02\x06\x02\b\x02\n\x02\f\x02\x0E\x02\x10\x02\x12\x02" + + "\x14\x02\x16\x02\x18\x02\x1A\x02\x1C\x02\x1E\x02 \x02\"\x02$\x02&\x02" + + "(\x02*\x02\x02\x07\x03\x02 !\x03\x02\x12\x17\x03\x02%&\x03\x02\x1B\x1C" + + "\x03\x02\"#\x02\xD3\x02.\x03\x02\x02\x02\x045\x03\x02\x02\x02\x067\x03" + + "\x02\x02\x02\b?\x03\x02\x02\x02\nI\x03\x02\x02\x02\fY\x03\x02\x02\x02" + + "\x0Ed\x03\x02\x02\x02\x10l\x03\x02\x02\x02\x12p\x03\x02\x02\x02\x14x\x03" + + "\x02\x02\x02\x16{\x03\x02\x02\x02\x18~\x03\x02\x02\x02\x1A\x82\x03\x02" + + "\x02\x02\x1C\xA1\x03\x02\x02\x02\x1E\xB1\x03\x02\x02\x02 \xB5\x03\x02" + + "\x02\x02\"\xB7\x03\x02\x02\x02$\xB9\x03\x02\x02\x02&\xBB\x03\x02\x02\x02" + + "(\xBD\x03\x02\x02\x02*\xBF\x03\x02\x02\x02,/\x05\x04\x03\x02-/\x05\f\x07" + + "\x02.,\x03\x02\x02\x02.-\x03\x02\x02\x02/0\x03\x02\x02\x0201\x07\x02\x02" + + "\x031\x03\x03\x02\x02\x0226\x05\x06\x04\x0236\x05\b\x05\x0246\x05\n\x06" + + "\x0252\x03\x02\x02\x0253\x03\x02\x02\x0254\x03\x02\x02\x026\x05\x03\x02" + + "\x02\x027:\x07\v\x02\x0289\x07\x0F\x02\x029;\x05\x1C\x0F\x02:8\x03\x02" + + "\x02\x02:;\x03\x02\x02\x02;=\x03\x02\x02\x02<>\x05\x14\v\x02=<\x03\x02" + + "\x02\x02=>\x03\x02\x02\x02>\x07\x03\x02\x02\x02?@\x07\f\x02\x02@A\x07" + + "\x0E\x02\x02AD\x05\x0E\b\x02BC\x07\x0F\x02\x02CE\x05\x1C\x0F\x02DB\x03" + + "\x02\x02\x02DE\x03\x02\x02\x02EG\x03\x02\x02\x02FH\x05\x14\v\x02GF\x03" + + "\x02\x02\x02GH\x03\x02\x02\x02H\t\x03\x02\x02\x02IJ\x07\r\x02\x02JM\x05" + + "\x12\n\x02KL\x07\x0F\x02\x02LN\x05\x1C\x0F\x02MK\x03\x02\x02\x02MN\x03" + + "\x02\x02\x02NP\x03\x02\x02\x02OQ\x05\x1A\x0E\x02PO\x03\x02\x02\x02PQ\x03" + + "\x02\x02\x02QS\x03\x02\x02\x02RT\x05\x14\v\x02SR\x03\x02\x02\x02ST\x03" + + "\x02\x02\x02TV\x03\x02\x02\x02UW\x05\x16\f\x02VU\x03\x02\x02\x02VW\x03" + + "\x02\x02\x02W\v\x03\x02\x02\x02XZ\x05\x1C\x0F\x02YX\x03\x02\x02\x02YZ" + + "\x03\x02\x02\x02Z\\\x03\x02\x02\x02[]\x05\x1A\x0E\x02\\[\x03\x02\x02\x02" + + "\\]\x03\x02\x02\x02]_\x03\x02\x02\x02^`\x05\x14\v\x02_^\x03\x02\x02\x02" + + "_`\x03\x02\x02\x02`b\x03\x02\x02\x02ac\x05\x16\f\x02ba\x03\x02\x02\x02" + + "bc\x03\x02\x02\x02c\r\x03\x02\x02\x02di\x05\x10\t\x02ef\x07\x06\x02\x02" + + "fh\x05\x10\t\x02ge\x03\x02\x02\x02hk\x03\x02\x02\x02ig\x03\x02\x02\x02" + + "ij\x03\x02\x02\x02j\x0F\x03\x02\x02\x02ki\x03\x02\x02\x02lm\x05\"\x12" + + "\x02mn\x07\x12\x02\x02no\x05\x1E\x10\x02o\x11\x03\x02\x02\x02pu\x05\"" + + "\x12\x02qr\x07\x06\x02\x02rt\x05\"\x12\x02sq\x03\x02\x02\x02tw\x03\x02" + + "\x02\x02us\x03\x02\x02\x02uv\x03\x02\x02\x02v\x13\x03\x02\x02\x02wu\x03" + + "\x02\x02\x02xy\x07\x1D\x02\x02yz\x05(\x15\x02z\x15\x03\x02\x02\x02{|\x07" + + "\x1E\x02\x02|}\x05&\x14\x02}\x17\x03\x02\x02\x02~\x80\x05\"\x12\x02\x7F" + + "\x81\t\x02\x02\x02\x80\x7F\x03\x02\x02\x02\x80\x81\x03\x02\x02\x02\x81" + + "\x19\x03\x02\x02\x02\x82\x83\x07\x1F\x02\x02\x83\x88\x05\x18\r\x02\x84" + + "\x85\x07\x06\x02\x02\x85\x87\x05\x18\r\x02\x86\x84\x03\x02\x02\x02\x87" + + "\x8A\x03\x02\x02\x02\x88\x86\x03\x02\x02\x02\x88\x89\x03\x02\x02\x02\x89" + + "\x1B\x03\x02\x02\x02\x8A\x88\x03\x02\x02\x02\x8B\x8C\b\x0F\x01\x02\x8C" + + "\x8D\x05\"\x12\x02\x8D\x8E\x07\x18\x02\x02\x8E\x8F\x05&\x14\x02\x8F\xA2" + + "\x03\x02\x02\x02\x90\x91\x05\"\x12\x02\x91\x92\x07\x19\x02\x02\x92\x93" + + "\x05*\x16\x02\x93\xA2\x03\x02\x02\x02\x94\x95\x05\"\x12\x02\x95\x96\x07" + + "\x1A\x02\x02\x96\x97\x05&\x14\x02\x97\xA2\x03\x02\x02\x02\x98\x99\x05" + + "\"\x12\x02\x99\x9A\t\x03\x02\x02\x9A\x9B\x05\x1E\x10\x02\x9B\xA2\x03\x02" + + "\x02\x02\x9C\x9D\x07\x04\x02\x02\x9D\x9E\x05\x1C\x0F\x02\x9E\x9F\x07\x05" + + "\x02\x02\x9F\xA2\x03\x02\x02\x02\xA0\xA2\x05 \x11\x02\xA1\x8B\x03\x02" + + "\x02\x02\xA1\x90\x03\x02\x02\x02\xA1\x94\x03\x02\x02\x02\xA1\x98\x03\x02" + + "\x02\x02\xA1\x9C\x03\x02\x02\x02\xA1\xA0\x03\x02\x02\x02\xA2\xAB\x03\x02" + + "\x02\x02\xA3\xA4\f\x06\x02\x02\xA4\xA5\x07\x10\x02\x02\xA5\xAA\x05\x1C" + + "\x0F\x07\xA6\xA7\f\x05\x02\x02\xA7\xA8\x07\x11\x02\x02\xA8\xAA\x05\x1C" + + "\x0F\x06\xA9\xA3\x03\x02\x02\x02\xA9\xA6\x03\x02\x02\x02\xAA\xAD\x03\x02" + + "\x02\x02\xAB\xA9\x03\x02\x02\x02\xAB\xAC\x03\x02\x02\x02\xAC\x1D\x03\x02" + + "\x02\x02\xAD\xAB\x03\x02\x02\x02\xAE\xB2\x05$\x13\x02\xAF\xB2\x05(\x15" + + "\x02\xB0\xB2\x05&\x14\x02\xB1\xAE\x03\x02\x02\x02\xB1\xAF\x03\x02\x02" + + "\x02\xB1\xB0\x03\x02\x02\x02\xB2\x1F\x03\x02\x02\x02\xB3\xB6\x05\x1E\x10" + + "\x02\xB4\xB6\x05\"\x12\x02\xB5\xB3\x03\x02\x02\x02\xB5\xB4\x03\x02\x02" + + "\x02\xB6!\x03\x02\x02\x02\xB7\xB8\t\x04\x02\x02\xB8#\x03\x02\x02\x02\xB9" + + "\xBA\t\x05\x02\x02\xBA%\x03\x02\x02\x02\xBB\xBC\t\x06\x02\x02\xBC\'\x03" + + "\x02\x02\x02\xBD\xBE\x07$\x02\x02\xBE)\x03\x02\x02\x02\xBF\xC0\x07\t\x02" + + "\x02\xC0\xC5\x05\x1E\x10\x02\xC1\xC2\x07\x06\x02\x02\xC2\xC4\x05\x1E\x10" + + "\x02\xC3\xC1\x03\x02\x02\x02\xC4\xC7\x03\x02\x02\x02\xC5\xC3\x03\x02\x02" + + "\x02\xC5\xC6\x03\x02\x02\x02\xC6\xC8\x03\x02\x02\x02\xC7\xC5\x03\x02\x02" + + "\x02\xC8\xC9\x07\n\x02\x02\xC9+\x03\x02\x02\x02\x1A.5:=DGMPSVY\\_biu\x80" + + "\x88\xA1\xA9\xAB\xB1\xB5\xC5"; + public static __ATN: ATN; + public static get _ATN(): ATN { + if (!WebdaQLParserParser.__ATN) { + WebdaQLParserParser.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(WebdaQLParserParser._serializedATN)); + } + + return WebdaQLParserParser.__ATN; + } + } export class WebdaqlContext extends ParserRuleContext { - public EOF(): TerminalNode { - return this.getToken(WebdaQLParserParser.EOF, 0); - } - public expression(): ExpressionContext | undefined { - return this.tryGetRuleContext(0, ExpressionContext); - } - public orderExpression(): OrderExpressionContext | undefined { - return this.tryGetRuleContext(0, OrderExpressionContext); - } - public limitExpression(): LimitExpressionContext | undefined { - return this.tryGetRuleContext(0, LimitExpressionContext); - } - public offsetExpression(): OffsetExpressionContext | undefined { - return this.tryGetRuleContext(0, OffsetExpressionContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_webdaql; - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterWebdaql) { - listener.enterWebdaql(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitWebdaql) { - listener.exitWebdaql(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitWebdaql) { - return visitor.visitWebdaql(this); - } else { - return visitor.visitChildren(this); - } - } + public EOF(): TerminalNode { return this.getToken(WebdaQLParserParser.EOF, 0); } + public statement(): StatementContext | undefined { + return this.tryGetRuleContext(0, StatementContext); + } + public filterQuery(): FilterQueryContext | undefined { + return this.tryGetRuleContext(0, FilterQueryContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_webdaql; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterWebdaql) { + listener.enterWebdaql(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitWebdaql) { + listener.exitWebdaql(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitWebdaql) { + return visitor.visitWebdaql(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class StatementContext extends ParserRuleContext { + public deleteStatement(): DeleteStatementContext | undefined { + return this.tryGetRuleContext(0, DeleteStatementContext); + } + public updateStatement(): UpdateStatementContext | undefined { + return this.tryGetRuleContext(0, UpdateStatementContext); + } + public selectStatement(): SelectStatementContext | undefined { + return this.tryGetRuleContext(0, SelectStatementContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_statement; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterStatement) { + listener.enterStatement(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitStatement) { + listener.exitStatement(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitStatement) { + return visitor.visitStatement(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class DeleteStatementContext extends ParserRuleContext { + public DELETE(): TerminalNode { return this.getToken(WebdaQLParserParser.DELETE, 0); } + public WHERE(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.WHERE, 0); } + public expression(): ExpressionContext | undefined { + return this.tryGetRuleContext(0, ExpressionContext); + } + public limitExpression(): LimitExpressionContext | undefined { + return this.tryGetRuleContext(0, LimitExpressionContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_deleteStatement; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterDeleteStatement) { + listener.enterDeleteStatement(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitDeleteStatement) { + listener.exitDeleteStatement(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitDeleteStatement) { + return visitor.visitDeleteStatement(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class UpdateStatementContext extends ParserRuleContext { + public UPDATE(): TerminalNode { return this.getToken(WebdaQLParserParser.UPDATE, 0); } + public SET(): TerminalNode { return this.getToken(WebdaQLParserParser.SET, 0); } + public assignmentList(): AssignmentListContext { + return this.getRuleContext(0, AssignmentListContext); + } + public WHERE(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.WHERE, 0); } + public expression(): ExpressionContext | undefined { + return this.tryGetRuleContext(0, ExpressionContext); + } + public limitExpression(): LimitExpressionContext | undefined { + return this.tryGetRuleContext(0, LimitExpressionContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_updateStatement; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterUpdateStatement) { + listener.enterUpdateStatement(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitUpdateStatement) { + listener.exitUpdateStatement(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitUpdateStatement) { + return visitor.visitUpdateStatement(this); + } else { + return visitor.visitChildren(this); + } + } } + +export class SelectStatementContext extends ParserRuleContext { + public SELECT(): TerminalNode { return this.getToken(WebdaQLParserParser.SELECT, 0); } + public fieldList(): FieldListContext { + return this.getRuleContext(0, FieldListContext); + } + public WHERE(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.WHERE, 0); } + public expression(): ExpressionContext | undefined { + return this.tryGetRuleContext(0, ExpressionContext); + } + public orderExpression(): OrderExpressionContext | undefined { + return this.tryGetRuleContext(0, OrderExpressionContext); + } + public limitExpression(): LimitExpressionContext | undefined { + return this.tryGetRuleContext(0, LimitExpressionContext); + } + public offsetExpression(): OffsetExpressionContext | undefined { + return this.tryGetRuleContext(0, OffsetExpressionContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_selectStatement; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterSelectStatement) { + listener.enterSelectStatement(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitSelectStatement) { + listener.exitSelectStatement(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitSelectStatement) { + return visitor.visitSelectStatement(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class FilterQueryContext extends ParserRuleContext { + public expression(): ExpressionContext | undefined { + return this.tryGetRuleContext(0, ExpressionContext); + } + public orderExpression(): OrderExpressionContext | undefined { + return this.tryGetRuleContext(0, OrderExpressionContext); + } + public limitExpression(): LimitExpressionContext | undefined { + return this.tryGetRuleContext(0, LimitExpressionContext); + } + public offsetExpression(): OffsetExpressionContext | undefined { + return this.tryGetRuleContext(0, OffsetExpressionContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_filterQuery; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterFilterQuery) { + listener.enterFilterQuery(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitFilterQuery) { + listener.exitFilterQuery(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitFilterQuery) { + return visitor.visitFilterQuery(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class AssignmentListContext extends ParserRuleContext { + public assignment(): AssignmentContext[]; + public assignment(i: number): AssignmentContext; + public assignment(i?: number): AssignmentContext | AssignmentContext[] { + if (i === undefined) { + return this.getRuleContexts(AssignmentContext); + } else { + return this.getRuleContext(i, AssignmentContext); + } + } + public COMMA(): TerminalNode[]; + public COMMA(i: number): TerminalNode; + public COMMA(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(WebdaQLParserParser.COMMA); + } else { + return this.getToken(WebdaQLParserParser.COMMA, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_assignmentList; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterAssignmentList) { + listener.enterAssignmentList(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitAssignmentList) { + listener.exitAssignmentList(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitAssignmentList) { + return visitor.visitAssignmentList(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class AssignmentContext extends ParserRuleContext { + public identifier(): IdentifierContext { + return this.getRuleContext(0, IdentifierContext); + } + public EQUAL(): TerminalNode { return this.getToken(WebdaQLParserParser.EQUAL, 0); } + public values(): ValuesContext { + return this.getRuleContext(0, ValuesContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_assignment; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterAssignment) { + listener.enterAssignment(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitAssignment) { + listener.exitAssignment(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitAssignment) { + return visitor.visitAssignment(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class FieldListContext extends ParserRuleContext { + public identifier(): IdentifierContext[]; + public identifier(i: number): IdentifierContext; + public identifier(i?: number): IdentifierContext | IdentifierContext[] { + if (i === undefined) { + return this.getRuleContexts(IdentifierContext); + } else { + return this.getRuleContext(i, IdentifierContext); + } + } + public COMMA(): TerminalNode[]; + public COMMA(i: number): TerminalNode; + public COMMA(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(WebdaQLParserParser.COMMA); + } else { + return this.getToken(WebdaQLParserParser.COMMA, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_fieldList; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterFieldList) { + listener.enterFieldList(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitFieldList) { + listener.exitFieldList(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitFieldList) { + return visitor.visitFieldList(this); + } else { + return visitor.visitChildren(this); + } + } +} + + export class LimitExpressionContext extends ParserRuleContext { - public LIMIT(): TerminalNode { - return this.getToken(WebdaQLParserParser.LIMIT, 0); - } - public integerLiteral(): IntegerLiteralContext { - return this.getRuleContext(0, IntegerLiteralContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_limitExpression; - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterLimitExpression) { - listener.enterLimitExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitLimitExpression) { - listener.exitLimitExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitLimitExpression) { - return visitor.visitLimitExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public LIMIT(): TerminalNode { return this.getToken(WebdaQLParserParser.LIMIT, 0); } + public integerLiteral(): IntegerLiteralContext { + return this.getRuleContext(0, IntegerLiteralContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_limitExpression; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterLimitExpression) { + listener.enterLimitExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitLimitExpression) { + listener.exitLimitExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitLimitExpression) { + return visitor.visitLimitExpression(this); + } else { + return visitor.visitChildren(this); + } + } } + export class OffsetExpressionContext extends ParserRuleContext { - public OFFSET(): TerminalNode { - return this.getToken(WebdaQLParserParser.OFFSET, 0); - } - public stringLiteral(): StringLiteralContext { - return this.getRuleContext(0, StringLiteralContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_offsetExpression; - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterOffsetExpression) { - listener.enterOffsetExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitOffsetExpression) { - listener.exitOffsetExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitOffsetExpression) { - return visitor.visitOffsetExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public OFFSET(): TerminalNode { return this.getToken(WebdaQLParserParser.OFFSET, 0); } + public stringLiteral(): StringLiteralContext { + return this.getRuleContext(0, StringLiteralContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_offsetExpression; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterOffsetExpression) { + listener.enterOffsetExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitOffsetExpression) { + listener.exitOffsetExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitOffsetExpression) { + return visitor.visitOffsetExpression(this); + } else { + return visitor.visitChildren(this); + } + } } + export class OrderFieldExpressionContext extends ParserRuleContext { - public identifier(): IdentifierContext { - return this.getRuleContext(0, IdentifierContext); - } - public ASC(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.ASC, 0); - } - public DESC(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.DESC, 0); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_orderFieldExpression; - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterOrderFieldExpression) { - listener.enterOrderFieldExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitOrderFieldExpression) { - listener.exitOrderFieldExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitOrderFieldExpression) { - return visitor.visitOrderFieldExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public identifier(): IdentifierContext { + return this.getRuleContext(0, IdentifierContext); + } + public ASC(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.ASC, 0); } + public DESC(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.DESC, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_orderFieldExpression; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterOrderFieldExpression) { + listener.enterOrderFieldExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitOrderFieldExpression) { + listener.exitOrderFieldExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitOrderFieldExpression) { + return visitor.visitOrderFieldExpression(this); + } else { + return visitor.visitChildren(this); + } + } } + export class OrderExpressionContext extends ParserRuleContext { - public ORDER_BY(): TerminalNode { - return this.getToken(WebdaQLParserParser.ORDER_BY, 0); - } - public orderFieldExpression(): OrderFieldExpressionContext[]; - public orderFieldExpression(i: number): OrderFieldExpressionContext; - public orderFieldExpression(i?: number): OrderFieldExpressionContext | OrderFieldExpressionContext[] { - if (i === undefined) { - return this.getRuleContexts(OrderFieldExpressionContext); - } else { - return this.getRuleContext(i, OrderFieldExpressionContext); - } - } - public COMMA(): TerminalNode[]; - public COMMA(i: number): TerminalNode; - public COMMA(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(WebdaQLParserParser.COMMA); - } else { - return this.getToken(WebdaQLParserParser.COMMA, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_orderExpression; - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterOrderExpression) { - listener.enterOrderExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitOrderExpression) { - listener.exitOrderExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitOrderExpression) { - return visitor.visitOrderExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public ORDER_BY(): TerminalNode { return this.getToken(WebdaQLParserParser.ORDER_BY, 0); } + public orderFieldExpression(): OrderFieldExpressionContext[]; + public orderFieldExpression(i: number): OrderFieldExpressionContext; + public orderFieldExpression(i?: number): OrderFieldExpressionContext | OrderFieldExpressionContext[] { + if (i === undefined) { + return this.getRuleContexts(OrderFieldExpressionContext); + } else { + return this.getRuleContext(i, OrderFieldExpressionContext); + } + } + public COMMA(): TerminalNode[]; + public COMMA(i: number): TerminalNode; + public COMMA(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(WebdaQLParserParser.COMMA); + } else { + return this.getToken(WebdaQLParserParser.COMMA, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_orderExpression; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterOrderExpression) { + listener.enterOrderExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitOrderExpression) { + listener.exitOrderExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitOrderExpression) { + return visitor.visitOrderExpression(this); + } else { + return visitor.visitChildren(this); + } + } } + export class ExpressionContext extends ParserRuleContext { - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_expression; - } - public copyFrom(ctx: ExpressionContext): void { - super.copyFrom(ctx); - } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_expression; } + public copyFrom(ctx: ExpressionContext): void { + super.copyFrom(ctx); + } } export class LikeExpressionContext extends ExpressionContext { - public identifier(): IdentifierContext { - return this.getRuleContext(0, IdentifierContext); - } - public LIKE(): TerminalNode { - return this.getToken(WebdaQLParserParser.LIKE, 0); - } - public stringLiteral(): StringLiteralContext { - return this.getRuleContext(0, StringLiteralContext); - } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterLikeExpression) { - listener.enterLikeExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitLikeExpression) { - listener.exitLikeExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitLikeExpression) { - return visitor.visitLikeExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public identifier(): IdentifierContext { + return this.getRuleContext(0, IdentifierContext); + } + public LIKE(): TerminalNode { return this.getToken(WebdaQLParserParser.LIKE, 0); } + public stringLiteral(): StringLiteralContext { + return this.getRuleContext(0, StringLiteralContext); + } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterLikeExpression) { + listener.enterLikeExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitLikeExpression) { + listener.exitLikeExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitLikeExpression) { + return visitor.visitLikeExpression(this); + } else { + return visitor.visitChildren(this); + } + } } export class InExpressionContext extends ExpressionContext { - public identifier(): IdentifierContext { - return this.getRuleContext(0, IdentifierContext); - } - public IN(): TerminalNode { - return this.getToken(WebdaQLParserParser.IN, 0); - } - public setExpression(): SetExpressionContext { - return this.getRuleContext(0, SetExpressionContext); - } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterInExpression) { - listener.enterInExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitInExpression) { - listener.exitInExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitInExpression) { - return visitor.visitInExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public identifier(): IdentifierContext { + return this.getRuleContext(0, IdentifierContext); + } + public IN(): TerminalNode { return this.getToken(WebdaQLParserParser.IN, 0); } + public setExpression(): SetExpressionContext { + return this.getRuleContext(0, SetExpressionContext); + } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterInExpression) { + listener.enterInExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitInExpression) { + listener.exitInExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitInExpression) { + return visitor.visitInExpression(this); + } else { + return visitor.visitChildren(this); + } + } } export class ContainsExpressionContext extends ExpressionContext { - public identifier(): IdentifierContext { - return this.getRuleContext(0, IdentifierContext); - } - public CONTAINS(): TerminalNode { - return this.getToken(WebdaQLParserParser.CONTAINS, 0); - } - public stringLiteral(): StringLiteralContext { - return this.getRuleContext(0, StringLiteralContext); - } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterContainsExpression) { - listener.enterContainsExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitContainsExpression) { - listener.exitContainsExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitContainsExpression) { - return visitor.visitContainsExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public identifier(): IdentifierContext { + return this.getRuleContext(0, IdentifierContext); + } + public CONTAINS(): TerminalNode { return this.getToken(WebdaQLParserParser.CONTAINS, 0); } + public stringLiteral(): StringLiteralContext { + return this.getRuleContext(0, StringLiteralContext); + } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterContainsExpression) { + listener.enterContainsExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitContainsExpression) { + listener.exitContainsExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitContainsExpression) { + return visitor.visitContainsExpression(this); + } else { + return visitor.visitChildren(this); + } + } } export class BinaryComparisonExpressionContext extends ExpressionContext { - public identifier(): IdentifierContext { - return this.getRuleContext(0, IdentifierContext); - } - public values(): ValuesContext { - return this.getRuleContext(0, ValuesContext); - } - public EQUAL(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.EQUAL, 0); - } - public NOT_EQUAL(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.NOT_EQUAL, 0); - } - public GREATER_OR_EQUAL(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.GREATER_OR_EQUAL, 0); - } - public LESS_OR_EQUAL(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.LESS_OR_EQUAL, 0); - } - public LESS(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.LESS, 0); - } - public GREATER(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.GREATER, 0); - } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterBinaryComparisonExpression) { - listener.enterBinaryComparisonExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitBinaryComparisonExpression) { - listener.exitBinaryComparisonExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitBinaryComparisonExpression) { - return visitor.visitBinaryComparisonExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public identifier(): IdentifierContext { + return this.getRuleContext(0, IdentifierContext); + } + public values(): ValuesContext { + return this.getRuleContext(0, ValuesContext); + } + public EQUAL(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.EQUAL, 0); } + public NOT_EQUAL(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.NOT_EQUAL, 0); } + public GREATER_OR_EQUAL(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.GREATER_OR_EQUAL, 0); } + public LESS_OR_EQUAL(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.LESS_OR_EQUAL, 0); } + public LESS(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.LESS, 0); } + public GREATER(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.GREATER, 0); } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterBinaryComparisonExpression) { + listener.enterBinaryComparisonExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitBinaryComparisonExpression) { + listener.exitBinaryComparisonExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitBinaryComparisonExpression) { + return visitor.visitBinaryComparisonExpression(this); + } else { + return visitor.visitChildren(this); + } + } } export class AndLogicExpressionContext extends ExpressionContext { - public expression(): ExpressionContext[]; - public expression(i: number): ExpressionContext; - public expression(i?: number): ExpressionContext | ExpressionContext[] { - if (i === undefined) { - return this.getRuleContexts(ExpressionContext); - } else { - return this.getRuleContext(i, ExpressionContext); - } - } - public AND(): TerminalNode { - return this.getToken(WebdaQLParserParser.AND, 0); - } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterAndLogicExpression) { - listener.enterAndLogicExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitAndLogicExpression) { - listener.exitAndLogicExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitAndLogicExpression) { - return visitor.visitAndLogicExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public expression(): ExpressionContext[]; + public expression(i: number): ExpressionContext; + public expression(i?: number): ExpressionContext | ExpressionContext[] { + if (i === undefined) { + return this.getRuleContexts(ExpressionContext); + } else { + return this.getRuleContext(i, ExpressionContext); + } + } + public AND(): TerminalNode { return this.getToken(WebdaQLParserParser.AND, 0); } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterAndLogicExpression) { + listener.enterAndLogicExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitAndLogicExpression) { + listener.exitAndLogicExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitAndLogicExpression) { + return visitor.visitAndLogicExpression(this); + } else { + return visitor.visitChildren(this); + } + } } export class OrLogicExpressionContext extends ExpressionContext { - public expression(): ExpressionContext[]; - public expression(i: number): ExpressionContext; - public expression(i?: number): ExpressionContext | ExpressionContext[] { - if (i === undefined) { - return this.getRuleContexts(ExpressionContext); - } else { - return this.getRuleContext(i, ExpressionContext); - } - } - public OR(): TerminalNode { - return this.getToken(WebdaQLParserParser.OR, 0); - } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterOrLogicExpression) { - listener.enterOrLogicExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitOrLogicExpression) { - listener.exitOrLogicExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitOrLogicExpression) { - return visitor.visitOrLogicExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public expression(): ExpressionContext[]; + public expression(i: number): ExpressionContext; + public expression(i?: number): ExpressionContext | ExpressionContext[] { + if (i === undefined) { + return this.getRuleContexts(ExpressionContext); + } else { + return this.getRuleContext(i, ExpressionContext); + } + } + public OR(): TerminalNode { return this.getToken(WebdaQLParserParser.OR, 0); } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterOrLogicExpression) { + listener.enterOrLogicExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitOrLogicExpression) { + listener.exitOrLogicExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitOrLogicExpression) { + return visitor.visitOrLogicExpression(this); + } else { + return visitor.visitChildren(this); + } + } } export class SubExpressionContext extends ExpressionContext { - public LR_BRACKET(): TerminalNode { - return this.getToken(WebdaQLParserParser.LR_BRACKET, 0); - } - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); - } - public RR_BRACKET(): TerminalNode { - return this.getToken(WebdaQLParserParser.RR_BRACKET, 0); - } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterSubExpression) { - listener.enterSubExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitSubExpression) { - listener.exitSubExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitSubExpression) { - return visitor.visitSubExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public LR_BRACKET(): TerminalNode { return this.getToken(WebdaQLParserParser.LR_BRACKET, 0); } + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); + } + public RR_BRACKET(): TerminalNode { return this.getToken(WebdaQLParserParser.RR_BRACKET, 0); } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterSubExpression) { + listener.enterSubExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitSubExpression) { + listener.exitSubExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitSubExpression) { + return visitor.visitSubExpression(this); + } else { + return visitor.visitChildren(this); + } + } } export class AtomExpressionContext extends ExpressionContext { - public atom(): AtomContext { - return this.getRuleContext(0, AtomContext); - } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterAtomExpression) { - listener.enterAtomExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitAtomExpression) { - listener.exitAtomExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitAtomExpression) { - return visitor.visitAtomExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public atom(): AtomContext { + return this.getRuleContext(0, AtomContext); + } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterAtomExpression) { + listener.enterAtomExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitAtomExpression) { + listener.exitAtomExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitAtomExpression) { + return visitor.visitAtomExpression(this); + } else { + return visitor.visitChildren(this); + } + } } + export class ValuesContext extends ParserRuleContext { - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_values; - } - public copyFrom(ctx: ValuesContext): void { - super.copyFrom(ctx); - } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_values; } + public copyFrom(ctx: ValuesContext): void { + super.copyFrom(ctx); + } } export class BooleanAtomContext extends ValuesContext { - public booleanLiteral(): BooleanLiteralContext { - return this.getRuleContext(0, BooleanLiteralContext); - } - constructor(ctx: ValuesContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterBooleanAtom) { - listener.enterBooleanAtom(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitBooleanAtom) { - listener.exitBooleanAtom(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitBooleanAtom) { - return visitor.visitBooleanAtom(this); - } else { - return visitor.visitChildren(this); - } - } + public booleanLiteral(): BooleanLiteralContext { + return this.getRuleContext(0, BooleanLiteralContext); + } + constructor(ctx: ValuesContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterBooleanAtom) { + listener.enterBooleanAtom(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitBooleanAtom) { + listener.exitBooleanAtom(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitBooleanAtom) { + return visitor.visitBooleanAtom(this); + } else { + return visitor.visitChildren(this); + } + } } export class IntegerAtomContext extends ValuesContext { - public integerLiteral(): IntegerLiteralContext { - return this.getRuleContext(0, IntegerLiteralContext); - } - constructor(ctx: ValuesContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterIntegerAtom) { - listener.enterIntegerAtom(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitIntegerAtom) { - listener.exitIntegerAtom(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitIntegerAtom) { - return visitor.visitIntegerAtom(this); - } else { - return visitor.visitChildren(this); - } - } + public integerLiteral(): IntegerLiteralContext { + return this.getRuleContext(0, IntegerLiteralContext); + } + constructor(ctx: ValuesContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterIntegerAtom) { + listener.enterIntegerAtom(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitIntegerAtom) { + listener.exitIntegerAtom(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitIntegerAtom) { + return visitor.visitIntegerAtom(this); + } else { + return visitor.visitChildren(this); + } + } } export class StringAtomContext extends ValuesContext { - public stringLiteral(): StringLiteralContext { - return this.getRuleContext(0, StringLiteralContext); - } - constructor(ctx: ValuesContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterStringAtom) { - listener.enterStringAtom(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitStringAtom) { - listener.exitStringAtom(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitStringAtom) { - return visitor.visitStringAtom(this); - } else { - return visitor.visitChildren(this); - } - } + public stringLiteral(): StringLiteralContext { + return this.getRuleContext(0, StringLiteralContext); + } + constructor(ctx: ValuesContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterStringAtom) { + listener.enterStringAtom(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitStringAtom) { + listener.exitStringAtom(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitStringAtom) { + return visitor.visitStringAtom(this); + } else { + return visitor.visitChildren(this); + } + } } + export class AtomContext extends ParserRuleContext { - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_atom; - } - public copyFrom(ctx: AtomContext): void { - super.copyFrom(ctx); - } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_atom; } + public copyFrom(ctx: AtomContext): void { + super.copyFrom(ctx); + } } export class ValuesAtomContext extends AtomContext { - public values(): ValuesContext { - return this.getRuleContext(0, ValuesContext); - } - constructor(ctx: AtomContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterValuesAtom) { - listener.enterValuesAtom(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitValuesAtom) { - listener.exitValuesAtom(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitValuesAtom) { - return visitor.visitValuesAtom(this); - } else { - return visitor.visitChildren(this); - } - } + public values(): ValuesContext { + return this.getRuleContext(0, ValuesContext); + } + constructor(ctx: AtomContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterValuesAtom) { + listener.enterValuesAtom(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitValuesAtom) { + listener.exitValuesAtom(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitValuesAtom) { + return visitor.visitValuesAtom(this); + } else { + return visitor.visitChildren(this); + } + } } export class IdentifierAtomContext extends AtomContext { - public identifier(): IdentifierContext { - return this.getRuleContext(0, IdentifierContext); - } - constructor(ctx: AtomContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterIdentifierAtom) { - listener.enterIdentifierAtom(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitIdentifierAtom) { - listener.exitIdentifierAtom(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitIdentifierAtom) { - return visitor.visitIdentifierAtom(this); - } else { - return visitor.visitChildren(this); - } - } + public identifier(): IdentifierContext { + return this.getRuleContext(0, IdentifierContext); + } + constructor(ctx: AtomContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterIdentifierAtom) { + listener.enterIdentifierAtom(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitIdentifierAtom) { + listener.exitIdentifierAtom(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitIdentifierAtom) { + return visitor.visitIdentifierAtom(this); + } else { + return visitor.visitChildren(this); + } + } } + export class IdentifierContext extends ParserRuleContext { - public IDENTIFIER(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.IDENTIFIER, 0); - } - public IDENTIFIER_WITH_NUMBER(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.IDENTIFIER_WITH_NUMBER, 0); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_identifier; - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterIdentifier) { - listener.enterIdentifier(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitIdentifier) { - listener.exitIdentifier(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitIdentifier) { - return visitor.visitIdentifier(this); - } else { - return visitor.visitChildren(this); - } - } + public IDENTIFIER(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.IDENTIFIER, 0); } + public IDENTIFIER_WITH_NUMBER(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.IDENTIFIER_WITH_NUMBER, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_identifier; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterIdentifier) { + listener.enterIdentifier(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitIdentifier) { + listener.exitIdentifier(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitIdentifier) { + return visitor.visitIdentifier(this); + } else { + return visitor.visitChildren(this); + } + } } + export class BooleanLiteralContext extends ParserRuleContext { - public TRUE(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.TRUE, 0); - } - public FALSE(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.FALSE, 0); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_booleanLiteral; - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterBooleanLiteral) { - listener.enterBooleanLiteral(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitBooleanLiteral) { - listener.exitBooleanLiteral(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitBooleanLiteral) { - return visitor.visitBooleanLiteral(this); - } else { - return visitor.visitChildren(this); - } - } + public TRUE(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.TRUE, 0); } + public FALSE(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.FALSE, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_booleanLiteral; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterBooleanLiteral) { + listener.enterBooleanLiteral(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitBooleanLiteral) { + listener.exitBooleanLiteral(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitBooleanLiteral) { + return visitor.visitBooleanLiteral(this); + } else { + return visitor.visitChildren(this); + } + } } + export class StringLiteralContext extends ParserRuleContext { - public DQUOTED_STRING_LITERAL(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.DQUOTED_STRING_LITERAL, 0); - } - public SQUOTED_STRING_LITERAL(): TerminalNode | undefined { - return this.tryGetToken(WebdaQLParserParser.SQUOTED_STRING_LITERAL, 0); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_stringLiteral; - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterStringLiteral) { - listener.enterStringLiteral(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitStringLiteral) { - listener.exitStringLiteral(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitStringLiteral) { - return visitor.visitStringLiteral(this); - } else { - return visitor.visitChildren(this); - } - } + public DQUOTED_STRING_LITERAL(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.DQUOTED_STRING_LITERAL, 0); } + public SQUOTED_STRING_LITERAL(): TerminalNode | undefined { return this.tryGetToken(WebdaQLParserParser.SQUOTED_STRING_LITERAL, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_stringLiteral; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterStringLiteral) { + listener.enterStringLiteral(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitStringLiteral) { + listener.exitStringLiteral(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitStringLiteral) { + return visitor.visitStringLiteral(this); + } else { + return visitor.visitChildren(this); + } + } } + export class IntegerLiteralContext extends ParserRuleContext { - public INTEGER_LITERAL(): TerminalNode { - return this.getToken(WebdaQLParserParser.INTEGER_LITERAL, 0); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_integerLiteral; - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterIntegerLiteral) { - listener.enterIntegerLiteral(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitIntegerLiteral) { - listener.exitIntegerLiteral(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitIntegerLiteral) { - return visitor.visitIntegerLiteral(this); - } else { - return visitor.visitChildren(this); - } - } + public INTEGER_LITERAL(): TerminalNode { return this.getToken(WebdaQLParserParser.INTEGER_LITERAL, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_integerLiteral; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterIntegerLiteral) { + listener.enterIntegerLiteral(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitIntegerLiteral) { + listener.exitIntegerLiteral(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitIntegerLiteral) { + return visitor.visitIntegerLiteral(this); + } else { + return visitor.visitChildren(this); + } + } } + export class SetExpressionContext extends ParserRuleContext { - public LR_SQ_BRACKET(): TerminalNode { - return this.getToken(WebdaQLParserParser.LR_SQ_BRACKET, 0); - } - public values(): ValuesContext[]; - public values(i: number): ValuesContext; - public values(i?: number): ValuesContext | ValuesContext[] { - if (i === undefined) { - return this.getRuleContexts(ValuesContext); - } else { - return this.getRuleContext(i, ValuesContext); - } - } - public RR_SQ_BRACKET(): TerminalNode { - return this.getToken(WebdaQLParserParser.RR_SQ_BRACKET, 0); - } - public COMMA(): TerminalNode[]; - public COMMA(i: number): TerminalNode; - public COMMA(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(WebdaQLParserParser.COMMA); - } else { - return this.getToken(WebdaQLParserParser.COMMA, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { - return WebdaQLParserParser.RULE_setExpression; - } - // @Override - public enterRule(listener: WebdaQLParserListener): void { - if (listener.enterSetExpression) { - listener.enterSetExpression(this); - } - } - // @Override - public exitRule(listener: WebdaQLParserListener): void { - if (listener.exitSetExpression) { - listener.exitSetExpression(this); - } - } - // @Override - public accept(visitor: WebdaQLParserVisitor): Result { - if (visitor.visitSetExpression) { - return visitor.visitSetExpression(this); - } else { - return visitor.visitChildren(this); - } - } + public LR_SQ_BRACKET(): TerminalNode { return this.getToken(WebdaQLParserParser.LR_SQ_BRACKET, 0); } + public values(): ValuesContext[]; + public values(i: number): ValuesContext; + public values(i?: number): ValuesContext | ValuesContext[] { + if (i === undefined) { + return this.getRuleContexts(ValuesContext); + } else { + return this.getRuleContext(i, ValuesContext); + } + } + public RR_SQ_BRACKET(): TerminalNode { return this.getToken(WebdaQLParserParser.RR_SQ_BRACKET, 0); } + public COMMA(): TerminalNode[]; + public COMMA(i: number): TerminalNode; + public COMMA(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(WebdaQLParserParser.COMMA); + } else { + return this.getToken(WebdaQLParserParser.COMMA, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return WebdaQLParserParser.RULE_setExpression; } + // @Override + public enterRule(listener: WebdaQLParserListener): void { + if (listener.enterSetExpression) { + listener.enterSetExpression(this); + } + } + // @Override + public exitRule(listener: WebdaQLParserListener): void { + if (listener.exitSetExpression) { + listener.exitSetExpression(this); + } + } + // @Override + public accept(visitor: WebdaQLParserVisitor): Result { + if (visitor.visitSetExpression) { + return visitor.visitSetExpression(this); + } else { + return visitor.visitChildren(this); + } + } } + + diff --git a/packages/ql/src/WebdaQLParserVisitor.ts b/packages/ql/src/WebdaQLParserVisitor.ts index d41392d8b..135ea89ef 100644 --- a/packages/ql/src/WebdaQLParserVisitor.ts +++ b/packages/ql/src/WebdaQLParserVisitor.ts @@ -1,35 +1,43 @@ -// Generated from src/stores/webdaql/WebdaQLParser.g4 by ANTLR 4.9.0-SNAPSHOT +// Generated from src/WebdaQLParser.g4 by ANTLR 4.9.0-SNAPSHOT + import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; -import { - AndLogicExpressionContext, - AtomContext, - AtomExpressionContext, - BinaryComparisonExpressionContext, - BooleanAtomContext, - BooleanLiteralContext, - ContainsExpressionContext, - ExpressionContext, - IdentifierAtomContext, - IdentifierContext, - InExpressionContext, - IntegerAtomContext, - IntegerLiteralContext, - LikeExpressionContext, - LimitExpressionContext, - OffsetExpressionContext, - OrderExpressionContext, - OrderFieldExpressionContext, - OrLogicExpressionContext, - SetExpressionContext, - StringAtomContext, - StringLiteralContext, - SubExpressionContext, - ValuesAtomContext, - ValuesContext, - WebdaqlContext -} from "./WebdaQLParserParser"; +import { LikeExpressionContext } from "./WebdaQLParserParser"; +import { InExpressionContext } from "./WebdaQLParserParser"; +import { ContainsExpressionContext } from "./WebdaQLParserParser"; +import { BinaryComparisonExpressionContext } from "./WebdaQLParserParser"; +import { AndLogicExpressionContext } from "./WebdaQLParserParser"; +import { OrLogicExpressionContext } from "./WebdaQLParserParser"; +import { SubExpressionContext } from "./WebdaQLParserParser"; +import { AtomExpressionContext } from "./WebdaQLParserParser"; +import { BooleanAtomContext } from "./WebdaQLParserParser"; +import { IntegerAtomContext } from "./WebdaQLParserParser"; +import { StringAtomContext } from "./WebdaQLParserParser"; +import { ValuesAtomContext } from "./WebdaQLParserParser"; +import { IdentifierAtomContext } from "./WebdaQLParserParser"; +import { WebdaqlContext } from "./WebdaQLParserParser"; +import { StatementContext } from "./WebdaQLParserParser"; +import { DeleteStatementContext } from "./WebdaQLParserParser"; +import { UpdateStatementContext } from "./WebdaQLParserParser"; +import { SelectStatementContext } from "./WebdaQLParserParser"; +import { FilterQueryContext } from "./WebdaQLParserParser"; +import { AssignmentListContext } from "./WebdaQLParserParser"; +import { AssignmentContext } from "./WebdaQLParserParser"; +import { FieldListContext } from "./WebdaQLParserParser"; +import { LimitExpressionContext } from "./WebdaQLParserParser"; +import { OffsetExpressionContext } from "./WebdaQLParserParser"; +import { OrderFieldExpressionContext } from "./WebdaQLParserParser"; +import { OrderExpressionContext } from "./WebdaQLParserParser"; +import { ExpressionContext } from "./WebdaQLParserParser"; +import { ValuesContext } from "./WebdaQLParserParser"; +import { AtomContext } from "./WebdaQLParserParser"; +import { IdentifierContext } from "./WebdaQLParserParser"; +import { BooleanLiteralContext } from "./WebdaQLParserParser"; +import { StringLiteralContext } from "./WebdaQLParserParser"; +import { IntegerLiteralContext } from "./WebdaQLParserParser"; +import { SetExpressionContext } from "./WebdaQLParserParser"; + /** * This interface defines a complete generic visitor for a parse tree produced @@ -39,199 +47,256 @@ import { * operations with no return type. */ export interface WebdaQLParserVisitor extends ParseTreeVisitor { - /** - * Visit a parse tree produced by the `likeExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitLikeExpression?: (ctx: LikeExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `inExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitInExpression?: (ctx: InExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `containsExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitContainsExpression?: (ctx: ContainsExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `binaryComparisonExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitBinaryComparisonExpression?: (ctx: BinaryComparisonExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `andLogicExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitAndLogicExpression?: (ctx: AndLogicExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `orLogicExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitOrLogicExpression?: (ctx: OrLogicExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `subExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitSubExpression?: (ctx: SubExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `atomExpression` - * labeled alternative in `WebdaQLParserParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitAtomExpression?: (ctx: AtomExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `booleanAtom` - * labeled alternative in `WebdaQLParserParser.values`. - * @param ctx the parse tree - * @return the visitor result - */ - visitBooleanAtom?: (ctx: BooleanAtomContext) => Result; - - /** - * Visit a parse tree produced by the `integerAtom` - * labeled alternative in `WebdaQLParserParser.values`. - * @param ctx the parse tree - * @return the visitor result - */ - visitIntegerAtom?: (ctx: IntegerAtomContext) => Result; - - /** - * Visit a parse tree produced by the `stringAtom` - * labeled alternative in `WebdaQLParserParser.values`. - * @param ctx the parse tree - * @return the visitor result - */ - visitStringAtom?: (ctx: StringAtomContext) => Result; - - /** - * Visit a parse tree produced by the `valuesAtom` - * labeled alternative in `WebdaQLParserParser.atom`. - * @param ctx the parse tree - * @return the visitor result - */ - visitValuesAtom?: (ctx: ValuesAtomContext) => Result; - - /** - * Visit a parse tree produced by the `identifierAtom` - * labeled alternative in `WebdaQLParserParser.atom`. - * @param ctx the parse tree - * @return the visitor result - */ - visitIdentifierAtom?: (ctx: IdentifierAtomContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.webdaql`. - * @param ctx the parse tree - * @return the visitor result - */ - visitWebdaql?: (ctx: WebdaqlContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.limitExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitLimitExpression?: (ctx: LimitExpressionContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.offsetExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitOffsetExpression?: (ctx: OffsetExpressionContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.orderFieldExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitOrderFieldExpression?: (ctx: OrderFieldExpressionContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.orderExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitOrderExpression?: (ctx: OrderExpressionContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitExpression?: (ctx: ExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `values` - * labeled alternative in `WebdaQLParserParser.expressionexpressionexpressionexpressionexpressionexpressionexpressionexpressionvaluesvaluesvaluesatomatom`. - * @param ctx the parse tree - * @return the visitor result - */ - visitValues?: (ctx: ValuesContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.atom`. - * @param ctx the parse tree - * @return the visitor result - */ - visitAtom?: (ctx: AtomContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.identifier`. - * @param ctx the parse tree - * @return the visitor result - */ - visitIdentifier?: (ctx: IdentifierContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.booleanLiteral`. - * @param ctx the parse tree - * @return the visitor result - */ - visitBooleanLiteral?: (ctx: BooleanLiteralContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.stringLiteral`. - * @param ctx the parse tree - * @return the visitor result - */ - visitStringLiteral?: (ctx: StringLiteralContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.integerLiteral`. - * @param ctx the parse tree - * @return the visitor result - */ - visitIntegerLiteral?: (ctx: IntegerLiteralContext) => Result; - - /** - * Visit a parse tree produced by `WebdaQLParserParser.setExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitSetExpression?: (ctx: SetExpressionContext) => Result; + /** + * Visit a parse tree produced by the `likeExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitLikeExpression?: (ctx: LikeExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `inExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitInExpression?: (ctx: InExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `containsExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitContainsExpression?: (ctx: ContainsExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `binaryComparisonExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitBinaryComparisonExpression?: (ctx: BinaryComparisonExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `andLogicExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAndLogicExpression?: (ctx: AndLogicExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `orLogicExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitOrLogicExpression?: (ctx: OrLogicExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `subExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSubExpression?: (ctx: SubExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `atomExpression` + * labeled alternative in `WebdaQLParserParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAtomExpression?: (ctx: AtomExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `booleanAtom` + * labeled alternative in `WebdaQLParserParser.values`. + * @param ctx the parse tree + * @return the visitor result + */ + visitBooleanAtom?: (ctx: BooleanAtomContext) => Result; + + /** + * Visit a parse tree produced by the `integerAtom` + * labeled alternative in `WebdaQLParserParser.values`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIntegerAtom?: (ctx: IntegerAtomContext) => Result; + + /** + * Visit a parse tree produced by the `stringAtom` + * labeled alternative in `WebdaQLParserParser.values`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStringAtom?: (ctx: StringAtomContext) => Result; + + /** + * Visit a parse tree produced by the `valuesAtom` + * labeled alternative in `WebdaQLParserParser.atom`. + * @param ctx the parse tree + * @return the visitor result + */ + visitValuesAtom?: (ctx: ValuesAtomContext) => Result; + + /** + * Visit a parse tree produced by the `identifierAtom` + * labeled alternative in `WebdaQLParserParser.atom`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIdentifierAtom?: (ctx: IdentifierAtomContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.webdaql`. + * @param ctx the parse tree + * @return the visitor result + */ + visitWebdaql?: (ctx: WebdaqlContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.statement`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStatement?: (ctx: StatementContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.deleteStatement`. + * @param ctx the parse tree + * @return the visitor result + */ + visitDeleteStatement?: (ctx: DeleteStatementContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.updateStatement`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUpdateStatement?: (ctx: UpdateStatementContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.selectStatement`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSelectStatement?: (ctx: SelectStatementContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.filterQuery`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFilterQuery?: (ctx: FilterQueryContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.assignmentList`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAssignmentList?: (ctx: AssignmentListContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.assignment`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAssignment?: (ctx: AssignmentContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.fieldList`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFieldList?: (ctx: FieldListContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.limitExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitLimitExpression?: (ctx: LimitExpressionContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.offsetExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitOffsetExpression?: (ctx: OffsetExpressionContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.orderFieldExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitOrderFieldExpression?: (ctx: OrderFieldExpressionContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.orderExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitOrderExpression?: (ctx: OrderExpressionContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitExpression?: (ctx: ExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `values` + * labeled alternative in `WebdaQLParserParser.expressionexpressionexpressionexpressionexpressionexpressionexpressionexpressionvaluesvaluesvaluesatomatom`. + * @param ctx the parse tree + * @return the visitor result + */ + visitValues?: (ctx: ValuesContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.atom`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAtom?: (ctx: AtomContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.identifier`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIdentifier?: (ctx: IdentifierContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.booleanLiteral`. + * @param ctx the parse tree + * @return the visitor result + */ + visitBooleanLiteral?: (ctx: BooleanLiteralContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.stringLiteral`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStringLiteral?: (ctx: StringLiteralContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.integerLiteral`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIntegerLiteral?: (ctx: IntegerLiteralContext) => Result; + + /** + * Visit a parse tree produced by `WebdaQLParserParser.setExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSetExpression?: (ctx: SetExpressionContext) => Result; } + diff --git a/packages/ql/src/query.ts b/packages/ql/src/query.ts index 98474a7ad..e0410eab7 100644 --- a/packages/ql/src/query.ts +++ b/packages/ql/src/query.ts @@ -16,6 +16,7 @@ import { OrderFieldExpressionContext, SetExpressionContext, StringLiteralContext, + FilterQueryContext, SubExpressionContext, WebdaQLParserParser, WebdaqlContext @@ -140,7 +141,18 @@ export class ExpressionBuilder extends AbstractParseTreeVisitor implement * Returns an empty AND expression (always true) when no filter is present. */ visitWebdaql(ctx: WebdaqlContext): Query { - if (ctx.childCount === 1) { + // The webdaql rule now dispatches to (statement | filterQuery) EOF + // QueryValidator only passes filter remainders, so delegate to the child + const child = ctx.getChild(0); + if (child instanceof FilterQueryContext) { + return this.visitFilterQuery(child); + } + // For statement contexts, visitChildren will handle it + return this.visit(child); + } + + visitFilterQuery(ctx: FilterQueryContext): Query { + if (ctx.childCount === 0) { // An empty AND return true return { filter: new AndExpression([]) @@ -148,7 +160,7 @@ export class ExpressionBuilder extends AbstractParseTreeVisitor implement } // To parse offset and limit and order by - for (let i = 1; i < ctx.childCount - 1; i++) { + for (let i = 1; i < ctx.childCount; i++) { this.visit(ctx.getChild(i)); } // If the first element is a sub expression, it means we have a filter From fa1a539b80e93c27cb11dff7f92d95945ba99d39 Mon Sep 17 00:00:00 2001 From: Yann-Gael Gautheron Date: Tue, 31 Mar 2026 14:12:19 -0700 Subject: [PATCH 5/7] feat: enhance query parsing to support explicit SELECT statements and improve statement handling --- packages/ql/src/query.spec.ts | 47 ++--- packages/ql/src/query.ts | 382 ++++++++++++---------------------- 2 files changed, 152 insertions(+), 277 deletions(-) diff --git a/packages/ql/src/query.spec.ts b/packages/ql/src/query.spec.ts index 2cd457c41..9abb28551 100644 --- a/packages/ql/src/query.spec.ts +++ b/packages/ql/src/query.spec.ts @@ -317,43 +317,38 @@ class QueryTest { @test selectFields() { - // Implicit SELECT via field list (no SELECT keyword needed) - const q1 = WebdaQL.parse("name, age WHERE status = 'active'"); + // SELECT with WHERE condition + const q1 = WebdaQL.parse("SELECT name, age WHERE status = 'active'"); assert.strictEqual(q1.type, "SELECT"); assert.deepStrictEqual(q1.fields, ["name", "age"]); assert.ok(q1.filter.eval({ status: "active" })); - // Implicit SELECT with nested fields - const q2 = WebdaQL.parse("name, profile.email WHERE status = 'active'"); + // SELECT with nested fields + const q2 = WebdaQL.parse("SELECT name, profile.email WHERE status = 'active'"); assert.strictEqual(q2.type, "SELECT"); assert.deepStrictEqual(q2.fields, ["name", "profile.email"]); - // Implicit SELECT with ORDER BY, LIMIT, OFFSET - const q3 = WebdaQL.parse("name, age WHERE status = 'active' ORDER BY name ASC LIMIT 10 OFFSET 'token'"); + // SELECT with ORDER BY, LIMIT, OFFSET + const q3 = WebdaQL.parse("SELECT name, age WHERE status = 'active' ORDER BY name ASC LIMIT 10 OFFSET 'token'"); assert.strictEqual(q3.type, "SELECT"); assert.deepStrictEqual(q3.fields, ["name", "age"]); assert.strictEqual(q3.limit, 10); assert.strictEqual(q3.continuationToken, "token"); assert.deepStrictEqual(q3.orderBy, [{ field: "name", direction: "ASC" }]); - // Implicit SELECT without WHERE (all items, specific fields) - const q4 = WebdaQL.parse("name, age"); + // SELECT without WHERE (all items, specific fields) + const q4 = WebdaQL.parse("SELECT name, age"); assert.strictEqual(q4.type, "SELECT"); assert.deepStrictEqual(q4.fields, ["name", "age"]); assert.ok(q4.filter instanceof WebdaQL.AndExpression); assert.strictEqual((q4.filter as WebdaQL.AndExpression).children.length, 0); - // Explicit SELECT keyword still works - const q4b = WebdaQL.parse("SELECT name, age WHERE status = 'active'"); - assert.strictEqual(q4b.type, "SELECT"); - assert.deepStrictEqual(q4b.fields, ["name", "age"]); - // Regular query (no field list) should have type undefined const q5 = WebdaQL.parse("status = 'active'"); assert.strictEqual(q5.type, undefined); assert.strictEqual(q5.fields, undefined); - // Single field with WHERE — not a SELECT (no comma = could be a filter identifier) + // Filter query should not be treated as SELECT const q6 = WebdaQL.parse("status = 'active' AND age > 18"); assert.strictEqual(q6.type, undefined); @@ -366,13 +361,13 @@ class QueryTest { const allowed = ["name", "age", "status", "profile.email"]; // Valid SELECT fields pass - const q1 = WebdaQL.parse("name, age WHERE status = 'active'", allowed); + const q1 = WebdaQL.parse("SELECT name, age WHERE status = 'active'", allowed); assert.strictEqual(q1.type, "SELECT"); assert.deepStrictEqual(q1.fields, ["name", "age"]); // Unknown SELECT field throws assert.throws( - () => WebdaQL.parse("name, unknown WHERE status = 'active'", allowed), + () => WebdaQL.parse("SELECT name, unknown WHERE status = 'active'", allowed), /Unknown field "unknown"/ ); @@ -387,7 +382,7 @@ class QueryTest { ); // Dot-notation fields work - const q3 = WebdaQL.parse("name, profile.email WHERE status = 'active'", allowed); + const q3 = WebdaQL.parse("SELECT name, profile.email WHERE status = 'active'", allowed); assert.deepStrictEqual(q3.fields, ["name", "profile.email"]); // DELETE and plain queries are not affected by allowedFields @@ -398,7 +393,7 @@ class QueryTest { assert.strictEqual(q5.type, undefined); // validateQueryFields can be called standalone - const parsed = WebdaQL.parse("name, age WHERE status = 'active'"); + const parsed = WebdaQL.parse("SELECT name, age WHERE status = 'active'"); WebdaQL.validateQueryFields(parsed, allowed); // should not throw assert.throws( () => WebdaQL.validateQueryFields(parsed, ["status"]), @@ -433,8 +428,8 @@ class QueryTest { assert.strictEqual(q3.type, "SELECT"); assert.deepStrictEqual(q3.fields, ["name", "age"]); - // lowercase delete with limit (LIMIT is ANTLR-level, stays uppercase) - const q4 = WebdaQL.parse("delete where status = 'old' LIMIT 100"); + // lowercase delete with limit + const q4 = WebdaQL.parse("delete where status = 'old' limit 100"); assert.strictEqual(q4.type, "DELETE"); assert.strictEqual(q4.limit, 100); @@ -449,23 +444,23 @@ class QueryTest { const userFields = ["name", "email", "age", "status", "profile.bio", "profile.avatar"]; // SELECT: valid fields pass - const q1 = WebdaQL.parse("name, email WHERE status = 'active'", userFields); + const q1 = WebdaQL.parse("SELECT name, email WHERE status = 'active'", userFields); assert.strictEqual(q1.type, "SELECT"); assert.deepStrictEqual(q1.fields, ["name", "email"]); // SELECT: unknown field rejects assert.throws( - () => WebdaQL.parse("name, password WHERE status = 'active'", userFields), + () => WebdaQL.parse("SELECT name, password WHERE status = 'active'", userFields), /Unknown field "password"/ ); // SELECT: nested dot-notation field passes - const q2 = WebdaQL.parse("name, profile.bio WHERE age > 18", userFields); + const q2 = WebdaQL.parse("SELECT name, profile.bio WHERE age > 18", userFields); assert.deepStrictEqual(q2.fields, ["name", "profile.bio"]); // SELECT: unknown nested field rejects assert.throws( - () => WebdaQL.parse("name, profile.ssn WHERE age > 18", userFields), + () => WebdaQL.parse("SELECT name, profile.ssn WHERE age > 18", userFields), /Unknown field "profile.ssn"/ ); @@ -499,7 +494,7 @@ class QueryTest { assert.strictEqual(q5.type, undefined); // Standalone validateQueryFields works the same way - const parsed = WebdaQL.parse("name, age WHERE status = 'active'"); + const parsed = WebdaQL.parse("SELECT name, age WHERE status = 'active'"); WebdaQL.validateQueryFields(parsed, userFields); // passes assert.throws( () => WebdaQL.validateQueryFields(parsed, ["name"]), // age not allowed @@ -508,7 +503,7 @@ class QueryTest { // Empty allowedFields rejects everything assert.throws( - () => WebdaQL.parse("name, email WHERE status = 'active'", []), + () => WebdaQL.parse("SELECT name, email WHERE status = 'active'", []), /Unknown field "name"/ ); } diff --git a/packages/ql/src/query.ts b/packages/ql/src/query.ts index e0410eab7..bc53bc59f 100644 --- a/packages/ql/src/query.ts +++ b/packages/ql/src/query.ts @@ -3,9 +3,14 @@ import { AbstractParseTreeVisitor, ParseTree, TerminalNode } from "antlr4ts/tree import { WebdaQLLexer } from "./WebdaQLLexer"; import { AndLogicExpressionContext, + AssignmentContext, + AssignmentListContext, BinaryComparisonExpressionContext, BooleanLiteralContext, ContainsExpressionContext, + DeleteStatementContext, + FieldListContext, + FilterQueryContext, InExpressionContext, IntegerLiteralContext, LikeExpressionContext, @@ -14,10 +19,11 @@ import { OrLogicExpressionContext, OrderExpressionContext, OrderFieldExpressionContext, + SelectStatementContext, SetExpressionContext, StringLiteralContext, - FilterQueryContext, SubExpressionContext, + UpdateStatementContext, WebdaQLParserParser, WebdaqlContext } from "./WebdaQLParserParser"; @@ -141,19 +147,12 @@ export class ExpressionBuilder extends AbstractParseTreeVisitor implement * Returns an empty AND expression (always true) when no filter is present. */ visitWebdaql(ctx: WebdaqlContext): Query { - // The webdaql rule now dispatches to (statement | filterQuery) EOF - // QueryValidator only passes filter remainders, so delegate to the child - const child = ctx.getChild(0); - if (child instanceof FilterQueryContext) { - return this.visitFilterQuery(child); - } - // For statement contexts, visitChildren will handle it - return this.visit(child); + // The webdaql rule dispatches to (statement | filterQuery) EOF + return this.visit(ctx.getChild(0)); } visitFilterQuery(ctx: FilterQueryContext): Query { if (ctx.childCount === 0) { - // An empty AND return true return { filter: new AndExpression([]) }; @@ -172,7 +171,6 @@ export class ExpressionBuilder extends AbstractParseTreeVisitor implement orderBy: this.orderBy }; } - // Go down one level - if expression empty it means no expression were provided return { filter: (this.visit(ctx.getChild(0))) || new AndExpression([]), limit: this.limit, @@ -181,6 +179,88 @@ export class ExpressionBuilder extends AbstractParseTreeVisitor implement }; } + /** + * Build a Query with filter/limit/order from a statement context that has optional WHERE, LIMIT, ORDER BY, OFFSET + */ + private buildQueryFromStatement(ctx: DeleteStatementContext | UpdateStatementContext | SelectStatementContext): Query { + const expr = ctx.expression(); + const filter = expr ? (this.visit(expr)) : new AndExpression([]); + const limitCtx = ctx.limitExpression(); + if (limitCtx) this.visitLimitExpression(limitCtx); + if (ctx instanceof SelectStatementContext) { + const orderCtx = ctx.orderExpression(); + if (orderCtx) this.visitOrderExpression(orderCtx); + const offsetCtx = ctx.offsetExpression(); + if (offsetCtx) this.visitOffsetExpression(offsetCtx); + } + return { + filter, + limit: this.limit, + continuationToken: this.offset, + orderBy: this.orderBy + }; + } + + visitDeleteStatement(ctx: DeleteStatementContext): Query { + const base = this.buildQueryFromStatement(ctx); + const result: Query = { + ...base, + type: "DELETE", + toString: () => { + const condition = base.filter.toString(); + return condition ? `DELETE WHERE ${condition}` : "DELETE"; + } + }; + return result; + } + + visitUpdateStatement(ctx: UpdateStatementContext): Query { + const assignments = this.visitAssignmentList(ctx.assignmentList()); + const base = this.buildQueryFromStatement(ctx); + const result: Query = { + ...base, + type: "UPDATE", + assignments, + toString: () => { + const setPart = assignments.map(a => `${a.field} = ${formatValue(a.value)}`).join(", "); + const condition = base.filter.toString(); + return condition ? `UPDATE SET ${setPart} WHERE ${condition}` : `UPDATE SET ${setPart}`; + } + }; + return result; + } + + visitSelectStatement(ctx: SelectStatementContext): Query { + const fields = this.visitFieldList(ctx.fieldList()); + const base = this.buildQueryFromStatement(ctx); + const result: Query = { + ...base, + type: "SELECT", + fields, + toString: () => { + const fieldsPart = fields.join(", "); + const condition = base.filter.toString(); + return condition ? `SELECT ${fieldsPart} WHERE ${condition}` : `SELECT ${fieldsPart}`; + } + }; + return result; + } + + visitAssignmentList(ctx: AssignmentListContext): { field: string; value: value }[] { + return ctx.assignment().map(a => this.visitAssignment(a)); + } + + visitAssignment(ctx: AssignmentContext): { field: string; value: value } { + return { + field: ctx.identifier().text, + value: (this.visit(ctx.values())) + }; + } + + visitFieldList(ctx: FieldListContext): string[] { + return ctx.identifier().map(id => id.text); + } + /** * Recursively flatten nested logical expressions of the same type * @@ -1042,53 +1122,6 @@ export function unsanitize(query: string): string { return query.replace(/</g, "<").replace(/>/g, ">"); } -/** - * Find the index of an unquoted keyword in a string - * Tracks single and double quote state to avoid matching inside string literals. - * - * @param str - the string to search - * @param keyword - the keyword to find (must be surrounded by whitespace or at string boundaries) - * @returns index of the keyword, or -1 if not found - */ -function findUnquotedKeyword(str: string, keyword: string): number { - let inSingle = false; - let inDouble = false; - const upperKeyword = keyword.toUpperCase(); - for (let i = 0; i <= str.length - upperKeyword.length; i++) { - const ch = str[i]; - if (ch === "'" && !inDouble) { - inSingle = !inSingle; - } else if (ch === '"' && !inSingle) { - inDouble = !inDouble; - } else if (!inSingle && !inDouble) { - if ( - str.substring(i, i + upperKeyword.length).toUpperCase() === upperKeyword && - (i === 0 || /\s/.test(str[i - 1])) && - (i + upperKeyword.length === str.length || /\s/.test(str[i + upperKeyword.length])) - ) { - return i; - } - } - } - return -1; -} - -/** - * Parse a value literal string into its typed representation - * - * @param raw - trimmed value string (e.g. `"'hello'"`, `"42"`, `"TRUE"`) - * @returns the parsed value - */ -function parseValue(raw: string): value { - if ((raw.startsWith("'") && raw.endsWith("'")) || (raw.startsWith('"') && raw.endsWith('"'))) { - return raw.substring(1, raw.length - 1); - } - const upper = raw.toUpperCase(); - if (upper === "TRUE") return true; - if (upper === "FALSE") return false; - return parseInt(raw); -} - /** * Serialize a value to its WebdaQL string representation */ @@ -1099,180 +1132,56 @@ function formatValue(v: value): string { } /** - * Parse a comma-separated assignment list like `"status = 'active', age = 30"` - * - * @param str - the assignment list string - * @returns array of field/value assignment objects + * Keywords that should be uppercased before passing to the case-sensitive ANTLR lexer. + * Sorted longest-first so that "ORDER BY" matches before "OR". */ -function parseAssignments(str: string): { field: string; value: value }[] { - const results: { field: string; value: value }[] = []; - // Split by unquoted commas - let current = ""; - let inSingle = false; - let inDouble = false; - for (const ch of str) { - if (ch === "'" && !inDouble) { - inSingle = !inSingle; - } else if (ch === '"' && !inSingle) { - inDouble = !inDouble; - } - if (ch === "," && !inSingle && !inDouble) { - results.push(parseOneAssignment(current)); - current = ""; - } else { - current += ch; - } - } - if (current.trim()) { - results.push(parseOneAssignment(current)); - } - return results; -} - -/** - * Parse a single assignment like `"status = 'active'"` into `{ field, value }` - */ -function parseOneAssignment(str: string): { field: string; value: value } { - const eqIdx = str.indexOf("="); - if (eqIdx === -1) { - throw new SyntaxError(`Invalid assignment: ${str}`); - } - return { - field: str.substring(0, eqIdx).trim(), - value: parseValue(str.substring(eqIdx + 1).trim()) - }; -} - -/** - * Parse the body after SELECT (or implicit select detection) into fields and remainder - */ -function parseSelectBody(body: string): StatementPrefix { - const whereIdx = findUnquotedKeyword(body, "WHERE"); - let fieldStr: string; - let remainder: string; - if (whereIdx === -1) { - // Check for ORDER BY, LIMIT, OFFSET without WHERE - let endOfFields = body.length; - for (const kw of ["ORDER BY", "LIMIT", "OFFSET"]) { - const idx = findUnquotedKeyword(body, kw); - if (idx !== -1 && idx < endOfFields) { - endOfFields = idx; - } - } - fieldStr = body.substring(0, endOfFields).trim(); - remainder = body.substring(endOfFields).trimStart(); - } else { - fieldStr = body.substring(0, whereIdx).trim(); - remainder = body.substring(whereIdx + 5).trimStart(); - } - const fields = fieldStr.split(",").map(f => f.trim()).filter(f => f.length > 0); - return { type: "SELECT", fields, remainder }; -} +const KEYWORDS = [ + "ORDER BY", "DELETE", "UPDATE", "SELECT", "WHERE", "LIMIT", "OFFSET", + "CONTAINS", "FALSE", "LIKE", "TRUE", "AND", "ASC", "DESC", "SET", "IN", "OR" +]; /** - * Detect if a query is an implicit SELECT (field list without the SELECT keyword). - * - * A query is an implicit SELECT if it contains an unquoted comma before any - * comparison operator or logical keyword. This distinguishes `name, age WHERE ...` - * from `name = 'John' AND ...`. - * - * @returns the query string (as the select body) if implicit SELECT, otherwise undefined + * Uppercase all known WebdaQL keywords in a query string, while preserving + * the original case of identifiers and string literals. */ -function detectImplicitSelect(query: string): string | undefined { +function uppercaseKeywords(query: string): string { + let result = ""; let inSingle = false; let inDouble = false; for (let i = 0; i < query.length; i++) { const ch = query[i]; if (ch === "'" && !inDouble) { inSingle = !inSingle; - } else if (ch === '"' && !inSingle) { + result += ch; + continue; + } + if (ch === '"' && !inSingle) { inDouble = !inDouble; - } else if (!inSingle && !inDouble) { - // If we hit a comma first, it's a field list - if (ch === ",") { - return query; - } - // If we hit an operator first, it's a filter expression - if (ch === "=" || ch === "!" || ch === "<" || ch === ">") { - return undefined; - } - // Check for keyword operators (AND, OR, LIKE, IN, CONTAINS) - for (const kw of ["AND", "OR", "LIKE", "IN", "CONTAINS"]) { - if ( - query.substring(i, i + kw.length) === kw && - (i === 0 || /\s/.test(query[i - 1])) && - (i + kw.length === query.length || /\s/.test(query[i + kw.length])) - ) { - return undefined; - } - } + result += ch; + continue; } - } - return undefined; -} - -interface StatementPrefix { - type?: "DELETE" | "UPDATE" | "SELECT"; - fields?: string[]; - assignments?: { field: string; value: value }[]; - remainder: string; -} - -/** - * Extract statement prefix (DELETE/UPDATE/SELECT) from a query string - * and return the remainder for the ANTLR parser. - * - * @param query - full query string - * @returns parsed prefix info and the condition remainder - */ -function extractStatementPrefix(query: string): StatementPrefix { - const trimmed = query.trimStart(); - const upperTrimmed = trimmed.toUpperCase(); - - // DELETE WHERE - if (upperTrimmed.startsWith("DELETE")) { - const afterDelete = trimmed.substring(6).trimStart(); - if (afterDelete.toUpperCase().startsWith("WHERE")) { - return { type: "DELETE", remainder: afterDelete.substring(5).trimStart() }; + if (inSingle || inDouble) { + result += ch; + continue; } - return { type: "DELETE", remainder: afterDelete }; - } - - // UPDATE SET WHERE - if (upperTrimmed.startsWith("UPDATE")) { - const afterUpdate = trimmed.substring(6).trimStart(); - if (!afterUpdate.toUpperCase().startsWith("SET")) { - throw new SyntaxError(`Expected SET after UPDATE (Query: ${query})`); + let matched = false; + for (const kw of KEYWORDS) { + if ( + query.substring(i, i + kw.length).toUpperCase() === kw && + (i === 0 || /[\s(]/.test(query[i - 1])) && + (i + kw.length === query.length || /[\s(]/.test(query[i + kw.length])) + ) { + result += kw; + i += kw.length - 1; + matched = true; + break; + } } - const afterSet = afterUpdate.substring(3).trimStart(); - const whereIdx = findUnquotedKeyword(afterSet, "WHERE"); - if (whereIdx === -1) { - // UPDATE SET assignments without WHERE → applies to all - return { - type: "UPDATE", - assignments: parseAssignments(afterSet), - remainder: "" - }; + if (!matched) { + result += ch; } - const assignmentStr = afterSet.substring(0, whereIdx).trim(); - const remainder = afterSet.substring(whereIdx + 5).trimStart(); - return { - type: "UPDATE", - assignments: parseAssignments(assignmentStr), - remainder - }; } - - // SELECT [WHERE ] — explicit or implicit - // Explicit: starts with SELECT keyword - // Implicit: starts with a comma-separated identifier list (contains a comma before any operator) - const selectBody = upperTrimmed.startsWith("SELECT") ? trimmed.substring(6).trimStart() : detectImplicitSelect(trimmed); - - if (selectBody !== undefined) { - return parseSelectBody(selectBody); - } - - return { remainder: query }; + return result; } /** @@ -1307,10 +1216,11 @@ export function validateQueryFields(query: Query, allowedFields: string[]): void * Parse a query string into a Query object * * Supports plain filter queries, and statement prefixes: - * - `DELETE WHERE [LIMIT n]` - * - `UPDATE SET WHERE [LIMIT n]` + * - `DELETE [WHERE ] [LIMIT n]` + * - `UPDATE SET [WHERE ] [LIMIT n]` * - `SELECT [WHERE ] [ORDER BY ...] [LIMIT ...] [OFFSET ...]` - * - `, [WHERE ] ...` (implicit SELECT when comma-separated fields detected) + * + * Keywords are case-insensitive. * * @param query - the query string to parse * @param allowedFields - optional list of allowed field names; if provided, SELECT fields @@ -1318,38 +1228,8 @@ export function validateQueryFields(query: Query, allowedFields: string[]): void * @returns parsed Query object */ export function parse(query: string, allowedFields?: string[]): Query { - const prefix = extractStatementPrefix(query); - const base = new QueryValidator(prefix.remainder).getQuery(); - if (!prefix.type) { - return base; - } - const result: Query = { - ...base, - type: prefix.type, - fields: prefix.fields, - assignments: prefix.assignments, - toString: () => { - const basePart = base.toString(); - switch (prefix.type) { - case "DELETE": { - const condition = basePart ? ` WHERE ${basePart}` : ""; - return `DELETE${condition}`.trim(); - } - case "UPDATE": { - const setPart = prefix.assignments!.map(a => `${a.field} = ${formatValue(a.value)}`).join(", "); - const condition = basePart ? ` WHERE ${basePart}` : ""; - return `UPDATE SET ${setPart}${condition}`.trim(); - } - case "SELECT": { - const fieldsPart = prefix.fields!.join(", "); - const condition = basePart ? ` WHERE ${basePart}` : ""; - return `SELECT ${fieldsPart}${condition}`.trim(); - } - default: - return basePart; - } - } - }; + const normalized = uppercaseKeywords(query); + const result = new QueryValidator(normalized).getQuery(); if (allowedFields) { validateQueryFields(result, allowedFields); } From 6f332db42a9028807c0f6fa3e942fd4847a6a0ba Mon Sep 17 00:00:00 2001 From: Yann-Gael Gautheron Date: Tue, 31 Mar 2026 14:16:31 -0700 Subject: [PATCH 6/7] Refactor WebdaQL parser and query handling for case insensitivity - Updated the WebdaQLParserParser to remove unnecessary literal names and improve parsing efficiency. - Enhanced query tests to validate case insensitivity for keywords such as DELETE, UPDATE, SELECT, and boolean values. - Modified the ExpressionBuilder to ensure that order directions and boolean literals are evaluated in a case-insensitive manner. - Removed the uppercaseKeywords function as it is no longer needed, simplifying the query parsing process. - Adjusted the parse function to directly use the original query string without normalization. --- packages/ql/src/WebdaQLLexer.g4 | 61 +++-- packages/ql/src/WebdaQLLexer.interp | 57 ++-- packages/ql/src/WebdaQLLexer.tokens | 17 -- packages/ql/src/WebdaQLLexer.ts | 300 ++++++++++++---------- packages/ql/src/WebdaQLParser.interp | 34 +-- packages/ql/src/WebdaQLParser.tokens | 17 -- packages/ql/src/WebdaQLParserLexer.interp | 57 ++-- packages/ql/src/WebdaQLParserLexer.tokens | 17 -- packages/ql/src/WebdaQLParserLexer.ts | 300 ++++++++++++---------- packages/ql/src/WebdaQLParserParser.ts | 5 +- packages/ql/src/query.spec.ts | 39 +++ packages/ql/src/query.ts | 59 +---- 12 files changed, 519 insertions(+), 444 deletions(-) diff --git a/packages/ql/src/WebdaQLLexer.g4 b/packages/ql/src/WebdaQLLexer.g4 index 0392af865..e87e052b0 100644 --- a/packages/ql/src/WebdaQLLexer.g4 +++ b/packages/ql/src/WebdaQLLexer.g4 @@ -1,9 +1,28 @@ lexer grammar WebdaQLLexer; -// NOTE: -// This grammar is case-sensitive, although CESQL keywords are case-insensitive. -// In order to implement case-insensitivity, check out -// https://github.com/antlr/antlr4/blob/master/doc/case-insensitive-lexing.md#custom-character-streams-approach +// Case-insensitive keyword fragments + +fragment A: [aA]; +fragment B: [bB]; +fragment C: [cC]; +fragment D: [dD]; +fragment E: [eE]; +fragment F: [fF]; +fragment G: [gG]; +fragment H: [hH]; +fragment I: [iI]; +fragment K: [kK]; +fragment L: [lL]; +fragment M: [mM]; +fragment N: [nN]; +fragment O: [oO]; +fragment P: [pP]; +fragment R: [rR]; +fragment S: [sS]; +fragment T: [tT]; +fragment U: [uU]; +fragment W: [wW]; +fragment Y: [yY]; // Skip tab, carriage return and newlines @@ -33,17 +52,17 @@ fragment QUOTE_SYMB // Statement keywords -DELETE: 'DELETE'; -UPDATE: 'UPDATE'; -SELECT: 'SELECT'; -SET: 'SET'; -WHERE: 'WHERE'; +DELETE: D E L E T E; +UPDATE: U P D A T E; +SELECT: S E L E C T; +SET: S E T; +WHERE: W H E R E; // Operators // - Logic -AND: 'AND'; -OR: 'OR'; +AND: A N D; +OR: O R; // - Comparison @@ -56,23 +75,23 @@ LESS_OR_EQUAL: '<='; // Like, exists, in -LIKE: 'LIKE'; -IN: 'IN'; -CONTAINS: 'CONTAINS'; +LIKE: L I K E; +IN: I N; +CONTAINS: C O N T A I N S; // Booleans -TRUE: 'TRUE'; -FALSE: 'FALSE'; +TRUE: T R U E; +FALSE: F A L S E; // Limit -LIMIT: 'LIMIT'; -OFFSET: 'OFFSET'; +LIMIT: L I M I T; +OFFSET: O F F S E T; // Order by -ORDER_BY: 'ORDER BY'; -ASC: 'ASC'; -DESC: 'DESC'; +ORDER_BY: O R D E R ' ' B Y; +ASC: A S C; +DESC: D E S C; // Literals diff --git a/packages/ql/src/WebdaQLLexer.interp b/packages/ql/src/WebdaQLLexer.interp index fd0246f95..60d5ed56d 100644 --- a/packages/ql/src/WebdaQLLexer.interp +++ b/packages/ql/src/WebdaQLLexer.interp @@ -8,29 +8,29 @@ null '"' '[' ']' -'DELETE' -'UPDATE' -'SELECT' -'SET' -'WHERE' -'AND' -'OR' +null +null +null +null +null +null +null '=' '!=' '>' '>=' '<' '<=' -'LIKE' -'IN' -'CONTAINS' -'TRUE' -'FALSE' -'LIMIT' -'OFFSET' -'ORDER BY' -'ASC' -'DESC' +null +null +null +null +null +null +null +null +null +null null null null @@ -79,6 +79,27 @@ IDENTIFIER_WITH_NUMBER FUNCTION_IDENTIFIER_WITH_UNDERSCORE rule names: +A +B +C +D +E +F +G +H +I +K +L +M +N +O +P +R +S +T +U +W +Y SPACE ID_LITERAL DQUOTA_STRING @@ -131,4 +152,4 @@ mode names: DEFAULT_MODE atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 39, 292, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 3, 2, 6, 2, 91, 10, 2, 13, 2, 14, 2, 92, 3, 2, 3, 2, 3, 3, 6, 3, 98, 10, 3, 13, 3, 14, 3, 99, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 108, 10, 4, 12, 4, 14, 4, 111, 11, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 7, 5, 121, 10, 5, 12, 5, 14, 5, 124, 11, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 7, 7, 132, 10, 7, 12, 7, 14, 7, 135, 11, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 5, 15, 153, 10, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 6, 41, 272, 10, 41, 13, 41, 14, 41, 273, 3, 42, 6, 42, 277, 10, 42, 13, 42, 14, 42, 278, 3, 43, 6, 43, 282, 10, 43, 13, 43, 14, 43, 283, 3, 44, 3, 44, 7, 44, 288, 10, 44, 12, 44, 14, 44, 291, 11, 44, 2, 2, 2, 45, 3, 2, 3, 5, 2, 2, 7, 2, 2, 9, 2, 2, 11, 2, 2, 13, 2, 2, 15, 2, 4, 17, 2, 5, 19, 2, 6, 21, 2, 7, 23, 2, 8, 25, 2, 9, 27, 2, 10, 29, 2, 2, 31, 2, 11, 33, 2, 12, 35, 2, 13, 37, 2, 14, 39, 2, 15, 41, 2, 16, 43, 2, 17, 45, 2, 18, 47, 2, 19, 49, 2, 20, 51, 2, 21, 53, 2, 22, 55, 2, 23, 57, 2, 24, 59, 2, 25, 61, 2, 26, 63, 2, 27, 65, 2, 28, 67, 2, 29, 69, 2, 30, 71, 2, 31, 73, 2, 32, 75, 2, 33, 77, 2, 34, 79, 2, 35, 81, 2, 36, 83, 2, 37, 85, 2, 38, 87, 2, 39, 3, 2, 11, 5, 2, 11, 12, 15, 15, 34, 34, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 50, 59, 3, 2, 67, 92, 4, 2, 67, 92, 97, 97, 4, 2, 67, 92, 99, 124, 7, 2, 48, 48, 50, 59, 67, 92, 97, 97, 99, 124, 2, 299, 2, 3, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 3, 90, 3, 2, 2, 2, 5, 97, 3, 2, 2, 2, 7, 101, 3, 2, 2, 2, 9, 114, 3, 2, 2, 2, 11, 127, 3, 2, 2, 2, 13, 129, 3, 2, 2, 2, 15, 136, 3, 2, 2, 2, 17, 138, 3, 2, 2, 2, 19, 140, 3, 2, 2, 2, 21, 142, 3, 2, 2, 2, 23, 144, 3, 2, 2, 2, 25, 146, 3, 2, 2, 2, 27, 148, 3, 2, 2, 2, 29, 152, 3, 2, 2, 2, 31, 154, 3, 2, 2, 2, 33, 161, 3, 2, 2, 2, 35, 168, 3, 2, 2, 2, 37, 175, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 185, 3, 2, 2, 2, 43, 189, 3, 2, 2, 2, 45, 192, 3, 2, 2, 2, 47, 194, 3, 2, 2, 2, 49, 197, 3, 2, 2, 2, 51, 199, 3, 2, 2, 2, 53, 202, 3, 2, 2, 2, 55, 204, 3, 2, 2, 2, 57, 207, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 215, 3, 2, 2, 2, 63, 224, 3, 2, 2, 2, 65, 229, 3, 2, 2, 2, 67, 235, 3, 2, 2, 2, 69, 241, 3, 2, 2, 2, 71, 248, 3, 2, 2, 2, 73, 257, 3, 2, 2, 2, 75, 261, 3, 2, 2, 2, 77, 266, 3, 2, 2, 2, 79, 268, 3, 2, 2, 2, 81, 271, 3, 2, 2, 2, 83, 276, 3, 2, 2, 2, 85, 281, 3, 2, 2, 2, 87, 285, 3, 2, 2, 2, 89, 91, 9, 2, 2, 2, 90, 89, 3, 2, 2, 2, 91, 92, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 92, 93, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 95, 8, 2, 2, 2, 95, 4, 3, 2, 2, 2, 96, 98, 9, 3, 2, 2, 97, 96, 3, 2, 2, 2, 98, 99, 3, 2, 2, 2, 99, 97, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 6, 3, 2, 2, 2, 101, 109, 7, 36, 2, 2, 102, 103, 7, 94, 2, 2, 103, 108, 11, 2, 2, 2, 104, 105, 7, 36, 2, 2, 105, 108, 7, 36, 2, 2, 106, 108, 10, 4, 2, 2, 107, 102, 3, 2, 2, 2, 107, 104, 3, 2, 2, 2, 107, 106, 3, 2, 2, 2, 108, 111, 3, 2, 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 112, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 112, 113, 7, 36, 2, 2, 113, 8, 3, 2, 2, 2, 114, 122, 7, 41, 2, 2, 115, 116, 7, 94, 2, 2, 116, 121, 11, 2, 2, 2, 117, 118, 7, 41, 2, 2, 118, 121, 7, 41, 2, 2, 119, 121, 10, 5, 2, 2, 120, 115, 3, 2, 2, 2, 120, 117, 3, 2, 2, 2, 120, 119, 3, 2, 2, 2, 121, 124, 3, 2, 2, 2, 122, 120, 3, 2, 2, 2, 122, 123, 3, 2, 2, 2, 123, 125, 3, 2, 2, 2, 124, 122, 3, 2, 2, 2, 125, 126, 7, 41, 2, 2, 126, 10, 3, 2, 2, 2, 127, 128, 9, 6, 2, 2, 128, 12, 3, 2, 2, 2, 129, 133, 9, 7, 2, 2, 130, 132, 9, 8, 2, 2, 131, 130, 3, 2, 2, 2, 132, 135, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 14, 3, 2, 2, 2, 135, 133, 3, 2, 2, 2, 136, 137, 7, 42, 2, 2, 137, 16, 3, 2, 2, 2, 138, 139, 7, 43, 2, 2, 139, 18, 3, 2, 2, 2, 140, 141, 7, 46, 2, 2, 141, 20, 3, 2, 2, 2, 142, 143, 7, 41, 2, 2, 143, 22, 3, 2, 2, 2, 144, 145, 7, 36, 2, 2, 145, 24, 3, 2, 2, 2, 146, 147, 7, 93, 2, 2, 147, 26, 3, 2, 2, 2, 148, 149, 7, 95, 2, 2, 149, 28, 3, 2, 2, 2, 150, 153, 5, 21, 11, 2, 151, 153, 5, 23, 12, 2, 152, 150, 3, 2, 2, 2, 152, 151, 3, 2, 2, 2, 153, 30, 3, 2, 2, 2, 154, 155, 7, 70, 2, 2, 155, 156, 7, 71, 2, 2, 156, 157, 7, 78, 2, 2, 157, 158, 7, 71, 2, 2, 158, 159, 7, 86, 2, 2, 159, 160, 7, 71, 2, 2, 160, 32, 3, 2, 2, 2, 161, 162, 7, 87, 2, 2, 162, 163, 7, 82, 2, 2, 163, 164, 7, 70, 2, 2, 164, 165, 7, 67, 2, 2, 165, 166, 7, 86, 2, 2, 166, 167, 7, 71, 2, 2, 167, 34, 3, 2, 2, 2, 168, 169, 7, 85, 2, 2, 169, 170, 7, 71, 2, 2, 170, 171, 7, 78, 2, 2, 171, 172, 7, 71, 2, 2, 172, 173, 7, 69, 2, 2, 173, 174, 7, 86, 2, 2, 174, 36, 3, 2, 2, 2, 175, 176, 7, 85, 2, 2, 176, 177, 7, 71, 2, 2, 177, 178, 7, 86, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 89, 2, 2, 180, 181, 7, 74, 2, 2, 181, 182, 7, 71, 2, 2, 182, 183, 7, 84, 2, 2, 183, 184, 7, 71, 2, 2, 184, 40, 3, 2, 2, 2, 185, 186, 7, 67, 2, 2, 186, 187, 7, 80, 2, 2, 187, 188, 7, 70, 2, 2, 188, 42, 3, 2, 2, 2, 189, 190, 7, 81, 2, 2, 190, 191, 7, 84, 2, 2, 191, 44, 3, 2, 2, 2, 192, 193, 7, 63, 2, 2, 193, 46, 3, 2, 2, 2, 194, 195, 7, 35, 2, 2, 195, 196, 7, 63, 2, 2, 196, 48, 3, 2, 2, 2, 197, 198, 7, 64, 2, 2, 198, 50, 3, 2, 2, 2, 199, 200, 7, 64, 2, 2, 200, 201, 7, 63, 2, 2, 201, 52, 3, 2, 2, 2, 202, 203, 7, 62, 2, 2, 203, 54, 3, 2, 2, 2, 204, 205, 7, 62, 2, 2, 205, 206, 7, 63, 2, 2, 206, 56, 3, 2, 2, 2, 207, 208, 7, 78, 2, 2, 208, 209, 7, 75, 2, 2, 209, 210, 7, 77, 2, 2, 210, 211, 7, 71, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 75, 2, 2, 213, 214, 7, 80, 2, 2, 214, 60, 3, 2, 2, 2, 215, 216, 7, 69, 2, 2, 216, 217, 7, 81, 2, 2, 217, 218, 7, 80, 2, 2, 218, 219, 7, 86, 2, 2, 219, 220, 7, 67, 2, 2, 220, 221, 7, 75, 2, 2, 221, 222, 7, 80, 2, 2, 222, 223, 7, 85, 2, 2, 223, 62, 3, 2, 2, 2, 224, 225, 7, 86, 2, 2, 225, 226, 7, 84, 2, 2, 226, 227, 7, 87, 2, 2, 227, 228, 7, 71, 2, 2, 228, 64, 3, 2, 2, 2, 229, 230, 7, 72, 2, 2, 230, 231, 7, 67, 2, 2, 231, 232, 7, 78, 2, 2, 232, 233, 7, 85, 2, 2, 233, 234, 7, 71, 2, 2, 234, 66, 3, 2, 2, 2, 235, 236, 7, 78, 2, 2, 236, 237, 7, 75, 2, 2, 237, 238, 7, 79, 2, 2, 238, 239, 7, 75, 2, 2, 239, 240, 7, 86, 2, 2, 240, 68, 3, 2, 2, 2, 241, 242, 7, 81, 2, 2, 242, 243, 7, 72, 2, 2, 243, 244, 7, 72, 2, 2, 244, 245, 7, 85, 2, 2, 245, 246, 7, 71, 2, 2, 246, 247, 7, 86, 2, 2, 247, 70, 3, 2, 2, 2, 248, 249, 7, 81, 2, 2, 249, 250, 7, 84, 2, 2, 250, 251, 7, 70, 2, 2, 251, 252, 7, 71, 2, 2, 252, 253, 7, 84, 2, 2, 253, 254, 7, 34, 2, 2, 254, 255, 7, 68, 2, 2, 255, 256, 7, 91, 2, 2, 256, 72, 3, 2, 2, 2, 257, 258, 7, 67, 2, 2, 258, 259, 7, 85, 2, 2, 259, 260, 7, 69, 2, 2, 260, 74, 3, 2, 2, 2, 261, 262, 7, 70, 2, 2, 262, 263, 7, 71, 2, 2, 263, 264, 7, 85, 2, 2, 264, 265, 7, 69, 2, 2, 265, 76, 3, 2, 2, 2, 266, 267, 5, 7, 4, 2, 267, 78, 3, 2, 2, 2, 268, 269, 5, 9, 5, 2, 269, 80, 3, 2, 2, 2, 270, 272, 5, 11, 6, 2, 271, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 82, 3, 2, 2, 2, 275, 277, 9, 9, 2, 2, 276, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 84, 3, 2, 2, 2, 280, 282, 9, 10, 2, 2, 281, 280, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 86, 3, 2, 2, 2, 285, 289, 9, 7, 2, 2, 286, 288, 9, 8, 2, 2, 287, 286, 3, 2, 2, 2, 288, 291, 3, 2, 2, 2, 289, 287, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 88, 3, 2, 2, 2, 291, 289, 3, 2, 2, 2, 15, 2, 92, 99, 107, 109, 120, 122, 133, 152, 273, 278, 283, 289, 3, 8, 2, 2] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 39, 376, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 6, 23, 175, 10, 23, 13, 23, 14, 23, 176, 3, 23, 3, 23, 3, 24, 6, 24, 182, 10, 24, 13, 24, 14, 24, 183, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 192, 10, 25, 12, 25, 14, 25, 195, 11, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 7, 26, 205, 10, 26, 12, 26, 14, 26, 208, 11, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 7, 28, 216, 10, 28, 12, 28, 14, 28, 219, 11, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 5, 36, 237, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 6, 62, 356, 10, 62, 13, 62, 14, 62, 357, 3, 63, 6, 63, 361, 10, 63, 13, 63, 14, 63, 362, 3, 64, 6, 64, 366, 10, 64, 13, 64, 14, 64, 367, 3, 65, 3, 65, 7, 65, 372, 10, 65, 12, 65, 14, 65, 375, 11, 65, 2, 2, 2, 66, 3, 2, 2, 5, 2, 2, 7, 2, 2, 9, 2, 2, 11, 2, 2, 13, 2, 2, 15, 2, 2, 17, 2, 2, 19, 2, 2, 21, 2, 2, 23, 2, 2, 25, 2, 2, 27, 2, 2, 29, 2, 2, 31, 2, 2, 33, 2, 2, 35, 2, 2, 37, 2, 2, 39, 2, 2, 41, 2, 2, 43, 2, 2, 45, 2, 3, 47, 2, 2, 49, 2, 2, 51, 2, 2, 53, 2, 2, 55, 2, 2, 57, 2, 4, 59, 2, 5, 61, 2, 6, 63, 2, 7, 65, 2, 8, 67, 2, 9, 69, 2, 10, 71, 2, 2, 73, 2, 11, 75, 2, 12, 77, 2, 13, 79, 2, 14, 81, 2, 15, 83, 2, 16, 85, 2, 17, 87, 2, 18, 89, 2, 19, 91, 2, 20, 93, 2, 21, 95, 2, 22, 97, 2, 23, 99, 2, 24, 101, 2, 25, 103, 2, 26, 105, 2, 27, 107, 2, 28, 109, 2, 29, 111, 2, 30, 113, 2, 31, 115, 2, 32, 117, 2, 33, 119, 2, 34, 121, 2, 35, 123, 2, 36, 125, 2, 37, 127, 2, 38, 129, 2, 39, 3, 2, 32, 4, 2, 67, 67, 99, 99, 4, 2, 68, 68, 100, 100, 4, 2, 69, 69, 101, 101, 4, 2, 70, 70, 102, 102, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 73, 73, 105, 105, 4, 2, 74, 74, 106, 106, 4, 2, 75, 75, 107, 107, 4, 2, 77, 77, 109, 109, 4, 2, 78, 78, 110, 110, 4, 2, 79, 79, 111, 111, 4, 2, 80, 80, 112, 112, 4, 2, 81, 81, 113, 113, 4, 2, 82, 82, 114, 114, 4, 2, 84, 84, 116, 116, 4, 2, 85, 85, 117, 117, 4, 2, 86, 86, 118, 118, 4, 2, 87, 87, 119, 119, 4, 2, 89, 89, 121, 121, 4, 2, 91, 91, 123, 123, 5, 2, 11, 12, 15, 15, 34, 34, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 50, 59, 3, 2, 67, 92, 4, 2, 67, 92, 97, 97, 4, 2, 67, 92, 99, 124, 7, 2, 48, 48, 50, 59, 67, 92, 97, 97, 99, 124, 2, 362, 2, 45, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 3, 131, 3, 2, 2, 2, 5, 133, 3, 2, 2, 2, 7, 135, 3, 2, 2, 2, 9, 137, 3, 2, 2, 2, 11, 139, 3, 2, 2, 2, 13, 141, 3, 2, 2, 2, 15, 143, 3, 2, 2, 2, 17, 145, 3, 2, 2, 2, 19, 147, 3, 2, 2, 2, 21, 149, 3, 2, 2, 2, 23, 151, 3, 2, 2, 2, 25, 153, 3, 2, 2, 2, 27, 155, 3, 2, 2, 2, 29, 157, 3, 2, 2, 2, 31, 159, 3, 2, 2, 2, 33, 161, 3, 2, 2, 2, 35, 163, 3, 2, 2, 2, 37, 165, 3, 2, 2, 2, 39, 167, 3, 2, 2, 2, 41, 169, 3, 2, 2, 2, 43, 171, 3, 2, 2, 2, 45, 174, 3, 2, 2, 2, 47, 181, 3, 2, 2, 2, 49, 185, 3, 2, 2, 2, 51, 198, 3, 2, 2, 2, 53, 211, 3, 2, 2, 2, 55, 213, 3, 2, 2, 2, 57, 220, 3, 2, 2, 2, 59, 222, 3, 2, 2, 2, 61, 224, 3, 2, 2, 2, 63, 226, 3, 2, 2, 2, 65, 228, 3, 2, 2, 2, 67, 230, 3, 2, 2, 2, 69, 232, 3, 2, 2, 2, 71, 236, 3, 2, 2, 2, 73, 238, 3, 2, 2, 2, 75, 245, 3, 2, 2, 2, 77, 252, 3, 2, 2, 2, 79, 259, 3, 2, 2, 2, 81, 263, 3, 2, 2, 2, 83, 269, 3, 2, 2, 2, 85, 273, 3, 2, 2, 2, 87, 276, 3, 2, 2, 2, 89, 278, 3, 2, 2, 2, 91, 281, 3, 2, 2, 2, 93, 283, 3, 2, 2, 2, 95, 286, 3, 2, 2, 2, 97, 288, 3, 2, 2, 2, 99, 291, 3, 2, 2, 2, 101, 296, 3, 2, 2, 2, 103, 299, 3, 2, 2, 2, 105, 308, 3, 2, 2, 2, 107, 313, 3, 2, 2, 2, 109, 319, 3, 2, 2, 2, 111, 325, 3, 2, 2, 2, 113, 332, 3, 2, 2, 2, 115, 341, 3, 2, 2, 2, 117, 345, 3, 2, 2, 2, 119, 350, 3, 2, 2, 2, 121, 352, 3, 2, 2, 2, 123, 355, 3, 2, 2, 2, 125, 360, 3, 2, 2, 2, 127, 365, 3, 2, 2, 2, 129, 369, 3, 2, 2, 2, 131, 132, 9, 2, 2, 2, 132, 4, 3, 2, 2, 2, 133, 134, 9, 3, 2, 2, 134, 6, 3, 2, 2, 2, 135, 136, 9, 4, 2, 2, 136, 8, 3, 2, 2, 2, 137, 138, 9, 5, 2, 2, 138, 10, 3, 2, 2, 2, 139, 140, 9, 6, 2, 2, 140, 12, 3, 2, 2, 2, 141, 142, 9, 7, 2, 2, 142, 14, 3, 2, 2, 2, 143, 144, 9, 8, 2, 2, 144, 16, 3, 2, 2, 2, 145, 146, 9, 9, 2, 2, 146, 18, 3, 2, 2, 2, 147, 148, 9, 10, 2, 2, 148, 20, 3, 2, 2, 2, 149, 150, 9, 11, 2, 2, 150, 22, 3, 2, 2, 2, 151, 152, 9, 12, 2, 2, 152, 24, 3, 2, 2, 2, 153, 154, 9, 13, 2, 2, 154, 26, 3, 2, 2, 2, 155, 156, 9, 14, 2, 2, 156, 28, 3, 2, 2, 2, 157, 158, 9, 15, 2, 2, 158, 30, 3, 2, 2, 2, 159, 160, 9, 16, 2, 2, 160, 32, 3, 2, 2, 2, 161, 162, 9, 17, 2, 2, 162, 34, 3, 2, 2, 2, 163, 164, 9, 18, 2, 2, 164, 36, 3, 2, 2, 2, 165, 166, 9, 19, 2, 2, 166, 38, 3, 2, 2, 2, 167, 168, 9, 20, 2, 2, 168, 40, 3, 2, 2, 2, 169, 170, 9, 21, 2, 2, 170, 42, 3, 2, 2, 2, 171, 172, 9, 22, 2, 2, 172, 44, 3, 2, 2, 2, 173, 175, 9, 23, 2, 2, 174, 173, 3, 2, 2, 2, 175, 176, 3, 2, 2, 2, 176, 174, 3, 2, 2, 2, 176, 177, 3, 2, 2, 2, 177, 178, 3, 2, 2, 2, 178, 179, 8, 23, 2, 2, 179, 46, 3, 2, 2, 2, 180, 182, 9, 24, 2, 2, 181, 180, 3, 2, 2, 2, 182, 183, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 48, 3, 2, 2, 2, 185, 193, 7, 36, 2, 2, 186, 187, 7, 94, 2, 2, 187, 192, 11, 2, 2, 2, 188, 189, 7, 36, 2, 2, 189, 192, 7, 36, 2, 2, 190, 192, 10, 25, 2, 2, 191, 186, 3, 2, 2, 2, 191, 188, 3, 2, 2, 2, 191, 190, 3, 2, 2, 2, 192, 195, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 193, 194, 3, 2, 2, 2, 194, 196, 3, 2, 2, 2, 195, 193, 3, 2, 2, 2, 196, 197, 7, 36, 2, 2, 197, 50, 3, 2, 2, 2, 198, 206, 7, 41, 2, 2, 199, 200, 7, 94, 2, 2, 200, 205, 11, 2, 2, 2, 201, 202, 7, 41, 2, 2, 202, 205, 7, 41, 2, 2, 203, 205, 10, 26, 2, 2, 204, 199, 3, 2, 2, 2, 204, 201, 3, 2, 2, 2, 204, 203, 3, 2, 2, 2, 205, 208, 3, 2, 2, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 209, 3, 2, 2, 2, 208, 206, 3, 2, 2, 2, 209, 210, 7, 41, 2, 2, 210, 52, 3, 2, 2, 2, 211, 212, 9, 27, 2, 2, 212, 54, 3, 2, 2, 2, 213, 217, 9, 28, 2, 2, 214, 216, 9, 29, 2, 2, 215, 214, 3, 2, 2, 2, 216, 219, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 56, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 220, 221, 7, 42, 2, 2, 221, 58, 3, 2, 2, 2, 222, 223, 7, 43, 2, 2, 223, 60, 3, 2, 2, 2, 224, 225, 7, 46, 2, 2, 225, 62, 3, 2, 2, 2, 226, 227, 7, 41, 2, 2, 227, 64, 3, 2, 2, 2, 228, 229, 7, 36, 2, 2, 229, 66, 3, 2, 2, 2, 230, 231, 7, 93, 2, 2, 231, 68, 3, 2, 2, 2, 232, 233, 7, 95, 2, 2, 233, 70, 3, 2, 2, 2, 234, 237, 5, 63, 32, 2, 235, 237, 5, 65, 33, 2, 236, 234, 3, 2, 2, 2, 236, 235, 3, 2, 2, 2, 237, 72, 3, 2, 2, 2, 238, 239, 5, 9, 5, 2, 239, 240, 5, 11, 6, 2, 240, 241, 5, 23, 12, 2, 241, 242, 5, 11, 6, 2, 242, 243, 5, 37, 19, 2, 243, 244, 5, 11, 6, 2, 244, 74, 3, 2, 2, 2, 245, 246, 5, 39, 20, 2, 246, 247, 5, 31, 16, 2, 247, 248, 5, 9, 5, 2, 248, 249, 5, 3, 2, 2, 249, 250, 5, 37, 19, 2, 250, 251, 5, 11, 6, 2, 251, 76, 3, 2, 2, 2, 252, 253, 5, 35, 18, 2, 253, 254, 5, 11, 6, 2, 254, 255, 5, 23, 12, 2, 255, 256, 5, 11, 6, 2, 256, 257, 5, 7, 4, 2, 257, 258, 5, 37, 19, 2, 258, 78, 3, 2, 2, 2, 259, 260, 5, 35, 18, 2, 260, 261, 5, 11, 6, 2, 261, 262, 5, 37, 19, 2, 262, 80, 3, 2, 2, 2, 263, 264, 5, 41, 21, 2, 264, 265, 5, 17, 9, 2, 265, 266, 5, 11, 6, 2, 266, 267, 5, 33, 17, 2, 267, 268, 5, 11, 6, 2, 268, 82, 3, 2, 2, 2, 269, 270, 5, 3, 2, 2, 270, 271, 5, 27, 14, 2, 271, 272, 5, 9, 5, 2, 272, 84, 3, 2, 2, 2, 273, 274, 5, 29, 15, 2, 274, 275, 5, 33, 17, 2, 275, 86, 3, 2, 2, 2, 276, 277, 7, 63, 2, 2, 277, 88, 3, 2, 2, 2, 278, 279, 7, 35, 2, 2, 279, 280, 7, 63, 2, 2, 280, 90, 3, 2, 2, 2, 281, 282, 7, 64, 2, 2, 282, 92, 3, 2, 2, 2, 283, 284, 7, 64, 2, 2, 284, 285, 7, 63, 2, 2, 285, 94, 3, 2, 2, 2, 286, 287, 7, 62, 2, 2, 287, 96, 3, 2, 2, 2, 288, 289, 7, 62, 2, 2, 289, 290, 7, 63, 2, 2, 290, 98, 3, 2, 2, 2, 291, 292, 5, 23, 12, 2, 292, 293, 5, 19, 10, 2, 293, 294, 5, 21, 11, 2, 294, 295, 5, 11, 6, 2, 295, 100, 3, 2, 2, 2, 296, 297, 5, 19, 10, 2, 297, 298, 5, 27, 14, 2, 298, 102, 3, 2, 2, 2, 299, 300, 5, 7, 4, 2, 300, 301, 5, 29, 15, 2, 301, 302, 5, 27, 14, 2, 302, 303, 5, 37, 19, 2, 303, 304, 5, 3, 2, 2, 304, 305, 5, 19, 10, 2, 305, 306, 5, 27, 14, 2, 306, 307, 5, 35, 18, 2, 307, 104, 3, 2, 2, 2, 308, 309, 5, 37, 19, 2, 309, 310, 5, 33, 17, 2, 310, 311, 5, 39, 20, 2, 311, 312, 5, 11, 6, 2, 312, 106, 3, 2, 2, 2, 313, 314, 5, 13, 7, 2, 314, 315, 5, 3, 2, 2, 315, 316, 5, 23, 12, 2, 316, 317, 5, 35, 18, 2, 317, 318, 5, 11, 6, 2, 318, 108, 3, 2, 2, 2, 319, 320, 5, 23, 12, 2, 320, 321, 5, 19, 10, 2, 321, 322, 5, 25, 13, 2, 322, 323, 5, 19, 10, 2, 323, 324, 5, 37, 19, 2, 324, 110, 3, 2, 2, 2, 325, 326, 5, 29, 15, 2, 326, 327, 5, 13, 7, 2, 327, 328, 5, 13, 7, 2, 328, 329, 5, 35, 18, 2, 329, 330, 5, 11, 6, 2, 330, 331, 5, 37, 19, 2, 331, 112, 3, 2, 2, 2, 332, 333, 5, 29, 15, 2, 333, 334, 5, 33, 17, 2, 334, 335, 5, 9, 5, 2, 335, 336, 5, 11, 6, 2, 336, 337, 5, 33, 17, 2, 337, 338, 7, 34, 2, 2, 338, 339, 5, 5, 3, 2, 339, 340, 5, 43, 22, 2, 340, 114, 3, 2, 2, 2, 341, 342, 5, 3, 2, 2, 342, 343, 5, 35, 18, 2, 343, 344, 5, 7, 4, 2, 344, 116, 3, 2, 2, 2, 345, 346, 5, 9, 5, 2, 346, 347, 5, 11, 6, 2, 347, 348, 5, 35, 18, 2, 348, 349, 5, 7, 4, 2, 349, 118, 3, 2, 2, 2, 350, 351, 5, 49, 25, 2, 351, 120, 3, 2, 2, 2, 352, 353, 5, 51, 26, 2, 353, 122, 3, 2, 2, 2, 354, 356, 5, 53, 27, 2, 355, 354, 3, 2, 2, 2, 356, 357, 3, 2, 2, 2, 357, 355, 3, 2, 2, 2, 357, 358, 3, 2, 2, 2, 358, 124, 3, 2, 2, 2, 359, 361, 9, 30, 2, 2, 360, 359, 3, 2, 2, 2, 361, 362, 3, 2, 2, 2, 362, 360, 3, 2, 2, 2, 362, 363, 3, 2, 2, 2, 363, 126, 3, 2, 2, 2, 364, 366, 9, 31, 2, 2, 365, 364, 3, 2, 2, 2, 366, 367, 3, 2, 2, 2, 367, 365, 3, 2, 2, 2, 367, 368, 3, 2, 2, 2, 368, 128, 3, 2, 2, 2, 369, 373, 9, 28, 2, 2, 370, 372, 9, 29, 2, 2, 371, 370, 3, 2, 2, 2, 372, 375, 3, 2, 2, 2, 373, 371, 3, 2, 2, 2, 373, 374, 3, 2, 2, 2, 374, 130, 3, 2, 2, 2, 375, 373, 3, 2, 2, 2, 15, 2, 176, 183, 191, 193, 204, 206, 217, 236, 357, 362, 367, 373, 3, 8, 2, 2] \ No newline at end of file diff --git a/packages/ql/src/WebdaQLLexer.tokens b/packages/ql/src/WebdaQLLexer.tokens index cf8a82415..31ac02aa6 100644 --- a/packages/ql/src/WebdaQLLexer.tokens +++ b/packages/ql/src/WebdaQLLexer.tokens @@ -42,26 +42,9 @@ FUNCTION_IDENTIFIER_WITH_UNDERSCORE=37 '"'=6 '['=7 ']'=8 -'DELETE'=9 -'UPDATE'=10 -'SELECT'=11 -'SET'=12 -'WHERE'=13 -'AND'=14 -'OR'=15 '='=16 '!='=17 '>'=18 '>='=19 '<'=20 '<='=21 -'LIKE'=22 -'IN'=23 -'CONTAINS'=24 -'TRUE'=25 -'FALSE'=26 -'LIMIT'=27 -'OFFSET'=28 -'ORDER BY'=29 -'ASC'=30 -'DESC'=31 diff --git a/packages/ql/src/WebdaQLLexer.ts b/packages/ql/src/WebdaQLLexer.ts index 9f369a817..6969b9d2b 100644 --- a/packages/ql/src/WebdaQLLexer.ts +++ b/packages/ql/src/WebdaQLLexer.ts @@ -62,21 +62,21 @@ export class WebdaQLLexer extends Lexer { ]; public static readonly ruleNames: string[] = [ - "SPACE", "ID_LITERAL", "DQUOTA_STRING", "SQUOTA_STRING", "INT_DIGIT", - "FN_LITERAL", "LR_BRACKET", "RR_BRACKET", "COMMA", "SINGLE_QUOTE_SYMB", - "DOUBLE_QUOTE_SYMB", "LR_SQ_BRACKET", "RR_SQ_BRACKET", "QUOTE_SYMB", "DELETE", - "UPDATE", "SELECT", "SET", "WHERE", "AND", "OR", "EQUAL", "NOT_EQUAL", - "GREATER", "GREATER_OR_EQUAL", "LESS", "LESS_OR_EQUAL", "LIKE", "IN", - "CONTAINS", "TRUE", "FALSE", "LIMIT", "OFFSET", "ORDER_BY", "ASC", "DESC", - "DQUOTED_STRING_LITERAL", "SQUOTED_STRING_LITERAL", "INTEGER_LITERAL", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "O", + "P", "R", "S", "T", "U", "W", "Y", "SPACE", "ID_LITERAL", "DQUOTA_STRING", + "SQUOTA_STRING", "INT_DIGIT", "FN_LITERAL", "LR_BRACKET", "RR_BRACKET", + "COMMA", "SINGLE_QUOTE_SYMB", "DOUBLE_QUOTE_SYMB", "LR_SQ_BRACKET", "RR_SQ_BRACKET", + "QUOTE_SYMB", "DELETE", "UPDATE", "SELECT", "SET", "WHERE", "AND", "OR", + "EQUAL", "NOT_EQUAL", "GREATER", "GREATER_OR_EQUAL", "LESS", "LESS_OR_EQUAL", + "LIKE", "IN", "CONTAINS", "TRUE", "FALSE", "LIMIT", "OFFSET", "ORDER_BY", + "ASC", "DESC", "DQUOTED_STRING_LITERAL", "SQUOTED_STRING_LITERAL", "INTEGER_LITERAL", "IDENTIFIER", "IDENTIFIER_WITH_NUMBER", "FUNCTION_IDENTIFIER_WITH_UNDERSCORE", ]; private static readonly _LITERAL_NAMES: Array = [ undefined, undefined, "'('", "')'", "','", "'''", "'\"'", "'['", "']'", - "'DELETE'", "'UPDATE'", "'SELECT'", "'SET'", "'WHERE'", "'AND'", "'OR'", - "'='", "'!='", "'>'", "'>='", "'<'", "'<='", "'LIKE'", "'IN'", "'CONTAINS'", - "'TRUE'", "'FALSE'", "'LIMIT'", "'OFFSET'", "'ORDER BY'", "'ASC'", "'DESC'", + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + "'='", "'!='", "'>'", "'>='", "'<'", "'<='", ]; private static readonly _SYMBOLIC_NAMES: Array = [ undefined, "SPACE", "LR_BRACKET", "RR_BRACKET", "COMMA", "SINGLE_QUOTE_SYMB", @@ -118,7 +118,7 @@ export class WebdaQLLexer extends Lexer { public get modeNames(): string[] { return WebdaQLLexer.modeNames; } public static readonly _serializedATN: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02\'\u0124\b\x01" + + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02\'\u0178\b\x01" + "\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06" + "\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r" + "\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t" + @@ -126,125 +126,165 @@ export class WebdaQLLexer extends Lexer { "\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t" + "\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t" + "\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t)\x04*\t*\x04" + - "+\t+\x04,\t,\x03\x02\x06\x02[\n\x02\r\x02\x0E\x02\\\x03\x02\x03\x02\x03" + - "\x03\x06\x03b\n\x03\r\x03\x0E\x03c\x03\x04\x03\x04\x03\x04\x03\x04\x03" + - "\x04\x03\x04\x07\x04l\n\x04\f\x04\x0E\x04o\v\x04\x03\x04\x03\x04\x03\x05" + - "\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x07\x05y\n\x05\f\x05\x0E\x05" + - "|\v\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03\x07\x03\x07\x07\x07\x84\n" + - "\x07\f\x07\x0E\x07\x87\v\x07\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\v" + - "\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x05\x0F" + - "\x99\n\x0F\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03" + - "\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x12\x03\x12\x03" + - "\x12\x03\x12\x03\x12\x03\x12\x03\x12\x03\x13\x03\x13\x03\x13\x03\x13\x03" + - "\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x15\x03" + - "\x15\x03\x16\x03\x16\x03\x16\x03\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03" + - "\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03" + - "\x1C\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03" + - "\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03" + - " \x03 \x03 \x03 \x03 \x03!\x03!\x03!\x03!\x03!\x03!\x03\"\x03\"\x03\"" + - "\x03\"\x03\"\x03\"\x03#\x03#\x03#\x03#\x03#\x03#\x03#\x03$\x03$\x03$\x03" + - "$\x03$\x03$\x03$\x03$\x03$\x03%\x03%\x03%\x03%\x03&\x03&\x03&\x03&\x03" + - "&\x03\'\x03\'\x03(\x03(\x03)\x06)\u0110\n)\r)\x0E)\u0111\x03*\x06*\u0115" + - "\n*\r*\x0E*\u0116\x03+\x06+\u011A\n+\r+\x0E+\u011B\x03,\x03,\x07,\u0120" + - "\n,\f,\x0E,\u0123\v,\x02\x02\x02-\x03\x02\x03\x05\x02\x02\x07\x02\x02" + - "\t\x02\x02\v\x02\x02\r\x02\x02\x0F\x02\x04\x11\x02\x05\x13\x02\x06\x15" + - "\x02\x07\x17\x02\b\x19\x02\t\x1B\x02\n\x1D\x02\x02\x1F\x02\v!\x02\f#\x02" + - "\r%\x02\x0E\'\x02\x0F)\x02\x10+\x02\x11-\x02\x12/\x02\x131\x02\x143\x02" + - "\x155\x02\x167\x02\x179\x02\x18;\x02\x19=\x02\x1A?\x02\x1BA\x02\x1CC\x02" + - "\x1DE\x02\x1EG\x02\x1FI\x02 K\x02!M\x02\"O\x02#Q\x02$S\x02%U\x02&W\x02" + - "\'\x03\x02\v\x05\x02\v\f\x0F\x0F\"\"\x05\x022;C\\c|\x04\x02$$^^\x04\x02" + - "))^^\x03\x022;\x03\x02C\\\x04\x02C\\aa\x04\x02C\\c|\x07\x02002;C\\aac" + - "|\x02\u012B\x02\x03\x03\x02\x02\x02\x02\x0F\x03\x02\x02\x02\x02\x11\x03" + - "\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17\x03" + - "\x02\x02\x02\x02\x19\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1F\x03" + - "\x02\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02\x02" + - "\x02\x02\'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02" + - "-\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02" + - "\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02" + - "\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03" + - "\x02\x02\x02\x02C\x03\x02\x02\x02\x02E\x03\x02\x02\x02\x02G\x03\x02\x02" + - "\x02\x02I\x03\x02\x02\x02\x02K\x03\x02\x02\x02\x02M\x03\x02\x02\x02\x02" + - "O\x03\x02\x02\x02\x02Q\x03\x02\x02\x02\x02S\x03\x02\x02\x02\x02U\x03\x02" + - "\x02\x02\x02W\x03\x02\x02\x02\x03Z\x03\x02\x02\x02\x05a\x03\x02\x02\x02" + - "\x07e\x03\x02\x02\x02\tr\x03\x02\x02\x02\v\x7F\x03\x02\x02\x02\r\x81\x03" + - "\x02\x02\x02\x0F\x88\x03\x02\x02\x02\x11\x8A\x03\x02\x02\x02\x13\x8C\x03" + - "\x02\x02\x02\x15\x8E\x03\x02\x02\x02\x17\x90\x03\x02\x02\x02\x19\x92\x03" + - "\x02\x02\x02\x1B\x94\x03\x02\x02\x02\x1D\x98\x03\x02\x02\x02\x1F\x9A\x03" + - "\x02\x02\x02!\xA1\x03\x02\x02\x02#\xA8\x03\x02\x02\x02%\xAF\x03\x02\x02" + - "\x02\'\xB3\x03\x02\x02\x02)\xB9\x03\x02\x02\x02+\xBD\x03\x02\x02\x02-" + - "\xC0\x03\x02\x02\x02/\xC2\x03\x02\x02\x021\xC5\x03\x02\x02\x023\xC7\x03" + - "\x02\x02\x025\xCA\x03\x02\x02\x027\xCC\x03\x02\x02\x029\xCF\x03\x02\x02" + - "\x02;\xD4\x03\x02\x02\x02=\xD7\x03\x02\x02\x02?\xE0\x03\x02\x02\x02A\xE5" + - "\x03\x02\x02\x02C\xEB\x03\x02\x02\x02E\xF1\x03\x02\x02\x02G\xF8\x03\x02" + - "\x02\x02I\u0101\x03\x02\x02\x02K\u0105\x03\x02\x02\x02M\u010A\x03\x02" + - "\x02\x02O\u010C\x03\x02\x02\x02Q\u010F\x03\x02\x02\x02S\u0114\x03\x02" + - "\x02\x02U\u0119\x03\x02\x02\x02W\u011D\x03\x02\x02\x02Y[\t\x02\x02\x02" + - "ZY\x03\x02\x02\x02[\\\x03\x02\x02\x02\\Z\x03\x02\x02\x02\\]\x03\x02\x02" + - "\x02]^\x03\x02\x02\x02^_\b\x02\x02\x02_\x04\x03\x02\x02\x02`b\t\x03\x02" + - "\x02a`\x03\x02\x02\x02bc\x03\x02\x02\x02ca\x03\x02\x02\x02cd\x03\x02\x02" + - "\x02d\x06\x03\x02\x02\x02em\x07$\x02\x02fg\x07^\x02\x02gl\v\x02\x02\x02" + - "hi\x07$\x02\x02il\x07$\x02\x02jl\n\x04\x02\x02kf\x03\x02\x02\x02kh\x03" + - "\x02\x02\x02kj\x03\x02\x02\x02lo\x03\x02\x02\x02mk\x03\x02\x02\x02mn\x03" + - "\x02\x02\x02np\x03\x02\x02\x02om\x03\x02\x02\x02pq\x07$\x02\x02q\b\x03" + - "\x02\x02\x02rz\x07)\x02\x02st\x07^\x02\x02ty\v\x02\x02\x02uv\x07)\x02" + - "\x02vy\x07)\x02\x02wy\n\x05\x02\x02xs\x03\x02\x02\x02xu\x03\x02\x02\x02" + - "xw\x03\x02\x02\x02y|\x03\x02\x02\x02zx\x03\x02\x02\x02z{\x03\x02\x02\x02" + - "{}\x03\x02\x02\x02|z\x03\x02\x02\x02}~\x07)\x02\x02~\n\x03\x02\x02\x02" + - "\x7F\x80\t\x06\x02\x02\x80\f\x03\x02\x02\x02\x81\x85\t\x07\x02\x02\x82" + - "\x84\t\b\x02\x02\x83\x82\x03\x02\x02\x02\x84\x87\x03\x02\x02\x02\x85\x83" + - "\x03\x02\x02\x02\x85\x86\x03\x02\x02\x02\x86\x0E\x03\x02\x02\x02\x87\x85" + - "\x03\x02\x02\x02\x88\x89\x07*\x02\x02\x89\x10\x03\x02\x02\x02\x8A\x8B" + - "\x07+\x02\x02\x8B\x12\x03\x02\x02\x02\x8C\x8D\x07.\x02\x02\x8D\x14\x03" + - "\x02\x02\x02\x8E\x8F\x07)\x02\x02\x8F\x16\x03\x02\x02\x02\x90\x91\x07" + - "$\x02\x02\x91\x18\x03\x02\x02\x02\x92\x93\x07]\x02\x02\x93\x1A\x03\x02" + - "\x02\x02\x94\x95\x07_\x02\x02\x95\x1C\x03\x02\x02\x02\x96\x99\x05\x15" + - "\v\x02\x97\x99\x05\x17\f\x02\x98\x96\x03\x02\x02\x02\x98\x97\x03\x02\x02" + - "\x02\x99\x1E\x03\x02\x02\x02\x9A\x9B\x07F\x02\x02\x9B\x9C\x07G\x02\x02" + - "\x9C\x9D\x07N\x02\x02\x9D\x9E\x07G\x02\x02\x9E\x9F\x07V\x02\x02\x9F\xA0" + - "\x07G\x02\x02\xA0 \x03\x02\x02\x02\xA1\xA2\x07W\x02\x02\xA2\xA3\x07R\x02" + - "\x02\xA3\xA4\x07F\x02\x02\xA4\xA5\x07C\x02\x02\xA5\xA6\x07V\x02\x02\xA6" + - "\xA7\x07G\x02\x02\xA7\"\x03\x02\x02\x02\xA8\xA9\x07U\x02\x02\xA9\xAA\x07" + - "G\x02\x02\xAA\xAB\x07N\x02\x02\xAB\xAC\x07G\x02\x02\xAC\xAD\x07E\x02\x02" + - "\xAD\xAE\x07V\x02\x02\xAE$\x03\x02\x02\x02\xAF\xB0\x07U\x02\x02\xB0\xB1" + - "\x07G\x02\x02\xB1\xB2\x07V\x02\x02\xB2&\x03\x02\x02\x02\xB3\xB4\x07Y\x02" + - "\x02\xB4\xB5\x07J\x02\x02\xB5\xB6\x07G\x02\x02\xB6\xB7\x07T\x02\x02\xB7" + - "\xB8\x07G\x02\x02\xB8(\x03\x02\x02\x02\xB9\xBA\x07C\x02\x02\xBA\xBB\x07" + - "P\x02\x02\xBB\xBC\x07F\x02\x02\xBC*\x03\x02\x02\x02\xBD\xBE\x07Q\x02\x02" + - "\xBE\xBF\x07T\x02\x02\xBF,\x03\x02\x02\x02\xC0\xC1\x07?\x02\x02\xC1.\x03" + - "\x02\x02\x02\xC2\xC3\x07#\x02\x02\xC3\xC4\x07?\x02\x02\xC40\x03\x02\x02" + - "\x02\xC5\xC6\x07@\x02\x02\xC62\x03\x02\x02\x02\xC7\xC8\x07@\x02\x02\xC8" + - "\xC9\x07?\x02\x02\xC94\x03\x02\x02\x02\xCA\xCB\x07>\x02\x02\xCB6\x03\x02" + - "\x02\x02\xCC\xCD\x07>\x02\x02\xCD\xCE\x07?\x02\x02\xCE8\x03\x02\x02\x02" + - "\xCF\xD0\x07N\x02\x02\xD0\xD1\x07K\x02\x02\xD1\xD2\x07M\x02\x02\xD2\xD3" + - "\x07G\x02\x02\xD3:\x03\x02\x02\x02\xD4\xD5\x07K\x02\x02\xD5\xD6\x07P\x02" + - "\x02\xD6<\x03\x02\x02\x02\xD7\xD8\x07E\x02\x02\xD8\xD9\x07Q\x02\x02\xD9" + - "\xDA\x07P\x02\x02\xDA\xDB\x07V\x02\x02\xDB\xDC\x07C\x02\x02\xDC\xDD\x07" + - "K\x02\x02\xDD\xDE\x07P\x02\x02\xDE\xDF\x07U\x02\x02\xDF>\x03\x02\x02\x02" + - "\xE0\xE1\x07V\x02\x02\xE1\xE2\x07T\x02\x02\xE2\xE3\x07W\x02\x02\xE3\xE4" + - "\x07G\x02\x02\xE4@\x03\x02\x02\x02\xE5\xE6\x07H\x02\x02\xE6\xE7\x07C\x02" + - "\x02\xE7\xE8\x07N\x02\x02\xE8\xE9\x07U\x02\x02\xE9\xEA\x07G\x02\x02\xEA" + - "B\x03\x02\x02\x02\xEB\xEC\x07N\x02\x02\xEC\xED\x07K\x02\x02\xED\xEE\x07" + - "O\x02\x02\xEE\xEF\x07K\x02\x02\xEF\xF0\x07V\x02\x02\xF0D\x03\x02\x02\x02" + - "\xF1\xF2\x07Q\x02\x02\xF2\xF3\x07H\x02\x02\xF3\xF4\x07H\x02\x02\xF4\xF5" + - "\x07U\x02\x02\xF5\xF6\x07G\x02\x02\xF6\xF7\x07V\x02\x02\xF7F\x03\x02\x02" + - "\x02\xF8\xF9\x07Q\x02\x02\xF9\xFA\x07T\x02\x02\xFA\xFB\x07F\x02\x02\xFB" + - "\xFC\x07G\x02\x02\xFC\xFD\x07T\x02\x02\xFD\xFE\x07\"\x02\x02\xFE\xFF\x07" + - "D\x02\x02\xFF\u0100\x07[\x02\x02\u0100H\x03\x02\x02\x02\u0101\u0102\x07" + - "C\x02\x02\u0102\u0103\x07U\x02\x02\u0103\u0104\x07E\x02\x02\u0104J\x03" + - "\x02\x02\x02\u0105\u0106\x07F\x02\x02\u0106\u0107\x07G\x02\x02\u0107\u0108" + - "\x07U\x02\x02\u0108\u0109\x07E\x02\x02\u0109L\x03\x02\x02\x02\u010A\u010B" + - "\x05\x07\x04\x02\u010BN\x03\x02\x02\x02\u010C\u010D\x05\t\x05\x02\u010D" + - "P\x03\x02\x02\x02\u010E\u0110\x05\v\x06\x02\u010F\u010E\x03\x02\x02\x02" + - "\u0110\u0111\x03\x02\x02\x02\u0111\u010F\x03\x02\x02\x02\u0111\u0112\x03" + - "\x02\x02\x02\u0112R\x03\x02\x02\x02\u0113\u0115\t\t\x02\x02\u0114\u0113" + - "\x03\x02\x02\x02\u0115\u0116\x03\x02\x02\x02\u0116\u0114\x03\x02\x02\x02" + - "\u0116\u0117\x03\x02\x02\x02\u0117T\x03\x02\x02\x02\u0118\u011A\t\n\x02" + - "\x02\u0119\u0118\x03\x02\x02\x02\u011A\u011B\x03\x02\x02\x02\u011B\u0119" + - "\x03\x02\x02\x02\u011B\u011C\x03\x02\x02\x02\u011CV\x03\x02\x02\x02\u011D" + - "\u0121\t\x07\x02\x02\u011E\u0120\t\b\x02\x02\u011F\u011E\x03\x02\x02\x02" + - "\u0120\u0123\x03\x02\x02\x02\u0121\u011F\x03\x02\x02\x02\u0121\u0122\x03" + - "\x02\x02\x02\u0122X\x03\x02\x02\x02\u0123\u0121\x03\x02\x02\x02\x0F\x02" + - "\\ckmxz\x85\x98\u0111\u0116\u011B\u0121\x03\b\x02\x02"; + "+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x042\t2\x043\t3\x04" + + "4\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04;\t;\x04<\t<\x04" + + "=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x03\x02\x03\x02\x03\x03\x03\x03\x03" + + "\x04\x03\x04\x03\x05\x03\x05\x03\x06\x03\x06\x03\x07\x03\x07\x03\b\x03" + + "\b\x03\t\x03\t\x03\n\x03\n\x03\v\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E" + + "\x03\x0E\x03\x0F\x03\x0F\x03\x10\x03\x10\x03\x11\x03\x11\x03\x12\x03\x12" + + "\x03\x13\x03\x13\x03\x14\x03\x14\x03\x15\x03\x15\x03\x16\x03\x16\x03\x17" + + "\x06\x17\xAF\n\x17\r\x17\x0E\x17\xB0\x03\x17\x03\x17\x03\x18\x06\x18\xB6" + + "\n\x18\r\x18\x0E\x18\xB7\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19" + + "\x07\x19\xC0\n\x19\f\x19\x0E\x19\xC3\v\x19\x03\x19\x03\x19\x03\x1A\x03" + + "\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x07\x1A\xCD\n\x1A\f\x1A\x0E\x1A\xD0" + + "\v\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x07\x1C\xD8\n\x1C" + + "\f\x1C\x0E\x1C\xDB\v\x1C\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1F\x03\x1F" + + "\x03 \x03 \x03!\x03!\x03\"\x03\"\x03#\x03#\x03$\x03$\x05$\xED\n$\x03%" + + "\x03%\x03%\x03%\x03%\x03%\x03%\x03&\x03&\x03&\x03&\x03&\x03&\x03&\x03" + + "\'\x03\'\x03\'\x03\'\x03\'\x03\'\x03\'\x03(\x03(\x03(\x03(\x03)\x03)\x03" + + ")\x03)\x03)\x03)\x03*\x03*\x03*\x03*\x03+\x03+\x03+\x03,\x03,\x03-\x03" + + "-\x03-\x03.\x03.\x03/\x03/\x03/\x030\x030\x031\x031\x031\x032\x032\x03" + + "2\x032\x032\x033\x033\x033\x034\x034\x034\x034\x034\x034\x034\x034\x03" + + "4\x035\x035\x035\x035\x035\x036\x036\x036\x036\x036\x036\x037\x037\x03" + + "7\x037\x037\x037\x038\x038\x038\x038\x038\x038\x038\x039\x039\x039\x03" + + "9\x039\x039\x039\x039\x039\x03:\x03:\x03:\x03:\x03;\x03;\x03;\x03;\x03" + + ";\x03<\x03<\x03=\x03=\x03>\x06>\u0164\n>\r>\x0E>\u0165\x03?\x06?\u0169" + + "\n?\r?\x0E?\u016A\x03@\x06@\u016E\n@\r@\x0E@\u016F\x03A\x03A\x07A\u0174" + + "\nA\fA\x0EA\u0177\vA\x02\x02\x02B\x03\x02\x02\x05\x02\x02\x07\x02\x02" + + "\t\x02\x02\v\x02\x02\r\x02\x02\x0F\x02\x02\x11\x02\x02\x13\x02\x02\x15" + + "\x02\x02\x17\x02\x02\x19\x02\x02\x1B\x02\x02\x1D\x02\x02\x1F\x02\x02!" + + "\x02\x02#\x02\x02%\x02\x02\'\x02\x02)\x02\x02+\x02\x02-\x02\x03/\x02\x02" + + "1\x02\x023\x02\x025\x02\x027\x02\x029\x02\x04;\x02\x05=\x02\x06?\x02\x07" + + "A\x02\bC\x02\tE\x02\nG\x02\x02I\x02\vK\x02\fM\x02\rO\x02\x0EQ\x02\x0F" + + "S\x02\x10U\x02\x11W\x02\x12Y\x02\x13[\x02\x14]\x02\x15_\x02\x16a\x02\x17" + + "c\x02\x18e\x02\x19g\x02\x1Ai\x02\x1Bk\x02\x1Cm\x02\x1Do\x02\x1Eq\x02\x1F" + + "s\x02 u\x02!w\x02\"y\x02#{\x02$}\x02%\x7F\x02&\x81\x02\'\x03\x02 \x04" + + "\x02CCcc\x04\x02DDdd\x04\x02EEee\x04\x02FFff\x04\x02GGgg\x04\x02HHhh\x04" + + "\x02IIii\x04\x02JJjj\x04\x02KKkk\x04\x02MMmm\x04\x02NNnn\x04\x02OOoo\x04" + + "\x02PPpp\x04\x02QQqq\x04\x02RRrr\x04\x02TTtt\x04\x02UUuu\x04\x02VVvv\x04" + + "\x02WWww\x04\x02YYyy\x04\x02[[{{\x05\x02\v\f\x0F\x0F\"\"\x05\x022;C\\" + + "c|\x04\x02$$^^\x04\x02))^^\x03\x022;\x03\x02C\\\x04\x02C\\aa\x04\x02C" + + "\\c|\x07\x02002;C\\aac|\x02\u016A\x02-\x03\x02\x02\x02\x029\x03\x02\x02" + + "\x02\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x02" + + "A\x03\x02\x02\x02\x02C\x03\x02\x02\x02\x02E\x03\x02\x02\x02\x02I\x03\x02" + + "\x02\x02\x02K\x03\x02\x02\x02\x02M\x03\x02\x02\x02\x02O\x03\x02\x02\x02" + + "\x02Q\x03\x02\x02\x02\x02S\x03\x02\x02\x02\x02U\x03\x02\x02\x02\x02W\x03" + + "\x02\x02\x02\x02Y\x03\x02\x02\x02\x02[\x03\x02\x02\x02\x02]\x03\x02\x02" + + "\x02\x02_\x03\x02\x02\x02\x02a\x03\x02\x02\x02\x02c\x03\x02\x02\x02\x02" + + "e\x03\x02\x02\x02\x02g\x03\x02\x02\x02\x02i\x03\x02\x02\x02\x02k\x03\x02" + + "\x02\x02\x02m\x03\x02\x02\x02\x02o\x03\x02\x02\x02\x02q\x03\x02\x02\x02" + + "\x02s\x03\x02\x02\x02\x02u\x03\x02\x02\x02\x02w\x03\x02\x02\x02\x02y\x03" + + "\x02\x02\x02\x02{\x03\x02\x02\x02\x02}\x03\x02\x02\x02\x02\x7F\x03\x02" + + "\x02\x02\x02\x81\x03\x02\x02\x02\x03\x83\x03\x02\x02\x02\x05\x85\x03\x02" + + "\x02\x02\x07\x87\x03\x02\x02\x02\t\x89\x03\x02\x02\x02\v\x8B\x03\x02\x02" + + "\x02\r\x8D\x03\x02\x02\x02\x0F\x8F\x03\x02\x02\x02\x11\x91\x03\x02\x02" + + "\x02\x13\x93\x03\x02\x02\x02\x15\x95\x03\x02\x02\x02\x17\x97\x03\x02\x02" + + "\x02\x19\x99\x03\x02\x02\x02\x1B\x9B\x03\x02\x02\x02\x1D\x9D\x03\x02\x02" + + "\x02\x1F\x9F\x03\x02\x02\x02!\xA1\x03\x02\x02\x02#\xA3\x03\x02\x02\x02" + + "%\xA5\x03\x02\x02\x02\'\xA7\x03\x02\x02\x02)\xA9\x03\x02\x02\x02+\xAB" + + "\x03\x02\x02\x02-\xAE\x03\x02\x02\x02/\xB5\x03\x02\x02\x021\xB9\x03\x02" + + "\x02\x023\xC6\x03\x02\x02\x025\xD3\x03\x02\x02\x027\xD5\x03\x02\x02\x02" + + "9\xDC\x03\x02\x02\x02;\xDE\x03\x02\x02\x02=\xE0\x03\x02\x02\x02?\xE2\x03" + + "\x02\x02\x02A\xE4\x03\x02\x02\x02C\xE6\x03\x02\x02\x02E\xE8\x03\x02\x02" + + "\x02G\xEC\x03\x02\x02\x02I\xEE\x03\x02\x02\x02K\xF5\x03\x02\x02\x02M\xFC" + + "\x03\x02\x02\x02O\u0103\x03\x02\x02\x02Q\u0107\x03\x02\x02\x02S\u010D" + + "\x03\x02\x02\x02U\u0111\x03\x02\x02\x02W\u0114\x03\x02\x02\x02Y\u0116" + + "\x03\x02\x02\x02[\u0119\x03\x02\x02\x02]\u011B\x03\x02\x02\x02_\u011E" + + "\x03\x02\x02\x02a\u0120\x03\x02\x02\x02c\u0123\x03\x02\x02\x02e\u0128" + + "\x03\x02\x02\x02g\u012B\x03\x02\x02\x02i\u0134\x03\x02\x02\x02k\u0139" + + "\x03\x02\x02\x02m\u013F\x03\x02\x02\x02o\u0145\x03\x02\x02\x02q\u014C" + + "\x03\x02\x02\x02s\u0155\x03\x02\x02\x02u\u0159\x03\x02\x02\x02w\u015E" + + "\x03\x02\x02\x02y\u0160\x03\x02\x02\x02{\u0163\x03\x02\x02\x02}\u0168" + + "\x03\x02\x02\x02\x7F\u016D\x03\x02\x02\x02\x81\u0171\x03\x02\x02\x02\x83" + + "\x84\t\x02\x02\x02\x84\x04\x03\x02\x02\x02\x85\x86\t\x03\x02\x02\x86\x06" + + "\x03\x02\x02\x02\x87\x88\t\x04\x02\x02\x88\b\x03\x02\x02\x02\x89\x8A\t" + + "\x05\x02\x02\x8A\n\x03\x02\x02\x02\x8B\x8C\t\x06\x02\x02\x8C\f\x03\x02" + + "\x02\x02\x8D\x8E\t\x07\x02\x02\x8E\x0E\x03\x02\x02\x02\x8F\x90\t\b\x02" + + "\x02\x90\x10\x03\x02\x02\x02\x91\x92\t\t\x02\x02\x92\x12\x03\x02\x02\x02" + + "\x93\x94\t\n\x02\x02\x94\x14\x03\x02\x02\x02\x95\x96\t\v\x02\x02\x96\x16" + + "\x03\x02\x02\x02\x97\x98\t\f\x02\x02\x98\x18\x03\x02\x02\x02\x99\x9A\t" + + "\r\x02\x02\x9A\x1A\x03\x02\x02\x02\x9B\x9C\t\x0E\x02\x02\x9C\x1C\x03\x02" + + "\x02\x02\x9D\x9E\t\x0F\x02\x02\x9E\x1E\x03\x02\x02\x02\x9F\xA0\t\x10\x02" + + "\x02\xA0 \x03\x02\x02\x02\xA1\xA2\t\x11\x02\x02\xA2\"\x03\x02\x02\x02" + + "\xA3\xA4\t\x12\x02\x02\xA4$\x03\x02\x02\x02\xA5\xA6\t\x13\x02\x02\xA6" + + "&\x03\x02\x02\x02\xA7\xA8\t\x14\x02\x02\xA8(\x03\x02\x02\x02\xA9\xAA\t" + + "\x15\x02\x02\xAA*\x03\x02\x02\x02\xAB\xAC\t\x16\x02\x02\xAC,\x03\x02\x02" + + "\x02\xAD\xAF\t\x17\x02\x02\xAE\xAD\x03\x02\x02\x02\xAF\xB0\x03\x02\x02" + + "\x02\xB0\xAE\x03\x02\x02\x02\xB0\xB1\x03\x02\x02\x02\xB1\xB2\x03\x02\x02" + + "\x02\xB2\xB3\b\x17\x02\x02\xB3.\x03\x02\x02\x02\xB4\xB6\t\x18\x02\x02" + + "\xB5\xB4\x03\x02\x02\x02\xB6\xB7\x03\x02\x02\x02\xB7\xB5\x03\x02\x02\x02" + + "\xB7\xB8\x03\x02\x02\x02\xB80\x03\x02\x02\x02\xB9\xC1\x07$\x02\x02\xBA" + + "\xBB\x07^\x02\x02\xBB\xC0\v\x02\x02\x02\xBC\xBD\x07$\x02\x02\xBD\xC0\x07" + + "$\x02\x02\xBE\xC0\n\x19\x02\x02\xBF\xBA\x03\x02\x02\x02\xBF\xBC\x03\x02" + + "\x02\x02\xBF\xBE\x03\x02\x02\x02\xC0\xC3\x03\x02\x02\x02\xC1\xBF\x03\x02" + + "\x02\x02\xC1\xC2\x03\x02\x02\x02\xC2\xC4\x03\x02\x02\x02\xC3\xC1\x03\x02" + + "\x02\x02\xC4\xC5\x07$\x02\x02\xC52\x03\x02\x02\x02\xC6\xCE\x07)\x02\x02" + + "\xC7\xC8\x07^\x02\x02\xC8\xCD\v\x02\x02\x02\xC9\xCA\x07)\x02\x02\xCA\xCD" + + "\x07)\x02\x02\xCB\xCD\n\x1A\x02\x02\xCC\xC7\x03\x02\x02\x02\xCC\xC9\x03" + + "\x02\x02\x02\xCC\xCB\x03\x02\x02\x02\xCD\xD0\x03\x02\x02\x02\xCE\xCC\x03" + + "\x02\x02\x02\xCE\xCF\x03\x02\x02\x02\xCF\xD1\x03\x02\x02\x02\xD0\xCE\x03" + + "\x02\x02\x02\xD1\xD2\x07)\x02\x02\xD24\x03\x02\x02\x02\xD3\xD4\t\x1B\x02" + + "\x02\xD46\x03\x02\x02\x02\xD5\xD9\t\x1C\x02\x02\xD6\xD8\t\x1D\x02\x02" + + "\xD7\xD6\x03\x02\x02\x02\xD8\xDB\x03\x02\x02\x02\xD9\xD7\x03\x02\x02\x02" + + "\xD9\xDA\x03\x02\x02\x02\xDA8\x03\x02\x02\x02\xDB\xD9\x03\x02\x02\x02" + + "\xDC\xDD\x07*\x02\x02\xDD:\x03\x02\x02\x02\xDE\xDF\x07+\x02\x02\xDF<\x03" + + "\x02\x02\x02\xE0\xE1\x07.\x02\x02\xE1>\x03\x02\x02\x02\xE2\xE3\x07)\x02" + + "\x02\xE3@\x03\x02\x02\x02\xE4\xE5\x07$\x02\x02\xE5B\x03\x02\x02\x02\xE6" + + "\xE7\x07]\x02\x02\xE7D\x03\x02\x02\x02\xE8\xE9\x07_\x02\x02\xE9F\x03\x02" + + "\x02\x02\xEA\xED\x05? \x02\xEB\xED\x05A!\x02\xEC\xEA\x03\x02\x02\x02\xEC" + + "\xEB\x03\x02\x02\x02\xEDH\x03\x02\x02\x02\xEE\xEF\x05\t\x05\x02\xEF\xF0" + + "\x05\v\x06\x02\xF0\xF1\x05\x17\f\x02\xF1\xF2\x05\v\x06\x02\xF2\xF3\x05" + + "%\x13\x02\xF3\xF4\x05\v\x06\x02\xF4J\x03\x02\x02\x02\xF5\xF6\x05\'\x14" + + "\x02\xF6\xF7\x05\x1F\x10\x02\xF7\xF8\x05\t\x05\x02\xF8\xF9\x05\x03\x02" + + "\x02\xF9\xFA\x05%\x13\x02\xFA\xFB\x05\v\x06\x02\xFBL\x03\x02\x02\x02\xFC" + + "\xFD\x05#\x12\x02\xFD\xFE\x05\v\x06\x02\xFE\xFF\x05\x17\f\x02\xFF\u0100" + + "\x05\v\x06\x02\u0100\u0101\x05\x07\x04\x02\u0101\u0102\x05%\x13\x02\u0102" + + "N\x03\x02\x02\x02\u0103\u0104\x05#\x12\x02\u0104\u0105\x05\v\x06\x02\u0105" + + "\u0106\x05%\x13\x02\u0106P\x03\x02\x02\x02\u0107\u0108\x05)\x15\x02\u0108" + + "\u0109\x05\x11\t\x02\u0109\u010A\x05\v\x06\x02\u010A\u010B\x05!\x11\x02" + + "\u010B\u010C\x05\v\x06\x02\u010CR\x03\x02\x02\x02\u010D\u010E\x05\x03" + + "\x02\x02\u010E\u010F\x05\x1B\x0E\x02\u010F\u0110\x05\t\x05\x02\u0110T" + + "\x03\x02\x02\x02\u0111\u0112\x05\x1D\x0F\x02\u0112\u0113\x05!\x11\x02" + + "\u0113V\x03\x02\x02\x02\u0114\u0115\x07?\x02\x02\u0115X\x03\x02\x02\x02" + + "\u0116\u0117\x07#\x02\x02\u0117\u0118\x07?\x02\x02\u0118Z\x03\x02\x02" + + "\x02\u0119\u011A\x07@\x02\x02\u011A\\\x03\x02\x02\x02\u011B\u011C\x07" + + "@\x02\x02\u011C\u011D\x07?\x02\x02\u011D^\x03\x02\x02\x02\u011E\u011F" + + "\x07>\x02\x02\u011F`\x03\x02\x02\x02\u0120\u0121\x07>\x02\x02\u0121\u0122" + + "\x07?\x02\x02\u0122b\x03\x02\x02\x02\u0123\u0124\x05\x17\f\x02\u0124\u0125" + + "\x05\x13\n\x02\u0125\u0126\x05\x15\v\x02\u0126\u0127\x05\v\x06\x02\u0127" + + "d\x03\x02\x02\x02\u0128\u0129\x05\x13\n\x02\u0129\u012A\x05\x1B\x0E\x02" + + "\u012Af\x03\x02\x02\x02\u012B\u012C\x05\x07\x04\x02\u012C\u012D\x05\x1D" + + "\x0F\x02\u012D\u012E\x05\x1B\x0E\x02\u012E\u012F\x05%\x13\x02\u012F\u0130" + + "\x05\x03\x02\x02\u0130\u0131\x05\x13\n\x02\u0131\u0132\x05\x1B\x0E\x02" + + "\u0132\u0133\x05#\x12\x02\u0133h\x03\x02\x02\x02\u0134\u0135\x05%\x13" + + "\x02\u0135\u0136\x05!\x11\x02\u0136\u0137\x05\'\x14\x02\u0137\u0138\x05" + + "\v\x06\x02\u0138j\x03\x02\x02\x02\u0139\u013A\x05\r\x07\x02\u013A\u013B" + + "\x05\x03\x02\x02\u013B\u013C\x05\x17\f\x02\u013C\u013D\x05#\x12\x02\u013D" + + "\u013E\x05\v\x06\x02\u013El\x03\x02\x02\x02\u013F\u0140\x05\x17\f\x02" + + "\u0140\u0141\x05\x13\n\x02\u0141\u0142\x05\x19\r\x02\u0142\u0143\x05\x13" + + "\n\x02\u0143\u0144\x05%\x13\x02\u0144n\x03\x02\x02\x02\u0145\u0146\x05" + + "\x1D\x0F\x02\u0146\u0147\x05\r\x07\x02\u0147\u0148\x05\r\x07\x02\u0148" + + "\u0149\x05#\x12\x02\u0149\u014A\x05\v\x06\x02\u014A\u014B\x05%\x13\x02" + + "\u014Bp\x03\x02\x02\x02\u014C\u014D\x05\x1D\x0F\x02\u014D\u014E\x05!\x11" + + "\x02\u014E\u014F\x05\t\x05\x02\u014F\u0150\x05\v\x06\x02\u0150\u0151\x05" + + "!\x11\x02\u0151\u0152\x07\"\x02\x02\u0152\u0153\x05\x05\x03\x02\u0153" + + "\u0154\x05+\x16\x02\u0154r\x03\x02\x02\x02\u0155\u0156\x05\x03\x02\x02" + + "\u0156\u0157\x05#\x12\x02\u0157\u0158\x05\x07\x04\x02\u0158t\x03\x02\x02" + + "\x02\u0159\u015A\x05\t\x05\x02\u015A\u015B\x05\v\x06\x02\u015B\u015C\x05" + + "#\x12\x02\u015C\u015D\x05\x07\x04\x02\u015Dv\x03\x02\x02\x02\u015E\u015F" + + "\x051\x19\x02\u015Fx\x03\x02\x02\x02\u0160\u0161\x053\x1A\x02\u0161z\x03" + + "\x02\x02\x02\u0162\u0164\x055\x1B\x02\u0163\u0162\x03\x02\x02\x02\u0164" + + "\u0165\x03\x02\x02\x02\u0165\u0163\x03\x02\x02\x02\u0165\u0166\x03\x02" + + "\x02\x02\u0166|\x03\x02\x02\x02\u0167\u0169\t\x1E\x02\x02\u0168\u0167" + + "\x03\x02\x02\x02\u0169\u016A\x03\x02\x02\x02\u016A\u0168\x03\x02\x02\x02" + + "\u016A\u016B\x03\x02\x02\x02\u016B~\x03\x02\x02\x02\u016C\u016E\t\x1F" + + "\x02\x02\u016D\u016C\x03\x02\x02\x02\u016E\u016F\x03\x02\x02\x02\u016F" + + "\u016D\x03\x02\x02\x02\u016F\u0170\x03\x02\x02\x02\u0170\x80\x03\x02\x02" + + "\x02\u0171\u0175\t\x1C\x02\x02\u0172\u0174\t\x1D\x02\x02\u0173\u0172\x03" + + "\x02\x02\x02\u0174\u0177\x03\x02\x02\x02\u0175\u0173\x03\x02\x02\x02\u0175" + + "\u0176\x03\x02\x02\x02\u0176\x82\x03\x02\x02\x02\u0177\u0175\x03\x02\x02" + + "\x02\x0F\x02\xB0\xB7\xBF\xC1\xCC\xCE\xD9\xEC\u0165\u016A\u016F\u0175\x03" + + "\b\x02\x02"; public static __ATN: ATN; public static get _ATN(): ATN { if (!WebdaQLLexer.__ATN) { diff --git a/packages/ql/src/WebdaQLParser.interp b/packages/ql/src/WebdaQLParser.interp index 4a61dde4f..47abd3c32 100644 --- a/packages/ql/src/WebdaQLParser.interp +++ b/packages/ql/src/WebdaQLParser.interp @@ -8,29 +8,29 @@ null '"' '[' ']' -'DELETE' -'UPDATE' -'SELECT' -'SET' -'WHERE' -'AND' -'OR' +null +null +null +null +null +null +null '=' '!=' '>' '>=' '<' '<=' -'LIKE' -'IN' -'CONTAINS' -'TRUE' -'FALSE' -'LIMIT' -'OFFSET' -'ORDER BY' -'ASC' -'DESC' +null +null +null +null +null +null +null +null +null +null null null null diff --git a/packages/ql/src/WebdaQLParser.tokens b/packages/ql/src/WebdaQLParser.tokens index cf8a82415..31ac02aa6 100644 --- a/packages/ql/src/WebdaQLParser.tokens +++ b/packages/ql/src/WebdaQLParser.tokens @@ -42,26 +42,9 @@ FUNCTION_IDENTIFIER_WITH_UNDERSCORE=37 '"'=6 '['=7 ']'=8 -'DELETE'=9 -'UPDATE'=10 -'SELECT'=11 -'SET'=12 -'WHERE'=13 -'AND'=14 -'OR'=15 '='=16 '!='=17 '>'=18 '>='=19 '<'=20 '<='=21 -'LIKE'=22 -'IN'=23 -'CONTAINS'=24 -'TRUE'=25 -'FALSE'=26 -'LIMIT'=27 -'OFFSET'=28 -'ORDER BY'=29 -'ASC'=30 -'DESC'=31 diff --git a/packages/ql/src/WebdaQLParserLexer.interp b/packages/ql/src/WebdaQLParserLexer.interp index fd0246f95..60d5ed56d 100644 --- a/packages/ql/src/WebdaQLParserLexer.interp +++ b/packages/ql/src/WebdaQLParserLexer.interp @@ -8,29 +8,29 @@ null '"' '[' ']' -'DELETE' -'UPDATE' -'SELECT' -'SET' -'WHERE' -'AND' -'OR' +null +null +null +null +null +null +null '=' '!=' '>' '>=' '<' '<=' -'LIKE' -'IN' -'CONTAINS' -'TRUE' -'FALSE' -'LIMIT' -'OFFSET' -'ORDER BY' -'ASC' -'DESC' +null +null +null +null +null +null +null +null +null +null null null null @@ -79,6 +79,27 @@ IDENTIFIER_WITH_NUMBER FUNCTION_IDENTIFIER_WITH_UNDERSCORE rule names: +A +B +C +D +E +F +G +H +I +K +L +M +N +O +P +R +S +T +U +W +Y SPACE ID_LITERAL DQUOTA_STRING @@ -131,4 +152,4 @@ mode names: DEFAULT_MODE atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 39, 292, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 3, 2, 6, 2, 91, 10, 2, 13, 2, 14, 2, 92, 3, 2, 3, 2, 3, 3, 6, 3, 98, 10, 3, 13, 3, 14, 3, 99, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 108, 10, 4, 12, 4, 14, 4, 111, 11, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 7, 5, 121, 10, 5, 12, 5, 14, 5, 124, 11, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 7, 7, 132, 10, 7, 12, 7, 14, 7, 135, 11, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 5, 15, 153, 10, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 6, 41, 272, 10, 41, 13, 41, 14, 41, 273, 3, 42, 6, 42, 277, 10, 42, 13, 42, 14, 42, 278, 3, 43, 6, 43, 282, 10, 43, 13, 43, 14, 43, 283, 3, 44, 3, 44, 7, 44, 288, 10, 44, 12, 44, 14, 44, 291, 11, 44, 2, 2, 2, 45, 3, 2, 3, 5, 2, 2, 7, 2, 2, 9, 2, 2, 11, 2, 2, 13, 2, 2, 15, 2, 4, 17, 2, 5, 19, 2, 6, 21, 2, 7, 23, 2, 8, 25, 2, 9, 27, 2, 10, 29, 2, 2, 31, 2, 11, 33, 2, 12, 35, 2, 13, 37, 2, 14, 39, 2, 15, 41, 2, 16, 43, 2, 17, 45, 2, 18, 47, 2, 19, 49, 2, 20, 51, 2, 21, 53, 2, 22, 55, 2, 23, 57, 2, 24, 59, 2, 25, 61, 2, 26, 63, 2, 27, 65, 2, 28, 67, 2, 29, 69, 2, 30, 71, 2, 31, 73, 2, 32, 75, 2, 33, 77, 2, 34, 79, 2, 35, 81, 2, 36, 83, 2, 37, 85, 2, 38, 87, 2, 39, 3, 2, 11, 5, 2, 11, 12, 15, 15, 34, 34, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 50, 59, 3, 2, 67, 92, 4, 2, 67, 92, 97, 97, 4, 2, 67, 92, 99, 124, 7, 2, 48, 48, 50, 59, 67, 92, 97, 97, 99, 124, 2, 299, 2, 3, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 3, 90, 3, 2, 2, 2, 5, 97, 3, 2, 2, 2, 7, 101, 3, 2, 2, 2, 9, 114, 3, 2, 2, 2, 11, 127, 3, 2, 2, 2, 13, 129, 3, 2, 2, 2, 15, 136, 3, 2, 2, 2, 17, 138, 3, 2, 2, 2, 19, 140, 3, 2, 2, 2, 21, 142, 3, 2, 2, 2, 23, 144, 3, 2, 2, 2, 25, 146, 3, 2, 2, 2, 27, 148, 3, 2, 2, 2, 29, 152, 3, 2, 2, 2, 31, 154, 3, 2, 2, 2, 33, 161, 3, 2, 2, 2, 35, 168, 3, 2, 2, 2, 37, 175, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 185, 3, 2, 2, 2, 43, 189, 3, 2, 2, 2, 45, 192, 3, 2, 2, 2, 47, 194, 3, 2, 2, 2, 49, 197, 3, 2, 2, 2, 51, 199, 3, 2, 2, 2, 53, 202, 3, 2, 2, 2, 55, 204, 3, 2, 2, 2, 57, 207, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 215, 3, 2, 2, 2, 63, 224, 3, 2, 2, 2, 65, 229, 3, 2, 2, 2, 67, 235, 3, 2, 2, 2, 69, 241, 3, 2, 2, 2, 71, 248, 3, 2, 2, 2, 73, 257, 3, 2, 2, 2, 75, 261, 3, 2, 2, 2, 77, 266, 3, 2, 2, 2, 79, 268, 3, 2, 2, 2, 81, 271, 3, 2, 2, 2, 83, 276, 3, 2, 2, 2, 85, 281, 3, 2, 2, 2, 87, 285, 3, 2, 2, 2, 89, 91, 9, 2, 2, 2, 90, 89, 3, 2, 2, 2, 91, 92, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 92, 93, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 95, 8, 2, 2, 2, 95, 4, 3, 2, 2, 2, 96, 98, 9, 3, 2, 2, 97, 96, 3, 2, 2, 2, 98, 99, 3, 2, 2, 2, 99, 97, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 6, 3, 2, 2, 2, 101, 109, 7, 36, 2, 2, 102, 103, 7, 94, 2, 2, 103, 108, 11, 2, 2, 2, 104, 105, 7, 36, 2, 2, 105, 108, 7, 36, 2, 2, 106, 108, 10, 4, 2, 2, 107, 102, 3, 2, 2, 2, 107, 104, 3, 2, 2, 2, 107, 106, 3, 2, 2, 2, 108, 111, 3, 2, 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 112, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 112, 113, 7, 36, 2, 2, 113, 8, 3, 2, 2, 2, 114, 122, 7, 41, 2, 2, 115, 116, 7, 94, 2, 2, 116, 121, 11, 2, 2, 2, 117, 118, 7, 41, 2, 2, 118, 121, 7, 41, 2, 2, 119, 121, 10, 5, 2, 2, 120, 115, 3, 2, 2, 2, 120, 117, 3, 2, 2, 2, 120, 119, 3, 2, 2, 2, 121, 124, 3, 2, 2, 2, 122, 120, 3, 2, 2, 2, 122, 123, 3, 2, 2, 2, 123, 125, 3, 2, 2, 2, 124, 122, 3, 2, 2, 2, 125, 126, 7, 41, 2, 2, 126, 10, 3, 2, 2, 2, 127, 128, 9, 6, 2, 2, 128, 12, 3, 2, 2, 2, 129, 133, 9, 7, 2, 2, 130, 132, 9, 8, 2, 2, 131, 130, 3, 2, 2, 2, 132, 135, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 14, 3, 2, 2, 2, 135, 133, 3, 2, 2, 2, 136, 137, 7, 42, 2, 2, 137, 16, 3, 2, 2, 2, 138, 139, 7, 43, 2, 2, 139, 18, 3, 2, 2, 2, 140, 141, 7, 46, 2, 2, 141, 20, 3, 2, 2, 2, 142, 143, 7, 41, 2, 2, 143, 22, 3, 2, 2, 2, 144, 145, 7, 36, 2, 2, 145, 24, 3, 2, 2, 2, 146, 147, 7, 93, 2, 2, 147, 26, 3, 2, 2, 2, 148, 149, 7, 95, 2, 2, 149, 28, 3, 2, 2, 2, 150, 153, 5, 21, 11, 2, 151, 153, 5, 23, 12, 2, 152, 150, 3, 2, 2, 2, 152, 151, 3, 2, 2, 2, 153, 30, 3, 2, 2, 2, 154, 155, 7, 70, 2, 2, 155, 156, 7, 71, 2, 2, 156, 157, 7, 78, 2, 2, 157, 158, 7, 71, 2, 2, 158, 159, 7, 86, 2, 2, 159, 160, 7, 71, 2, 2, 160, 32, 3, 2, 2, 2, 161, 162, 7, 87, 2, 2, 162, 163, 7, 82, 2, 2, 163, 164, 7, 70, 2, 2, 164, 165, 7, 67, 2, 2, 165, 166, 7, 86, 2, 2, 166, 167, 7, 71, 2, 2, 167, 34, 3, 2, 2, 2, 168, 169, 7, 85, 2, 2, 169, 170, 7, 71, 2, 2, 170, 171, 7, 78, 2, 2, 171, 172, 7, 71, 2, 2, 172, 173, 7, 69, 2, 2, 173, 174, 7, 86, 2, 2, 174, 36, 3, 2, 2, 2, 175, 176, 7, 85, 2, 2, 176, 177, 7, 71, 2, 2, 177, 178, 7, 86, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 89, 2, 2, 180, 181, 7, 74, 2, 2, 181, 182, 7, 71, 2, 2, 182, 183, 7, 84, 2, 2, 183, 184, 7, 71, 2, 2, 184, 40, 3, 2, 2, 2, 185, 186, 7, 67, 2, 2, 186, 187, 7, 80, 2, 2, 187, 188, 7, 70, 2, 2, 188, 42, 3, 2, 2, 2, 189, 190, 7, 81, 2, 2, 190, 191, 7, 84, 2, 2, 191, 44, 3, 2, 2, 2, 192, 193, 7, 63, 2, 2, 193, 46, 3, 2, 2, 2, 194, 195, 7, 35, 2, 2, 195, 196, 7, 63, 2, 2, 196, 48, 3, 2, 2, 2, 197, 198, 7, 64, 2, 2, 198, 50, 3, 2, 2, 2, 199, 200, 7, 64, 2, 2, 200, 201, 7, 63, 2, 2, 201, 52, 3, 2, 2, 2, 202, 203, 7, 62, 2, 2, 203, 54, 3, 2, 2, 2, 204, 205, 7, 62, 2, 2, 205, 206, 7, 63, 2, 2, 206, 56, 3, 2, 2, 2, 207, 208, 7, 78, 2, 2, 208, 209, 7, 75, 2, 2, 209, 210, 7, 77, 2, 2, 210, 211, 7, 71, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 75, 2, 2, 213, 214, 7, 80, 2, 2, 214, 60, 3, 2, 2, 2, 215, 216, 7, 69, 2, 2, 216, 217, 7, 81, 2, 2, 217, 218, 7, 80, 2, 2, 218, 219, 7, 86, 2, 2, 219, 220, 7, 67, 2, 2, 220, 221, 7, 75, 2, 2, 221, 222, 7, 80, 2, 2, 222, 223, 7, 85, 2, 2, 223, 62, 3, 2, 2, 2, 224, 225, 7, 86, 2, 2, 225, 226, 7, 84, 2, 2, 226, 227, 7, 87, 2, 2, 227, 228, 7, 71, 2, 2, 228, 64, 3, 2, 2, 2, 229, 230, 7, 72, 2, 2, 230, 231, 7, 67, 2, 2, 231, 232, 7, 78, 2, 2, 232, 233, 7, 85, 2, 2, 233, 234, 7, 71, 2, 2, 234, 66, 3, 2, 2, 2, 235, 236, 7, 78, 2, 2, 236, 237, 7, 75, 2, 2, 237, 238, 7, 79, 2, 2, 238, 239, 7, 75, 2, 2, 239, 240, 7, 86, 2, 2, 240, 68, 3, 2, 2, 2, 241, 242, 7, 81, 2, 2, 242, 243, 7, 72, 2, 2, 243, 244, 7, 72, 2, 2, 244, 245, 7, 85, 2, 2, 245, 246, 7, 71, 2, 2, 246, 247, 7, 86, 2, 2, 247, 70, 3, 2, 2, 2, 248, 249, 7, 81, 2, 2, 249, 250, 7, 84, 2, 2, 250, 251, 7, 70, 2, 2, 251, 252, 7, 71, 2, 2, 252, 253, 7, 84, 2, 2, 253, 254, 7, 34, 2, 2, 254, 255, 7, 68, 2, 2, 255, 256, 7, 91, 2, 2, 256, 72, 3, 2, 2, 2, 257, 258, 7, 67, 2, 2, 258, 259, 7, 85, 2, 2, 259, 260, 7, 69, 2, 2, 260, 74, 3, 2, 2, 2, 261, 262, 7, 70, 2, 2, 262, 263, 7, 71, 2, 2, 263, 264, 7, 85, 2, 2, 264, 265, 7, 69, 2, 2, 265, 76, 3, 2, 2, 2, 266, 267, 5, 7, 4, 2, 267, 78, 3, 2, 2, 2, 268, 269, 5, 9, 5, 2, 269, 80, 3, 2, 2, 2, 270, 272, 5, 11, 6, 2, 271, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 82, 3, 2, 2, 2, 275, 277, 9, 9, 2, 2, 276, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 84, 3, 2, 2, 2, 280, 282, 9, 10, 2, 2, 281, 280, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 86, 3, 2, 2, 2, 285, 289, 9, 7, 2, 2, 286, 288, 9, 8, 2, 2, 287, 286, 3, 2, 2, 2, 288, 291, 3, 2, 2, 2, 289, 287, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 88, 3, 2, 2, 2, 291, 289, 3, 2, 2, 2, 15, 2, 92, 99, 107, 109, 120, 122, 133, 152, 273, 278, 283, 289, 3, 8, 2, 2] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 39, 376, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 6, 23, 175, 10, 23, 13, 23, 14, 23, 176, 3, 23, 3, 23, 3, 24, 6, 24, 182, 10, 24, 13, 24, 14, 24, 183, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 192, 10, 25, 12, 25, 14, 25, 195, 11, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 7, 26, 205, 10, 26, 12, 26, 14, 26, 208, 11, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 7, 28, 216, 10, 28, 12, 28, 14, 28, 219, 11, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 5, 36, 237, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 6, 62, 356, 10, 62, 13, 62, 14, 62, 357, 3, 63, 6, 63, 361, 10, 63, 13, 63, 14, 63, 362, 3, 64, 6, 64, 366, 10, 64, 13, 64, 14, 64, 367, 3, 65, 3, 65, 7, 65, 372, 10, 65, 12, 65, 14, 65, 375, 11, 65, 2, 2, 2, 66, 3, 2, 2, 5, 2, 2, 7, 2, 2, 9, 2, 2, 11, 2, 2, 13, 2, 2, 15, 2, 2, 17, 2, 2, 19, 2, 2, 21, 2, 2, 23, 2, 2, 25, 2, 2, 27, 2, 2, 29, 2, 2, 31, 2, 2, 33, 2, 2, 35, 2, 2, 37, 2, 2, 39, 2, 2, 41, 2, 2, 43, 2, 2, 45, 2, 3, 47, 2, 2, 49, 2, 2, 51, 2, 2, 53, 2, 2, 55, 2, 2, 57, 2, 4, 59, 2, 5, 61, 2, 6, 63, 2, 7, 65, 2, 8, 67, 2, 9, 69, 2, 10, 71, 2, 2, 73, 2, 11, 75, 2, 12, 77, 2, 13, 79, 2, 14, 81, 2, 15, 83, 2, 16, 85, 2, 17, 87, 2, 18, 89, 2, 19, 91, 2, 20, 93, 2, 21, 95, 2, 22, 97, 2, 23, 99, 2, 24, 101, 2, 25, 103, 2, 26, 105, 2, 27, 107, 2, 28, 109, 2, 29, 111, 2, 30, 113, 2, 31, 115, 2, 32, 117, 2, 33, 119, 2, 34, 121, 2, 35, 123, 2, 36, 125, 2, 37, 127, 2, 38, 129, 2, 39, 3, 2, 32, 4, 2, 67, 67, 99, 99, 4, 2, 68, 68, 100, 100, 4, 2, 69, 69, 101, 101, 4, 2, 70, 70, 102, 102, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 73, 73, 105, 105, 4, 2, 74, 74, 106, 106, 4, 2, 75, 75, 107, 107, 4, 2, 77, 77, 109, 109, 4, 2, 78, 78, 110, 110, 4, 2, 79, 79, 111, 111, 4, 2, 80, 80, 112, 112, 4, 2, 81, 81, 113, 113, 4, 2, 82, 82, 114, 114, 4, 2, 84, 84, 116, 116, 4, 2, 85, 85, 117, 117, 4, 2, 86, 86, 118, 118, 4, 2, 87, 87, 119, 119, 4, 2, 89, 89, 121, 121, 4, 2, 91, 91, 123, 123, 5, 2, 11, 12, 15, 15, 34, 34, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 50, 59, 3, 2, 67, 92, 4, 2, 67, 92, 97, 97, 4, 2, 67, 92, 99, 124, 7, 2, 48, 48, 50, 59, 67, 92, 97, 97, 99, 124, 2, 362, 2, 45, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 3, 131, 3, 2, 2, 2, 5, 133, 3, 2, 2, 2, 7, 135, 3, 2, 2, 2, 9, 137, 3, 2, 2, 2, 11, 139, 3, 2, 2, 2, 13, 141, 3, 2, 2, 2, 15, 143, 3, 2, 2, 2, 17, 145, 3, 2, 2, 2, 19, 147, 3, 2, 2, 2, 21, 149, 3, 2, 2, 2, 23, 151, 3, 2, 2, 2, 25, 153, 3, 2, 2, 2, 27, 155, 3, 2, 2, 2, 29, 157, 3, 2, 2, 2, 31, 159, 3, 2, 2, 2, 33, 161, 3, 2, 2, 2, 35, 163, 3, 2, 2, 2, 37, 165, 3, 2, 2, 2, 39, 167, 3, 2, 2, 2, 41, 169, 3, 2, 2, 2, 43, 171, 3, 2, 2, 2, 45, 174, 3, 2, 2, 2, 47, 181, 3, 2, 2, 2, 49, 185, 3, 2, 2, 2, 51, 198, 3, 2, 2, 2, 53, 211, 3, 2, 2, 2, 55, 213, 3, 2, 2, 2, 57, 220, 3, 2, 2, 2, 59, 222, 3, 2, 2, 2, 61, 224, 3, 2, 2, 2, 63, 226, 3, 2, 2, 2, 65, 228, 3, 2, 2, 2, 67, 230, 3, 2, 2, 2, 69, 232, 3, 2, 2, 2, 71, 236, 3, 2, 2, 2, 73, 238, 3, 2, 2, 2, 75, 245, 3, 2, 2, 2, 77, 252, 3, 2, 2, 2, 79, 259, 3, 2, 2, 2, 81, 263, 3, 2, 2, 2, 83, 269, 3, 2, 2, 2, 85, 273, 3, 2, 2, 2, 87, 276, 3, 2, 2, 2, 89, 278, 3, 2, 2, 2, 91, 281, 3, 2, 2, 2, 93, 283, 3, 2, 2, 2, 95, 286, 3, 2, 2, 2, 97, 288, 3, 2, 2, 2, 99, 291, 3, 2, 2, 2, 101, 296, 3, 2, 2, 2, 103, 299, 3, 2, 2, 2, 105, 308, 3, 2, 2, 2, 107, 313, 3, 2, 2, 2, 109, 319, 3, 2, 2, 2, 111, 325, 3, 2, 2, 2, 113, 332, 3, 2, 2, 2, 115, 341, 3, 2, 2, 2, 117, 345, 3, 2, 2, 2, 119, 350, 3, 2, 2, 2, 121, 352, 3, 2, 2, 2, 123, 355, 3, 2, 2, 2, 125, 360, 3, 2, 2, 2, 127, 365, 3, 2, 2, 2, 129, 369, 3, 2, 2, 2, 131, 132, 9, 2, 2, 2, 132, 4, 3, 2, 2, 2, 133, 134, 9, 3, 2, 2, 134, 6, 3, 2, 2, 2, 135, 136, 9, 4, 2, 2, 136, 8, 3, 2, 2, 2, 137, 138, 9, 5, 2, 2, 138, 10, 3, 2, 2, 2, 139, 140, 9, 6, 2, 2, 140, 12, 3, 2, 2, 2, 141, 142, 9, 7, 2, 2, 142, 14, 3, 2, 2, 2, 143, 144, 9, 8, 2, 2, 144, 16, 3, 2, 2, 2, 145, 146, 9, 9, 2, 2, 146, 18, 3, 2, 2, 2, 147, 148, 9, 10, 2, 2, 148, 20, 3, 2, 2, 2, 149, 150, 9, 11, 2, 2, 150, 22, 3, 2, 2, 2, 151, 152, 9, 12, 2, 2, 152, 24, 3, 2, 2, 2, 153, 154, 9, 13, 2, 2, 154, 26, 3, 2, 2, 2, 155, 156, 9, 14, 2, 2, 156, 28, 3, 2, 2, 2, 157, 158, 9, 15, 2, 2, 158, 30, 3, 2, 2, 2, 159, 160, 9, 16, 2, 2, 160, 32, 3, 2, 2, 2, 161, 162, 9, 17, 2, 2, 162, 34, 3, 2, 2, 2, 163, 164, 9, 18, 2, 2, 164, 36, 3, 2, 2, 2, 165, 166, 9, 19, 2, 2, 166, 38, 3, 2, 2, 2, 167, 168, 9, 20, 2, 2, 168, 40, 3, 2, 2, 2, 169, 170, 9, 21, 2, 2, 170, 42, 3, 2, 2, 2, 171, 172, 9, 22, 2, 2, 172, 44, 3, 2, 2, 2, 173, 175, 9, 23, 2, 2, 174, 173, 3, 2, 2, 2, 175, 176, 3, 2, 2, 2, 176, 174, 3, 2, 2, 2, 176, 177, 3, 2, 2, 2, 177, 178, 3, 2, 2, 2, 178, 179, 8, 23, 2, 2, 179, 46, 3, 2, 2, 2, 180, 182, 9, 24, 2, 2, 181, 180, 3, 2, 2, 2, 182, 183, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 48, 3, 2, 2, 2, 185, 193, 7, 36, 2, 2, 186, 187, 7, 94, 2, 2, 187, 192, 11, 2, 2, 2, 188, 189, 7, 36, 2, 2, 189, 192, 7, 36, 2, 2, 190, 192, 10, 25, 2, 2, 191, 186, 3, 2, 2, 2, 191, 188, 3, 2, 2, 2, 191, 190, 3, 2, 2, 2, 192, 195, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 193, 194, 3, 2, 2, 2, 194, 196, 3, 2, 2, 2, 195, 193, 3, 2, 2, 2, 196, 197, 7, 36, 2, 2, 197, 50, 3, 2, 2, 2, 198, 206, 7, 41, 2, 2, 199, 200, 7, 94, 2, 2, 200, 205, 11, 2, 2, 2, 201, 202, 7, 41, 2, 2, 202, 205, 7, 41, 2, 2, 203, 205, 10, 26, 2, 2, 204, 199, 3, 2, 2, 2, 204, 201, 3, 2, 2, 2, 204, 203, 3, 2, 2, 2, 205, 208, 3, 2, 2, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 209, 3, 2, 2, 2, 208, 206, 3, 2, 2, 2, 209, 210, 7, 41, 2, 2, 210, 52, 3, 2, 2, 2, 211, 212, 9, 27, 2, 2, 212, 54, 3, 2, 2, 2, 213, 217, 9, 28, 2, 2, 214, 216, 9, 29, 2, 2, 215, 214, 3, 2, 2, 2, 216, 219, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 56, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 220, 221, 7, 42, 2, 2, 221, 58, 3, 2, 2, 2, 222, 223, 7, 43, 2, 2, 223, 60, 3, 2, 2, 2, 224, 225, 7, 46, 2, 2, 225, 62, 3, 2, 2, 2, 226, 227, 7, 41, 2, 2, 227, 64, 3, 2, 2, 2, 228, 229, 7, 36, 2, 2, 229, 66, 3, 2, 2, 2, 230, 231, 7, 93, 2, 2, 231, 68, 3, 2, 2, 2, 232, 233, 7, 95, 2, 2, 233, 70, 3, 2, 2, 2, 234, 237, 5, 63, 32, 2, 235, 237, 5, 65, 33, 2, 236, 234, 3, 2, 2, 2, 236, 235, 3, 2, 2, 2, 237, 72, 3, 2, 2, 2, 238, 239, 5, 9, 5, 2, 239, 240, 5, 11, 6, 2, 240, 241, 5, 23, 12, 2, 241, 242, 5, 11, 6, 2, 242, 243, 5, 37, 19, 2, 243, 244, 5, 11, 6, 2, 244, 74, 3, 2, 2, 2, 245, 246, 5, 39, 20, 2, 246, 247, 5, 31, 16, 2, 247, 248, 5, 9, 5, 2, 248, 249, 5, 3, 2, 2, 249, 250, 5, 37, 19, 2, 250, 251, 5, 11, 6, 2, 251, 76, 3, 2, 2, 2, 252, 253, 5, 35, 18, 2, 253, 254, 5, 11, 6, 2, 254, 255, 5, 23, 12, 2, 255, 256, 5, 11, 6, 2, 256, 257, 5, 7, 4, 2, 257, 258, 5, 37, 19, 2, 258, 78, 3, 2, 2, 2, 259, 260, 5, 35, 18, 2, 260, 261, 5, 11, 6, 2, 261, 262, 5, 37, 19, 2, 262, 80, 3, 2, 2, 2, 263, 264, 5, 41, 21, 2, 264, 265, 5, 17, 9, 2, 265, 266, 5, 11, 6, 2, 266, 267, 5, 33, 17, 2, 267, 268, 5, 11, 6, 2, 268, 82, 3, 2, 2, 2, 269, 270, 5, 3, 2, 2, 270, 271, 5, 27, 14, 2, 271, 272, 5, 9, 5, 2, 272, 84, 3, 2, 2, 2, 273, 274, 5, 29, 15, 2, 274, 275, 5, 33, 17, 2, 275, 86, 3, 2, 2, 2, 276, 277, 7, 63, 2, 2, 277, 88, 3, 2, 2, 2, 278, 279, 7, 35, 2, 2, 279, 280, 7, 63, 2, 2, 280, 90, 3, 2, 2, 2, 281, 282, 7, 64, 2, 2, 282, 92, 3, 2, 2, 2, 283, 284, 7, 64, 2, 2, 284, 285, 7, 63, 2, 2, 285, 94, 3, 2, 2, 2, 286, 287, 7, 62, 2, 2, 287, 96, 3, 2, 2, 2, 288, 289, 7, 62, 2, 2, 289, 290, 7, 63, 2, 2, 290, 98, 3, 2, 2, 2, 291, 292, 5, 23, 12, 2, 292, 293, 5, 19, 10, 2, 293, 294, 5, 21, 11, 2, 294, 295, 5, 11, 6, 2, 295, 100, 3, 2, 2, 2, 296, 297, 5, 19, 10, 2, 297, 298, 5, 27, 14, 2, 298, 102, 3, 2, 2, 2, 299, 300, 5, 7, 4, 2, 300, 301, 5, 29, 15, 2, 301, 302, 5, 27, 14, 2, 302, 303, 5, 37, 19, 2, 303, 304, 5, 3, 2, 2, 304, 305, 5, 19, 10, 2, 305, 306, 5, 27, 14, 2, 306, 307, 5, 35, 18, 2, 307, 104, 3, 2, 2, 2, 308, 309, 5, 37, 19, 2, 309, 310, 5, 33, 17, 2, 310, 311, 5, 39, 20, 2, 311, 312, 5, 11, 6, 2, 312, 106, 3, 2, 2, 2, 313, 314, 5, 13, 7, 2, 314, 315, 5, 3, 2, 2, 315, 316, 5, 23, 12, 2, 316, 317, 5, 35, 18, 2, 317, 318, 5, 11, 6, 2, 318, 108, 3, 2, 2, 2, 319, 320, 5, 23, 12, 2, 320, 321, 5, 19, 10, 2, 321, 322, 5, 25, 13, 2, 322, 323, 5, 19, 10, 2, 323, 324, 5, 37, 19, 2, 324, 110, 3, 2, 2, 2, 325, 326, 5, 29, 15, 2, 326, 327, 5, 13, 7, 2, 327, 328, 5, 13, 7, 2, 328, 329, 5, 35, 18, 2, 329, 330, 5, 11, 6, 2, 330, 331, 5, 37, 19, 2, 331, 112, 3, 2, 2, 2, 332, 333, 5, 29, 15, 2, 333, 334, 5, 33, 17, 2, 334, 335, 5, 9, 5, 2, 335, 336, 5, 11, 6, 2, 336, 337, 5, 33, 17, 2, 337, 338, 7, 34, 2, 2, 338, 339, 5, 5, 3, 2, 339, 340, 5, 43, 22, 2, 340, 114, 3, 2, 2, 2, 341, 342, 5, 3, 2, 2, 342, 343, 5, 35, 18, 2, 343, 344, 5, 7, 4, 2, 344, 116, 3, 2, 2, 2, 345, 346, 5, 9, 5, 2, 346, 347, 5, 11, 6, 2, 347, 348, 5, 35, 18, 2, 348, 349, 5, 7, 4, 2, 349, 118, 3, 2, 2, 2, 350, 351, 5, 49, 25, 2, 351, 120, 3, 2, 2, 2, 352, 353, 5, 51, 26, 2, 353, 122, 3, 2, 2, 2, 354, 356, 5, 53, 27, 2, 355, 354, 3, 2, 2, 2, 356, 357, 3, 2, 2, 2, 357, 355, 3, 2, 2, 2, 357, 358, 3, 2, 2, 2, 358, 124, 3, 2, 2, 2, 359, 361, 9, 30, 2, 2, 360, 359, 3, 2, 2, 2, 361, 362, 3, 2, 2, 2, 362, 360, 3, 2, 2, 2, 362, 363, 3, 2, 2, 2, 363, 126, 3, 2, 2, 2, 364, 366, 9, 31, 2, 2, 365, 364, 3, 2, 2, 2, 366, 367, 3, 2, 2, 2, 367, 365, 3, 2, 2, 2, 367, 368, 3, 2, 2, 2, 368, 128, 3, 2, 2, 2, 369, 373, 9, 28, 2, 2, 370, 372, 9, 29, 2, 2, 371, 370, 3, 2, 2, 2, 372, 375, 3, 2, 2, 2, 373, 371, 3, 2, 2, 2, 373, 374, 3, 2, 2, 2, 374, 130, 3, 2, 2, 2, 375, 373, 3, 2, 2, 2, 15, 2, 176, 183, 191, 193, 204, 206, 217, 236, 357, 362, 367, 373, 3, 8, 2, 2] \ No newline at end of file diff --git a/packages/ql/src/WebdaQLParserLexer.tokens b/packages/ql/src/WebdaQLParserLexer.tokens index cf8a82415..31ac02aa6 100644 --- a/packages/ql/src/WebdaQLParserLexer.tokens +++ b/packages/ql/src/WebdaQLParserLexer.tokens @@ -42,26 +42,9 @@ FUNCTION_IDENTIFIER_WITH_UNDERSCORE=37 '"'=6 '['=7 ']'=8 -'DELETE'=9 -'UPDATE'=10 -'SELECT'=11 -'SET'=12 -'WHERE'=13 -'AND'=14 -'OR'=15 '='=16 '!='=17 '>'=18 '>='=19 '<'=20 '<='=21 -'LIKE'=22 -'IN'=23 -'CONTAINS'=24 -'TRUE'=25 -'FALSE'=26 -'LIMIT'=27 -'OFFSET'=28 -'ORDER BY'=29 -'ASC'=30 -'DESC'=31 diff --git a/packages/ql/src/WebdaQLParserLexer.ts b/packages/ql/src/WebdaQLParserLexer.ts index fa617e83e..f3921fbcf 100644 --- a/packages/ql/src/WebdaQLParserLexer.ts +++ b/packages/ql/src/WebdaQLParserLexer.ts @@ -62,21 +62,21 @@ export class WebdaQLParserLexer extends Lexer { ]; public static readonly ruleNames: string[] = [ - "SPACE", "ID_LITERAL", "DQUOTA_STRING", "SQUOTA_STRING", "INT_DIGIT", - "FN_LITERAL", "LR_BRACKET", "RR_BRACKET", "COMMA", "SINGLE_QUOTE_SYMB", - "DOUBLE_QUOTE_SYMB", "LR_SQ_BRACKET", "RR_SQ_BRACKET", "QUOTE_SYMB", "DELETE", - "UPDATE", "SELECT", "SET", "WHERE", "AND", "OR", "EQUAL", "NOT_EQUAL", - "GREATER", "GREATER_OR_EQUAL", "LESS", "LESS_OR_EQUAL", "LIKE", "IN", - "CONTAINS", "TRUE", "FALSE", "LIMIT", "OFFSET", "ORDER_BY", "ASC", "DESC", - "DQUOTED_STRING_LITERAL", "SQUOTED_STRING_LITERAL", "INTEGER_LITERAL", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "O", + "P", "R", "S", "T", "U", "W", "Y", "SPACE", "ID_LITERAL", "DQUOTA_STRING", + "SQUOTA_STRING", "INT_DIGIT", "FN_LITERAL", "LR_BRACKET", "RR_BRACKET", + "COMMA", "SINGLE_QUOTE_SYMB", "DOUBLE_QUOTE_SYMB", "LR_SQ_BRACKET", "RR_SQ_BRACKET", + "QUOTE_SYMB", "DELETE", "UPDATE", "SELECT", "SET", "WHERE", "AND", "OR", + "EQUAL", "NOT_EQUAL", "GREATER", "GREATER_OR_EQUAL", "LESS", "LESS_OR_EQUAL", + "LIKE", "IN", "CONTAINS", "TRUE", "FALSE", "LIMIT", "OFFSET", "ORDER_BY", + "ASC", "DESC", "DQUOTED_STRING_LITERAL", "SQUOTED_STRING_LITERAL", "INTEGER_LITERAL", "IDENTIFIER", "IDENTIFIER_WITH_NUMBER", "FUNCTION_IDENTIFIER_WITH_UNDERSCORE", ]; private static readonly _LITERAL_NAMES: Array = [ undefined, undefined, "'('", "')'", "','", "'''", "'\"'", "'['", "']'", - "'DELETE'", "'UPDATE'", "'SELECT'", "'SET'", "'WHERE'", "'AND'", "'OR'", - "'='", "'!='", "'>'", "'>='", "'<'", "'<='", "'LIKE'", "'IN'", "'CONTAINS'", - "'TRUE'", "'FALSE'", "'LIMIT'", "'OFFSET'", "'ORDER BY'", "'ASC'", "'DESC'", + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + "'='", "'!='", "'>'", "'>='", "'<'", "'<='", ]; private static readonly _SYMBOLIC_NAMES: Array = [ undefined, "SPACE", "LR_BRACKET", "RR_BRACKET", "COMMA", "SINGLE_QUOTE_SYMB", @@ -118,7 +118,7 @@ export class WebdaQLParserLexer extends Lexer { public get modeNames(): string[] { return WebdaQLParserLexer.modeNames; } public static readonly _serializedATN: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02\'\u0124\b\x01" + + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02\'\u0178\b\x01" + "\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06" + "\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r" + "\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t" + @@ -126,125 +126,165 @@ export class WebdaQLParserLexer extends Lexer { "\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t" + "\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t" + "\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t)\x04*\t*\x04" + - "+\t+\x04,\t,\x03\x02\x06\x02[\n\x02\r\x02\x0E\x02\\\x03\x02\x03\x02\x03" + - "\x03\x06\x03b\n\x03\r\x03\x0E\x03c\x03\x04\x03\x04\x03\x04\x03\x04\x03" + - "\x04\x03\x04\x07\x04l\n\x04\f\x04\x0E\x04o\v\x04\x03\x04\x03\x04\x03\x05" + - "\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x07\x05y\n\x05\f\x05\x0E\x05" + - "|\v\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03\x07\x03\x07\x07\x07\x84\n" + - "\x07\f\x07\x0E\x07\x87\v\x07\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\v" + - "\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x05\x0F" + - "\x99\n\x0F\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03" + - "\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x12\x03\x12\x03" + - "\x12\x03\x12\x03\x12\x03\x12\x03\x12\x03\x13\x03\x13\x03\x13\x03\x13\x03" + - "\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x15\x03" + - "\x15\x03\x16\x03\x16\x03\x16\x03\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03" + - "\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03" + - "\x1C\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03" + - "\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03" + - " \x03 \x03 \x03 \x03 \x03!\x03!\x03!\x03!\x03!\x03!\x03\"\x03\"\x03\"" + - "\x03\"\x03\"\x03\"\x03#\x03#\x03#\x03#\x03#\x03#\x03#\x03$\x03$\x03$\x03" + - "$\x03$\x03$\x03$\x03$\x03$\x03%\x03%\x03%\x03%\x03&\x03&\x03&\x03&\x03" + - "&\x03\'\x03\'\x03(\x03(\x03)\x06)\u0110\n)\r)\x0E)\u0111\x03*\x06*\u0115" + - "\n*\r*\x0E*\u0116\x03+\x06+\u011A\n+\r+\x0E+\u011B\x03,\x03,\x07,\u0120" + - "\n,\f,\x0E,\u0123\v,\x02\x02\x02-\x03\x02\x03\x05\x02\x02\x07\x02\x02" + - "\t\x02\x02\v\x02\x02\r\x02\x02\x0F\x02\x04\x11\x02\x05\x13\x02\x06\x15" + - "\x02\x07\x17\x02\b\x19\x02\t\x1B\x02\n\x1D\x02\x02\x1F\x02\v!\x02\f#\x02" + - "\r%\x02\x0E\'\x02\x0F)\x02\x10+\x02\x11-\x02\x12/\x02\x131\x02\x143\x02" + - "\x155\x02\x167\x02\x179\x02\x18;\x02\x19=\x02\x1A?\x02\x1BA\x02\x1CC\x02" + - "\x1DE\x02\x1EG\x02\x1FI\x02 K\x02!M\x02\"O\x02#Q\x02$S\x02%U\x02&W\x02" + - "\'\x03\x02\v\x05\x02\v\f\x0F\x0F\"\"\x05\x022;C\\c|\x04\x02$$^^\x04\x02" + - "))^^\x03\x022;\x03\x02C\\\x04\x02C\\aa\x04\x02C\\c|\x07\x02002;C\\aac" + - "|\x02\u012B\x02\x03\x03\x02\x02\x02\x02\x0F\x03\x02\x02\x02\x02\x11\x03" + - "\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17\x03" + - "\x02\x02\x02\x02\x19\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1F\x03" + - "\x02\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02\x02" + - "\x02\x02\'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02" + - "-\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02" + - "\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02" + - "\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03" + - "\x02\x02\x02\x02C\x03\x02\x02\x02\x02E\x03\x02\x02\x02\x02G\x03\x02\x02" + - "\x02\x02I\x03\x02\x02\x02\x02K\x03\x02\x02\x02\x02M\x03\x02\x02\x02\x02" + - "O\x03\x02\x02\x02\x02Q\x03\x02\x02\x02\x02S\x03\x02\x02\x02\x02U\x03\x02" + - "\x02\x02\x02W\x03\x02\x02\x02\x03Z\x03\x02\x02\x02\x05a\x03\x02\x02\x02" + - "\x07e\x03\x02\x02\x02\tr\x03\x02\x02\x02\v\x7F\x03\x02\x02\x02\r\x81\x03" + - "\x02\x02\x02\x0F\x88\x03\x02\x02\x02\x11\x8A\x03\x02\x02\x02\x13\x8C\x03" + - "\x02\x02\x02\x15\x8E\x03\x02\x02\x02\x17\x90\x03\x02\x02\x02\x19\x92\x03" + - "\x02\x02\x02\x1B\x94\x03\x02\x02\x02\x1D\x98\x03\x02\x02\x02\x1F\x9A\x03" + - "\x02\x02\x02!\xA1\x03\x02\x02\x02#\xA8\x03\x02\x02\x02%\xAF\x03\x02\x02" + - "\x02\'\xB3\x03\x02\x02\x02)\xB9\x03\x02\x02\x02+\xBD\x03\x02\x02\x02-" + - "\xC0\x03\x02\x02\x02/\xC2\x03\x02\x02\x021\xC5\x03\x02\x02\x023\xC7\x03" + - "\x02\x02\x025\xCA\x03\x02\x02\x027\xCC\x03\x02\x02\x029\xCF\x03\x02\x02" + - "\x02;\xD4\x03\x02\x02\x02=\xD7\x03\x02\x02\x02?\xE0\x03\x02\x02\x02A\xE5" + - "\x03\x02\x02\x02C\xEB\x03\x02\x02\x02E\xF1\x03\x02\x02\x02G\xF8\x03\x02" + - "\x02\x02I\u0101\x03\x02\x02\x02K\u0105\x03\x02\x02\x02M\u010A\x03\x02" + - "\x02\x02O\u010C\x03\x02\x02\x02Q\u010F\x03\x02\x02\x02S\u0114\x03\x02" + - "\x02\x02U\u0119\x03\x02\x02\x02W\u011D\x03\x02\x02\x02Y[\t\x02\x02\x02" + - "ZY\x03\x02\x02\x02[\\\x03\x02\x02\x02\\Z\x03\x02\x02\x02\\]\x03\x02\x02" + - "\x02]^\x03\x02\x02\x02^_\b\x02\x02\x02_\x04\x03\x02\x02\x02`b\t\x03\x02" + - "\x02a`\x03\x02\x02\x02bc\x03\x02\x02\x02ca\x03\x02\x02\x02cd\x03\x02\x02" + - "\x02d\x06\x03\x02\x02\x02em\x07$\x02\x02fg\x07^\x02\x02gl\v\x02\x02\x02" + - "hi\x07$\x02\x02il\x07$\x02\x02jl\n\x04\x02\x02kf\x03\x02\x02\x02kh\x03" + - "\x02\x02\x02kj\x03\x02\x02\x02lo\x03\x02\x02\x02mk\x03\x02\x02\x02mn\x03" + - "\x02\x02\x02np\x03\x02\x02\x02om\x03\x02\x02\x02pq\x07$\x02\x02q\b\x03" + - "\x02\x02\x02rz\x07)\x02\x02st\x07^\x02\x02ty\v\x02\x02\x02uv\x07)\x02" + - "\x02vy\x07)\x02\x02wy\n\x05\x02\x02xs\x03\x02\x02\x02xu\x03\x02\x02\x02" + - "xw\x03\x02\x02\x02y|\x03\x02\x02\x02zx\x03\x02\x02\x02z{\x03\x02\x02\x02" + - "{}\x03\x02\x02\x02|z\x03\x02\x02\x02}~\x07)\x02\x02~\n\x03\x02\x02\x02" + - "\x7F\x80\t\x06\x02\x02\x80\f\x03\x02\x02\x02\x81\x85\t\x07\x02\x02\x82" + - "\x84\t\b\x02\x02\x83\x82\x03\x02\x02\x02\x84\x87\x03\x02\x02\x02\x85\x83" + - "\x03\x02\x02\x02\x85\x86\x03\x02\x02\x02\x86\x0E\x03\x02\x02\x02\x87\x85" + - "\x03\x02\x02\x02\x88\x89\x07*\x02\x02\x89\x10\x03\x02\x02\x02\x8A\x8B" + - "\x07+\x02\x02\x8B\x12\x03\x02\x02\x02\x8C\x8D\x07.\x02\x02\x8D\x14\x03" + - "\x02\x02\x02\x8E\x8F\x07)\x02\x02\x8F\x16\x03\x02\x02\x02\x90\x91\x07" + - "$\x02\x02\x91\x18\x03\x02\x02\x02\x92\x93\x07]\x02\x02\x93\x1A\x03\x02" + - "\x02\x02\x94\x95\x07_\x02\x02\x95\x1C\x03\x02\x02\x02\x96\x99\x05\x15" + - "\v\x02\x97\x99\x05\x17\f\x02\x98\x96\x03\x02\x02\x02\x98\x97\x03\x02\x02" + - "\x02\x99\x1E\x03\x02\x02\x02\x9A\x9B\x07F\x02\x02\x9B\x9C\x07G\x02\x02" + - "\x9C\x9D\x07N\x02\x02\x9D\x9E\x07G\x02\x02\x9E\x9F\x07V\x02\x02\x9F\xA0" + - "\x07G\x02\x02\xA0 \x03\x02\x02\x02\xA1\xA2\x07W\x02\x02\xA2\xA3\x07R\x02" + - "\x02\xA3\xA4\x07F\x02\x02\xA4\xA5\x07C\x02\x02\xA5\xA6\x07V\x02\x02\xA6" + - "\xA7\x07G\x02\x02\xA7\"\x03\x02\x02\x02\xA8\xA9\x07U\x02\x02\xA9\xAA\x07" + - "G\x02\x02\xAA\xAB\x07N\x02\x02\xAB\xAC\x07G\x02\x02\xAC\xAD\x07E\x02\x02" + - "\xAD\xAE\x07V\x02\x02\xAE$\x03\x02\x02\x02\xAF\xB0\x07U\x02\x02\xB0\xB1" + - "\x07G\x02\x02\xB1\xB2\x07V\x02\x02\xB2&\x03\x02\x02\x02\xB3\xB4\x07Y\x02" + - "\x02\xB4\xB5\x07J\x02\x02\xB5\xB6\x07G\x02\x02\xB6\xB7\x07T\x02\x02\xB7" + - "\xB8\x07G\x02\x02\xB8(\x03\x02\x02\x02\xB9\xBA\x07C\x02\x02\xBA\xBB\x07" + - "P\x02\x02\xBB\xBC\x07F\x02\x02\xBC*\x03\x02\x02\x02\xBD\xBE\x07Q\x02\x02" + - "\xBE\xBF\x07T\x02\x02\xBF,\x03\x02\x02\x02\xC0\xC1\x07?\x02\x02\xC1.\x03" + - "\x02\x02\x02\xC2\xC3\x07#\x02\x02\xC3\xC4\x07?\x02\x02\xC40\x03\x02\x02" + - "\x02\xC5\xC6\x07@\x02\x02\xC62\x03\x02\x02\x02\xC7\xC8\x07@\x02\x02\xC8" + - "\xC9\x07?\x02\x02\xC94\x03\x02\x02\x02\xCA\xCB\x07>\x02\x02\xCB6\x03\x02" + - "\x02\x02\xCC\xCD\x07>\x02\x02\xCD\xCE\x07?\x02\x02\xCE8\x03\x02\x02\x02" + - "\xCF\xD0\x07N\x02\x02\xD0\xD1\x07K\x02\x02\xD1\xD2\x07M\x02\x02\xD2\xD3" + - "\x07G\x02\x02\xD3:\x03\x02\x02\x02\xD4\xD5\x07K\x02\x02\xD5\xD6\x07P\x02" + - "\x02\xD6<\x03\x02\x02\x02\xD7\xD8\x07E\x02\x02\xD8\xD9\x07Q\x02\x02\xD9" + - "\xDA\x07P\x02\x02\xDA\xDB\x07V\x02\x02\xDB\xDC\x07C\x02\x02\xDC\xDD\x07" + - "K\x02\x02\xDD\xDE\x07P\x02\x02\xDE\xDF\x07U\x02\x02\xDF>\x03\x02\x02\x02" + - "\xE0\xE1\x07V\x02\x02\xE1\xE2\x07T\x02\x02\xE2\xE3\x07W\x02\x02\xE3\xE4" + - "\x07G\x02\x02\xE4@\x03\x02\x02\x02\xE5\xE6\x07H\x02\x02\xE6\xE7\x07C\x02" + - "\x02\xE7\xE8\x07N\x02\x02\xE8\xE9\x07U\x02\x02\xE9\xEA\x07G\x02\x02\xEA" + - "B\x03\x02\x02\x02\xEB\xEC\x07N\x02\x02\xEC\xED\x07K\x02\x02\xED\xEE\x07" + - "O\x02\x02\xEE\xEF\x07K\x02\x02\xEF\xF0\x07V\x02\x02\xF0D\x03\x02\x02\x02" + - "\xF1\xF2\x07Q\x02\x02\xF2\xF3\x07H\x02\x02\xF3\xF4\x07H\x02\x02\xF4\xF5" + - "\x07U\x02\x02\xF5\xF6\x07G\x02\x02\xF6\xF7\x07V\x02\x02\xF7F\x03\x02\x02" + - "\x02\xF8\xF9\x07Q\x02\x02\xF9\xFA\x07T\x02\x02\xFA\xFB\x07F\x02\x02\xFB" + - "\xFC\x07G\x02\x02\xFC\xFD\x07T\x02\x02\xFD\xFE\x07\"\x02\x02\xFE\xFF\x07" + - "D\x02\x02\xFF\u0100\x07[\x02\x02\u0100H\x03\x02\x02\x02\u0101\u0102\x07" + - "C\x02\x02\u0102\u0103\x07U\x02\x02\u0103\u0104\x07E\x02\x02\u0104J\x03" + - "\x02\x02\x02\u0105\u0106\x07F\x02\x02\u0106\u0107\x07G\x02\x02\u0107\u0108" + - "\x07U\x02\x02\u0108\u0109\x07E\x02\x02\u0109L\x03\x02\x02\x02\u010A\u010B" + - "\x05\x07\x04\x02\u010BN\x03\x02\x02\x02\u010C\u010D\x05\t\x05\x02\u010D" + - "P\x03\x02\x02\x02\u010E\u0110\x05\v\x06\x02\u010F\u010E\x03\x02\x02\x02" + - "\u0110\u0111\x03\x02\x02\x02\u0111\u010F\x03\x02\x02\x02\u0111\u0112\x03" + - "\x02\x02\x02\u0112R\x03\x02\x02\x02\u0113\u0115\t\t\x02\x02\u0114\u0113" + - "\x03\x02\x02\x02\u0115\u0116\x03\x02\x02\x02\u0116\u0114\x03\x02\x02\x02" + - "\u0116\u0117\x03\x02\x02\x02\u0117T\x03\x02\x02\x02\u0118\u011A\t\n\x02" + - "\x02\u0119\u0118\x03\x02\x02\x02\u011A\u011B\x03\x02\x02\x02\u011B\u0119" + - "\x03\x02\x02\x02\u011B\u011C\x03\x02\x02\x02\u011CV\x03\x02\x02\x02\u011D" + - "\u0121\t\x07\x02\x02\u011E\u0120\t\b\x02\x02\u011F\u011E\x03\x02\x02\x02" + - "\u0120\u0123\x03\x02\x02\x02\u0121\u011F\x03\x02\x02\x02\u0121\u0122\x03" + - "\x02\x02\x02\u0122X\x03\x02\x02\x02\u0123\u0121\x03\x02\x02\x02\x0F\x02" + - "\\ckmxz\x85\x98\u0111\u0116\u011B\u0121\x03\b\x02\x02"; + "+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x042\t2\x043\t3\x04" + + "4\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04;\t;\x04<\t<\x04" + + "=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x03\x02\x03\x02\x03\x03\x03\x03\x03" + + "\x04\x03\x04\x03\x05\x03\x05\x03\x06\x03\x06\x03\x07\x03\x07\x03\b\x03" + + "\b\x03\t\x03\t\x03\n\x03\n\x03\v\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E" + + "\x03\x0E\x03\x0F\x03\x0F\x03\x10\x03\x10\x03\x11\x03\x11\x03\x12\x03\x12" + + "\x03\x13\x03\x13\x03\x14\x03\x14\x03\x15\x03\x15\x03\x16\x03\x16\x03\x17" + + "\x06\x17\xAF\n\x17\r\x17\x0E\x17\xB0\x03\x17\x03\x17\x03\x18\x06\x18\xB6" + + "\n\x18\r\x18\x0E\x18\xB7\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19" + + "\x07\x19\xC0\n\x19\f\x19\x0E\x19\xC3\v\x19\x03\x19\x03\x19\x03\x1A\x03" + + "\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x07\x1A\xCD\n\x1A\f\x1A\x0E\x1A\xD0" + + "\v\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x07\x1C\xD8\n\x1C" + + "\f\x1C\x0E\x1C\xDB\v\x1C\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1F\x03\x1F" + + "\x03 \x03 \x03!\x03!\x03\"\x03\"\x03#\x03#\x03$\x03$\x05$\xED\n$\x03%" + + "\x03%\x03%\x03%\x03%\x03%\x03%\x03&\x03&\x03&\x03&\x03&\x03&\x03&\x03" + + "\'\x03\'\x03\'\x03\'\x03\'\x03\'\x03\'\x03(\x03(\x03(\x03(\x03)\x03)\x03" + + ")\x03)\x03)\x03)\x03*\x03*\x03*\x03*\x03+\x03+\x03+\x03,\x03,\x03-\x03" + + "-\x03-\x03.\x03.\x03/\x03/\x03/\x030\x030\x031\x031\x031\x032\x032\x03" + + "2\x032\x032\x033\x033\x033\x034\x034\x034\x034\x034\x034\x034\x034\x03" + + "4\x035\x035\x035\x035\x035\x036\x036\x036\x036\x036\x036\x037\x037\x03" + + "7\x037\x037\x037\x038\x038\x038\x038\x038\x038\x038\x039\x039\x039\x03" + + "9\x039\x039\x039\x039\x039\x03:\x03:\x03:\x03:\x03;\x03;\x03;\x03;\x03" + + ";\x03<\x03<\x03=\x03=\x03>\x06>\u0164\n>\r>\x0E>\u0165\x03?\x06?\u0169" + + "\n?\r?\x0E?\u016A\x03@\x06@\u016E\n@\r@\x0E@\u016F\x03A\x03A\x07A\u0174" + + "\nA\fA\x0EA\u0177\vA\x02\x02\x02B\x03\x02\x02\x05\x02\x02\x07\x02\x02" + + "\t\x02\x02\v\x02\x02\r\x02\x02\x0F\x02\x02\x11\x02\x02\x13\x02\x02\x15" + + "\x02\x02\x17\x02\x02\x19\x02\x02\x1B\x02\x02\x1D\x02\x02\x1F\x02\x02!" + + "\x02\x02#\x02\x02%\x02\x02\'\x02\x02)\x02\x02+\x02\x02-\x02\x03/\x02\x02" + + "1\x02\x023\x02\x025\x02\x027\x02\x029\x02\x04;\x02\x05=\x02\x06?\x02\x07" + + "A\x02\bC\x02\tE\x02\nG\x02\x02I\x02\vK\x02\fM\x02\rO\x02\x0EQ\x02\x0F" + + "S\x02\x10U\x02\x11W\x02\x12Y\x02\x13[\x02\x14]\x02\x15_\x02\x16a\x02\x17" + + "c\x02\x18e\x02\x19g\x02\x1Ai\x02\x1Bk\x02\x1Cm\x02\x1Do\x02\x1Eq\x02\x1F" + + "s\x02 u\x02!w\x02\"y\x02#{\x02$}\x02%\x7F\x02&\x81\x02\'\x03\x02 \x04" + + "\x02CCcc\x04\x02DDdd\x04\x02EEee\x04\x02FFff\x04\x02GGgg\x04\x02HHhh\x04" + + "\x02IIii\x04\x02JJjj\x04\x02KKkk\x04\x02MMmm\x04\x02NNnn\x04\x02OOoo\x04" + + "\x02PPpp\x04\x02QQqq\x04\x02RRrr\x04\x02TTtt\x04\x02UUuu\x04\x02VVvv\x04" + + "\x02WWww\x04\x02YYyy\x04\x02[[{{\x05\x02\v\f\x0F\x0F\"\"\x05\x022;C\\" + + "c|\x04\x02$$^^\x04\x02))^^\x03\x022;\x03\x02C\\\x04\x02C\\aa\x04\x02C" + + "\\c|\x07\x02002;C\\aac|\x02\u016A\x02-\x03\x02\x02\x02\x029\x03\x02\x02" + + "\x02\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x02" + + "A\x03\x02\x02\x02\x02C\x03\x02\x02\x02\x02E\x03\x02\x02\x02\x02I\x03\x02" + + "\x02\x02\x02K\x03\x02\x02\x02\x02M\x03\x02\x02\x02\x02O\x03\x02\x02\x02" + + "\x02Q\x03\x02\x02\x02\x02S\x03\x02\x02\x02\x02U\x03\x02\x02\x02\x02W\x03" + + "\x02\x02\x02\x02Y\x03\x02\x02\x02\x02[\x03\x02\x02\x02\x02]\x03\x02\x02" + + "\x02\x02_\x03\x02\x02\x02\x02a\x03\x02\x02\x02\x02c\x03\x02\x02\x02\x02" + + "e\x03\x02\x02\x02\x02g\x03\x02\x02\x02\x02i\x03\x02\x02\x02\x02k\x03\x02" + + "\x02\x02\x02m\x03\x02\x02\x02\x02o\x03\x02\x02\x02\x02q\x03\x02\x02\x02" + + "\x02s\x03\x02\x02\x02\x02u\x03\x02\x02\x02\x02w\x03\x02\x02\x02\x02y\x03" + + "\x02\x02\x02\x02{\x03\x02\x02\x02\x02}\x03\x02\x02\x02\x02\x7F\x03\x02" + + "\x02\x02\x02\x81\x03\x02\x02\x02\x03\x83\x03\x02\x02\x02\x05\x85\x03\x02" + + "\x02\x02\x07\x87\x03\x02\x02\x02\t\x89\x03\x02\x02\x02\v\x8B\x03\x02\x02" + + "\x02\r\x8D\x03\x02\x02\x02\x0F\x8F\x03\x02\x02\x02\x11\x91\x03\x02\x02" + + "\x02\x13\x93\x03\x02\x02\x02\x15\x95\x03\x02\x02\x02\x17\x97\x03\x02\x02" + + "\x02\x19\x99\x03\x02\x02\x02\x1B\x9B\x03\x02\x02\x02\x1D\x9D\x03\x02\x02" + + "\x02\x1F\x9F\x03\x02\x02\x02!\xA1\x03\x02\x02\x02#\xA3\x03\x02\x02\x02" + + "%\xA5\x03\x02\x02\x02\'\xA7\x03\x02\x02\x02)\xA9\x03\x02\x02\x02+\xAB" + + "\x03\x02\x02\x02-\xAE\x03\x02\x02\x02/\xB5\x03\x02\x02\x021\xB9\x03\x02" + + "\x02\x023\xC6\x03\x02\x02\x025\xD3\x03\x02\x02\x027\xD5\x03\x02\x02\x02" + + "9\xDC\x03\x02\x02\x02;\xDE\x03\x02\x02\x02=\xE0\x03\x02\x02\x02?\xE2\x03" + + "\x02\x02\x02A\xE4\x03\x02\x02\x02C\xE6\x03\x02\x02\x02E\xE8\x03\x02\x02" + + "\x02G\xEC\x03\x02\x02\x02I\xEE\x03\x02\x02\x02K\xF5\x03\x02\x02\x02M\xFC" + + "\x03\x02\x02\x02O\u0103\x03\x02\x02\x02Q\u0107\x03\x02\x02\x02S\u010D" + + "\x03\x02\x02\x02U\u0111\x03\x02\x02\x02W\u0114\x03\x02\x02\x02Y\u0116" + + "\x03\x02\x02\x02[\u0119\x03\x02\x02\x02]\u011B\x03\x02\x02\x02_\u011E" + + "\x03\x02\x02\x02a\u0120\x03\x02\x02\x02c\u0123\x03\x02\x02\x02e\u0128" + + "\x03\x02\x02\x02g\u012B\x03\x02\x02\x02i\u0134\x03\x02\x02\x02k\u0139" + + "\x03\x02\x02\x02m\u013F\x03\x02\x02\x02o\u0145\x03\x02\x02\x02q\u014C" + + "\x03\x02\x02\x02s\u0155\x03\x02\x02\x02u\u0159\x03\x02\x02\x02w\u015E" + + "\x03\x02\x02\x02y\u0160\x03\x02\x02\x02{\u0163\x03\x02\x02\x02}\u0168" + + "\x03\x02\x02\x02\x7F\u016D\x03\x02\x02\x02\x81\u0171\x03\x02\x02\x02\x83" + + "\x84\t\x02\x02\x02\x84\x04\x03\x02\x02\x02\x85\x86\t\x03\x02\x02\x86\x06" + + "\x03\x02\x02\x02\x87\x88\t\x04\x02\x02\x88\b\x03\x02\x02\x02\x89\x8A\t" + + "\x05\x02\x02\x8A\n\x03\x02\x02\x02\x8B\x8C\t\x06\x02\x02\x8C\f\x03\x02" + + "\x02\x02\x8D\x8E\t\x07\x02\x02\x8E\x0E\x03\x02\x02\x02\x8F\x90\t\b\x02" + + "\x02\x90\x10\x03\x02\x02\x02\x91\x92\t\t\x02\x02\x92\x12\x03\x02\x02\x02" + + "\x93\x94\t\n\x02\x02\x94\x14\x03\x02\x02\x02\x95\x96\t\v\x02\x02\x96\x16" + + "\x03\x02\x02\x02\x97\x98\t\f\x02\x02\x98\x18\x03\x02\x02\x02\x99\x9A\t" + + "\r\x02\x02\x9A\x1A\x03\x02\x02\x02\x9B\x9C\t\x0E\x02\x02\x9C\x1C\x03\x02" + + "\x02\x02\x9D\x9E\t\x0F\x02\x02\x9E\x1E\x03\x02\x02\x02\x9F\xA0\t\x10\x02" + + "\x02\xA0 \x03\x02\x02\x02\xA1\xA2\t\x11\x02\x02\xA2\"\x03\x02\x02\x02" + + "\xA3\xA4\t\x12\x02\x02\xA4$\x03\x02\x02\x02\xA5\xA6\t\x13\x02\x02\xA6" + + "&\x03\x02\x02\x02\xA7\xA8\t\x14\x02\x02\xA8(\x03\x02\x02\x02\xA9\xAA\t" + + "\x15\x02\x02\xAA*\x03\x02\x02\x02\xAB\xAC\t\x16\x02\x02\xAC,\x03\x02\x02" + + "\x02\xAD\xAF\t\x17\x02\x02\xAE\xAD\x03\x02\x02\x02\xAF\xB0\x03\x02\x02" + + "\x02\xB0\xAE\x03\x02\x02\x02\xB0\xB1\x03\x02\x02\x02\xB1\xB2\x03\x02\x02" + + "\x02\xB2\xB3\b\x17\x02\x02\xB3.\x03\x02\x02\x02\xB4\xB6\t\x18\x02\x02" + + "\xB5\xB4\x03\x02\x02\x02\xB6\xB7\x03\x02\x02\x02\xB7\xB5\x03\x02\x02\x02" + + "\xB7\xB8\x03\x02\x02\x02\xB80\x03\x02\x02\x02\xB9\xC1\x07$\x02\x02\xBA" + + "\xBB\x07^\x02\x02\xBB\xC0\v\x02\x02\x02\xBC\xBD\x07$\x02\x02\xBD\xC0\x07" + + "$\x02\x02\xBE\xC0\n\x19\x02\x02\xBF\xBA\x03\x02\x02\x02\xBF\xBC\x03\x02" + + "\x02\x02\xBF\xBE\x03\x02\x02\x02\xC0\xC3\x03\x02\x02\x02\xC1\xBF\x03\x02" + + "\x02\x02\xC1\xC2\x03\x02\x02\x02\xC2\xC4\x03\x02\x02\x02\xC3\xC1\x03\x02" + + "\x02\x02\xC4\xC5\x07$\x02\x02\xC52\x03\x02\x02\x02\xC6\xCE\x07)\x02\x02" + + "\xC7\xC8\x07^\x02\x02\xC8\xCD\v\x02\x02\x02\xC9\xCA\x07)\x02\x02\xCA\xCD" + + "\x07)\x02\x02\xCB\xCD\n\x1A\x02\x02\xCC\xC7\x03\x02\x02\x02\xCC\xC9\x03" + + "\x02\x02\x02\xCC\xCB\x03\x02\x02\x02\xCD\xD0\x03\x02\x02\x02\xCE\xCC\x03" + + "\x02\x02\x02\xCE\xCF\x03\x02\x02\x02\xCF\xD1\x03\x02\x02\x02\xD0\xCE\x03" + + "\x02\x02\x02\xD1\xD2\x07)\x02\x02\xD24\x03\x02\x02\x02\xD3\xD4\t\x1B\x02" + + "\x02\xD46\x03\x02\x02\x02\xD5\xD9\t\x1C\x02\x02\xD6\xD8\t\x1D\x02\x02" + + "\xD7\xD6\x03\x02\x02\x02\xD8\xDB\x03\x02\x02\x02\xD9\xD7\x03\x02\x02\x02" + + "\xD9\xDA\x03\x02\x02\x02\xDA8\x03\x02\x02\x02\xDB\xD9\x03\x02\x02\x02" + + "\xDC\xDD\x07*\x02\x02\xDD:\x03\x02\x02\x02\xDE\xDF\x07+\x02\x02\xDF<\x03" + + "\x02\x02\x02\xE0\xE1\x07.\x02\x02\xE1>\x03\x02\x02\x02\xE2\xE3\x07)\x02" + + "\x02\xE3@\x03\x02\x02\x02\xE4\xE5\x07$\x02\x02\xE5B\x03\x02\x02\x02\xE6" + + "\xE7\x07]\x02\x02\xE7D\x03\x02\x02\x02\xE8\xE9\x07_\x02\x02\xE9F\x03\x02" + + "\x02\x02\xEA\xED\x05? \x02\xEB\xED\x05A!\x02\xEC\xEA\x03\x02\x02\x02\xEC" + + "\xEB\x03\x02\x02\x02\xEDH\x03\x02\x02\x02\xEE\xEF\x05\t\x05\x02\xEF\xF0" + + "\x05\v\x06\x02\xF0\xF1\x05\x17\f\x02\xF1\xF2\x05\v\x06\x02\xF2\xF3\x05" + + "%\x13\x02\xF3\xF4\x05\v\x06\x02\xF4J\x03\x02\x02\x02\xF5\xF6\x05\'\x14" + + "\x02\xF6\xF7\x05\x1F\x10\x02\xF7\xF8\x05\t\x05\x02\xF8\xF9\x05\x03\x02" + + "\x02\xF9\xFA\x05%\x13\x02\xFA\xFB\x05\v\x06\x02\xFBL\x03\x02\x02\x02\xFC" + + "\xFD\x05#\x12\x02\xFD\xFE\x05\v\x06\x02\xFE\xFF\x05\x17\f\x02\xFF\u0100" + + "\x05\v\x06\x02\u0100\u0101\x05\x07\x04\x02\u0101\u0102\x05%\x13\x02\u0102" + + "N\x03\x02\x02\x02\u0103\u0104\x05#\x12\x02\u0104\u0105\x05\v\x06\x02\u0105" + + "\u0106\x05%\x13\x02\u0106P\x03\x02\x02\x02\u0107\u0108\x05)\x15\x02\u0108" + + "\u0109\x05\x11\t\x02\u0109\u010A\x05\v\x06\x02\u010A\u010B\x05!\x11\x02" + + "\u010B\u010C\x05\v\x06\x02\u010CR\x03\x02\x02\x02\u010D\u010E\x05\x03" + + "\x02\x02\u010E\u010F\x05\x1B\x0E\x02\u010F\u0110\x05\t\x05\x02\u0110T" + + "\x03\x02\x02\x02\u0111\u0112\x05\x1D\x0F\x02\u0112\u0113\x05!\x11\x02" + + "\u0113V\x03\x02\x02\x02\u0114\u0115\x07?\x02\x02\u0115X\x03\x02\x02\x02" + + "\u0116\u0117\x07#\x02\x02\u0117\u0118\x07?\x02\x02\u0118Z\x03\x02\x02" + + "\x02\u0119\u011A\x07@\x02\x02\u011A\\\x03\x02\x02\x02\u011B\u011C\x07" + + "@\x02\x02\u011C\u011D\x07?\x02\x02\u011D^\x03\x02\x02\x02\u011E\u011F" + + "\x07>\x02\x02\u011F`\x03\x02\x02\x02\u0120\u0121\x07>\x02\x02\u0121\u0122" + + "\x07?\x02\x02\u0122b\x03\x02\x02\x02\u0123\u0124\x05\x17\f\x02\u0124\u0125" + + "\x05\x13\n\x02\u0125\u0126\x05\x15\v\x02\u0126\u0127\x05\v\x06\x02\u0127" + + "d\x03\x02\x02\x02\u0128\u0129\x05\x13\n\x02\u0129\u012A\x05\x1B\x0E\x02" + + "\u012Af\x03\x02\x02\x02\u012B\u012C\x05\x07\x04\x02\u012C\u012D\x05\x1D" + + "\x0F\x02\u012D\u012E\x05\x1B\x0E\x02\u012E\u012F\x05%\x13\x02\u012F\u0130" + + "\x05\x03\x02\x02\u0130\u0131\x05\x13\n\x02\u0131\u0132\x05\x1B\x0E\x02" + + "\u0132\u0133\x05#\x12\x02\u0133h\x03\x02\x02\x02\u0134\u0135\x05%\x13" + + "\x02\u0135\u0136\x05!\x11\x02\u0136\u0137\x05\'\x14\x02\u0137\u0138\x05" + + "\v\x06\x02\u0138j\x03\x02\x02\x02\u0139\u013A\x05\r\x07\x02\u013A\u013B" + + "\x05\x03\x02\x02\u013B\u013C\x05\x17\f\x02\u013C\u013D\x05#\x12\x02\u013D" + + "\u013E\x05\v\x06\x02\u013El\x03\x02\x02\x02\u013F\u0140\x05\x17\f\x02" + + "\u0140\u0141\x05\x13\n\x02\u0141\u0142\x05\x19\r\x02\u0142\u0143\x05\x13" + + "\n\x02\u0143\u0144\x05%\x13\x02\u0144n\x03\x02\x02\x02\u0145\u0146\x05" + + "\x1D\x0F\x02\u0146\u0147\x05\r\x07\x02\u0147\u0148\x05\r\x07\x02\u0148" + + "\u0149\x05#\x12\x02\u0149\u014A\x05\v\x06\x02\u014A\u014B\x05%\x13\x02" + + "\u014Bp\x03\x02\x02\x02\u014C\u014D\x05\x1D\x0F\x02\u014D\u014E\x05!\x11" + + "\x02\u014E\u014F\x05\t\x05\x02\u014F\u0150\x05\v\x06\x02\u0150\u0151\x05" + + "!\x11\x02\u0151\u0152\x07\"\x02\x02\u0152\u0153\x05\x05\x03\x02\u0153" + + "\u0154\x05+\x16\x02\u0154r\x03\x02\x02\x02\u0155\u0156\x05\x03\x02\x02" + + "\u0156\u0157\x05#\x12\x02\u0157\u0158\x05\x07\x04\x02\u0158t\x03\x02\x02" + + "\x02\u0159\u015A\x05\t\x05\x02\u015A\u015B\x05\v\x06\x02\u015B\u015C\x05" + + "#\x12\x02\u015C\u015D\x05\x07\x04\x02\u015Dv\x03\x02\x02\x02\u015E\u015F" + + "\x051\x19\x02\u015Fx\x03\x02\x02\x02\u0160\u0161\x053\x1A\x02\u0161z\x03" + + "\x02\x02\x02\u0162\u0164\x055\x1B\x02\u0163\u0162\x03\x02\x02\x02\u0164" + + "\u0165\x03\x02\x02\x02\u0165\u0163\x03\x02\x02\x02\u0165\u0166\x03\x02" + + "\x02\x02\u0166|\x03\x02\x02\x02\u0167\u0169\t\x1E\x02\x02\u0168\u0167" + + "\x03\x02\x02\x02\u0169\u016A\x03\x02\x02\x02\u016A\u0168\x03\x02\x02\x02" + + "\u016A\u016B\x03\x02\x02\x02\u016B~\x03\x02\x02\x02\u016C\u016E\t\x1F" + + "\x02\x02\u016D\u016C\x03\x02\x02\x02\u016E\u016F\x03\x02\x02\x02\u016F" + + "\u016D\x03\x02\x02\x02\u016F\u0170\x03\x02\x02\x02\u0170\x80\x03\x02\x02" + + "\x02\u0171\u0175\t\x1C\x02\x02\u0172\u0174\t\x1D\x02\x02\u0173\u0172\x03" + + "\x02\x02\x02\u0174\u0177\x03\x02\x02\x02\u0175\u0173\x03\x02\x02\x02\u0175" + + "\u0176\x03\x02\x02\x02\u0176\x82\x03\x02\x02\x02\u0177\u0175\x03\x02\x02" + + "\x02\x0F\x02\xB0\xB7\xBF\xC1\xCC\xCE\xD9\xEC\u0165\u016A\u016F\u0175\x03" + + "\b\x02\x02"; public static __ATN: ATN; public static get _ATN(): ATN { if (!WebdaQLParserLexer.__ATN) { diff --git a/packages/ql/src/WebdaQLParserParser.ts b/packages/ql/src/WebdaQLParserParser.ts index 81c569a40..dd5917b57 100644 --- a/packages/ql/src/WebdaQLParserParser.ts +++ b/packages/ql/src/WebdaQLParserParser.ts @@ -93,9 +93,8 @@ export class WebdaQLParserParser extends Parser { private static readonly _LITERAL_NAMES: Array = [ undefined, undefined, "'('", "')'", "','", "'''", "'\"'", "'['", "']'", - "'DELETE'", "'UPDATE'", "'SELECT'", "'SET'", "'WHERE'", "'AND'", "'OR'", - "'='", "'!='", "'>'", "'>='", "'<'", "'<='", "'LIKE'", "'IN'", "'CONTAINS'", - "'TRUE'", "'FALSE'", "'LIMIT'", "'OFFSET'", "'ORDER BY'", "'ASC'", "'DESC'", + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + "'='", "'!='", "'>'", "'>='", "'<'", "'<='", ]; private static readonly _SYMBOLIC_NAMES: Array = [ undefined, "SPACE", "LR_BRACKET", "RR_BRACKET", "COMMA", "SINGLE_QUOTE_SYMB", diff --git a/packages/ql/src/query.spec.ts b/packages/ql/src/query.spec.ts index 9abb28551..70990b365 100644 --- a/packages/ql/src/query.spec.ts +++ b/packages/ql/src/query.spec.ts @@ -436,6 +436,45 @@ class QueryTest { // lowercase boolean values in assignments const q5 = WebdaQL.parse("UPDATE SET active = false WHERE id = 1"); assert.deepStrictEqual(q5.assignments, [{ field: "active", value: false }]); + + // UPPERCASE keywords + const q6 = WebdaQL.parse("DELETE WHERE status = 'old'"); + assert.strictEqual(q6.type, "DELETE"); + const q7 = WebdaQL.parse("UPDATE SET status = 'active' WHERE name = 'John'"); + assert.strictEqual(q7.type, "UPDATE"); + const q8 = WebdaQL.parse("SELECT name, age WHERE status = 'active'"); + assert.strictEqual(q8.type, "SELECT"); + + // lowercase filter keywords + const q9 = new WebdaQL.QueryValidator("status = 'active' and age > 18"); + assert.ok(q9.getExpression().eval({ status: "active", age: 20 })); + const q10 = new WebdaQL.QueryValidator("status = 'active' or age > 18"); + assert.ok(q10.getExpression().eval({ age: 20 })); + + // lowercase like, in, contains + const q11 = new WebdaQL.QueryValidator("name like 'Jo%'"); + assert.ok(q11.getExpression().eval({ name: "John" })); + const q12 = new WebdaQL.QueryValidator("status in ['active', 'pending']"); + assert.ok(q12.getExpression().eval({ status: "active" })); + const q13 = new WebdaQL.QueryValidator("tags contains 'vip'"); + assert.ok(q13.getExpression().eval({ tags: ["vip", "premium"] })); + + // lowercase order by, limit, offset + const q14 = WebdaQL.parse("SELECT name WHERE status = 'active' order by name asc limit 5 offset 'tok'"); + assert.strictEqual(q14.type, "SELECT"); + assert.strictEqual(q14.limit, 5); + assert.strictEqual(q14.continuationToken, "tok"); + assert.deepStrictEqual(q14.orderBy, [{ field: "name", direction: "ASC" }]); + + // lowercase desc + const q15 = WebdaQL.parse("SELECT name WHERE status = 'active' order by name desc"); + assert.deepStrictEqual(q15.orderBy, [{ field: "name", direction: "DESC" }]); + + // lowercase true/false in filters + const q16 = new WebdaQL.QueryValidator("active = true"); + assert.ok(q16.getExpression().eval({ active: true })); + const q17 = new WebdaQL.QueryValidator("active = false"); + assert.ok(q17.getExpression().eval({ active: false })); } @test diff --git a/packages/ql/src/query.ts b/packages/ql/src/query.ts index bc53bc59f..5e691b554 100644 --- a/packages/ql/src/query.ts +++ b/packages/ql/src/query.ts @@ -127,7 +127,7 @@ export class ExpressionBuilder extends AbstractParseTreeVisitor implement visitOrderFieldExpression(ctx: OrderFieldExpressionContext): OrderBy { return { field: ctx.getChild(0).text, - direction: ctx.childCount > 1 ? ctx.getChild(1).text : "ASC" + direction: ctx.childCount > 1 ? <"ASC" | "DESC">ctx.getChild(1).text.toUpperCase() : "ASC" }; } @@ -368,7 +368,7 @@ export class ExpressionBuilder extends AbstractParseTreeVisitor implement * Read the boolean literal */ visitBooleanLiteral(ctx: BooleanLiteralContext): boolean { - return "TRUE" === ctx.text; + return "TRUE" === ctx.text.toUpperCase(); } /** @@ -1131,58 +1131,6 @@ function formatValue(v: value): string { return String(v); } -/** - * Keywords that should be uppercased before passing to the case-sensitive ANTLR lexer. - * Sorted longest-first so that "ORDER BY" matches before "OR". - */ -const KEYWORDS = [ - "ORDER BY", "DELETE", "UPDATE", "SELECT", "WHERE", "LIMIT", "OFFSET", - "CONTAINS", "FALSE", "LIKE", "TRUE", "AND", "ASC", "DESC", "SET", "IN", "OR" -]; - -/** - * Uppercase all known WebdaQL keywords in a query string, while preserving - * the original case of identifiers and string literals. - */ -function uppercaseKeywords(query: string): string { - let result = ""; - let inSingle = false; - let inDouble = false; - for (let i = 0; i < query.length; i++) { - const ch = query[i]; - if (ch === "'" && !inDouble) { - inSingle = !inSingle; - result += ch; - continue; - } - if (ch === '"' && !inSingle) { - inDouble = !inDouble; - result += ch; - continue; - } - if (inSingle || inDouble) { - result += ch; - continue; - } - let matched = false; - for (const kw of KEYWORDS) { - if ( - query.substring(i, i + kw.length).toUpperCase() === kw && - (i === 0 || /[\s(]/.test(query[i - 1])) && - (i + kw.length === query.length || /[\s(]/.test(query[i + kw.length])) - ) { - result += kw; - i += kw.length - 1; - matched = true; - break; - } - } - if (!matched) { - result += ch; - } - } - return result; -} /** * Validate that all fields and assignment targets in a query are within the allowed set. @@ -1228,8 +1176,7 @@ export function validateQueryFields(query: Query, allowedFields: string[]): void * @returns parsed Query object */ export function parse(query: string, allowedFields?: string[]): Query { - const normalized = uppercaseKeywords(query); - const result = new QueryValidator(normalized).getQuery(); + const result = new QueryValidator(query).getQuery(); if (allowedFields) { validateQueryFields(result, allowedFields); } From bab27a19d3c6a1e64252dcb5397c9aefe0eb58d0 Mon Sep 17 00:00:00 2001 From: Yann-Gael Gautheron Date: Tue, 31 Mar 2026 14:23:03 -0700 Subject: [PATCH 7/7] refactor: remove implicit SELECT detection and update tests for explicit SELECT handling --- packages/ql-ts-plugin/src/parser.spec.ts | 16 ++++------- packages/ql-ts-plugin/src/parser.ts | 32 ---------------------- packages/ql/src/WebdaQLLexer.ts | 19 +++++++------ packages/ql/src/WebdaQLParserLexer.ts | 17 +++++++----- packages/ql/src/WebdaQLParserParser.ts | 34 +++++++++++++----------- 5 files changed, 45 insertions(+), 73 deletions(-) diff --git a/packages/ql-ts-plugin/src/parser.spec.ts b/packages/ql-ts-plugin/src/parser.spec.ts index 1be71610b..fbada5b90 100644 --- a/packages/ql-ts-plugin/src/parser.spec.ts +++ b/packages/ql-ts-plugin/src/parser.spec.ts @@ -3,12 +3,6 @@ import { extractFields } from "./parser.js"; describe("extractFields", () => { describe("SELECT", () => { - it("detects implicit SELECT (field list with comma)", () => { - const result = extractFields("name, age WHERE status = 'active'"); - expect(result.type).toBe("SELECT"); - expect(result.fields).toEqual(["name", "age"]); - }); - it("detects explicit SELECT", () => { const result = extractFields("SELECT name, age WHERE status = 'active'"); expect(result.type).toBe("SELECT"); @@ -22,19 +16,19 @@ describe("extractFields", () => { }); it("handles nested dot-notation fields", () => { - const result = extractFields("name, profile.email WHERE active = TRUE"); + const result = extractFields("SELECT name, profile.email WHERE active = TRUE"); expect(result.type).toBe("SELECT"); expect(result.fields).toEqual(["name", "profile.email"]); }); it("handles SELECT without WHERE", () => { - const result = extractFields("name, age"); + const result = extractFields("SELECT name, age"); expect(result.type).toBe("SELECT"); expect(result.fields).toEqual(["name", "age"]); }); it("handles SELECT with ORDER BY/LIMIT", () => { - const result = extractFields("name, age ORDER BY name ASC LIMIT 10"); + const result = extractFields("SELECT name, age ORDER BY name ASC LIMIT 10"); expect(result.type).toBe("SELECT"); expect(result.fields).toEqual(["name", "age"]); }); @@ -87,7 +81,7 @@ describe("extractFields", () => { expect(result.fields).toBeUndefined(); }); - it("does not confuse a filter with an implicit SELECT", () => { + it("does not treat a filter as SELECT", () => { const result = extractFields("name = 'John'"); expect(result.type).toBeUndefined(); }); @@ -95,7 +89,7 @@ describe("extractFields", () => { describe("edge cases", () => { it("does not match keywords inside quoted strings", () => { - const result = extractFields("name, age WHERE title = 'SELECT committee'"); + const result = extractFields("SELECT name, age WHERE title = 'SELECT committee'"); expect(result.type).toBe("SELECT"); expect(result.fields).toEqual(["name", "age"]); }); diff --git a/packages/ql-ts-plugin/src/parser.ts b/packages/ql-ts-plugin/src/parser.ts index 01c46419e..638e6d7e6 100644 --- a/packages/ql-ts-plugin/src/parser.ts +++ b/packages/ql-ts-plugin/src/parser.ts @@ -39,33 +39,6 @@ function findUnquotedKeyword(str: string, keyword: string): number { return -1; } -/** - * Detect implicit SELECT: query has an unquoted comma before any operator - */ -function isImplicitSelect(query: string): boolean { - let inSingle = false; - let inDouble = false; - for (let i = 0; i < query.length; i++) { - const ch = query[i]; - if (ch === "'" && !inDouble) inSingle = !inSingle; - else if (ch === '"' && !inSingle) inDouble = !inDouble; - else if (!inSingle && !inDouble) { - if (ch === ",") return true; - if (ch === "=" || ch === "!" || ch === "<" || ch === ">") return false; - for (const kw of ["AND", "OR", "LIKE", "IN", "CONTAINS"]) { - if ( - query.substring(i, i + kw.length).toUpperCase() === kw && - (i === 0 || /\s/.test(query[i - 1])) && - (i + kw.length === query.length || /\s/.test(query[i + kw.length])) - ) { - return false; - } - } - } - } - return false; -} - /** * Parse comma-separated field names from a string, stopping at a boundary keyword */ @@ -144,11 +117,6 @@ export function extractFields(query: string): ParsedFields { return { type: "SELECT", fields: parseFieldList(body) }; } - // Implicit SELECT (field list with commas before operators) - if (isImplicitSelect(trimmed)) { - return { type: "SELECT", fields: parseFieldList(trimmed) }; - } - // Plain filter query — no fields to validate return {}; } diff --git a/packages/ql/src/WebdaQLLexer.ts b/packages/ql/src/WebdaQLLexer.ts index 6969b9d2b..a171185a3 100644 --- a/packages/ql/src/WebdaQLLexer.ts +++ b/packages/ql/src/WebdaQLLexer.ts @@ -1,15 +1,18 @@ // Generated from src/WebdaQLLexer.g4 by ANTLR 4.9.0-SNAPSHOT -import { ATN } from "antlr4ts/atn/ATN.js"; -import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer.js"; -import { LexerATNSimulator } from "antlr4ts/atn/LexerATNSimulator.js"; -import { CharStream } from "antlr4ts/CharStream.js"; -import { Lexer } from "antlr4ts/Lexer.js"; -import { Vocabulary } from "antlr4ts/Vocabulary.js"; -import { VocabularyImpl } from "antlr4ts/VocabularyImpl.js"; +import { ATN } from "antlr4ts/atn/ATN"; +import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; +import { CharStream } from "antlr4ts/CharStream"; +import { Lexer } from "antlr4ts/Lexer"; +import { LexerATNSimulator } from "antlr4ts/atn/LexerATNSimulator"; +import { NotNull } from "antlr4ts/Decorators"; +import { Override } from "antlr4ts/Decorators"; +import { RuleContext } from "antlr4ts/RuleContext"; +import { Vocabulary } from "antlr4ts/Vocabulary"; +import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; -import * as Utils from "antlr4ts/misc/Utils.js"; +import * as Utils from "antlr4ts/misc/Utils"; export class WebdaQLLexer extends Lexer { diff --git a/packages/ql/src/WebdaQLParserLexer.ts b/packages/ql/src/WebdaQLParserLexer.ts index f3921fbcf..53a29dbb8 100644 --- a/packages/ql/src/WebdaQLParserLexer.ts +++ b/packages/ql/src/WebdaQLParserLexer.ts @@ -1,13 +1,16 @@ // Generated from src/WebdaQLParser.g4 by ANTLR 4.9.0-SNAPSHOT -import { ATN } from "antlr4ts/atn/ATN.js"; -import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer.js"; -import { LexerATNSimulator } from "antlr4ts/atn/LexerATNSimulator.js"; -import { CharStream } from "antlr4ts/CharStream.js"; -import { Lexer } from "antlr4ts/Lexer.js"; -import { Vocabulary } from "antlr4ts/Vocabulary.js"; -import { VocabularyImpl } from "antlr4ts/VocabularyImpl.js"; +import { ATN } from "antlr4ts/atn/ATN"; +import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; +import { CharStream } from "antlr4ts/CharStream"; +import { Lexer } from "antlr4ts/Lexer"; +import { LexerATNSimulator } from "antlr4ts/atn/LexerATNSimulator"; +import { NotNull } from "antlr4ts/Decorators"; +import { Override } from "antlr4ts/Decorators"; +import { RuleContext } from "antlr4ts/RuleContext"; +import { Vocabulary } from "antlr4ts/Vocabulary"; +import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; import * as Utils from "antlr4ts/misc/Utils"; diff --git a/packages/ql/src/WebdaQLParserParser.ts b/packages/ql/src/WebdaQLParserParser.ts index dd5917b57..822d1f5d1 100644 --- a/packages/ql/src/WebdaQLParserParser.ts +++ b/packages/ql/src/WebdaQLParserParser.ts @@ -1,23 +1,27 @@ // Generated from src/WebdaQLParser.g4 by ANTLR 4.9.0-SNAPSHOT -import { ATN } from "antlr4ts/atn/ATN.js"; -import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer.js"; -import { ParserATNSimulator } from "antlr4ts/atn/ParserATNSimulator.js"; -import { FailedPredicateException } from "antlr4ts/FailedPredicateException.js"; -import { NoViableAltException } from "antlr4ts/NoViableAltException.js"; -import { Parser } from "antlr4ts/Parser.js"; -import { ParserRuleContext } from "antlr4ts/ParserRuleContext.js"; -import { RecognitionException } from "antlr4ts/RecognitionException.js"; -import { RuleContext } from "antlr4ts/RuleContext.js"; +import { ATN } from "antlr4ts/atn/ATN"; +import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; +import { FailedPredicateException } from "antlr4ts/FailedPredicateException"; +import { NotNull } from "antlr4ts/Decorators"; +import { NoViableAltException } from "antlr4ts/NoViableAltException"; +import { Override } from "antlr4ts/Decorators"; +import { Parser } from "antlr4ts/Parser"; +import { ParserRuleContext } from "antlr4ts/ParserRuleContext"; +import { ParserATNSimulator } from "antlr4ts/atn/ParserATNSimulator"; +import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; +import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; +import { RecognitionException } from "antlr4ts/RecognitionException"; +import { RuleContext } from "antlr4ts/RuleContext"; //import { RuleVersion } from "antlr4ts/RuleVersion"; -import { Token } from "antlr4ts/Token.js"; -import { TokenStream } from "antlr4ts/TokenStream.js"; -import { TerminalNode } from "antlr4ts/tree/TerminalNode.js"; -import { Vocabulary } from "antlr4ts/Vocabulary.js"; -import { VocabularyImpl } from "antlr4ts/VocabularyImpl.js"; +import { TerminalNode } from "antlr4ts/tree/TerminalNode"; +import { Token } from "antlr4ts/Token"; +import { TokenStream } from "antlr4ts/TokenStream"; +import { Vocabulary } from "antlr4ts/Vocabulary"; +import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; -import * as Utils from "antlr4ts/misc/Utils.js"; +import * as Utils from "antlr4ts/misc/Utils"; import { WebdaQLParserListener } from "./WebdaQLParserListener"; import { WebdaQLParserVisitor } from "./WebdaQLParserVisitor";