forked from DTStack/dt-sql-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplsql.ts
More file actions
17 lines (15 loc) · 643 Bytes
/
Copy pathplsql.ts
File metadata and controls
17 lines (15 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { InputStream, CommonTokenStream, Lexer } from 'antlr4';
import { PlSqlLexer } from '../lib/plsql/PlSqlLexer';
import { PlSqlParser } from '../lib/plsql/PlSqlParser';
import BasicParser from './common/basicParser';
export default class PLSQLParser extends BasicParser {
public createLexer(input: string): Lexer {
const chars = new InputStream(input.toUpperCase());
const lexer = <unknown> new PlSqlLexer(chars) as Lexer;
return lexer;
}
public createParserFromLexer(lexer: Lexer): any {
const tokenStream = new CommonTokenStream(lexer);
return new PlSqlParser(tokenStream);
}
}