@malloydata/malloy 0.0.70-dev230810160240 → 0.0.70
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/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/lang/ast/types/annotation-elements.d.ts +6 -4
- package/dist/lang/ast/types/annotation-elements.js +7 -11
- package/dist/lang/ast/types/malloy-element.d.ts +4 -4
- package/dist/lang/ast/types/malloy-element.js +7 -5
- package/dist/lang/lib/Malloy/MalloyTagLexer.d.ts +39 -0
- package/dist/lang/lib/Malloy/MalloyTagLexer.js +347 -0
- package/dist/lang/lib/Malloy/MalloyTagListener.d.ts +158 -0
- package/dist/lang/lib/Malloy/MalloyTagListener.js +4 -0
- package/dist/lang/lib/Malloy/MalloyTagParser.d.ts +187 -0
- package/dist/lang/lib/Malloy/MalloyTagParser.js +1104 -0
- package/dist/lang/lib/Malloy/MalloyTagVisitor.d.ts +105 -0
- package/dist/lang/lib/Malloy/MalloyTagVisitor.js +4 -0
- package/dist/lang/malloy-to-ast.d.ts +16 -4
- package/dist/lang/malloy-to-ast.js +65 -37
- package/dist/lang/parse-malloy.d.ts +2 -2
- package/dist/lang/parse-malloy.js +2 -1
- package/dist/lang/parse-utils.d.ts +1 -12
- package/dist/lang/parse-utils.js +1 -15
- package/dist/lang/test/annotation.spec.d.ts +13 -0
- package/dist/lang/test/annotation.spec.js +70 -30
- package/dist/malloy.d.ts +13 -1
- package/dist/malloy.js +41 -0
- package/dist/model/malloy_types.d.ts +6 -2
- package/dist/tags.d.ts +63 -3
- package/dist/tags.js +401 -13
- package/package.json +2 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener";
|
|
2
|
+
import { TagEqContext } from "./MalloyTagParser";
|
|
3
|
+
import { TagReplacePropertiesContext } from "./MalloyTagParser";
|
|
4
|
+
import { TagUpdatePropertiesContext } from "./MalloyTagParser";
|
|
5
|
+
import { TagDefContext } from "./MalloyTagParser";
|
|
6
|
+
import { TagLineContext } from "./MalloyTagParser";
|
|
7
|
+
import { TagSpecContext } from "./MalloyTagParser";
|
|
8
|
+
import { StringContext } from "./MalloyTagParser";
|
|
9
|
+
import { PropNameContext } from "./MalloyTagParser";
|
|
10
|
+
import { EqValueContext } from "./MalloyTagParser";
|
|
11
|
+
import { ArrayElementContext } from "./MalloyTagParser";
|
|
12
|
+
import { ReferenceContext } from "./MalloyTagParser";
|
|
13
|
+
import { ArrayValueContext } from "./MalloyTagParser";
|
|
14
|
+
import { PropertiesContext } from "./MalloyTagParser";
|
|
15
|
+
/**
|
|
16
|
+
* This interface defines a complete listener for a parse tree produced by
|
|
17
|
+
* `MalloyTagParser`.
|
|
18
|
+
*/
|
|
19
|
+
export interface MalloyTagListener extends ParseTreeListener {
|
|
20
|
+
/**
|
|
21
|
+
* Enter a parse tree produced by the `tagEq`
|
|
22
|
+
* labeled alternative in `MalloyTagParser.tagSpec`.
|
|
23
|
+
* @param ctx the parse tree
|
|
24
|
+
*/
|
|
25
|
+
enterTagEq?: (ctx: TagEqContext) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Exit a parse tree produced by the `tagEq`
|
|
28
|
+
* labeled alternative in `MalloyTagParser.tagSpec`.
|
|
29
|
+
* @param ctx the parse tree
|
|
30
|
+
*/
|
|
31
|
+
exitTagEq?: (ctx: TagEqContext) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Enter a parse tree produced by the `tagReplaceProperties`
|
|
34
|
+
* labeled alternative in `MalloyTagParser.tagSpec`.
|
|
35
|
+
* @param ctx the parse tree
|
|
36
|
+
*/
|
|
37
|
+
enterTagReplaceProperties?: (ctx: TagReplacePropertiesContext) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Exit a parse tree produced by the `tagReplaceProperties`
|
|
40
|
+
* labeled alternative in `MalloyTagParser.tagSpec`.
|
|
41
|
+
* @param ctx the parse tree
|
|
42
|
+
*/
|
|
43
|
+
exitTagReplaceProperties?: (ctx: TagReplacePropertiesContext) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Enter a parse tree produced by the `tagUpdateProperties`
|
|
46
|
+
* labeled alternative in `MalloyTagParser.tagSpec`.
|
|
47
|
+
* @param ctx the parse tree
|
|
48
|
+
*/
|
|
49
|
+
enterTagUpdateProperties?: (ctx: TagUpdatePropertiesContext) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Exit a parse tree produced by the `tagUpdateProperties`
|
|
52
|
+
* labeled alternative in `MalloyTagParser.tagSpec`.
|
|
53
|
+
* @param ctx the parse tree
|
|
54
|
+
*/
|
|
55
|
+
exitTagUpdateProperties?: (ctx: TagUpdatePropertiesContext) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Enter a parse tree produced by the `tagDef`
|
|
58
|
+
* labeled alternative in `MalloyTagParser.tagSpec`.
|
|
59
|
+
* @param ctx the parse tree
|
|
60
|
+
*/
|
|
61
|
+
enterTagDef?: (ctx: TagDefContext) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Exit a parse tree produced by the `tagDef`
|
|
64
|
+
* labeled alternative in `MalloyTagParser.tagSpec`.
|
|
65
|
+
* @param ctx the parse tree
|
|
66
|
+
*/
|
|
67
|
+
exitTagDef?: (ctx: TagDefContext) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Enter a parse tree produced by `MalloyTagParser.tagLine`.
|
|
70
|
+
* @param ctx the parse tree
|
|
71
|
+
*/
|
|
72
|
+
enterTagLine?: (ctx: TagLineContext) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Exit a parse tree produced by `MalloyTagParser.tagLine`.
|
|
75
|
+
* @param ctx the parse tree
|
|
76
|
+
*/
|
|
77
|
+
exitTagLine?: (ctx: TagLineContext) => void;
|
|
78
|
+
/**
|
|
79
|
+
* Enter a parse tree produced by `MalloyTagParser.tagSpec`.
|
|
80
|
+
* @param ctx the parse tree
|
|
81
|
+
*/
|
|
82
|
+
enterTagSpec?: (ctx: TagSpecContext) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Exit a parse tree produced by `MalloyTagParser.tagSpec`.
|
|
85
|
+
* @param ctx the parse tree
|
|
86
|
+
*/
|
|
87
|
+
exitTagSpec?: (ctx: TagSpecContext) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Enter a parse tree produced by `MalloyTagParser.string`.
|
|
90
|
+
* @param ctx the parse tree
|
|
91
|
+
*/
|
|
92
|
+
enterString?: (ctx: StringContext) => void;
|
|
93
|
+
/**
|
|
94
|
+
* Exit a parse tree produced by `MalloyTagParser.string`.
|
|
95
|
+
* @param ctx the parse tree
|
|
96
|
+
*/
|
|
97
|
+
exitString?: (ctx: StringContext) => void;
|
|
98
|
+
/**
|
|
99
|
+
* Enter a parse tree produced by `MalloyTagParser.propName`.
|
|
100
|
+
* @param ctx the parse tree
|
|
101
|
+
*/
|
|
102
|
+
enterPropName?: (ctx: PropNameContext) => void;
|
|
103
|
+
/**
|
|
104
|
+
* Exit a parse tree produced by `MalloyTagParser.propName`.
|
|
105
|
+
* @param ctx the parse tree
|
|
106
|
+
*/
|
|
107
|
+
exitPropName?: (ctx: PropNameContext) => void;
|
|
108
|
+
/**
|
|
109
|
+
* Enter a parse tree produced by `MalloyTagParser.eqValue`.
|
|
110
|
+
* @param ctx the parse tree
|
|
111
|
+
*/
|
|
112
|
+
enterEqValue?: (ctx: EqValueContext) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Exit a parse tree produced by `MalloyTagParser.eqValue`.
|
|
115
|
+
* @param ctx the parse tree
|
|
116
|
+
*/
|
|
117
|
+
exitEqValue?: (ctx: EqValueContext) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Enter a parse tree produced by `MalloyTagParser.arrayElement`.
|
|
120
|
+
* @param ctx the parse tree
|
|
121
|
+
*/
|
|
122
|
+
enterArrayElement?: (ctx: ArrayElementContext) => void;
|
|
123
|
+
/**
|
|
124
|
+
* Exit a parse tree produced by `MalloyTagParser.arrayElement`.
|
|
125
|
+
* @param ctx the parse tree
|
|
126
|
+
*/
|
|
127
|
+
exitArrayElement?: (ctx: ArrayElementContext) => void;
|
|
128
|
+
/**
|
|
129
|
+
* Enter a parse tree produced by `MalloyTagParser.reference`.
|
|
130
|
+
* @param ctx the parse tree
|
|
131
|
+
*/
|
|
132
|
+
enterReference?: (ctx: ReferenceContext) => void;
|
|
133
|
+
/**
|
|
134
|
+
* Exit a parse tree produced by `MalloyTagParser.reference`.
|
|
135
|
+
* @param ctx the parse tree
|
|
136
|
+
*/
|
|
137
|
+
exitReference?: (ctx: ReferenceContext) => void;
|
|
138
|
+
/**
|
|
139
|
+
* Enter a parse tree produced by `MalloyTagParser.arrayValue`.
|
|
140
|
+
* @param ctx the parse tree
|
|
141
|
+
*/
|
|
142
|
+
enterArrayValue?: (ctx: ArrayValueContext) => void;
|
|
143
|
+
/**
|
|
144
|
+
* Exit a parse tree produced by `MalloyTagParser.arrayValue`.
|
|
145
|
+
* @param ctx the parse tree
|
|
146
|
+
*/
|
|
147
|
+
exitArrayValue?: (ctx: ArrayValueContext) => void;
|
|
148
|
+
/**
|
|
149
|
+
* Enter a parse tree produced by `MalloyTagParser.properties`.
|
|
150
|
+
* @param ctx the parse tree
|
|
151
|
+
*/
|
|
152
|
+
enterProperties?: (ctx: PropertiesContext) => void;
|
|
153
|
+
/**
|
|
154
|
+
* Exit a parse tree produced by `MalloyTagParser.properties`.
|
|
155
|
+
* @param ctx the parse tree
|
|
156
|
+
*/
|
|
157
|
+
exitProperties?: (ctx: PropertiesContext) => void;
|
|
158
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { ATN } from "antlr4ts/atn/ATN";
|
|
2
|
+
import { FailedPredicateException } from "antlr4ts/FailedPredicateException";
|
|
3
|
+
import { Parser } from "antlr4ts/Parser";
|
|
4
|
+
import { ParserRuleContext } from "antlr4ts/ParserRuleContext";
|
|
5
|
+
import { TerminalNode } from "antlr4ts/tree/TerminalNode";
|
|
6
|
+
import { TokenStream } from "antlr4ts/TokenStream";
|
|
7
|
+
import { Vocabulary } from "antlr4ts/Vocabulary";
|
|
8
|
+
import { MalloyTagListener } from "./MalloyTagListener";
|
|
9
|
+
import { MalloyTagVisitor } from "./MalloyTagVisitor";
|
|
10
|
+
export declare class MalloyTagParser extends Parser {
|
|
11
|
+
static readonly DOTTY = 1;
|
|
12
|
+
static readonly DOT = 2;
|
|
13
|
+
static readonly MINUS = 3;
|
|
14
|
+
static readonly EQ = 4;
|
|
15
|
+
static readonly RF_BEG = 5;
|
|
16
|
+
static readonly RF_END = 6;
|
|
17
|
+
static readonly PR_BEG = 7;
|
|
18
|
+
static readonly PR_END = 8;
|
|
19
|
+
static readonly AR_BEG = 9;
|
|
20
|
+
static readonly COMMA = 10;
|
|
21
|
+
static readonly AR_END = 11;
|
|
22
|
+
static readonly SQ_STRING = 12;
|
|
23
|
+
static readonly DQ_STRING = 13;
|
|
24
|
+
static readonly BARE_STRING = 14;
|
|
25
|
+
static readonly COMMENT = 15;
|
|
26
|
+
static readonly WHITE_SPACE = 16;
|
|
27
|
+
static readonly UNEXPECTED_CHAR = 17;
|
|
28
|
+
static readonly RULE_tagLine = 0;
|
|
29
|
+
static readonly RULE_tagSpec = 1;
|
|
30
|
+
static readonly RULE_string = 2;
|
|
31
|
+
static readonly RULE_propName = 3;
|
|
32
|
+
static readonly RULE_eqValue = 4;
|
|
33
|
+
static readonly RULE_arrayElement = 5;
|
|
34
|
+
static readonly RULE_reference = 6;
|
|
35
|
+
static readonly RULE_arrayValue = 7;
|
|
36
|
+
static readonly RULE_properties = 8;
|
|
37
|
+
static readonly ruleNames: string[];
|
|
38
|
+
private static readonly _LITERAL_NAMES;
|
|
39
|
+
private static readonly _SYMBOLIC_NAMES;
|
|
40
|
+
static readonly VOCABULARY: Vocabulary;
|
|
41
|
+
get vocabulary(): Vocabulary;
|
|
42
|
+
get grammarFileName(): string;
|
|
43
|
+
get ruleNames(): string[];
|
|
44
|
+
get serializedATN(): string;
|
|
45
|
+
protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException;
|
|
46
|
+
constructor(input: TokenStream);
|
|
47
|
+
tagLine(): TagLineContext;
|
|
48
|
+
tagSpec(): TagSpecContext;
|
|
49
|
+
string(): StringContext;
|
|
50
|
+
propName(): PropNameContext;
|
|
51
|
+
eqValue(): EqValueContext;
|
|
52
|
+
arrayElement(): ArrayElementContext;
|
|
53
|
+
reference(): ReferenceContext;
|
|
54
|
+
arrayValue(): ArrayValueContext;
|
|
55
|
+
properties(): PropertiesContext;
|
|
56
|
+
static readonly _serializedATN: string;
|
|
57
|
+
static __ATN: ATN;
|
|
58
|
+
static get _ATN(): ATN;
|
|
59
|
+
}
|
|
60
|
+
export declare class TagLineContext extends ParserRuleContext {
|
|
61
|
+
EOF(): TerminalNode;
|
|
62
|
+
tagSpec(): TagSpecContext[];
|
|
63
|
+
tagSpec(i: number): TagSpecContext;
|
|
64
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
65
|
+
get ruleIndex(): number;
|
|
66
|
+
enterRule(listener: MalloyTagListener): void;
|
|
67
|
+
exitRule(listener: MalloyTagListener): void;
|
|
68
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
69
|
+
}
|
|
70
|
+
export declare class TagSpecContext extends ParserRuleContext {
|
|
71
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
72
|
+
get ruleIndex(): number;
|
|
73
|
+
copyFrom(ctx: TagSpecContext): void;
|
|
74
|
+
}
|
|
75
|
+
export declare class TagEqContext extends TagSpecContext {
|
|
76
|
+
propName(): PropNameContext;
|
|
77
|
+
EQ(): TerminalNode;
|
|
78
|
+
eqValue(): EqValueContext;
|
|
79
|
+
properties(): PropertiesContext | undefined;
|
|
80
|
+
constructor(ctx: TagSpecContext);
|
|
81
|
+
enterRule(listener: MalloyTagListener): void;
|
|
82
|
+
exitRule(listener: MalloyTagListener): void;
|
|
83
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
84
|
+
}
|
|
85
|
+
export declare class TagReplacePropertiesContext extends TagSpecContext {
|
|
86
|
+
propName(): PropNameContext;
|
|
87
|
+
EQ(): TerminalNode;
|
|
88
|
+
properties(): PropertiesContext;
|
|
89
|
+
DOTTY(): TerminalNode | undefined;
|
|
90
|
+
constructor(ctx: TagSpecContext);
|
|
91
|
+
enterRule(listener: MalloyTagListener): void;
|
|
92
|
+
exitRule(listener: MalloyTagListener): void;
|
|
93
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
94
|
+
}
|
|
95
|
+
export declare class TagUpdatePropertiesContext extends TagSpecContext {
|
|
96
|
+
propName(): PropNameContext;
|
|
97
|
+
properties(): PropertiesContext;
|
|
98
|
+
constructor(ctx: TagSpecContext);
|
|
99
|
+
enterRule(listener: MalloyTagListener): void;
|
|
100
|
+
exitRule(listener: MalloyTagListener): void;
|
|
101
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
102
|
+
}
|
|
103
|
+
export declare class TagDefContext extends TagSpecContext {
|
|
104
|
+
propName(): PropNameContext;
|
|
105
|
+
MINUS(): TerminalNode | undefined;
|
|
106
|
+
constructor(ctx: TagSpecContext);
|
|
107
|
+
enterRule(listener: MalloyTagListener): void;
|
|
108
|
+
exitRule(listener: MalloyTagListener): void;
|
|
109
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
110
|
+
}
|
|
111
|
+
export declare class StringContext extends ParserRuleContext {
|
|
112
|
+
SQ_STRING(): TerminalNode | undefined;
|
|
113
|
+
DQ_STRING(): TerminalNode | undefined;
|
|
114
|
+
BARE_STRING(): TerminalNode | undefined;
|
|
115
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
116
|
+
get ruleIndex(): number;
|
|
117
|
+
enterRule(listener: MalloyTagListener): void;
|
|
118
|
+
exitRule(listener: MalloyTagListener): void;
|
|
119
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
120
|
+
}
|
|
121
|
+
export declare class PropNameContext extends ParserRuleContext {
|
|
122
|
+
string(): StringContext[];
|
|
123
|
+
string(i: number): StringContext;
|
|
124
|
+
DOT(): TerminalNode[];
|
|
125
|
+
DOT(i: number): TerminalNode;
|
|
126
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
127
|
+
get ruleIndex(): number;
|
|
128
|
+
enterRule(listener: MalloyTagListener): void;
|
|
129
|
+
exitRule(listener: MalloyTagListener): void;
|
|
130
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
131
|
+
}
|
|
132
|
+
export declare class EqValueContext extends ParserRuleContext {
|
|
133
|
+
string(): StringContext | undefined;
|
|
134
|
+
arrayValue(): ArrayValueContext | undefined;
|
|
135
|
+
reference(): ReferenceContext | undefined;
|
|
136
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
137
|
+
get ruleIndex(): number;
|
|
138
|
+
enterRule(listener: MalloyTagListener): void;
|
|
139
|
+
exitRule(listener: MalloyTagListener): void;
|
|
140
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
141
|
+
}
|
|
142
|
+
export declare class ArrayElementContext extends ParserRuleContext {
|
|
143
|
+
string(): StringContext | undefined;
|
|
144
|
+
properties(): PropertiesContext | undefined;
|
|
145
|
+
arrayValue(): ArrayValueContext | undefined;
|
|
146
|
+
reference(): ReferenceContext | undefined;
|
|
147
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
148
|
+
get ruleIndex(): number;
|
|
149
|
+
enterRule(listener: MalloyTagListener): void;
|
|
150
|
+
exitRule(listener: MalloyTagListener): void;
|
|
151
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
152
|
+
}
|
|
153
|
+
export declare class ReferenceContext extends ParserRuleContext {
|
|
154
|
+
RF_BEG(): TerminalNode;
|
|
155
|
+
propName(): PropNameContext;
|
|
156
|
+
RF_END(): TerminalNode;
|
|
157
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
158
|
+
get ruleIndex(): number;
|
|
159
|
+
enterRule(listener: MalloyTagListener): void;
|
|
160
|
+
exitRule(listener: MalloyTagListener): void;
|
|
161
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
162
|
+
}
|
|
163
|
+
export declare class ArrayValueContext extends ParserRuleContext {
|
|
164
|
+
AR_BEG(): TerminalNode;
|
|
165
|
+
arrayElement(): ArrayElementContext[];
|
|
166
|
+
arrayElement(i: number): ArrayElementContext;
|
|
167
|
+
AR_END(): TerminalNode;
|
|
168
|
+
COMMA(): TerminalNode[];
|
|
169
|
+
COMMA(i: number): TerminalNode;
|
|
170
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
171
|
+
get ruleIndex(): number;
|
|
172
|
+
enterRule(listener: MalloyTagListener): void;
|
|
173
|
+
exitRule(listener: MalloyTagListener): void;
|
|
174
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
175
|
+
}
|
|
176
|
+
export declare class PropertiesContext extends ParserRuleContext {
|
|
177
|
+
PR_BEG(): TerminalNode;
|
|
178
|
+
PR_END(): TerminalNode;
|
|
179
|
+
DOTTY(): TerminalNode | undefined;
|
|
180
|
+
tagSpec(): TagSpecContext[];
|
|
181
|
+
tagSpec(i: number): TagSpecContext;
|
|
182
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
183
|
+
get ruleIndex(): number;
|
|
184
|
+
enterRule(listener: MalloyTagListener): void;
|
|
185
|
+
exitRule(listener: MalloyTagListener): void;
|
|
186
|
+
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
187
|
+
}
|