@gooddata/maql-antlr4ts 0.5.1-a5e4f136.0 → 0.5.1-b239d365.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +76 -0
- package/README.md +50 -18
- package/dist/index.d.ts +80 -80
- package/dist/index.js +3588 -3927
- package/package.json +36 -27
package/NOTICE
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
================================================================================
|
|
2
|
+
================================================================================
|
|
3
|
+
|
|
4
|
+
Third-Party Software for @gooddata/maql-antlr4ts
|
|
5
|
+
|
|
6
|
+
--------------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
The following 3rd-party software packages may be used by or distributed with
|
|
9
|
+
@gooddata/maql-antlr4ts. Any information relevant to third-party vendors listed
|
|
10
|
+
below are collected using common, reasonable means.
|
|
11
|
+
|
|
12
|
+
Date generated: 2026-10-20
|
|
13
|
+
|
|
14
|
+
================================================================================
|
|
15
|
+
================================================================================
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
================================================================================
|
|
19
|
+
|
|
20
|
+
Dependencies
|
|
21
|
+
|
|
22
|
+
================================================================================
|
|
23
|
+
|
|
24
|
+
- antlr4ts (0.5.0-alpha.4) [BSD-3-Clause]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
--------------------------------------------------------------------------------
|
|
28
|
+
Package Title: antlr4ts (0.5.0-alpha.4)
|
|
29
|
+
|
|
30
|
+
Package Locator: npm+antlr4ts$0.5.0-alpha.4
|
|
31
|
+
|
|
32
|
+
Package Depth: Direct
|
|
33
|
+
--------------------------------------------------------------------------------
|
|
34
|
+
|
|
35
|
+
* Declared Licenses *
|
|
36
|
+
BSD-3-Clause
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
[The "BSD license"]
|
|
40
|
+
Copyright (c) 2016 The ANTLR Project
|
|
41
|
+
All rights reserved.
|
|
42
|
+
|
|
43
|
+
Redistribution and use in source and binary forms, with or without
|
|
44
|
+
modification, are permitted provided that the following conditions
|
|
45
|
+
are met:
|
|
46
|
+
|
|
47
|
+
1. Redistributions of source code must retain the above copyright
|
|
48
|
+
notice, this list of conditions and the following disclaimer.
|
|
49
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
50
|
+
notice, this list of conditions and the following disclaimer in the
|
|
51
|
+
documentation and/or other materials provided with the distribution.
|
|
52
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
53
|
+
contributors may be used to endorse or promote products derived from
|
|
54
|
+
this software without specific prior written permission.
|
|
55
|
+
|
|
56
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
57
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
58
|
+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
59
|
+
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
60
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
61
|
+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
62
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
63
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
64
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
65
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
* Package Info *
|
|
69
|
+
|
|
70
|
+
Authors: Terence Parr, Sam Harwell, and Burt Harris
|
|
71
|
+
|
|
72
|
+
Package Homepage: https://github.com/tunnelvisionlabs/antlr4ts
|
|
73
|
+
|
|
74
|
+
Package Download URL: https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz
|
|
75
|
+
|
|
76
|
+
--------------------------------------------------------------------------------
|
package/README.md
CHANGED
|
@@ -19,7 +19,8 @@ import {
|
|
|
19
19
|
AstNormalizer,
|
|
20
20
|
} from "@gooddata/maql-antlr4ts";
|
|
21
21
|
|
|
22
|
-
const maql =
|
|
22
|
+
const maql =
|
|
23
|
+
"parse metric SELECT SUM(0.81 * {fact/price} * {fact/quantity}) BY {attribute/country} WITHOUT PF";
|
|
23
24
|
const charStream = new CaseInsensitiveCharStream(maql);
|
|
24
25
|
const lexer = new MaqlLexer(charStream);
|
|
25
26
|
const tokenStream = new CommonTokenStream(lexer);
|
|
@@ -33,30 +34,32 @@ const normalizedAst = normalizer.visit(ast);
|
|
|
33
34
|
|
|
34
35
|
## Local development
|
|
35
36
|
|
|
36
|
-
> Requirements: [`
|
|
37
|
+
> Requirements: [`pnpm`](https://pnpm.io)
|
|
37
38
|
|
|
38
|
-
| command
|
|
39
|
-
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
39
|
+
| command | effect |
|
|
40
|
+
| ---------------- | ----------------------------------------------------------------- |
|
|
41
|
+
| `pnpm install` | install all dependencies |
|
|
42
|
+
| `pnpm build` | generate source files, compile files, bundle files into a package |
|
|
43
|
+
| `pnpm antlr4` | generate source files from MAQL grammar |
|
|
44
|
+
| `pnpm funcdef` | generate source files from MAQL function definitions |
|
|
45
|
+
| `pnpm compile` | compile TypeScript |
|
|
46
|
+
| `pnpm rollup -c` | bundle files into a package |
|
|
47
|
+
| `pnpm test` | run ESLint, Prettier, and all tests |
|
|
48
|
+
| `pnpm test-ci` | run `pnpm test` with CI options and junit.xml output file |
|
|
49
|
+
| `pnpm fix` | automatically fix ESLint and Prettier errors |
|
|
49
50
|
|
|
50
51
|
## Linking the package to other modules
|
|
51
52
|
|
|
52
|
-
First build and bundle the module.
|
|
53
|
+
First install the dependencies, then build and bundle the module.
|
|
53
54
|
|
|
54
|
-
`
|
|
55
|
+
`pnpm install`
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
`pnpm build`
|
|
58
|
+
|
|
59
|
+
> Warning: Do not use `pnpm link` or `npm link`.
|
|
57
60
|
>
|
|
58
61
|
> Currently, there exists an issue which causes a runtime error when symbolically linking
|
|
59
|
-
> this package using `
|
|
62
|
+
> this package using `pnpm` or `npm`. The error seems to involve the `antlr4ts` library,
|
|
60
63
|
> because it results in every single token having index of -1.
|
|
61
64
|
|
|
62
65
|
Use [yalc](https://github.com/wclr/yalc) to link the package to other repositories.
|
|
@@ -67,4 +70,33 @@ Use [yalc](https://github.com/wclr/yalc) to link the package to other repositori
|
|
|
67
70
|
|
|
68
71
|
## Publishing
|
|
69
72
|
|
|
70
|
-
|
|
73
|
+
To publish the package, run the [publish_maql_antlr4ts_npm](https://github.com/gooddata/gdc-nas/actions/workflows/publish_maql_antlr4ts_npm.yml) GitHub workflow manually.
|
|
74
|
+
|
|
75
|
+
The workflow publishes a prerelease version `<package.json version + 1 patch>-<commit sha>.0`, for example `0.5.1-a5e4f136.0`.
|
|
76
|
+
It moves the npm `latest` dist-tag to this version. It does not commit the version back. To raise the base version,
|
|
77
|
+
change `version` in `package.json` in a PR before you run the workflow.
|
|
78
|
+
|
|
79
|
+
The workflow publishes to npm with [trusted publishing](https://docs.npmjs.com/trusted-publishers) (OIDC), so it does not need an npm token.
|
|
80
|
+
Trusted publishing does not support self-hosted runners, so the workflow runs on a GitHub-hosted runner.
|
|
81
|
+
|
|
82
|
+
### Trusted publisher setup
|
|
83
|
+
|
|
84
|
+
The trusted publisher for the package is set once on npm.
|
|
85
|
+
This section records how it was set up, so that you can change it or set it up again.
|
|
86
|
+
|
|
87
|
+
You can set it up in one of these ways:
|
|
88
|
+
|
|
89
|
+
- **In the npm UI** at https://www.npmjs.com/package/@gooddata/maql-antlr4ts/access.
|
|
90
|
+
- **With the npm CLI.** Use npm 11.10.0 or newer, which has the `npm trust` command.
|
|
91
|
+
Log in to npm (`npm login`) as user `gooddata-ci`.
|
|
92
|
+
The user must have publish access to `@gooddata/maql-antlr4ts` and two-factor authentication.
|
|
93
|
+
Then run:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
npm trust github @gooddata/maql-antlr4ts \
|
|
97
|
+
--file publish_maql_antlr4ts_npm.yml \
|
|
98
|
+
--repo gooddata/gdc-nas \
|
|
99
|
+
--allow-publish
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
To see the current configuration, run `npm trust list @gooddata/maql-antlr4ts`.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ATN } from 'antlr4ts/atn/ATN';
|
|
2
|
-
import { CharStream } from 'antlr4ts/CharStream';
|
|
3
|
-
import { Lexer } from 'antlr4ts/Lexer';
|
|
4
|
-
import { Vocabulary } from 'antlr4ts/Vocabulary';
|
|
5
|
-
import { FailedPredicateException } from 'antlr4ts/FailedPredicateException';
|
|
6
|
-
import { Parser } from 'antlr4ts/Parser';
|
|
7
|
-
import { ParserRuleContext } from 'antlr4ts/ParserRuleContext';
|
|
8
|
-
import { TerminalNode } from 'antlr4ts/tree/TerminalNode';
|
|
9
|
-
import { TokenStream } from 'antlr4ts/TokenStream';
|
|
10
|
-
import { ParseTreeListener } from 'antlr4ts/tree/ParseTreeListener';
|
|
11
|
-
import { ParseTreeVisitor } from 'antlr4ts/tree/ParseTreeVisitor';
|
|
1
|
+
import { ATN } from 'antlr4ts/atn/ATN.js';
|
|
2
|
+
import { CharStream } from 'antlr4ts/CharStream.js';
|
|
3
|
+
import { Lexer } from 'antlr4ts/Lexer.js';
|
|
4
|
+
import { Vocabulary } from 'antlr4ts/Vocabulary.js';
|
|
5
|
+
import { FailedPredicateException } from 'antlr4ts/FailedPredicateException.js';
|
|
6
|
+
import { Parser } from 'antlr4ts/Parser.js';
|
|
7
|
+
import { ParserRuleContext } from 'antlr4ts/ParserRuleContext.js';
|
|
8
|
+
import { TerminalNode } from 'antlr4ts/tree/TerminalNode.js';
|
|
9
|
+
import { TokenStream } from 'antlr4ts/TokenStream.js';
|
|
10
|
+
import { ParseTreeListener } from 'antlr4ts/tree/ParseTreeListener.js';
|
|
11
|
+
import { ParseTreeVisitor } from 'antlr4ts/tree/ParseTreeVisitor.js';
|
|
12
12
|
import { CodePointCharStream, ANTLRErrorListener, Token, Recognizer, BufferedTokenStream } from 'antlr4ts';
|
|
13
|
-
import { RecognitionException } from 'antlr4ts/RecognitionException';
|
|
14
|
-
import { AbstractParseTreeVisitor, ParseTree, ErrorNode } from 'antlr4ts/tree';
|
|
13
|
+
import { RecognitionException } from 'antlr4ts/RecognitionException.js';
|
|
14
|
+
import { AbstractParseTreeVisitor, ParseTree, ErrorNode } from 'antlr4ts/tree/index.js';
|
|
15
15
|
|
|
16
16
|
declare class MaqlLexer extends Lexer {
|
|
17
17
|
static readonly ALL = 1;
|
|
@@ -3446,17 +3446,17 @@ declare class GranularityContext extends ParserRuleContext {
|
|
|
3446
3446
|
accept<Result>(visitor: MaqlParserVisitor<Result>): Result;
|
|
3447
3447
|
}
|
|
3448
3448
|
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3449
|
+
type FunctionAstType = keyof typeof functionDefinitions;
|
|
3450
|
+
type FunctionName = keyof typeof functionDefinitions["function"];
|
|
3451
|
+
type TimeMacroName = keyof typeof functionDefinitions["time macro"];
|
|
3452
3452
|
declare function isMaqlFunctionName(name: string, astType: "function"): name is FunctionName;
|
|
3453
3453
|
declare function isMaqlFunctionName(name: string, astType: "time macro"): name is TimeMacroName;
|
|
3454
3454
|
declare function isMaqlFunctionName(name: string, astType: FunctionAstType): name is FunctionName | TimeMacroName;
|
|
3455
|
-
|
|
3456
|
-
|
|
3455
|
+
type ParameterType = "CHRONOLOGICAL_GRANULARITY_LITERAL" | "DATASET" | "DATE" | "GRANULARITY_LITERAL" | "INTEGER_LITERAL" | "NUMERIC" | "NUMERIC_LITERAL" | "STRING";
|
|
3456
|
+
type FunctionParameter = {
|
|
3457
3457
|
type: ParameterType;
|
|
3458
3458
|
};
|
|
3459
|
-
|
|
3459
|
+
type FunctionDefinition = {
|
|
3460
3460
|
operands: FunctionParameter[];
|
|
3461
3461
|
returns: FunctionParameter;
|
|
3462
3462
|
vararg?: boolean;
|
|
@@ -4343,21 +4343,21 @@ interface IAntlrError {
|
|
|
4343
4343
|
}
|
|
4344
4344
|
|
|
4345
4345
|
declare const selectTypes: readonly ["metric"];
|
|
4346
|
-
|
|
4346
|
+
type Select = typeof selectTypes[number];
|
|
4347
4347
|
declare class SelectNode extends AstNode {
|
|
4348
4348
|
readonly expression: ExpressionNode;
|
|
4349
|
-
readonly by?: AstNode
|
|
4350
|
-
readonly forEach?: AstNode
|
|
4351
|
-
readonly datetimeTransformation?: AstNode
|
|
4352
|
-
readonly filter?: AstNode
|
|
4353
|
-
readonly using?: AstNode
|
|
4354
|
-
readonly parentFilterModification?: AstNode
|
|
4349
|
+
readonly by?: AstNode;
|
|
4350
|
+
readonly forEach?: AstNode;
|
|
4351
|
+
readonly datetimeTransformation?: AstNode;
|
|
4352
|
+
readonly filter?: AstNode;
|
|
4353
|
+
readonly using?: AstNode;
|
|
4354
|
+
readonly parentFilterModification?: AstNode;
|
|
4355
4355
|
type: Select;
|
|
4356
|
-
constructor(expression: ExpressionNode, by?: AstNode
|
|
4356
|
+
constructor(expression: ExpressionNode, by?: AstNode, forEach?: AstNode, datetimeTransformation?: AstNode, filter?: AstNode, using?: AstNode, parentFilterModification?: AstNode);
|
|
4357
4357
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4358
4358
|
}
|
|
4359
4359
|
declare const expressionTypes: readonly ["expression"];
|
|
4360
|
-
|
|
4360
|
+
type Expression = typeof expressionTypes[number];
|
|
4361
4361
|
declare class ExpressionNode extends AstNode {
|
|
4362
4362
|
readonly expression: AstNode;
|
|
4363
4363
|
type: Expression;
|
|
@@ -4365,28 +4365,28 @@ declare class ExpressionNode extends AstNode {
|
|
|
4365
4365
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4366
4366
|
}
|
|
4367
4367
|
declare const byTypes: readonly ["by"];
|
|
4368
|
-
|
|
4368
|
+
type By = typeof byTypes[number];
|
|
4369
4369
|
declare class ByNode extends AstNode {
|
|
4370
4370
|
type: By;
|
|
4371
4371
|
constructor(operands: AstNode[]);
|
|
4372
4372
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4373
4373
|
}
|
|
4374
4374
|
declare const dimensionOperatorTypes: readonly ["all", "all other"];
|
|
4375
|
-
|
|
4375
|
+
type DimensionOperator = typeof dimensionOperatorTypes[number];
|
|
4376
4376
|
declare class DimensionOperatorNode extends AstNode {
|
|
4377
4377
|
type: DimensionOperator;
|
|
4378
4378
|
constructor(type: DimensionOperator, operands: AstNode[]);
|
|
4379
4379
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4380
4380
|
}
|
|
4381
4381
|
declare const datetimeTransformationTypes: readonly ["for"];
|
|
4382
|
-
|
|
4382
|
+
type DatetimeTransformation = typeof datetimeTransformationTypes[number];
|
|
4383
4383
|
declare class DatetimeTransformationNode extends AstNode {
|
|
4384
4384
|
type: DatetimeTransformation;
|
|
4385
4385
|
constructor(name: string, operands: AstNode[]);
|
|
4386
4386
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4387
4387
|
}
|
|
4388
4388
|
declare const filterTypes: readonly ["where", "having"];
|
|
4389
|
-
|
|
4389
|
+
type Filter = typeof filterTypes[number];
|
|
4390
4390
|
declare class FilterNode extends AstNode {
|
|
4391
4391
|
readonly condition: AstNode;
|
|
4392
4392
|
type: Filter;
|
|
@@ -4394,28 +4394,28 @@ declare class FilterNode extends AstNode {
|
|
|
4394
4394
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4395
4395
|
}
|
|
4396
4396
|
declare const usingTypes: readonly ["using"];
|
|
4397
|
-
|
|
4397
|
+
type Using = typeof usingTypes[number];
|
|
4398
4398
|
declare class UsingNode extends AstNode {
|
|
4399
4399
|
type: Using;
|
|
4400
4400
|
constructor(operands: AstNode[]);
|
|
4401
4401
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4402
4402
|
}
|
|
4403
4403
|
declare const parentFilterModificationTypes: readonly ["with pf", "without pf"];
|
|
4404
|
-
|
|
4404
|
+
type ParentFilterModification = typeof parentFilterModificationTypes[number];
|
|
4405
4405
|
declare class ParentFilterModificationNode extends AstNode {
|
|
4406
4406
|
type: ParentFilterModification;
|
|
4407
4407
|
constructor(type: ParentFilterModification, operand?: AstNode);
|
|
4408
4408
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4409
4409
|
}
|
|
4410
4410
|
declare const modificationOperatorTypes: readonly ["stop", "pass"];
|
|
4411
|
-
|
|
4411
|
+
type ModificationOperator = typeof modificationOperatorTypes[number];
|
|
4412
4412
|
declare class ModificationOperatorNode extends AstNode {
|
|
4413
4413
|
type: ModificationOperator;
|
|
4414
4414
|
constructor(type: ModificationOperator, operands: AstNode[]);
|
|
4415
4415
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4416
4416
|
}
|
|
4417
4417
|
declare const forEachTypes: readonly ["for each"];
|
|
4418
|
-
|
|
4418
|
+
type ForEach = typeof forEachTypes[number];
|
|
4419
4419
|
declare class ForEachNode extends AstNode {
|
|
4420
4420
|
type: ForEach;
|
|
4421
4421
|
constructor(operands: AstNode[]);
|
|
@@ -4423,7 +4423,7 @@ declare class ForEachNode extends AstNode {
|
|
|
4423
4423
|
}
|
|
4424
4424
|
|
|
4425
4425
|
declare const operatorTypes: readonly ["or", "and", "not", "=", "<>", ">=", "<=", "<", ">", "*", "/", "+", "-", "neg", "between", "not between", "in", "not in", "like", "ilike", "not like", "not ilike"];
|
|
4426
|
-
|
|
4426
|
+
type Operator = typeof operatorTypes[number];
|
|
4427
4427
|
declare function isOperator(type: string): type is Operator;
|
|
4428
4428
|
declare class OperatorNode extends AstNode {
|
|
4429
4429
|
type: Operator;
|
|
@@ -4432,7 +4432,7 @@ declare class OperatorNode extends AstNode {
|
|
|
4432
4432
|
}
|
|
4433
4433
|
|
|
4434
4434
|
declare const functionTypes: readonly ["function", "time macro"];
|
|
4435
|
-
|
|
4435
|
+
type MaqlFunction = typeof functionTypes[number];
|
|
4436
4436
|
declare function isMaqlFunction(type: string): type is MaqlFunction;
|
|
4437
4437
|
declare class FunctionNode extends AstNode {
|
|
4438
4438
|
readonly name: string;
|
|
@@ -4441,24 +4441,24 @@ declare class FunctionNode extends AstNode {
|
|
|
4441
4441
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4442
4442
|
}
|
|
4443
4443
|
declare const runningFunctionTypes: readonly ["running function"];
|
|
4444
|
-
|
|
4444
|
+
type RunningFunction = typeof runningFunctionTypes[number];
|
|
4445
4445
|
declare class RunningFunctionNode extends AstNode {
|
|
4446
|
-
readonly within?: AstNode
|
|
4447
|
-
readonly rollWindow?: AstNode
|
|
4446
|
+
readonly within?: AstNode;
|
|
4447
|
+
readonly rollWindow?: AstNode;
|
|
4448
4448
|
type: RunningFunction;
|
|
4449
4449
|
readonly functionNode: FunctionNode;
|
|
4450
|
-
constructor(name: string, operand: AstNode, within?: AstNode
|
|
4450
|
+
constructor(name: string, operand: AstNode, within?: AstNode, rollWindow?: AstNode);
|
|
4451
4451
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4452
4452
|
}
|
|
4453
4453
|
declare const windowTypes: readonly ["window"];
|
|
4454
|
-
|
|
4454
|
+
type Window = typeof windowTypes[number];
|
|
4455
4455
|
declare class WindowNode extends AstNode {
|
|
4456
4456
|
type: Window;
|
|
4457
4457
|
constructor(bounds: AstNode[]);
|
|
4458
4458
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4459
4459
|
}
|
|
4460
4460
|
declare const windowBoundTypes: readonly ["preceding", "following", "current"];
|
|
4461
|
-
|
|
4461
|
+
type WindowBound = typeof windowBoundTypes[number];
|
|
4462
4462
|
declare function isWindowBound(type: string): type is WindowBound;
|
|
4463
4463
|
declare class WindowBoundNode extends AstNode {
|
|
4464
4464
|
type: WindowBound;
|
|
@@ -4466,89 +4466,89 @@ declare class WindowBoundNode extends AstNode {
|
|
|
4466
4466
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4467
4467
|
}
|
|
4468
4468
|
declare const rankFunctionTypes: readonly ["rank function"];
|
|
4469
|
-
|
|
4469
|
+
type RankFunction = typeof rankFunctionTypes[number];
|
|
4470
4470
|
declare class RankFunctionNode extends AstNode {
|
|
4471
|
-
readonly within?: AstNode
|
|
4471
|
+
readonly within?: AstNode;
|
|
4472
4472
|
type: RankFunction;
|
|
4473
4473
|
readonly functionNode: FunctionNode;
|
|
4474
|
-
constructor(name: string, operands: AstNode[], rankDir?: string, within?: AstNode
|
|
4474
|
+
constructor(name: string, operands: AstNode[], rankDir?: string, within?: AstNode);
|
|
4475
4475
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4476
4476
|
}
|
|
4477
4477
|
declare const directionTypes: readonly ["direction"];
|
|
4478
|
-
|
|
4478
|
+
type Direction = typeof directionTypes[number];
|
|
4479
4479
|
declare class DirectionNode extends AstNode {
|
|
4480
4480
|
type: Direction;
|
|
4481
4481
|
constructor(direction: string);
|
|
4482
4482
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4483
4483
|
}
|
|
4484
4484
|
declare const lastFirstValueFunctionTypes: readonly ["lastfirstvalue function"];
|
|
4485
|
-
|
|
4485
|
+
type LastFirstValueFunction = typeof lastFirstValueFunctionTypes[number];
|
|
4486
4486
|
declare class LastFirstValueFunctionNode extends AstNode {
|
|
4487
4487
|
readonly orderBy: AstNode;
|
|
4488
|
-
readonly within?: AstNode
|
|
4488
|
+
readonly within?: AstNode;
|
|
4489
4489
|
type: LastFirstValueFunction;
|
|
4490
4490
|
readonly functionNode: FunctionNode;
|
|
4491
|
-
constructor(name: string, operands: AstNode[], orderBy: AstNode, within?: AstNode
|
|
4491
|
+
constructor(name: string, operands: AstNode[], orderBy: AstNode, within?: AstNode);
|
|
4492
4492
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4493
4493
|
}
|
|
4494
4494
|
declare const orderByTypes: readonly ["order by"];
|
|
4495
|
-
|
|
4495
|
+
type OrderBy = typeof orderByTypes[number];
|
|
4496
4496
|
declare class OrderByNode extends AstNode {
|
|
4497
4497
|
type: OrderBy;
|
|
4498
4498
|
constructor(operands: AstNode[]);
|
|
4499
4499
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4500
4500
|
}
|
|
4501
4501
|
declare const orderByElementTypes: readonly ["order by element"];
|
|
4502
|
-
|
|
4502
|
+
type OrderByElement = typeof orderByElementTypes[number];
|
|
4503
4503
|
declare class OrderByElementNode extends AstNode {
|
|
4504
4504
|
type: OrderByElement;
|
|
4505
4505
|
constructor(operand: AstNode, rankDir?: string);
|
|
4506
4506
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4507
4507
|
}
|
|
4508
4508
|
declare const metricReferenceTypes: readonly ["report metric"];
|
|
4509
|
-
|
|
4509
|
+
type MetricReference = typeof metricReferenceTypes[number];
|
|
4510
4510
|
declare class MetricReferenceNode extends AstNode {
|
|
4511
4511
|
type: MetricReference;
|
|
4512
4512
|
constructor(operand: AstNode);
|
|
4513
4513
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4514
4514
|
}
|
|
4515
4515
|
declare const listTypes: readonly ["list", "()", "of"];
|
|
4516
|
-
|
|
4516
|
+
type List = typeof listTypes[number];
|
|
4517
4517
|
declare class ListNode extends AstNode {
|
|
4518
4518
|
type: List;
|
|
4519
4519
|
constructor(type: List, operands: AstNode[]);
|
|
4520
4520
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4521
4521
|
}
|
|
4522
4522
|
declare const imageTypes: readonly ["image"];
|
|
4523
|
-
|
|
4523
|
+
type Image = typeof imageTypes[number];
|
|
4524
4524
|
declare class ImageNode extends AstNode {
|
|
4525
4525
|
type: Image;
|
|
4526
4526
|
constructor(expression: AstNode, mapping: AstNode[]);
|
|
4527
4527
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4528
4528
|
}
|
|
4529
4529
|
declare const rankingFilterTypes: readonly ["top", "bottom"];
|
|
4530
|
-
|
|
4530
|
+
type RankingFilter = typeof rankingFilterTypes[number];
|
|
4531
4531
|
declare function isRankingFilter(type: string): type is RankingFilter;
|
|
4532
4532
|
declare class RankingFilterNode extends AstNode {
|
|
4533
4533
|
readonly rankSpec: AstNode;
|
|
4534
4534
|
readonly operands: AstNode[];
|
|
4535
|
-
readonly within?: AstNode
|
|
4535
|
+
readonly within?: AstNode;
|
|
4536
4536
|
type: RankingFilter;
|
|
4537
|
-
constructor(type: RankingFilter, rankSpec: AstNode, operands: AstNode[], within?: AstNode
|
|
4537
|
+
constructor(type: RankingFilter, rankSpec: AstNode, operands: AstNode[], within?: AstNode);
|
|
4538
4538
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4539
4539
|
}
|
|
4540
4540
|
|
|
4541
4541
|
declare const caseTypes: readonly ["case"];
|
|
4542
|
-
|
|
4542
|
+
type Case = typeof caseTypes[number];
|
|
4543
4543
|
declare class CaseNode extends AstNode {
|
|
4544
4544
|
readonly branches: AstNode[];
|
|
4545
|
-
readonly elseBranch?: AstNode
|
|
4545
|
+
readonly elseBranch?: AstNode;
|
|
4546
4546
|
type: Case;
|
|
4547
|
-
constructor(branches: AstNode[], elseBranch?: AstNode
|
|
4547
|
+
constructor(branches: AstNode[], elseBranch?: AstNode);
|
|
4548
4548
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4549
4549
|
}
|
|
4550
4550
|
declare const conditionalTypes: readonly ["when"];
|
|
4551
|
-
|
|
4551
|
+
type Conditional = typeof conditionalTypes[number];
|
|
4552
4552
|
declare class ConditionalNode extends AstNode {
|
|
4553
4553
|
readonly condition: AstNode;
|
|
4554
4554
|
readonly expression: AstNode;
|
|
@@ -4557,7 +4557,7 @@ declare class ConditionalNode extends AstNode {
|
|
|
4557
4557
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4558
4558
|
}
|
|
4559
4559
|
declare const elseTypes: readonly ["else"];
|
|
4560
|
-
|
|
4560
|
+
type Else = typeof elseTypes[number];
|
|
4561
4561
|
declare class ElseNode extends AstNode {
|
|
4562
4562
|
type: Else;
|
|
4563
4563
|
constructor(expression: AstNode);
|
|
@@ -4565,32 +4565,32 @@ declare class ElseNode extends AstNode {
|
|
|
4565
4565
|
}
|
|
4566
4566
|
|
|
4567
4567
|
declare const identifierTypes: readonly ["identifier", "raw identifier"];
|
|
4568
|
-
|
|
4568
|
+
type Identifier = typeof identifierTypes[number];
|
|
4569
4569
|
declare const objectTypeTypes: readonly ["type"];
|
|
4570
|
-
|
|
4570
|
+
type ObjectType = typeof objectTypeTypes[number];
|
|
4571
4571
|
declare const objectIdTypes: readonly ["id"];
|
|
4572
|
-
|
|
4572
|
+
type ObjectId = typeof objectIdTypes[number];
|
|
4573
4573
|
declare const objectSpaceTypes: readonly ["space"];
|
|
4574
|
-
|
|
4574
|
+
type ObjectSpace = typeof objectSpaceTypes[number];
|
|
4575
4575
|
declare class IdentifierNode extends AstNode {
|
|
4576
4576
|
readonly objectType: string;
|
|
4577
4577
|
readonly id: string;
|
|
4578
|
-
readonly space?: string
|
|
4578
|
+
readonly space?: string;
|
|
4579
4579
|
type: Identifier;
|
|
4580
|
-
constructor(type: Identifier, objectType: string, id: string, space?: string
|
|
4580
|
+
constructor(type: Identifier, objectType: string, id: string, space?: string);
|
|
4581
4581
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4582
4582
|
}
|
|
4583
4583
|
|
|
4584
4584
|
declare const booleanLiteralTypes: readonly ["true", "false"];
|
|
4585
|
-
|
|
4585
|
+
type BooleanLiteral = typeof booleanLiteralTypes[number];
|
|
4586
4586
|
declare class BooleanLiteralNode extends AstNode {
|
|
4587
4587
|
type: BooleanLiteral;
|
|
4588
4588
|
constructor(type: BooleanLiteral);
|
|
4589
4589
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4590
4590
|
}
|
|
4591
4591
|
declare const numberLiteralTypes: readonly ["number", "percentage", "count"];
|
|
4592
|
-
|
|
4593
|
-
|
|
4592
|
+
type NumberLiteral = typeof numberLiteralTypes[number];
|
|
4593
|
+
type NumberLiteralFormat = "float" | "integer";
|
|
4594
4594
|
declare class NumberLiteralNode extends AstNode {
|
|
4595
4595
|
readonly format: NumberLiteralFormat;
|
|
4596
4596
|
type: NumberLiteral;
|
|
@@ -4598,7 +4598,7 @@ declare class NumberLiteralNode extends AstNode {
|
|
|
4598
4598
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4599
4599
|
}
|
|
4600
4600
|
declare const stringLiteralTypes: readonly ["string"];
|
|
4601
|
-
|
|
4601
|
+
type StringLiteral = typeof stringLiteralTypes[number];
|
|
4602
4602
|
declare class StringLiteralNode extends AstNode {
|
|
4603
4603
|
type: StringLiteral;
|
|
4604
4604
|
constructor(rawString: string);
|
|
@@ -4607,14 +4607,14 @@ declare class StringLiteralNode extends AstNode {
|
|
|
4607
4607
|
}
|
|
4608
4608
|
declare function escapeString(string: string, surroundChar?: string): string;
|
|
4609
4609
|
declare const nullLiteralTypes: readonly ["null"];
|
|
4610
|
-
|
|
4610
|
+
type NullLiteral = typeof nullLiteralTypes[number];
|
|
4611
4611
|
declare class NullLiteralNode extends AstNode {
|
|
4612
4612
|
type: NullLiteral;
|
|
4613
4613
|
constructor();
|
|
4614
4614
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4615
4615
|
}
|
|
4616
4616
|
declare const granularityTypes: readonly ["granularity"];
|
|
4617
|
-
|
|
4617
|
+
type Granularity = typeof granularityTypes[number];
|
|
4618
4618
|
declare class GranularityNode extends AstNode {
|
|
4619
4619
|
type: Granularity;
|
|
4620
4620
|
constructor(value: string);
|
|
@@ -4690,8 +4690,8 @@ declare class AstNode implements IAstNode {
|
|
|
4690
4690
|
constructor(type?: AstType, value?: string, content?: AstNode[]);
|
|
4691
4691
|
accept<Result>(visitor: AbstractAstVisitor<Result>): Result;
|
|
4692
4692
|
}
|
|
4693
|
-
|
|
4694
|
-
|
|
4693
|
+
type AstType = Empty | Select | Expression | By | DimensionOperator | DatetimeTransformation | Filter | Using | ParentFilterModification | ModificationOperator | Case | Conditional | Else | MaqlFunction | RunningFunction | Window | WindowBound | RankFunction | Direction | LastFirstValueFunction | OrderBy | OrderByElement | Image | RankingFilter | MetricReference | BooleanLiteral | Identifier | ObjectType | ObjectSpace | ObjectId | NumberLiteral | StringLiteral | NullLiteral | Granularity | Operator | List | ForEach;
|
|
4694
|
+
type Empty = "";
|
|
4695
4695
|
/**
|
|
4696
4696
|
* Empty node serves as a placeholder or as an error node. It should never appear from a well-formed query
|
|
4697
4697
|
*/
|
|
@@ -4714,7 +4714,7 @@ declare class MaqlAstVisitor extends AbstractParseTreeVisitor<AstNode> implement
|
|
|
4714
4714
|
* @param space name of the space (workspace) to which object IDs should be resolved
|
|
4715
4715
|
* @param tokenStream token stream of the parser used to gather additional information e.g. range with whitespace
|
|
4716
4716
|
*/
|
|
4717
|
-
constructor(space: string, tokenStream?: BufferedTokenStream
|
|
4717
|
+
constructor(space: string, tokenStream?: BufferedTokenStream);
|
|
4718
4718
|
protected defaultResult(): AstNode;
|
|
4719
4719
|
visit(tree: ParseTree): AstNode;
|
|
4720
4720
|
visitErrorNode(node: ErrorNode): AstNode;
|
|
@@ -4819,7 +4819,7 @@ declare class MaqlAstVisitor extends AbstractParseTreeVisitor<AstNode> implement
|
|
|
4819
4819
|
visitWithoutPf(ctx: WithoutPfContext): AstNode;
|
|
4820
4820
|
visitPf(ctx: WithPfContext | WithoutPfContext, pfType: ParentFilterModification, operator: ModificationOperator): AstNode;
|
|
4821
4821
|
}
|
|
4822
|
-
|
|
4822
|
+
type ObjectContext = NumericContext | AttributeContext | FactContext | ParameterContext | PromptContext;
|
|
4823
4823
|
|
|
4824
4824
|
/**
|
|
4825
4825
|
* AST visitor which makes adjustment to an AST such that its shape is the same as the output of
|