@malloydata/malloy 0.0.362 → 0.0.363

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.
Files changed (45) hide show
  1. package/dist/api/core.js +21 -3
  2. package/dist/api/foundation/compile.js +20 -0
  3. package/dist/api/foundation/runtime.d.ts +16 -4
  4. package/dist/api/foundation/runtime.js +22 -4
  5. package/dist/api/foundation/types.d.ts +3 -1
  6. package/dist/index.d.ts +1 -1
  7. package/dist/lang/ast/index.d.ts +5 -0
  8. package/dist/lang/ast/index.js +5 -0
  9. package/dist/lang/ast/source-elements/named-source.js +4 -0
  10. package/dist/lang/ast/source-elements/typed-source.d.ts +23 -0
  11. package/dist/lang/ast/source-elements/typed-source.js +133 -0
  12. package/dist/lang/ast/source-elements/virtual-source.d.ts +10 -0
  13. package/dist/lang/ast/source-elements/virtual-source.js +47 -0
  14. package/dist/lang/ast/source-properties/user-type-shape.d.ts +29 -0
  15. package/dist/lang/ast/source-properties/user-type-shape.js +100 -0
  16. package/dist/lang/ast/source-query-elements/sq-reference.js +1 -1
  17. package/dist/lang/ast/source-query-elements/sq-typed-source.d.ts +18 -0
  18. package/dist/lang/ast/source-query-elements/sq-typed-source.js +39 -0
  19. package/dist/lang/ast/statements/define-user-type.d.ts +28 -0
  20. package/dist/lang/ast/statements/define-user-type.js +82 -0
  21. package/dist/lang/ast/types/malloy-element.js +14 -6
  22. package/dist/lang/lib/Malloy/MalloyLexer.d.ts +146 -144
  23. package/dist/lang/lib/Malloy/MalloyLexer.js +1408 -1391
  24. package/dist/lang/lib/Malloy/MalloyParser.d.ts +491 -307
  25. package/dist/lang/lib/Malloy/MalloyParser.js +7907 -6680
  26. package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +186 -0
  27. package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +117 -0
  28. package/dist/lang/malloy-to-ast.d.ts +17 -0
  29. package/dist/lang/malloy-to-ast.js +118 -0
  30. package/dist/lang/parse-log.d.ts +12 -1
  31. package/dist/lang/parse-malloy.d.ts +6 -1
  32. package/dist/lang/parse-malloy.js +17 -1
  33. package/dist/lang/parse-tree-walkers/find-external-references.d.ts +4 -0
  34. package/dist/lang/parse-tree-walkers/find-external-references.js +10 -0
  35. package/dist/lang/test/test-translator.d.ts +2 -1
  36. package/dist/lang/test/test-translator.js +10 -0
  37. package/dist/lang/translate-response.d.ts +6 -1
  38. package/dist/lang/translate-response.js +3 -1
  39. package/dist/model/malloy_types.d.ts +23 -2
  40. package/dist/model/malloy_types.js +12 -2
  41. package/dist/model/query_model_impl.js +3 -0
  42. package/dist/model/query_query.js +11 -3
  43. package/dist/version.d.ts +1 -1
  44. package/dist/version.js +1 -1
  45. package/package.json +4 -4
@@ -42,316 +42,329 @@ export declare class MalloyParser extends Parser {
42
42
  static readonly SAMPLE = 31;
43
43
  static readonly SELECT = 32;
44
44
  static readonly SOURCE = 33;
45
- static readonly TOP = 34;
46
- static readonly WHERE = 35;
47
- static readonly VIEW = 36;
48
- static readonly TIMEZONE = 37;
49
- static readonly ALL = 38;
50
- static readonly AND = 39;
51
- static readonly AS = 40;
52
- static readonly ASC = 41;
53
- static readonly AVG = 42;
54
- static readonly BOOLEAN = 43;
55
- static readonly BY = 44;
56
- static readonly CASE = 45;
57
- static readonly CAST = 46;
58
- static readonly CONDITION = 47;
59
- static readonly COUNT = 48;
60
- static readonly COMPOSE = 49;
61
- static readonly DATE = 50;
62
- static readonly DAY = 51;
63
- static readonly DESC = 52;
64
- static readonly DISTINCT = 53;
65
- static readonly ELSE = 54;
66
- static readonly END = 55;
67
- static readonly EXCLUDE = 56;
68
- static readonly EXTEND = 57;
69
- static readonly FALSE = 58;
70
- static readonly FILTER = 59;
71
- static readonly FULL = 60;
72
- static readonly FOR = 61;
73
- static readonly FROM = 62;
74
- static readonly HAS = 63;
75
- static readonly HOUR = 64;
76
- static readonly IMPORT = 65;
77
- static readonly INCLUDE = 66;
78
- static readonly INNER = 67;
79
- static readonly IS = 68;
80
- static readonly IN = 69;
81
- static readonly INTERNAL_KW = 70;
82
- static readonly JSON = 71;
83
- static readonly LAST = 72;
84
- static readonly LEFT = 73;
85
- static readonly LIKE = 74;
86
- static readonly MAX = 75;
87
- static readonly MIN = 76;
88
- static readonly MINUTE = 77;
89
- static readonly MONTH = 78;
90
- static readonly NOT = 79;
91
- static readonly NOW = 80;
92
- static readonly NULL = 81;
93
- static readonly NUMBER = 82;
94
- static readonly ON = 83;
95
- static readonly OR = 84;
96
- static readonly PICK = 85;
97
- static readonly PRIVATE_KW = 86;
98
- static readonly PUBLIC_KW = 87;
99
- static readonly QUARTER = 88;
100
- static readonly RIGHT = 89;
101
- static readonly SECOND = 90;
102
- static readonly STRING = 91;
103
- static readonly SOURCE_KW = 92;
104
- static readonly SUM = 93;
105
- static readonly SQL = 94;
106
- static readonly TABLE = 95;
107
- static readonly THEN = 96;
108
- static readonly THIS = 97;
109
- static readonly TIMESTAMPTZ = 98;
110
- static readonly TIMESTAMP = 99;
111
- static readonly TO = 100;
112
- static readonly TRUE = 101;
113
- static readonly TURTLE = 102;
114
- static readonly WEEK = 103;
115
- static readonly WHEN = 104;
116
- static readonly WITH = 105;
117
- static readonly YEAR = 106;
118
- static readonly UNGROUPED = 107;
119
- static readonly HACKY_REGEX = 108;
120
- static readonly RAW_SQ = 109;
121
- static readonly RAW_DQ = 110;
122
- static readonly SQ3_FILTER = 111;
123
- static readonly SQ_FILTER = 112;
124
- static readonly DQ3_FILTER = 113;
125
- static readonly DQ_FILTER = 114;
126
- static readonly BQ3_FILTER = 115;
127
- static readonly BQ_FILTER = 116;
128
- static readonly SQ_STRING = 117;
129
- static readonly DQ_STRING = 118;
130
- static readonly BQ_STRING = 119;
131
- static readonly DOC_BLOCK_ANNOTATION_BEGIN = 120;
132
- static readonly BLOCK_ANNOTATION_BEGIN = 121;
133
- static readonly DOC_ANNOTATION = 122;
134
- static readonly ANNOTATION = 123;
135
- static readonly AMPER = 124;
136
- static readonly ARROW = 125;
137
- static readonly FAT_ARROW = 126;
138
- static readonly OPAREN = 127;
139
- static readonly CPAREN = 128;
140
- static readonly OBRACK = 129;
141
- static readonly CBRACK = 130;
142
- static readonly OCURLY = 131;
143
- static readonly CCURLY = 132;
144
- static readonly DOUBLECOLON = 133;
145
- static readonly TRIPLECOLON = 134;
146
- static readonly EXCLAM = 135;
147
- static readonly COLON = 136;
148
- static readonly COMMA = 137;
149
- static readonly DOT = 138;
150
- static readonly LT = 139;
151
- static readonly GT = 140;
152
- static readonly EQ = 141;
153
- static readonly NE = 142;
154
- static readonly LTE = 143;
155
- static readonly GTE = 144;
156
- static readonly PLUS = 145;
157
- static readonly MINUS = 146;
158
- static readonly STAR = 147;
159
- static readonly STARSTAR = 148;
160
- static readonly SLASH = 149;
161
- static readonly BAR = 150;
162
- static readonly SEMI = 151;
163
- static readonly NOT_MATCH = 152;
164
- static readonly MATCH = 153;
165
- static readonly PERCENT = 154;
166
- static readonly DOUBLE_QMARK = 155;
167
- static readonly QMARK = 156;
168
- static readonly LITERAL_TIMESTAMP = 157;
169
- static readonly LITERAL_HOUR = 158;
170
- static readonly LITERAL_DAY = 159;
171
- static readonly LITERAL_QUARTER = 160;
172
- static readonly LITERAL_MONTH = 161;
173
- static readonly LITERAL_WEEK = 162;
174
- static readonly LITERAL_YEAR = 163;
175
- static readonly IDENTIFIER = 164;
176
- static readonly PERCENT_LITERAL = 165;
177
- static readonly NUMERIC_LITERAL = 166;
178
- static readonly INTEGER_LITERAL = 167;
179
- static readonly BLOCK_COMMENT = 168;
180
- static readonly COMMENT_TO_EOL = 169;
181
- static readonly WHITE_SPACE = 170;
182
- static readonly SQL_BEGIN = 171;
183
- static readonly UNWATED_CHARS_TRAILING_NUMBERS = 172;
184
- static readonly UNEXPECTED_CHAR = 173;
185
- static readonly OPEN_CODE = 174;
186
- static readonly SQL_END = 175;
187
- static readonly BLOCK_ANNOTATION_END = 176;
188
- static readonly BLOCK_ANNOTATION_TEXT = 177;
45
+ static readonly TYPE = 34;
46
+ static readonly TOP = 35;
47
+ static readonly WHERE = 36;
48
+ static readonly VIEW = 37;
49
+ static readonly TIMEZONE = 38;
50
+ static readonly ALL = 39;
51
+ static readonly AND = 40;
52
+ static readonly AS = 41;
53
+ static readonly ASC = 42;
54
+ static readonly AVG = 43;
55
+ static readonly BOOLEAN = 44;
56
+ static readonly BY = 45;
57
+ static readonly CASE = 46;
58
+ static readonly CAST = 47;
59
+ static readonly CONDITION = 48;
60
+ static readonly COUNT = 49;
61
+ static readonly COMPOSE = 50;
62
+ static readonly DATE = 51;
63
+ static readonly DAY = 52;
64
+ static readonly DESC = 53;
65
+ static readonly DISTINCT = 54;
66
+ static readonly ELSE = 55;
67
+ static readonly END = 56;
68
+ static readonly EXCLUDE = 57;
69
+ static readonly EXTEND = 58;
70
+ static readonly FALSE = 59;
71
+ static readonly FILTER = 60;
72
+ static readonly FULL = 61;
73
+ static readonly FOR = 62;
74
+ static readonly FROM = 63;
75
+ static readonly HAS = 64;
76
+ static readonly HOUR = 65;
77
+ static readonly IMPORT = 66;
78
+ static readonly INCLUDE = 67;
79
+ static readonly INNER = 68;
80
+ static readonly IS = 69;
81
+ static readonly IN = 70;
82
+ static readonly INTERNAL_KW = 71;
83
+ static readonly JSON = 72;
84
+ static readonly LAST = 73;
85
+ static readonly LEFT = 74;
86
+ static readonly LIKE = 75;
87
+ static readonly MAX = 76;
88
+ static readonly MIN = 77;
89
+ static readonly MINUTE = 78;
90
+ static readonly MONTH = 79;
91
+ static readonly NOT = 80;
92
+ static readonly NOW = 81;
93
+ static readonly NULL = 82;
94
+ static readonly NUMBER = 83;
95
+ static readonly ON = 84;
96
+ static readonly OR = 85;
97
+ static readonly PICK = 86;
98
+ static readonly PRIVATE_KW = 87;
99
+ static readonly PUBLIC_KW = 88;
100
+ static readonly QUARTER = 89;
101
+ static readonly RIGHT = 90;
102
+ static readonly SECOND = 91;
103
+ static readonly STRING = 92;
104
+ static readonly SOURCE_KW = 93;
105
+ static readonly SUM = 94;
106
+ static readonly SQL = 95;
107
+ static readonly TABLE = 96;
108
+ static readonly THEN = 97;
109
+ static readonly THIS = 98;
110
+ static readonly TIMESTAMPTZ = 99;
111
+ static readonly TIMESTAMP = 100;
112
+ static readonly TO = 101;
113
+ static readonly TRUE = 102;
114
+ static readonly TURTLE = 103;
115
+ static readonly WEEK = 104;
116
+ static readonly WHEN = 105;
117
+ static readonly WITH = 106;
118
+ static readonly YEAR = 107;
119
+ static readonly UNGROUPED = 108;
120
+ static readonly VIRTUAL = 109;
121
+ static readonly HACKY_REGEX = 110;
122
+ static readonly RAW_SQ = 111;
123
+ static readonly RAW_DQ = 112;
124
+ static readonly SQ3_FILTER = 113;
125
+ static readonly SQ_FILTER = 114;
126
+ static readonly DQ3_FILTER = 115;
127
+ static readonly DQ_FILTER = 116;
128
+ static readonly BQ3_FILTER = 117;
129
+ static readonly BQ_FILTER = 118;
130
+ static readonly SQ_STRING = 119;
131
+ static readonly DQ_STRING = 120;
132
+ static readonly BQ_STRING = 121;
133
+ static readonly DOC_BLOCK_ANNOTATION_BEGIN = 122;
134
+ static readonly BLOCK_ANNOTATION_BEGIN = 123;
135
+ static readonly DOC_ANNOTATION = 124;
136
+ static readonly ANNOTATION = 125;
137
+ static readonly AMPER = 126;
138
+ static readonly ARROW = 127;
139
+ static readonly FAT_ARROW = 128;
140
+ static readonly OPAREN = 129;
141
+ static readonly CPAREN = 130;
142
+ static readonly OBRACK = 131;
143
+ static readonly CBRACK = 132;
144
+ static readonly OCURLY = 133;
145
+ static readonly CCURLY = 134;
146
+ static readonly DOUBLECOLON = 135;
147
+ static readonly TRIPLECOLON = 136;
148
+ static readonly EXCLAM = 137;
149
+ static readonly COLON = 138;
150
+ static readonly COMMA = 139;
151
+ static readonly DOT = 140;
152
+ static readonly LT = 141;
153
+ static readonly GT = 142;
154
+ static readonly EQ = 143;
155
+ static readonly NE = 144;
156
+ static readonly LTE = 145;
157
+ static readonly GTE = 146;
158
+ static readonly PLUS = 147;
159
+ static readonly MINUS = 148;
160
+ static readonly STAR = 149;
161
+ static readonly STARSTAR = 150;
162
+ static readonly SLASH = 151;
163
+ static readonly BAR = 152;
164
+ static readonly SEMI = 153;
165
+ static readonly NOT_MATCH = 154;
166
+ static readonly MATCH = 155;
167
+ static readonly PERCENT = 156;
168
+ static readonly DOUBLE_QMARK = 157;
169
+ static readonly QMARK = 158;
170
+ static readonly LITERAL_TIMESTAMP = 159;
171
+ static readonly LITERAL_HOUR = 160;
172
+ static readonly LITERAL_DAY = 161;
173
+ static readonly LITERAL_QUARTER = 162;
174
+ static readonly LITERAL_MONTH = 163;
175
+ static readonly LITERAL_WEEK = 164;
176
+ static readonly LITERAL_YEAR = 165;
177
+ static readonly IDENTIFIER = 166;
178
+ static readonly PERCENT_LITERAL = 167;
179
+ static readonly NUMERIC_LITERAL = 168;
180
+ static readonly INTEGER_LITERAL = 169;
181
+ static readonly BLOCK_COMMENT = 170;
182
+ static readonly COMMENT_TO_EOL = 171;
183
+ static readonly WHITE_SPACE = 172;
184
+ static readonly SQL_BEGIN = 173;
185
+ static readonly UNWATED_CHARS_TRAILING_NUMBERS = 174;
186
+ static readonly UNEXPECTED_CHAR = 175;
187
+ static readonly OPEN_CODE = 176;
188
+ static readonly SQL_END = 177;
189
+ static readonly BLOCK_ANNOTATION_END = 178;
190
+ static readonly BLOCK_ANNOTATION_TEXT = 179;
189
191
  static readonly RULE_malloyDocument = 0;
190
192
  static readonly RULE_malloyStatement = 1;
191
193
  static readonly RULE_defineSourceStatement = 2;
192
- static readonly RULE_defineQuery = 3;
193
- static readonly RULE_topLevelAnonQueryDef = 4;
194
- static readonly RULE_annotation = 5;
195
- static readonly RULE_tags = 6;
196
- static readonly RULE_blockAnnotation = 7;
197
- static readonly RULE_docAnnotation = 8;
198
- static readonly RULE_docBlockAnnotation = 9;
199
- static readonly RULE_isDefine = 10;
200
- static readonly RULE_runStatement = 11;
201
- static readonly RULE_sqlString = 12;
202
- static readonly RULE_sqlInterpolation = 13;
203
- static readonly RULE_importStatement = 14;
204
- static readonly RULE_importSelect = 15;
205
- static readonly RULE_importItem = 16;
206
- static readonly RULE_importURL = 17;
207
- static readonly RULE_docAnnotations = 18;
208
- static readonly RULE_ignoredObjectAnnotations = 19;
209
- static readonly RULE_ignoredModelAnnotations = 20;
210
- static readonly RULE_topLevelQueryDefs = 21;
211
- static readonly RULE_topLevelQueryDef = 22;
212
- static readonly RULE_refineOperator = 23;
213
- static readonly RULE_turtleName = 24;
214
- static readonly RULE_sqlSource = 25;
215
- static readonly RULE_exploreTable = 26;
216
- static readonly RULE_connectionId = 27;
217
- static readonly RULE_queryProperties = 28;
218
- static readonly RULE_queryName = 29;
219
- static readonly RULE_sourcePropertyList = 30;
220
- static readonly RULE_sourceDefinition = 31;
221
- static readonly RULE_sqExplore = 32;
222
- static readonly RULE_sourceParameters = 33;
223
- static readonly RULE_legalParamType = 34;
224
- static readonly RULE_sourceParameter = 35;
225
- static readonly RULE_parameterNameDef = 36;
226
- static readonly RULE_sourceNameDef = 37;
227
- static readonly RULE_exploreProperties = 38;
228
- static readonly RULE_exploreStatement = 39;
229
- static readonly RULE_accessLabel = 40;
230
- static readonly RULE_accessModifierList = 41;
231
- static readonly RULE_defMeasures = 42;
232
- static readonly RULE_defDimensions = 43;
233
- static readonly RULE_renameList = 44;
234
- static readonly RULE_renameEntry = 45;
235
- static readonly RULE_defList = 46;
236
- static readonly RULE_fieldDef = 47;
237
- static readonly RULE_fieldNameDef = 48;
238
- static readonly RULE_joinNameDef = 49;
239
- static readonly RULE_declareStatement = 50;
240
- static readonly RULE_joinStatement = 51;
241
- static readonly RULE_queryExtend = 52;
242
- static readonly RULE_modEither = 53;
243
- static readonly RULE_sourceArguments = 54;
244
- static readonly RULE_argumentId = 55;
245
- static readonly RULE_sourceArgument = 56;
246
- static readonly RULE_sqExpr = 57;
247
- static readonly RULE_includeBlock = 58;
248
- static readonly RULE_includeItem = 59;
249
- static readonly RULE_orphanedAnnotation = 60;
250
- static readonly RULE_accessLabelProp = 61;
251
- static readonly RULE_includeExceptList = 62;
252
- static readonly RULE_includeExceptListItem = 63;
253
- static readonly RULE_includeList = 64;
254
- static readonly RULE_includeField = 65;
255
- static readonly RULE_segExpr = 66;
256
- static readonly RULE_vExpr = 67;
257
- static readonly RULE_queryExtendStatement = 68;
258
- static readonly RULE_queryExtendStatementList = 69;
259
- static readonly RULE_joinList = 70;
260
- static readonly RULE_isExplore = 71;
261
- static readonly RULE_matrixOperation = 72;
262
- static readonly RULE_joinFrom = 73;
263
- static readonly RULE_joinDef = 74;
264
- static readonly RULE_joinExpression = 75;
265
- static readonly RULE_filterStatement = 76;
266
- static readonly RULE_fieldProperties = 77;
267
- static readonly RULE_aggregateOrdering = 78;
268
- static readonly RULE_aggregateOrderBySpec = 79;
269
- static readonly RULE_aggregateOrderByStatement = 80;
270
- static readonly RULE_fieldPropertyLimitStatement = 81;
271
- static readonly RULE_fieldPropertyStatement = 82;
272
- static readonly RULE_filterClauseList = 83;
273
- static readonly RULE_whereStatement = 84;
274
- static readonly RULE_havingStatement = 85;
275
- static readonly RULE_subQueryDefList = 86;
276
- static readonly RULE_exploreQueryNameDef = 87;
277
- static readonly RULE_exploreQueryDef = 88;
278
- static readonly RULE_drillStatement = 89;
279
- static readonly RULE_drillClauseList = 90;
280
- static readonly RULE_queryStatement = 91;
281
- static readonly RULE_queryJoinStatement = 92;
282
- static readonly RULE_groupByStatement = 93;
283
- static readonly RULE_queryFieldList = 94;
284
- static readonly RULE_queryFieldEntry = 95;
285
- static readonly RULE_nestStatement = 96;
286
- static readonly RULE_nestedQueryList = 97;
287
- static readonly RULE_nestEntry = 98;
288
- static readonly RULE_aggregateStatement = 99;
289
- static readonly RULE_calculateStatement = 100;
290
- static readonly RULE_projectStatement = 101;
291
- static readonly RULE_partitionByStatement = 102;
292
- static readonly RULE_groupedByStatement = 103;
293
- static readonly RULE_orderByStatement = 104;
294
- static readonly RULE_ordering = 105;
295
- static readonly RULE_orderBySpec = 106;
296
- static readonly RULE_limitStatement = 107;
297
- static readonly RULE_bySpec = 108;
298
- static readonly RULE_topStatement = 109;
299
- static readonly RULE_indexElement = 110;
300
- static readonly RULE_indexFields = 111;
301
- static readonly RULE_indexStatement = 112;
302
- static readonly RULE_sampleStatement = 113;
303
- static readonly RULE_timezoneStatement = 114;
304
- static readonly RULE_queryAnnotation = 115;
305
- static readonly RULE_sampleSpec = 116;
306
- static readonly RULE_aggregate = 117;
307
- static readonly RULE_malloyType = 118;
308
- static readonly RULE_malloyBasicType = 119;
309
- static readonly RULE_malloyRecordType = 120;
310
- static readonly RULE_malloyRecordField = 121;
311
- static readonly RULE_compareOp = 122;
312
- static readonly RULE_string = 123;
313
- static readonly RULE_shortString = 124;
314
- static readonly RULE_rawString = 125;
315
- static readonly RULE_numericLiteral = 126;
316
- static readonly RULE_literal = 127;
317
- static readonly RULE_dateLiteral = 128;
318
- static readonly RULE_tablePath = 129;
319
- static readonly RULE_tableURI = 130;
320
- static readonly RULE_id = 131;
321
- static readonly RULE_timeframe = 132;
322
- static readonly RULE_ungroup = 133;
323
- static readonly RULE_malloyOrSQLType = 134;
324
- static readonly RULE_fieldExpr = 135;
325
- static readonly RULE_partialCompare = 136;
326
- static readonly RULE_partialTest = 137;
327
- static readonly RULE_partialAllowedFieldExpr = 138;
328
- static readonly RULE_fieldExprList = 139;
329
- static readonly RULE_pickStatement = 140;
330
- static readonly RULE_pick = 141;
331
- static readonly RULE_caseStatement = 142;
332
- static readonly RULE_caseWhen = 143;
333
- static readonly RULE_recordKey = 144;
334
- static readonly RULE_recordElement = 145;
335
- static readonly RULE_argumentList = 146;
336
- static readonly RULE_fieldNameList = 147;
337
- static readonly RULE_fieldCollection = 148;
338
- static readonly RULE_collectionWildCard = 149;
339
- static readonly RULE_starQualified = 150;
340
- static readonly RULE_taggedRef = 151;
341
- static readonly RULE_refExpr = 152;
342
- static readonly RULE_collectionMember = 153;
343
- static readonly RULE_fieldPath = 154;
344
- static readonly RULE_joinName = 155;
345
- static readonly RULE_fieldName = 156;
346
- static readonly RULE_sqlExploreNameRef = 157;
347
- static readonly RULE_nameSQLBlock = 158;
348
- static readonly RULE_connectionName = 159;
349
- static readonly RULE_tripFilterString = 160;
350
- static readonly RULE_tickFilterString = 161;
351
- static readonly RULE_filterString = 162;
352
- static readonly RULE_debugExpr = 163;
353
- static readonly RULE_debugPartial = 164;
354
- static readonly RULE_experimentalStatementForTesting = 165;
194
+ static readonly RULE_defineUserTypeStatement = 3;
195
+ static readonly RULE_userTypePropertyList = 4;
196
+ static readonly RULE_userTypeDefinition = 5;
197
+ static readonly RULE_userTypeNameDef = 6;
198
+ static readonly RULE_userTypeExpr = 7;
199
+ static readonly RULE_userTypeShape = 8;
200
+ static readonly RULE_userTypeField = 9;
201
+ static readonly RULE_userTypeFieldType = 10;
202
+ static readonly RULE_defineQuery = 11;
203
+ static readonly RULE_topLevelAnonQueryDef = 12;
204
+ static readonly RULE_annotation = 13;
205
+ static readonly RULE_tags = 14;
206
+ static readonly RULE_blockAnnotation = 15;
207
+ static readonly RULE_docAnnotation = 16;
208
+ static readonly RULE_docBlockAnnotation = 17;
209
+ static readonly RULE_isDefine = 18;
210
+ static readonly RULE_runStatement = 19;
211
+ static readonly RULE_sqlString = 20;
212
+ static readonly RULE_sqlInterpolation = 21;
213
+ static readonly RULE_importStatement = 22;
214
+ static readonly RULE_importSelect = 23;
215
+ static readonly RULE_importItem = 24;
216
+ static readonly RULE_importURL = 25;
217
+ static readonly RULE_docAnnotations = 26;
218
+ static readonly RULE_ignoredObjectAnnotations = 27;
219
+ static readonly RULE_ignoredModelAnnotations = 28;
220
+ static readonly RULE_topLevelQueryDefs = 29;
221
+ static readonly RULE_topLevelQueryDef = 30;
222
+ static readonly RULE_refineOperator = 31;
223
+ static readonly RULE_turtleName = 32;
224
+ static readonly RULE_sqlSource = 33;
225
+ static readonly RULE_exploreTable = 34;
226
+ static readonly RULE_virtualSource = 35;
227
+ static readonly RULE_connectionId = 36;
228
+ static readonly RULE_queryProperties = 37;
229
+ static readonly RULE_queryName = 38;
230
+ static readonly RULE_sourcePropertyList = 39;
231
+ static readonly RULE_sourceDefinition = 40;
232
+ static readonly RULE_sqExplore = 41;
233
+ static readonly RULE_sourceParameters = 42;
234
+ static readonly RULE_legalParamType = 43;
235
+ static readonly RULE_sourceParameter = 44;
236
+ static readonly RULE_parameterNameDef = 45;
237
+ static readonly RULE_sourceNameDef = 46;
238
+ static readonly RULE_exploreProperties = 47;
239
+ static readonly RULE_exploreStatement = 48;
240
+ static readonly RULE_accessLabel = 49;
241
+ static readonly RULE_accessModifierList = 50;
242
+ static readonly RULE_defMeasures = 51;
243
+ static readonly RULE_defDimensions = 52;
244
+ static readonly RULE_renameList = 53;
245
+ static readonly RULE_renameEntry = 54;
246
+ static readonly RULE_defList = 55;
247
+ static readonly RULE_fieldDef = 56;
248
+ static readonly RULE_fieldNameDef = 57;
249
+ static readonly RULE_joinNameDef = 58;
250
+ static readonly RULE_declareStatement = 59;
251
+ static readonly RULE_joinStatement = 60;
252
+ static readonly RULE_queryExtend = 61;
253
+ static readonly RULE_modEither = 62;
254
+ static readonly RULE_sourceArguments = 63;
255
+ static readonly RULE_argumentId = 64;
256
+ static readonly RULE_sourceArgument = 65;
257
+ static readonly RULE_sqExpr = 66;
258
+ static readonly RULE_sourceTypeConstraints = 67;
259
+ static readonly RULE_userTypeName = 68;
260
+ static readonly RULE_includeBlock = 69;
261
+ static readonly RULE_includeItem = 70;
262
+ static readonly RULE_orphanedAnnotation = 71;
263
+ static readonly RULE_accessLabelProp = 72;
264
+ static readonly RULE_includeExceptList = 73;
265
+ static readonly RULE_includeExceptListItem = 74;
266
+ static readonly RULE_includeList = 75;
267
+ static readonly RULE_includeField = 76;
268
+ static readonly RULE_segExpr = 77;
269
+ static readonly RULE_vExpr = 78;
270
+ static readonly RULE_queryExtendStatement = 79;
271
+ static readonly RULE_queryExtendStatementList = 80;
272
+ static readonly RULE_joinList = 81;
273
+ static readonly RULE_isExplore = 82;
274
+ static readonly RULE_matrixOperation = 83;
275
+ static readonly RULE_joinFrom = 84;
276
+ static readonly RULE_joinDef = 85;
277
+ static readonly RULE_joinExpression = 86;
278
+ static readonly RULE_filterStatement = 87;
279
+ static readonly RULE_fieldProperties = 88;
280
+ static readonly RULE_aggregateOrdering = 89;
281
+ static readonly RULE_aggregateOrderBySpec = 90;
282
+ static readonly RULE_aggregateOrderByStatement = 91;
283
+ static readonly RULE_fieldPropertyLimitStatement = 92;
284
+ static readonly RULE_fieldPropertyStatement = 93;
285
+ static readonly RULE_filterClauseList = 94;
286
+ static readonly RULE_whereStatement = 95;
287
+ static readonly RULE_havingStatement = 96;
288
+ static readonly RULE_subQueryDefList = 97;
289
+ static readonly RULE_exploreQueryNameDef = 98;
290
+ static readonly RULE_exploreQueryDef = 99;
291
+ static readonly RULE_drillStatement = 100;
292
+ static readonly RULE_drillClauseList = 101;
293
+ static readonly RULE_queryStatement = 102;
294
+ static readonly RULE_queryJoinStatement = 103;
295
+ static readonly RULE_groupByStatement = 104;
296
+ static readonly RULE_queryFieldList = 105;
297
+ static readonly RULE_queryFieldEntry = 106;
298
+ static readonly RULE_nestStatement = 107;
299
+ static readonly RULE_nestedQueryList = 108;
300
+ static readonly RULE_nestEntry = 109;
301
+ static readonly RULE_aggregateStatement = 110;
302
+ static readonly RULE_calculateStatement = 111;
303
+ static readonly RULE_projectStatement = 112;
304
+ static readonly RULE_partitionByStatement = 113;
305
+ static readonly RULE_groupedByStatement = 114;
306
+ static readonly RULE_orderByStatement = 115;
307
+ static readonly RULE_ordering = 116;
308
+ static readonly RULE_orderBySpec = 117;
309
+ static readonly RULE_limitStatement = 118;
310
+ static readonly RULE_bySpec = 119;
311
+ static readonly RULE_topStatement = 120;
312
+ static readonly RULE_indexElement = 121;
313
+ static readonly RULE_indexFields = 122;
314
+ static readonly RULE_indexStatement = 123;
315
+ static readonly RULE_sampleStatement = 124;
316
+ static readonly RULE_timezoneStatement = 125;
317
+ static readonly RULE_queryAnnotation = 126;
318
+ static readonly RULE_sampleSpec = 127;
319
+ static readonly RULE_aggregate = 128;
320
+ static readonly RULE_malloyType = 129;
321
+ static readonly RULE_malloyBasicType = 130;
322
+ static readonly RULE_malloyRecordType = 131;
323
+ static readonly RULE_malloyRecordField = 132;
324
+ static readonly RULE_compareOp = 133;
325
+ static readonly RULE_string = 134;
326
+ static readonly RULE_shortString = 135;
327
+ static readonly RULE_rawString = 136;
328
+ static readonly RULE_numericLiteral = 137;
329
+ static readonly RULE_literal = 138;
330
+ static readonly RULE_dateLiteral = 139;
331
+ static readonly RULE_tablePath = 140;
332
+ static readonly RULE_tableURI = 141;
333
+ static readonly RULE_id = 142;
334
+ static readonly RULE_timeframe = 143;
335
+ static readonly RULE_ungroup = 144;
336
+ static readonly RULE_malloyOrSQLType = 145;
337
+ static readonly RULE_fieldExpr = 146;
338
+ static readonly RULE_partialCompare = 147;
339
+ static readonly RULE_partialTest = 148;
340
+ static readonly RULE_partialAllowedFieldExpr = 149;
341
+ static readonly RULE_fieldExprList = 150;
342
+ static readonly RULE_pickStatement = 151;
343
+ static readonly RULE_pick = 152;
344
+ static readonly RULE_caseStatement = 153;
345
+ static readonly RULE_caseWhen = 154;
346
+ static readonly RULE_recordKey = 155;
347
+ static readonly RULE_recordElement = 156;
348
+ static readonly RULE_argumentList = 157;
349
+ static readonly RULE_fieldNameList = 158;
350
+ static readonly RULE_fieldCollection = 159;
351
+ static readonly RULE_collectionWildCard = 160;
352
+ static readonly RULE_starQualified = 161;
353
+ static readonly RULE_taggedRef = 162;
354
+ static readonly RULE_refExpr = 163;
355
+ static readonly RULE_collectionMember = 164;
356
+ static readonly RULE_fieldPath = 165;
357
+ static readonly RULE_joinName = 166;
358
+ static readonly RULE_fieldName = 167;
359
+ static readonly RULE_sqlExploreNameRef = 168;
360
+ static readonly RULE_nameSQLBlock = 169;
361
+ static readonly RULE_connectionName = 170;
362
+ static readonly RULE_tripFilterString = 171;
363
+ static readonly RULE_tickFilterString = 172;
364
+ static readonly RULE_filterString = 173;
365
+ static readonly RULE_debugExpr = 174;
366
+ static readonly RULE_debugPartial = 175;
367
+ static readonly RULE_experimentalStatementForTesting = 176;
355
368
  static readonly ruleNames: string[];
356
369
  private static readonly _LITERAL_NAMES;
357
370
  private static readonly _SYMBOLIC_NAMES;
@@ -365,6 +378,15 @@ export declare class MalloyParser extends Parser {
365
378
  malloyDocument(): MalloyDocumentContext;
366
379
  malloyStatement(): MalloyStatementContext;
367
380
  defineSourceStatement(): DefineSourceStatementContext;
381
+ defineUserTypeStatement(): DefineUserTypeStatementContext;
382
+ userTypePropertyList(): UserTypePropertyListContext;
383
+ userTypeDefinition(): UserTypeDefinitionContext;
384
+ userTypeNameDef(): UserTypeNameDefContext;
385
+ userTypeExpr(): UserTypeExprContext;
386
+ userTypeShape(): UserTypeShapeContext;
387
+ userTypeField(): UserTypeFieldContext;
388
+ userTypeFieldType(): UserTypeFieldTypeContext;
389
+ userTypeFieldType(_p: number): UserTypeFieldTypeContext;
368
390
  defineQuery(): DefineQueryContext;
369
391
  topLevelAnonQueryDef(): TopLevelAnonQueryDefContext;
370
392
  annotation(): AnnotationContext;
@@ -389,6 +411,7 @@ export declare class MalloyParser extends Parser {
389
411
  turtleName(): TurtleNameContext;
390
412
  sqlSource(): SqlSourceContext;
391
413
  exploreTable(): ExploreTableContext;
414
+ virtualSource(): VirtualSourceContext;
392
415
  connectionId(): ConnectionIdContext;
393
416
  queryProperties(): QueryPropertiesContext;
394
417
  queryName(): QueryNameContext;
@@ -421,6 +444,8 @@ export declare class MalloyParser extends Parser {
421
444
  sourceArgument(): SourceArgumentContext;
422
445
  sqExpr(): SqExprContext;
423
446
  sqExpr(_p: number): SqExprContext;
447
+ sourceTypeConstraints(): SourceTypeConstraintsContext;
448
+ userTypeName(): UserTypeNameContext;
424
449
  includeBlock(): IncludeBlockContext;
425
450
  includeItem(): IncludeItemContext;
426
451
  orphanedAnnotation(): OrphanedAnnotationContext;
@@ -533,6 +558,7 @@ export declare class MalloyParser extends Parser {
533
558
  debugPartial(): DebugPartialContext;
534
559
  experimentalStatementForTesting(): ExperimentalStatementForTestingContext;
535
560
  sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean;
561
+ private userTypeFieldType_sempred;
536
562
  private sqExpr_sempred;
537
563
  private segExpr_sempred;
538
564
  private malloyType_sempred;
@@ -541,6 +567,7 @@ export declare class MalloyParser extends Parser {
541
567
  private static readonly _serializedATNSegment0;
542
568
  private static readonly _serializedATNSegment1;
543
569
  private static readonly _serializedATNSegment2;
570
+ private static readonly _serializedATNSegment3;
544
571
  static readonly _serializedATN: string;
545
572
  static __ATN: ATN;
546
573
  static get _ATN(): ATN;
@@ -559,6 +586,7 @@ export declare class MalloyDocumentContext extends ParserRuleContext {
559
586
  }
560
587
  export declare class MalloyStatementContext extends ParserRuleContext {
561
588
  defineSourceStatement(): DefineSourceStatementContext | undefined;
589
+ defineUserTypeStatement(): DefineUserTypeStatementContext | undefined;
562
590
  defineQuery(): DefineQueryContext | undefined;
563
591
  importStatement(): ImportStatementContext | undefined;
564
592
  runStatement(): RunStatementContext | undefined;
@@ -581,6 +609,112 @@ export declare class DefineSourceStatementContext extends ParserRuleContext {
581
609
  exitRule(listener: MalloyParserListener): void;
582
610
  accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
583
611
  }
612
+ export declare class DefineUserTypeStatementContext extends ParserRuleContext {
613
+ tags(): TagsContext;
614
+ TYPE(): TerminalNode;
615
+ userTypePropertyList(): UserTypePropertyListContext;
616
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
617
+ get ruleIndex(): number;
618
+ enterRule(listener: MalloyParserListener): void;
619
+ exitRule(listener: MalloyParserListener): void;
620
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
621
+ }
622
+ export declare class UserTypePropertyListContext extends ParserRuleContext {
623
+ userTypeDefinition(): UserTypeDefinitionContext[];
624
+ userTypeDefinition(i: number): UserTypeDefinitionContext;
625
+ COMMA(): TerminalNode[];
626
+ COMMA(i: number): TerminalNode;
627
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
628
+ get ruleIndex(): number;
629
+ enterRule(listener: MalloyParserListener): void;
630
+ exitRule(listener: MalloyParserListener): void;
631
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
632
+ }
633
+ export declare class UserTypeDefinitionContext extends ParserRuleContext {
634
+ tags(): TagsContext;
635
+ userTypeNameDef(): UserTypeNameDefContext;
636
+ isDefine(): IsDefineContext;
637
+ userTypeExpr(): UserTypeExprContext;
638
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
639
+ get ruleIndex(): number;
640
+ enterRule(listener: MalloyParserListener): void;
641
+ exitRule(listener: MalloyParserListener): void;
642
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
643
+ }
644
+ export declare class UserTypeNameDefContext extends ParserRuleContext {
645
+ id(): IdContext;
646
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
647
+ get ruleIndex(): number;
648
+ enterRule(listener: MalloyParserListener): void;
649
+ exitRule(listener: MalloyParserListener): void;
650
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
651
+ }
652
+ export declare class UserTypeExprContext extends ParserRuleContext {
653
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
654
+ get ruleIndex(): number;
655
+ copyFrom(ctx: UserTypeExprContext): void;
656
+ }
657
+ export declare class UserTypeRefContext extends UserTypeExprContext {
658
+ userTypeName(): UserTypeNameContext;
659
+ constructor(ctx: UserTypeExprContext);
660
+ enterRule(listener: MalloyParserListener): void;
661
+ exitRule(listener: MalloyParserListener): void;
662
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
663
+ }
664
+ export declare class UserTypeInlineContext extends UserTypeExprContext {
665
+ userTypeShape(): UserTypeShapeContext;
666
+ constructor(ctx: UserTypeExprContext);
667
+ enterRule(listener: MalloyParserListener): void;
668
+ exitRule(listener: MalloyParserListener): void;
669
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
670
+ }
671
+ export declare class UserTypeExtendContext extends UserTypeExprContext {
672
+ userTypeName(): UserTypeNameContext;
673
+ EXTEND(): TerminalNode;
674
+ userTypeShape(): UserTypeShapeContext;
675
+ constructor(ctx: UserTypeExprContext);
676
+ enterRule(listener: MalloyParserListener): void;
677
+ exitRule(listener: MalloyParserListener): void;
678
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
679
+ }
680
+ export declare class UserTypeShapeContext extends ParserRuleContext {
681
+ OCURLY(): TerminalNode;
682
+ userTypeField(): UserTypeFieldContext[];
683
+ userTypeField(i: number): UserTypeFieldContext;
684
+ CCURLY(): TerminalNode;
685
+ COMMA(): TerminalNode[];
686
+ COMMA(i: number): TerminalNode;
687
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
688
+ get ruleIndex(): number;
689
+ enterRule(listener: MalloyParserListener): void;
690
+ exitRule(listener: MalloyParserListener): void;
691
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
692
+ }
693
+ export declare class UserTypeFieldContext extends ParserRuleContext {
694
+ tags(): TagsContext;
695
+ id(): IdContext;
696
+ DOUBLECOLON(): TerminalNode;
697
+ userTypeFieldType(): UserTypeFieldTypeContext;
698
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
699
+ get ruleIndex(): number;
700
+ enterRule(listener: MalloyParserListener): void;
701
+ exitRule(listener: MalloyParserListener): void;
702
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
703
+ }
704
+ export declare class UserTypeFieldTypeContext extends ParserRuleContext {
705
+ malloyBasicType(): MalloyBasicTypeContext | undefined;
706
+ userTypeShape(): UserTypeShapeContext | undefined;
707
+ userTypeFieldType(): UserTypeFieldTypeContext | undefined;
708
+ OBRACK(): TerminalNode | undefined;
709
+ CBRACK(): TerminalNode | undefined;
710
+ shortString(): ShortStringContext | undefined;
711
+ userTypeName(): UserTypeNameContext | undefined;
712
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
713
+ get ruleIndex(): number;
714
+ enterRule(listener: MalloyParserListener): void;
715
+ exitRule(listener: MalloyParserListener): void;
716
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
717
+ }
584
718
  export declare class DefineQueryContext extends ParserRuleContext {
585
719
  constructor(parent: ParserRuleContext | undefined, invokingState: number);
586
720
  get ruleIndex(): number;
@@ -832,6 +966,19 @@ export declare class ExploreTableContext extends ParserRuleContext {
832
966
  exitRule(listener: MalloyParserListener): void;
833
967
  accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
834
968
  }
969
+ export declare class VirtualSourceContext extends ParserRuleContext {
970
+ connectionId(): ConnectionIdContext;
971
+ DOT(): TerminalNode;
972
+ VIRTUAL(): TerminalNode;
973
+ OPAREN(): TerminalNode;
974
+ shortString(): ShortStringContext;
975
+ CPAREN(): TerminalNode;
976
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
977
+ get ruleIndex(): number;
978
+ enterRule(listener: MalloyParserListener): void;
979
+ exitRule(listener: MalloyParserListener): void;
980
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
981
+ }
835
982
  export declare class ConnectionIdContext extends ParserRuleContext {
836
983
  id(): IdContext;
837
984
  constructor(parent: ParserRuleContext | undefined, invokingState: number);
@@ -1319,6 +1466,15 @@ export declare class SQIncludeContext extends SqExprContext {
1319
1466
  exitRule(listener: MalloyParserListener): void;
1320
1467
  accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
1321
1468
  }
1469
+ export declare class SQTypedSourceContext extends SqExprContext {
1470
+ sqExpr(): SqExprContext;
1471
+ DOUBLECOLON(): TerminalNode;
1472
+ sourceTypeConstraints(): SourceTypeConstraintsContext;
1473
+ constructor(ctx: SqExprContext);
1474
+ enterRule(listener: MalloyParserListener): void;
1475
+ exitRule(listener: MalloyParserListener): void;
1476
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
1477
+ }
1322
1478
  export declare class SQTableContext extends SqExprContext {
1323
1479
  exploreTable(): ExploreTableContext;
1324
1480
  constructor(ctx: SqExprContext);
@@ -1326,6 +1482,13 @@ export declare class SQTableContext extends SqExprContext {
1326
1482
  exitRule(listener: MalloyParserListener): void;
1327
1483
  accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
1328
1484
  }
1485
+ export declare class SQVirtualContext extends SqExprContext {
1486
+ virtualSource(): VirtualSourceContext;
1487
+ constructor(ctx: SqExprContext);
1488
+ enterRule(listener: MalloyParserListener): void;
1489
+ exitRule(listener: MalloyParserListener): void;
1490
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
1491
+ }
1329
1492
  export declare class SQSQLContext extends SqExprContext {
1330
1493
  sqlSource(): SqlSourceContext;
1331
1494
  constructor(ctx: SqExprContext);
@@ -1333,6 +1496,27 @@ export declare class SQSQLContext extends SqExprContext {
1333
1496
  exitRule(listener: MalloyParserListener): void;
1334
1497
  accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
1335
1498
  }
1499
+ export declare class SourceTypeConstraintsContext extends ParserRuleContext {
1500
+ userTypeName(): UserTypeNameContext[];
1501
+ userTypeName(i: number): UserTypeNameContext;
1502
+ OPAREN(): TerminalNode | undefined;
1503
+ CPAREN(): TerminalNode | undefined;
1504
+ COMMA(): TerminalNode[];
1505
+ COMMA(i: number): TerminalNode;
1506
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
1507
+ get ruleIndex(): number;
1508
+ enterRule(listener: MalloyParserListener): void;
1509
+ exitRule(listener: MalloyParserListener): void;
1510
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
1511
+ }
1512
+ export declare class UserTypeNameContext extends ParserRuleContext {
1513
+ id(): IdContext;
1514
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
1515
+ get ruleIndex(): number;
1516
+ enterRule(listener: MalloyParserListener): void;
1517
+ exitRule(listener: MalloyParserListener): void;
1518
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
1519
+ }
1336
1520
  export declare class IncludeBlockContext extends ParserRuleContext {
1337
1521
  OCURLY(): TerminalNode;
1338
1522
  CCURLY(): TerminalNode;