refactor: standard naming (#278)
* refactor: rename flinksql to flink * refactor: rename pgsql to postgresql * refactor: rename trinosql to trino * refactor: replace all default exports with named export * refactor: rename basicParser to basicSQL * refactor: rename basic-parser-types to types * refactor: replace arrow func with plain func
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import * as antlr from "antlr4ng";
|
||||
export default abstract class SQLParserBase<T = antlr.ParserRuleContext> extends antlr.Parser{
|
||||
export abstract class SQLParserBase<T = antlr.ParserRuleContext> extends antlr.Parser{
|
||||
public constructor(input: antlr.TokenStream) {
|
||||
super(input);
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Generated from dt-sql-parser/src/grammar/flinksql/FlinkSqlLexer.g4 by ANTLR 4.13.1
|
||||
// Generated from dt-sql-parser/src/grammar/flink/FlinkSqlLexer.g4 by ANTLR 4.13.1
|
||||
|
||||
import * as antlr from "antlr4ng";
|
||||
import { Token } from "antlr4ng";
|
||||
@ -1,4 +1,4 @@
|
||||
// Generated from dt-sql-parser/src/grammar/flinksql/FlinkSqlParser.g4 by ANTLR 4.13.1
|
||||
// Generated from dt-sql-parser/src/grammar/flink/FlinkSqlParser.g4 by ANTLR 4.13.1
|
||||
|
||||
import * as antlr from "antlr4ng";
|
||||
import { Token } from "antlr4ng";
|
||||
@ -11,7 +11,7 @@ import { FlinkSqlParserVisitor } from "./FlinkSqlParserVisitor.js";
|
||||
type int = number;
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
export class FlinkSqlParser extends SQLParserBase {
|
||||
@ -1,9 +1,9 @@
|
||||
// Generated from dt-sql-parser/src/grammar/flinksql/FlinkSqlParser.g4 by ANTLR 4.13.1
|
||||
// Generated from dt-sql-parser/src/grammar/flink/FlinkSqlParser.g4 by ANTLR 4.13.1
|
||||
|
||||
import { ErrorNode, ParseTreeListener, ParserRuleContext, TerminalNode } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./FlinkSqlParser.js";
|
||||
@ -1,9 +1,9 @@
|
||||
// Generated from dt-sql-parser/src/grammar/flinksql/FlinkSqlParser.g4 by ANTLR 4.13.1
|
||||
// Generated from dt-sql-parser/src/grammar/flink/FlinkSqlParser.g4 by ANTLR 4.13.1
|
||||
|
||||
import { AbstractParseTreeVisitor } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./FlinkSqlParser.js";
|
||||
@ -11,7 +11,7 @@ import { HiveSqlParserVisitor } from "./HiveSqlParserVisitor.js";
|
||||
type int = number;
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
export class HiveSqlParser extends SQLParserBase {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { ErrorNode, ParseTreeListener, ParserRuleContext, TerminalNode } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./HiveSqlParser.js";
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { AbstractParseTreeVisitor } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./HiveSqlParser.js";
|
||||
|
||||
@ -11,7 +11,7 @@ import { ImpalaSqlParserVisitor } from "./ImpalaSqlParserVisitor.js";
|
||||
type int = number;
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
export class ImpalaSqlParser extends SQLParserBase {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { ErrorNode, ParseTreeListener, ParserRuleContext, TerminalNode } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./ImpalaSqlParser.js";
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { AbstractParseTreeVisitor } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./ImpalaSqlParser.js";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
export { FlinkSqlParserListener } from './flinksql/FlinkSqlParserListener';
|
||||
export { FlinkSqlParserVisitor } from './flinksql/FlinkSqlParserVisitor';
|
||||
export { FlinkSqlParserListener } from './flink/FlinkSqlParserListener';
|
||||
export { FlinkSqlParserVisitor } from './flink/FlinkSqlParserVisitor';
|
||||
|
||||
export { MySqlParserListener } from './mysql/MySqlParserListener';
|
||||
export { MySqlParserVisitor } from './mysql/MySqlParserVisitor';
|
||||
@ -13,11 +13,11 @@ export { PlSqlParserVisitor } from './plsql/PlSqlParserVisitor';
|
||||
export { SparkSqlParserListener } from './spark/SparkSqlParserListener';
|
||||
export { SparkSqlParserVisitor } from './spark/SparkSqlParserVisitor';
|
||||
|
||||
export { PostgreSQLParserListener } from './pgsql/PostgreSQLParserListener';
|
||||
export { PostgreSQLParserVisitor } from './pgsql/PostgreSQLParserVisitor';
|
||||
export { PostgreSqlParserListener } from './postgresql/PostgreSqlParserListener';
|
||||
export { PostgreSqlParserVisitor } from './postgresql/PostgreSqlParserVisitor';
|
||||
|
||||
export { TrinoSqlListener } from './trinosql/TrinoSqlListener';
|
||||
export { TrinoSqlVisitor } from './trinosql/TrinoSqlVisitor';
|
||||
export { TrinoSqlListener } from './trino/TrinoSqlListener';
|
||||
export { TrinoSqlVisitor } from './trino/TrinoSqlVisitor';
|
||||
|
||||
export { ImpalaSqlParserListener } from './impala/ImpalaSqlParserListener';
|
||||
export { ImpalaSqlParserVisitor } from './impala/ImpalaSqlParserVisitor';
|
||||
@ -11,7 +11,7 @@ import { MySqlParserVisitor } from "./MySqlParserVisitor.js";
|
||||
type int = number;
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
export class MySqlParser extends SQLParserBase {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { ErrorNode, ParseTreeListener, ParserRuleContext, TerminalNode } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./MySqlParser.js";
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { AbstractParseTreeVisitor } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./MySqlParser.js";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Lexer } from "antlr4ng";
|
||||
|
||||
export default abstract class PlSqlBaseLexer extends Lexer {
|
||||
export abstract class PlSqlBaseLexer extends Lexer {
|
||||
|
||||
_interp: any;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { TokenStream } from "antlr4ng";
|
||||
import SQLParserBase from "../SQLParserBase";
|
||||
export default abstract class PlSqlBaseParser extends SQLParserBase {
|
||||
import {SQLParserBase} from "../SQLParserBase";
|
||||
export abstract class PlSqlBaseParser extends SQLParserBase {
|
||||
|
||||
private _isVersion10: boolean = false;
|
||||
private _isVersion12: boolean = true;
|
||||
|
||||
@ -4,7 +4,7 @@ import * as antlr from "antlr4ng";
|
||||
import { Token } from "antlr4ng";
|
||||
|
||||
|
||||
import PlSqlBaseLexer from "./PlSqlBaseLexer";
|
||||
import { PlSqlBaseLexer } from "./PlSqlBaseLexer";
|
||||
|
||||
|
||||
export class PlSqlLexer extends PlSqlBaseLexer {
|
||||
|
||||
@ -11,7 +11,7 @@ import { PlSqlParserVisitor } from "./PlSqlParserVisitor.js";
|
||||
type int = number;
|
||||
|
||||
|
||||
import PlSqlBaseParser from './PlSqlBaseParser';
|
||||
import { PlSqlBaseParser } from './PlSqlBaseParser';
|
||||
|
||||
|
||||
export class PlSqlParser extends PlSqlBaseParser {
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
// Generated from dt-sql-parser/src/grammar/pgsql/PostgreSQLLexer.g4 by ANTLR 4.13.1
|
||||
// Generated from dt-sql-parser/src/grammar/postgresql/PostgreSqlLexer.g4 by ANTLR 4.13.1
|
||||
|
||||
import * as antlr from "antlr4ng";
|
||||
import { Token } from "antlr4ng";
|
||||
|
||||
|
||||
export class PostgreSQLLexer extends antlr.Lexer {
|
||||
export class PostgreSqlLexer extends antlr.Lexer {
|
||||
public static readonly Dollar = 1;
|
||||
public static readonly OPEN_PAREN = 2;
|
||||
public static readonly CLOSE_PAREN = 3;
|
||||
@ -971,20 +971,20 @@ export class PostgreSQLLexer extends antlr.Lexer {
|
||||
|
||||
public constructor(input: antlr.CharStream) {
|
||||
super(input);
|
||||
this.interpreter = new antlr.LexerATNSimulator(this, PostgreSQLLexer._ATN, PostgreSQLLexer.decisionsToDFA, new antlr.PredictionContextCache());
|
||||
this.interpreter = new antlr.LexerATNSimulator(this, PostgreSqlLexer._ATN, PostgreSqlLexer.decisionsToDFA, new antlr.PredictionContextCache());
|
||||
}
|
||||
|
||||
public get grammarFileName(): string { return "PostgreSQLLexer.g4"; }
|
||||
public get grammarFileName(): string { return "PostgreSqlLexer.g4"; }
|
||||
|
||||
public get literalNames(): (string | null)[] { return PostgreSQLLexer.literalNames; }
|
||||
public get symbolicNames(): (string | null)[] { return PostgreSQLLexer.symbolicNames; }
|
||||
public get ruleNames(): string[] { return PostgreSQLLexer.ruleNames; }
|
||||
public get literalNames(): (string | null)[] { return PostgreSqlLexer.literalNames; }
|
||||
public get symbolicNames(): (string | null)[] { return PostgreSqlLexer.symbolicNames; }
|
||||
public get ruleNames(): string[] { return PostgreSqlLexer.ruleNames; }
|
||||
|
||||
public get serializedATN(): number[] { return PostgreSQLLexer._serializedATN; }
|
||||
public get serializedATN(): number[] { return PostgreSqlLexer._serializedATN; }
|
||||
|
||||
public get channelNames(): string[] { return PostgreSQLLexer.channelNames; }
|
||||
public get channelNames(): string[] { return PostgreSqlLexer.channelNames; }
|
||||
|
||||
public get modeNames(): string[] { return PostgreSQLLexer.modeNames; }
|
||||
public get modeNames(): string[] { return PostgreSqlLexer.modeNames; }
|
||||
|
||||
public static readonly _serializedATN: number[] = [
|
||||
4,0,590,5802,6,-1,6,-1,6,-1,6,-1,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,
|
||||
@ -3224,19 +3224,19 @@ export class PostgreSQLLexer extends antlr.Lexer {
|
||||
|
||||
private static __ATN: antlr.ATN;
|
||||
public static get _ATN(): antlr.ATN {
|
||||
if (!PostgreSQLLexer.__ATN) {
|
||||
PostgreSQLLexer.__ATN = new antlr.ATNDeserializer().deserialize(PostgreSQLLexer._serializedATN);
|
||||
if (!PostgreSqlLexer.__ATN) {
|
||||
PostgreSqlLexer.__ATN = new antlr.ATNDeserializer().deserialize(PostgreSqlLexer._serializedATN);
|
||||
}
|
||||
|
||||
return PostgreSQLLexer.__ATN;
|
||||
return PostgreSqlLexer.__ATN;
|
||||
}
|
||||
|
||||
|
||||
private static readonly vocabulary = new antlr.Vocabulary(PostgreSQLLexer.literalNames, PostgreSQLLexer.symbolicNames, []);
|
||||
private static readonly vocabulary = new antlr.Vocabulary(PostgreSqlLexer.literalNames, PostgreSqlLexer.symbolicNames, []);
|
||||
|
||||
public override get vocabulary(): antlr.Vocabulary {
|
||||
return PostgreSQLLexer.vocabulary;
|
||||
return PostgreSqlLexer.vocabulary;
|
||||
}
|
||||
|
||||
private static readonly decisionsToDFA = PostgreSQLLexer._ATN.decisionToState.map( (ds: antlr.DecisionState, index: number) => new antlr.DFA(ds, index) );
|
||||
private static readonly decisionsToDFA = PostgreSqlLexer._ATN.decisionToState.map( (ds: antlr.DecisionState, index: number) => new antlr.DFA(ds, index) );
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@ import { SparkSqlParserVisitor } from "./SparkSqlParserVisitor.js";
|
||||
type int = number;
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
export class SparkSqlParser extends SQLParserBase {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { ErrorNode, ParseTreeListener, ParserRuleContext, TerminalNode } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./SparkSqlParser.js";
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { AbstractParseTreeVisitor } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./SparkSqlParser.js";
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
// Generated from dt-sql-parser/src/grammar/trinosql/TrinoSql.g4 by ANTLR 4.13.1
|
||||
// Generated from dt-sql-parser/src/grammar/trino/TrinoSql.g4 by ANTLR 4.13.1
|
||||
|
||||
import * as antlr from "antlr4ng";
|
||||
import { Token } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
export class TrinoSqlLexer extends antlr.Lexer {
|
||||
@ -1,9 +1,9 @@
|
||||
// Generated from dt-sql-parser/src/grammar/trinosql/TrinoSql.g4 by ANTLR 4.13.1
|
||||
// Generated from dt-sql-parser/src/grammar/trino/TrinoSql.g4 by ANTLR 4.13.1
|
||||
|
||||
import { ErrorNode, ParseTreeListener, ParserRuleContext, TerminalNode } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./TrinoSqlParser.js";
|
||||
@ -1,4 +1,4 @@
|
||||
// Generated from dt-sql-parser/src/grammar/trinosql/TrinoSql.g4 by ANTLR 4.13.1
|
||||
// Generated from dt-sql-parser/src/grammar/trino/TrinoSql.g4 by ANTLR 4.13.1
|
||||
|
||||
import * as antlr from "antlr4ng";
|
||||
import { Token } from "antlr4ng";
|
||||
@ -11,7 +11,7 @@ import { TrinoSqlVisitor } from "./TrinoSqlVisitor.js";
|
||||
type int = number;
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
export class TrinoSqlParser extends SQLParserBase {
|
||||
@ -1,9 +1,9 @@
|
||||
// Generated from dt-sql-parser/src/grammar/trinosql/TrinoSql.g4 by ANTLR 4.13.1
|
||||
// Generated from dt-sql-parser/src/grammar/trino/TrinoSql.g4 by ANTLR 4.13.1
|
||||
|
||||
import { AbstractParseTreeVisitor } from "antlr4ng";
|
||||
|
||||
|
||||
import SQLParserBase from '../SQLParserBase';
|
||||
import { SQLParserBase } from '../SQLParserBase';
|
||||
|
||||
|
||||
import { ProgramContext } from "./TrinoSqlParser.js";
|
||||
Reference in New Issue
Block a user