Skip to content

Commit

Permalink
fix: #381 antlr4 flink grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxy0551 authored and LuckyFBB committed Jan 8, 2025
1 parent bdb4b96 commit 74be81c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/lib/flink/FlinkSqlParser.interp
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ addConstraint
dropConstraint
addUnique
notForced
alertView
alterView
alterDatabase
alterFunction
dropCatalog
Expand Down
32 changes: 16 additions & 16 deletions src/lib/flink/FlinkSqlParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ export class FlinkSqlParser extends SQLParserBase {
public static readonly RULE_dropConstraint = 61;
public static readonly RULE_addUnique = 62;
public static readonly RULE_notForced = 63;
public static readonly RULE_alertView = 64;
public static readonly RULE_alterView = 64;
public static readonly RULE_alterDatabase = 65;
public static readonly RULE_alterFunction = 66;
public static readonly RULE_dropCatalog = 67;
Expand Down Expand Up @@ -975,7 +975,7 @@ export class FlinkSqlParser extends SQLParserBase {
"likeDefinition", "likeOption", "createCatalog", "createDatabase",
"createView", "createFunction", "usingClause", "jarFileName", "alterTable",
"renameDefinition", "setKeyValueDefinition", "addConstraint", "dropConstraint",
"addUnique", "notForced", "alertView", "alterDatabase", "alterFunction",
"addUnique", "notForced", "alterView", "alterDatabase", "alterFunction",
"dropCatalog", "dropTable", "dropDatabase", "dropView", "dropFunction",
"insertStatement", "insertSimpleStatement", "insertPartitionDefinition",
"valuesDefinition", "valuesRowDefinition", "insertMulStatementCompatibility",
Expand Down Expand Up @@ -1315,7 +1315,7 @@ export class FlinkSqlParser extends SQLParserBase {
this.enterOuterAlt(localContext, 7);
{
this.state = 413;
this.alertView();
this.alterView();
}
break;
case 8:
Expand Down Expand Up @@ -4457,9 +4457,9 @@ export class FlinkSqlParser extends SQLParserBase {
}
return localContext;
}
public alertView(): AlertViewContext {
let localContext = new AlertViewContext(this.context, this.state);
this.enterRule(localContext, 128, FlinkSqlParser.RULE_alertView);
public alterView(): AlterViewContext {
let localContext = new AlterViewContext(this.context, this.state);
this.enterRule(localContext, 128, FlinkSqlParser.RULE_alterView);
try {
this.enterOuterAlt(localContext, 1);
{
Expand Down Expand Up @@ -12777,8 +12777,8 @@ export class DdlStatementContext extends antlr.ParserRuleContext {
public alterTable(): AlterTableContext | null {
return this.getRuleContext(0, AlterTableContext);
}
public alertView(): AlertViewContext | null {
return this.getRuleContext(0, AlertViewContext);
public alterView(): AlterViewContext | null {
return this.getRuleContext(0, AlterViewContext);
}
public alterDatabase(): AlterDatabaseContext | null {
return this.getRuleContext(0, AlterDatabaseContext);
Expand Down Expand Up @@ -15555,7 +15555,7 @@ export class NotForcedContext extends antlr.ParserRuleContext {
}


export class AlertViewContext extends antlr.ParserRuleContext {
export class AlterViewContext extends antlr.ParserRuleContext {
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
super(parent, invokingState);
}
Expand All @@ -15578,21 +15578,21 @@ export class AlertViewContext extends antlr.ParserRuleContext {
return this.getRuleContext(0, QueryStatementContext);
}
public override get ruleIndex(): number {
return FlinkSqlParser.RULE_alertView;
return FlinkSqlParser.RULE_alterView;
}
public override enterRule(listener: FlinkSqlParserListener): void {
if(listener.enterAlertView) {
listener.enterAlertView(this);
if(listener.enterAlterView) {
listener.enterAlterView(this);
}
}
public override exitRule(listener: FlinkSqlParserListener): void {
if(listener.exitAlertView) {
listener.exitAlertView(this);
if(listener.exitAlterView) {
listener.exitAlterView(this);
}
}
public override accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null {
if (visitor.visitAlertView) {
return visitor.visitAlertView(this);
if (visitor.visitAlterView) {
return visitor.visitAlterView(this);
} else {
return visitor.visitChildren(this);
}
Expand Down
10 changes: 5 additions & 5 deletions src/lib/flink/FlinkSqlParserListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import { AddConstraintContext } from "./FlinkSqlParser.js";
import { DropConstraintContext } from "./FlinkSqlParser.js";
import { AddUniqueContext } from "./FlinkSqlParser.js";
import { NotForcedContext } from "./FlinkSqlParser.js";
import { AlertViewContext } from "./FlinkSqlParser.js";
import { AlterViewContext } from "./FlinkSqlParser.js";
import { AlterDatabaseContext } from "./FlinkSqlParser.js";
import { AlterFunctionContext } from "./FlinkSqlParser.js";
import { DropCatalogContext } from "./FlinkSqlParser.js";
Expand Down Expand Up @@ -883,15 +883,15 @@ export class FlinkSqlParserListener implements ParseTreeListener {
*/
exitNotForced?: (ctx: NotForcedContext) => void;
/**
* Enter a parse tree produced by `FlinkSqlParser.alertView`.
* Enter a parse tree produced by `FlinkSqlParser.alterView`.
* @param ctx the parse tree
*/
enterAlertView?: (ctx: AlertViewContext) => void;
enterAlterView?: (ctx: AlterViewContext) => void;
/**
* Exit a parse tree produced by `FlinkSqlParser.alertView`.
* Exit a parse tree produced by `FlinkSqlParser.alterView`.
* @param ctx the parse tree
*/
exitAlertView?: (ctx: AlertViewContext) => void;
exitAlterView?: (ctx: AlterViewContext) => void;
/**
* Enter a parse tree produced by `FlinkSqlParser.alterDatabase`.
* @param ctx the parse tree
Expand Down
6 changes: 3 additions & 3 deletions src/lib/flink/FlinkSqlParserVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import { AddConstraintContext } from "./FlinkSqlParser.js";
import { DropConstraintContext } from "./FlinkSqlParser.js";
import { AddUniqueContext } from "./FlinkSqlParser.js";
import { NotForcedContext } from "./FlinkSqlParser.js";
import { AlertViewContext } from "./FlinkSqlParser.js";
import { AlterViewContext } from "./FlinkSqlParser.js";
import { AlterDatabaseContext } from "./FlinkSqlParser.js";
import { AlterFunctionContext } from "./FlinkSqlParser.js";
import { DropCatalogContext } from "./FlinkSqlParser.js";
Expand Down Expand Up @@ -624,11 +624,11 @@ export class FlinkSqlParserVisitor<Result> extends AbstractParseTreeVisitor<Resu
*/
visitNotForced?: (ctx: NotForcedContext) => Result;
/**
* Visit a parse tree produced by `FlinkSqlParser.alertView`.
* Visit a parse tree produced by `FlinkSqlParser.alterView`.
* @param ctx the parse tree
* @return the visitor result
*/
visitAlertView?: (ctx: AlertViewContext) => Result;
visitAlterView?: (ctx: AlterViewContext) => Result;
/**
* Visit a parse tree produced by `FlinkSqlParser.alterDatabase`.
* @param ctx the parse tree
Expand Down

0 comments on commit 74be81c

Please sign in to comment.