refactor: migrate antlr4 v4.12.0 to antlr4ts(4.9.0) (#106)

* build: ignore gen folder

* refactor: remove useless code

* fix: correct the Javascript usage in grammar

* refactor: move to antlr4ts

* fix: remove useless

* fix: update grammars for javascript target

* refactor: migrate to antlr4ts

* refactor: migrate to antlr4ts

* refactor: implements ParserErrorListener

* fix: rename the  start reserved word

* refactor: remove unused import

* refactor: migrate to antlr4ts

* test: update the expects of test cases

* refactor: migrate hive to antlr4ts

* refactor: update the incompatible syntax for antlr4ts

* refactor: migrate pgsql grammar to antlr4ts, increasing tests

* refactor: migrate the plsql to antlr4ts

* build: remove unused config

* build: migrate to antlr4ts

* build: migrate ts-jest to @swc/jest

* refactor: migrate to anltr4ts

* build: migrate ts-jest to @swc/jest
This commit is contained in:
Ziv
2023-05-30 14:44:03 +08:00
committed by GitHub
parent 793ff6ef0e
commit 34f64e6bea
104 changed files with 436945 additions and 419757 deletions

View File

@ -1,9 +1,11 @@
import { Lexer } from "antlr4";
import { Lexer } from "antlr4ts/Lexer";
export default class PlSqlBaseLexer extends Lexer {
export default abstract class PlSqlBaseLexer extends Lexer {
_interp: any;
IsNewlineAtPos(pos: number): boolean {
const la = this._input.LA(pos);
return la == -1;
return la == -1 || String.fromCharCode(la) == '\n';
}
}

View File

@ -1,20 +1,30 @@
import { Parser } from 'antlr4';
import { Parser } from "antlr4ts/Parser";
import { TokenStream } from "antlr4ts/TokenStream";
export default class PlSqlBaseParser extends Parser {
export default abstract class PlSqlBaseParser extends Parser {
private _isVersion10: boolean = false;
private _isVersion12: boolean = true;
public isVersion10(): boolean {
constructor(input: TokenStream) {
super(input);
this._isVersion10 = false;
this._isVersion12 = true;
}
isVersion10(): boolean {
return this._isVersion10;
}
public isVersion12(): boolean {
}
isVersion12(): boolean {
return this._isVersion12;
}
public setVersion10(value: boolean): void {
}
setVersion10(value: boolean): void {
this._isVersion10 = value;
}
public setVersion12(value: boolean): void {
}
setVersion12(value: boolean): void {
this._isVersion12 = value;
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff