Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rename createLexerFormCharStream to createLexerFromCharStream #243

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/parser/common/basicParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default abstract class BasicParser<
* Create a antlr4 Lexer instance.
* @param input source string
*/
protected abstract createLexerFormCharStream(charStreams: CodePointCharStream): L;
protected abstract createLexerFromCharStream(charStreams: CodePointCharStream): L;

/**
* Create Parser by CommonTokenStream
Expand Down Expand Up @@ -93,7 +93,7 @@ export default abstract class BasicParser<
*/
public createLexer(input: string, errorListener?: ErrorListener<any>) {
const charStreams = CharStreams.fromString(input.toUpperCase());
const lexer = this.createLexerFormCharStream(charStreams);
const lexer = this.createLexerFromCharStream(charStreams);
if (errorListener) {
lexer.removeErrorListeners();
lexer.addErrorListener(new ParseErrorListener(errorListener));
Expand Down Expand Up @@ -140,7 +140,7 @@ export default abstract class BasicParser<
private createParserWithCache(input: string): P {
this._parseTree = null;
this._charStreams = CharStreams.fromString(input.toUpperCase());
this._lexer = this.createLexerFormCharStream(this._charStreams);
this._lexer = this.createLexerFromCharStream(this._charStreams);

this._lexer.removeErrorListeners();
this._lexer.addErrorListener(new ParseErrorListener(this._errorListener));
Expand Down
2 changes: 1 addition & 1 deletion src/parser/flinksql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SyntaxContextType, Suggestions, SyntaxSuggestion } from './common/basic
import BasicParser from './common/basicParser';

export default class FlinkSQL extends BasicParser<FlinkSqlLexer, ProgramContext, FlinkSqlParser> {
protected createLexerFormCharStream(charStreams) {
protected createLexerFromCharStream(charStreams) {
const lexer = new FlinkSqlLexer(charStreams);
return lexer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/parser/hive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { HiveSqlParserListener } from '../lib/hive/HiveSqlParserListener';
import { SyntaxContextType, Suggestions, SyntaxSuggestion } from './common/basic-parser-types';

export default class HiveSQL extends BasicParser<HiveSqlLexer, ProgramContext, HiveSqlParser> {
protected createLexerFormCharStream(charStreams) {
protected createLexerFromCharStream(charStreams) {
const lexer = new HiveSqlLexer(charStreams);
return lexer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/parser/impala.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class ImpalaSQL extends BasicParser<
ProgramContext,
ImpalaSqlParser
> {
protected createLexerFormCharStream(charStreams) {
protected createLexerFromCharStream(charStreams) {
const lexer = new ImpalaSqlLexer(charStreams);
return lexer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/parser/mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Suggestions, SyntaxContextType, SyntaxSuggestion } from './common/basic
import { MySqlParserListener } from '../lib/mysql/MySqlParserListener';

export default class MySQL extends BasicParser<MySqlLexer, ProgramContext, MySqlParser> {
protected createLexerFormCharStream(charStreams): MySqlLexer {
protected createLexerFromCharStream(charStreams): MySqlLexer {
const lexer = new MySqlLexer(charStreams);
return lexer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/parser/pgsql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class PostgresSQL extends BasicParser<
ProgramContext,
PostgreSQLParser
> {
protected createLexerFormCharStream(charStreams) {
protected createLexerFromCharStream(charStreams) {
const lexer = new PostgreSQLLexer(charStreams);
return lexer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/parser/plsql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import BasicParser from './common/basicParser';
import { Suggestions } from './common/basic-parser-types';

export default class PLSQL extends BasicParser<PlSqlLexer, ProgramContext, PlSqlParser> {
protected createLexerFormCharStream(charStreams) {
protected createLexerFromCharStream(charStreams) {
const lexer = new PlSqlLexer(charStreams);
return lexer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/parser/spark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Suggestions, SyntaxContextType, SyntaxSuggestion } from './common/basic
import { SparkSqlParserListener } from '../lib/spark/SparkSqlParserListener';

export default class SparkSQL extends BasicParser<SparkSqlLexer, ProgramContext, SparkSqlParser> {
protected createLexerFormCharStream(charStreams) {
protected createLexerFromCharStream(charStreams) {
const lexer = new SparkSqlLexer(charStreams);
return lexer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/parser/trinosql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import BasicParser from './common/basicParser';
import { Suggestions, SyntaxContextType, SyntaxSuggestion } from './common/basic-parser-types';

export default class TrinoSQL extends BasicParser<TrinoSqlLexer, ProgramContext, TrinoSqlParser> {
protected createLexerFormCharStream(charStreams) {
protected createLexerFromCharStream(charStreams) {
const lexer = new TrinoSqlLexer(charStreams);
return lexer;
}
Expand Down
Loading