@malloydata/malloy 0.0.22-dev230126015148 → 0.0.22-dev230206094309
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/package.json +2 -2
- package/dist/connection_utils.d.ts +0 -1
- package/dist/connection_utils.js +0 -66
- package/dist/dialect/dialect.d.ts +0 -66
- package/dist/dialect/dialect.js +0 -85
- package/dist/dialect/dialect_map.d.ts +0 -3
- package/dist/dialect/dialect_map.js +0 -45
- package/dist/dialect/duckdb.d.ts +0 -52
- package/dist/dialect/duckdb.js +0 -364
- package/dist/dialect/index.d.ts +0 -6
- package/dist/dialect/index.js +0 -37
- package/dist/dialect/postgres.d.ts +0 -52
- package/dist/dialect/postgres.js +0 -330
- package/dist/dialect/standardsql.d.ts +0 -49
- package/dist/dialect/standardsql.js +0 -381
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -59
- package/dist/lang/ast/apply-expr.d.ts +0 -3
- package/dist/lang/ast/apply-expr.js +0 -34
- package/dist/lang/ast/ast-expr.d.ts +0 -206
- package/dist/lang/ast/ast-expr.js +0 -781
- package/dist/lang/ast/ast-main.d.ts +0 -915
- package/dist/lang/ast/ast-main.js +0 -3672
- package/dist/lang/ast/ast-time-expr.d.ts +0 -69
- package/dist/lang/ast/ast-time-expr.js +0 -389
- package/dist/lang/ast/ast-types.d.ts +0 -83
- package/dist/lang/ast/ast-types.js +0 -225
- package/dist/lang/ast/index.d.ts +0 -5
- package/dist/lang/ast/index.js +0 -44
- package/dist/lang/ast/time-utils.d.ts +0 -9
- package/dist/lang/ast/time-utils.js +0 -104
- package/dist/lang/field-utils.d.ts +0 -5
- package/dist/lang/field-utils.js +0 -43
- package/dist/lang/index.d.ts +0 -9
- package/dist/lang/index.js +0 -32
- package/dist/lang/lib/Malloy/MalloyLexer.d.ts +0 -165
- package/dist/lang/lib/Malloy/MalloyLexer.js +0 -1232
- package/dist/lang/lib/Malloy/MalloyParser.d.ts +0 -1947
- package/dist/lang/lib/Malloy/MalloyParser.js +0 -11909
- package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +0 -2022
- package/dist/lang/lib/Malloy/MalloyParserListener.js +0 -4
- package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +0 -1274
- package/dist/lang/lib/Malloy/MalloyParserVisitor.js +0 -4
- package/dist/lang/parse-log.d.ts +0 -27
- package/dist/lang/parse-log.js +0 -51
- package/dist/lang/parse-malloy.d.ts +0 -236
- package/dist/lang/parse-malloy.js +0 -746
- package/dist/lang/parse-to-ast.d.ts +0 -155
- package/dist/lang/parse-to-ast.js +0 -990
- package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +0 -10
- package/dist/lang/parse-tree-walkers/document-completion-walker.js +0 -148
- package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +0 -9
- package/dist/lang/parse-tree-walkers/document-help-context-walker.js +0 -107
- package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +0 -83
- package/dist/lang/parse-tree-walkers/document-highlight-walker.js +0 -385
- package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +0 -11
- package/dist/lang/parse-tree-walkers/document-symbol-walker.js +0 -182
- package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +0 -34
- package/dist/lang/parse-tree-walkers/explore-query-walker.js +0 -74
- package/dist/lang/parse-tree-walkers/find-external-references.d.ts +0 -11
- package/dist/lang/parse-tree-walkers/find-external-references.js +0 -61
- package/dist/lang/reference-list.d.ts +0 -10
- package/dist/lang/reference-list.js +0 -90
- package/dist/lang/space-field.d.ts +0 -17
- package/dist/lang/space-field.js +0 -127
- package/dist/lang/test/document-help-context-walker.spec.d.ts +0 -1
- package/dist/lang/test/document-help-context-walker.spec.js +0 -55
- package/dist/lang/test/document-symbol-walker.spec.d.ts +0 -1
- package/dist/lang/test/document-symbol-walker.spec.js +0 -110
- package/dist/lang/test/field-symbols.spec.d.ts +0 -1
- package/dist/lang/test/field-symbols.spec.js +0 -180
- package/dist/lang/test/parse.spec.d.ts +0 -14
- package/dist/lang/test/parse.spec.js +0 -2134
- package/dist/lang/test/test-translator.d.ts +0 -38
- package/dist/lang/test/test-translator.js +0 -344
- package/dist/lang/zone.d.ts +0 -57
- package/dist/lang/zone.js +0 -107
- package/dist/malloy.d.ts +0 -1146
- package/dist/malloy.js +0 -2413
- package/dist/model/index.d.ts +0 -2
- package/dist/model/index.js +0 -45
- package/dist/model/malloy_query.d.ts +0 -351
- package/dist/model/malloy_query.js +0 -3174
- package/dist/model/malloy_types.d.ts +0 -551
- package/dist/model/malloy_types.js +0 -378
- package/dist/model/sql_block.d.ts +0 -7
- package/dist/model/sql_block.js +0 -56
- package/dist/model/utils.d.ts +0 -22
- package/dist/model/utils.js +0 -102
- package/dist/run_sql_options.d.ts +0 -3
- package/dist/run_sql_options.js +0 -25
- package/dist/runtime_types.d.ts +0 -105
- package/dist/runtime_types.js +0 -25
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { ParserRuleContext } from "antlr4ts";
|
|
2
|
-
import type { ParseTree } from "antlr4ts/tree";
|
|
3
|
-
import { AbstractParseTreeVisitor } from "antlr4ts/tree/AbstractParseTreeVisitor";
|
|
4
|
-
import { MalloyParserVisitor } from "./lib/Malloy/MalloyParserVisitor";
|
|
5
|
-
import * as parse from "./lib/Malloy/MalloyParser";
|
|
6
|
-
import * as ast from "./ast";
|
|
7
|
-
import { LogSeverity, MessageLogger } from "./parse-log";
|
|
8
|
-
import { MalloyParseRoot } from "./parse-malloy";
|
|
9
|
-
/**
|
|
10
|
-
* ANTLR visitor pattern parse tree traversal. Generates a Malloy
|
|
11
|
-
* AST from an ANTLR parse tree.
|
|
12
|
-
*/
|
|
13
|
-
export declare class MalloyToAST extends AbstractParseTreeVisitor<ast.MalloyElement> implements MalloyParserVisitor<ast.MalloyElement> {
|
|
14
|
-
readonly parse: MalloyParseRoot;
|
|
15
|
-
readonly msgLog: MessageLogger;
|
|
16
|
-
constructor(parse: MalloyParseRoot, msgLog: MessageLogger);
|
|
17
|
-
/**
|
|
18
|
-
* Mostly used to flag a case where the grammar and the type system are
|
|
19
|
-
* no longer in sync. A visitor was written based on a grammar which
|
|
20
|
-
* apparently has changed and now an unexpected element type has appeared.
|
|
21
|
-
* This is a non recoverable error, since the parser and the grammar
|
|
22
|
-
* are not compatible.
|
|
23
|
-
* @returns an error object to throw.
|
|
24
|
-
*/
|
|
25
|
-
protected internalError(cx: ParserRuleContext, msg: string): Error;
|
|
26
|
-
/**
|
|
27
|
-
* Log an error message relative to an AST node
|
|
28
|
-
*/
|
|
29
|
-
protected astError(el: ast.MalloyElement, str: string, sev?: LogSeverity): void;
|
|
30
|
-
/**
|
|
31
|
-
* Log an error message relative to a parse node
|
|
32
|
-
*/
|
|
33
|
-
protected contextError(cx: ParserRuleContext, msg: string, sev?: LogSeverity): void;
|
|
34
|
-
protected onlyExploreProperties(els: ast.MalloyElement[]): ast.ExploreProperty[];
|
|
35
|
-
protected onlyJoins(els: ast.MalloyElement[]): ast.Join[];
|
|
36
|
-
protected onlyDocStatements(els: ast.MalloyElement[]): ast.DocStatement[];
|
|
37
|
-
protected onlyNestedQueries(els: ast.MalloyElement[]): ast.NestedQuery[];
|
|
38
|
-
protected onlyQueryRefs(els: ast.MalloyElement[]): ast.QueryItem[];
|
|
39
|
-
protected getNumber(term: ParseTree): number;
|
|
40
|
-
protected optionalString(fromTerm: ParseTree | undefined): string | undefined;
|
|
41
|
-
protected getIdText(fromTerm: ParseTree): string;
|
|
42
|
-
protected getFieldName(cx: ParserRuleContext): ast.FieldName;
|
|
43
|
-
protected getModelEntryName(cx: ParserRuleContext): ast.ModelEntryReference;
|
|
44
|
-
protected stripQuotes(s: string): string;
|
|
45
|
-
protected optionalText(idCx: ParseTree | undefined): string | undefined;
|
|
46
|
-
defaultResult(): ast.MalloyElement;
|
|
47
|
-
protected astAt<MT extends ast.MalloyElement>(el: MT, cx: ParserRuleContext): MT;
|
|
48
|
-
protected getSourceCode(cx: ParserRuleContext): string;
|
|
49
|
-
protected getFilterElement(cx: parse.FieldExprContext): ast.FilterElement;
|
|
50
|
-
protected getFieldDefs(cxList: ParserRuleContext[], isAgg?: boolean): ast.FieldDeclaration[];
|
|
51
|
-
protected getFieldExpr(cx: parse.FieldExprContext): ast.ExpressionDef;
|
|
52
|
-
protected getSegments(segments: parse.PipeElementContext[]): ast.QOPDesc[];
|
|
53
|
-
protected getFilterShortcut(cx: parse.FilterShortcutContext): ast.Filter;
|
|
54
|
-
protected getExploreSource(pcx: parse.ExploreSourceContext): ast.Mallobj;
|
|
55
|
-
protected makeSqlString(pcx: parse.SqlStringContext, sqlStr: ast.SQLString): void;
|
|
56
|
-
visitMalloyDocument(pcx: parse.MalloyDocumentContext): ast.Document;
|
|
57
|
-
visitDefineExploreStatement(pcx: parse.DefineExploreStatementContext): ast.DefineSourceList | ast.DefineExplore;
|
|
58
|
-
visitExploreDefinition(pcx: parse.ExploreDefinitionContext): ast.DefineExplore;
|
|
59
|
-
visitExplore(pcx: parse.ExploreContext): ast.Mallobj;
|
|
60
|
-
visitExploreProperties(pcx: parse.ExplorePropertiesContext): ast.ExploreDesc;
|
|
61
|
-
visitExploreTable(pcx: parse.ExploreTableContext): ast.TableSource;
|
|
62
|
-
visitTableSource(pcx: parse.TableSourceContext): ast.TableSource;
|
|
63
|
-
visitSQLSourceName(pcx: parse.SQLSourceNameContext): ast.SQLSource;
|
|
64
|
-
visitQuerySource(pcx: parse.QuerySourceContext): ast.Mallobj;
|
|
65
|
-
visitDefJoinMany(pcx: parse.DefJoinManyContext): ast.Joins;
|
|
66
|
-
visitDefJoinOne(pcx: parse.DefJoinOneContext): ast.Joins;
|
|
67
|
-
visitDefJoinCross(pcx: parse.DefJoinCrossContext): ast.Joins;
|
|
68
|
-
protected getJoinList(pcx: parse.JoinListContext): ast.MalloyElement[];
|
|
69
|
-
protected getJoinSource(name: ast.ModelEntryReference, ecx: parse.ExploreContext | undefined): ast.Mallobj;
|
|
70
|
-
visitJoinOn(pcx: parse.JoinOnContext): ast.Join;
|
|
71
|
-
visitJoinWith(pcx: parse.JoinWithContext): ast.Join;
|
|
72
|
-
visitFieldDef(pcx: parse.FieldDefContext): ast.FieldDeclaration;
|
|
73
|
-
visitDefExploreDimension(pcx: parse.DefExploreDimensionContext): ast.Dimensions;
|
|
74
|
-
visitDefExploreMeasure(pcx: parse.DefExploreMeasureContext): ast.Measures;
|
|
75
|
-
visitDeclareStatement(pcx: parse.DeclareStatementContext): ast.DeclareFields;
|
|
76
|
-
visitExploreRenameDef(pcx: parse.ExploreRenameDefContext): ast.RenameField;
|
|
77
|
-
visitDefExploreRename(pcx: parse.DefExploreRenameContext): ast.Renames;
|
|
78
|
-
visitFilterClauseList(pcx: parse.FilterClauseListContext): ast.Filter;
|
|
79
|
-
visitFilterByShortcut(pcx: parse.FilterByShortcutContext): ast.Filter;
|
|
80
|
-
visitWhereStatement(pcx: parse.WhereStatementContext): ast.Filter;
|
|
81
|
-
visitHavingStatement(pcx: parse.HavingStatementContext): ast.Filter;
|
|
82
|
-
visitSubQueryDefList(pcx: parse.SubQueryDefListContext): ast.Turtles;
|
|
83
|
-
visitDefExplorePrimaryKey(pcx: parse.DefExplorePrimaryKeyContext): ast.PrimaryKey;
|
|
84
|
-
visitFieldNameList(pcx: parse.FieldNameListContext): ast.FieldReferences;
|
|
85
|
-
visitDefExploreEditField(pcx: parse.DefExploreEditFieldContext): ast.FieldListEdit;
|
|
86
|
-
visitQueryProperties(pcx: parse.QueryPropertiesContext): ast.QOPDesc;
|
|
87
|
-
visitFieldPath(pcx: parse.FieldPathContext): ast.FieldReference;
|
|
88
|
-
visitQueryFieldDef(pcx: parse.QueryFieldDefContext): ast.QueryItem;
|
|
89
|
-
visitQueryFieldRef(pcx: parse.QueryFieldRefContext): ast.QueryItem;
|
|
90
|
-
protected getQueryItems(pcx: parse.QueryFieldListContext): ast.QueryItem[];
|
|
91
|
-
visitAggregateStatement(pcx: parse.AggregateStatementContext): ast.Aggregate;
|
|
92
|
-
visitGroupByStatement(pcx: parse.GroupByStatementContext): ast.GroupBy;
|
|
93
|
-
visitFieldCollection(pcx: parse.FieldCollectionContext): ast.ProjectStatement;
|
|
94
|
-
visitWildMember(pcx: parse.WildMemberContext): ast.FieldReferenceElement;
|
|
95
|
-
visitIndexFields(pcx: parse.IndexFieldsContext): ast.FieldReferences;
|
|
96
|
-
visitIndexStatement(pcx: parse.IndexStatementContext): ast.Index;
|
|
97
|
-
visitLimitStatement(pcx: parse.LimitStatementContext): ast.Limit;
|
|
98
|
-
visitOrderBySpec(pcx: parse.OrderBySpecContext): ast.OrderBy;
|
|
99
|
-
visitOrdering(pcx: parse.OrderingContext): ast.Ordering;
|
|
100
|
-
visitTopStatement(pcx: parse.TopStatementContext): ast.Top;
|
|
101
|
-
visitExploreName(pcx: parse.ExploreNameContext): ast.NamedSource;
|
|
102
|
-
protected buildPipelineFromName(pipe: ast.TurtleHeadedPipe, pipeCx: parse.PipelineFromNameContext): void;
|
|
103
|
-
visitExploreArrowQuery(pcx: parse.ExploreArrowQueryContext): ast.FullQuery;
|
|
104
|
-
visitArrowQuery(pcx: parse.ArrowQueryContext): ast.ExistingQuery;
|
|
105
|
-
visitTopLevelQueryDefs(pcx: parse.TopLevelQueryDefsContext): ast.DocStatement;
|
|
106
|
-
visitTopLevelQueryDef(pcx: parse.TopLevelQueryDefContext): ast.DefineQuery;
|
|
107
|
-
visitAnonymousQuery(pcx: parse.AnonymousQueryContext): ast.AnonymousQuery;
|
|
108
|
-
visitNestedQueryList(pcx: parse.NestedQueryListContext): ast.MalloyElement;
|
|
109
|
-
visitNestExisting(pcx: parse.NestExistingContext): ast.NestedQuery;
|
|
110
|
-
visitNestDef(pcx: parse.NestDefContext): ast.NestDefinition;
|
|
111
|
-
visitExploreQueryDef(pcx: parse.ExploreQueryDefContext): ast.TurtleDecl;
|
|
112
|
-
visitExprNot(pcx: parse.ExprNotContext): ast.ExprNot;
|
|
113
|
-
visitExprBool(pcx: parse.ExprBoolContext): ast.Boolean;
|
|
114
|
-
allFieldExpressions(exprList: parse.FieldExprContext[]): ast.ExpressionDef[];
|
|
115
|
-
visitExprLogical(pcx: parse.ExprLogicalContext): ast.ExprLogicalOp;
|
|
116
|
-
visitExprLogicalTree(pcx: parse.ExprLogicalTreeContext): ast.ExprAlternationTree;
|
|
117
|
-
visitPartialAllowedFieldExpr(pcx: parse.PartialAllowedFieldExprContext): ast.ExpressionDef;
|
|
118
|
-
visitExprString(pcx: parse.ExprStringContext): ast.ExprString;
|
|
119
|
-
visitExprRegex(pcx: parse.ExprRegexContext): ast.ExprRegEx;
|
|
120
|
-
visitExprNow(_pcx: parse.ExprNowContext): ast.ExprNow;
|
|
121
|
-
visitExprNumber(pcx: parse.ExprNumberContext): ast.ExprNumber;
|
|
122
|
-
visitExprFieldPath(pcx: parse.ExprFieldPathContext): ast.ExprIdReference;
|
|
123
|
-
visitExprNULL(_pcx: parse.ExprNULLContext): ast.ExprNULL;
|
|
124
|
-
visitExprExpr(pcx: parse.ExprExprContext): ast.ExprParens;
|
|
125
|
-
visitExprMinus(pcx: parse.ExprMinusContext): ast.ExprMinus;
|
|
126
|
-
visitExprAddSub(pcx: parse.ExprAddSubContext): ast.ExprAddSub;
|
|
127
|
-
visitExprMulDiv(pcx: parse.ExprMulDivContext): ast.ExprMulDiv;
|
|
128
|
-
visitExprCompare(pcx: parse.ExprCompareContext): ast.ExprCompare;
|
|
129
|
-
visitExprCountDisinct(pcx: parse.ExprCountDisinctContext): ast.ExprCountDistinct;
|
|
130
|
-
visitExprUngroup(pcx: parse.ExprUngroupContext): ast.ExprUngroup;
|
|
131
|
-
visitExprAggregate(pcx: parse.ExprAggregateContext): ast.ExpressionDef;
|
|
132
|
-
visitExprApply(pcx: parse.ExprApplyContext): ast.Apply;
|
|
133
|
-
visitExprRange(pcx: parse.ExprRangeContext): ast.Range;
|
|
134
|
-
visitExprCast(pcx: parse.ExprCastContext): ast.ExpressionDef;
|
|
135
|
-
visitExprSafeCast(pcx: parse.ExprSafeCastContext): ast.ExpressionDef;
|
|
136
|
-
visitExprTimeTrunc(pcx: parse.ExprTimeTruncContext): ast.ExprGranularTime;
|
|
137
|
-
visitTimeframe(pcx: parse.TimeframeContext): ast.Timeframe;
|
|
138
|
-
visitExprForRange(pcx: parse.ExprForRangeContext): ast.ForRange;
|
|
139
|
-
visitExprFunc(pcx: parse.ExprFuncContext): ast.ExpressionDef;
|
|
140
|
-
visitExprDuration(pcx: parse.ExprDurationContext): ast.ExprDuration;
|
|
141
|
-
visitPickStatement(pcx: parse.PickStatementContext): ast.Pick;
|
|
142
|
-
visitNamedSource(pcx: parse.NamedSourceContext): ast.NamedSource;
|
|
143
|
-
visitExprFilter(pcx: parse.ExprFilterContext): ast.ExprFilter;
|
|
144
|
-
protected getLiteralTime(cx: ParserRuleContext): ast.ExpressionDef;
|
|
145
|
-
visitLiteralTimestamp(pcx: parse.LiteralTimestampContext): ast.ExpressionDef;
|
|
146
|
-
visitLiteralDay(pcx: parse.LiteralDayContext): ast.ExpressionDef;
|
|
147
|
-
visitLiteralWeek(pcx: parse.LiteralWeekContext): ast.ExpressionDef;
|
|
148
|
-
visitLiteralMonth(pcx: parse.LiteralMonthContext): ast.ExpressionDef;
|
|
149
|
-
visitLiteralQuarter(pcx: parse.LiteralQuarterContext): ast.ExpressionDef;
|
|
150
|
-
visitLiteralYear(pcx: parse.LiteralYearContext): ast.ExpressionDef;
|
|
151
|
-
visitImportStatement(pcx: parse.ImportStatementContext): ast.ImportStatement;
|
|
152
|
-
visitJustExpr(pcx: parse.JustExprContext): ast.ExpressionDef;
|
|
153
|
-
visitDefineSQLStatement(pcx: parse.DefineSQLStatementContext): ast.SQLStatement;
|
|
154
|
-
visitSampleStatement(pcx: parse.SampleStatementContext): ast.SampleProperty;
|
|
155
|
-
}
|