Skip to content

Commit f851638

Browse files
committed
feat: add generic and plsql basic parser file
1 parent 6880031 commit f851638

83 files changed

Lines changed: 326433 additions & 155590 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ package-lock.json
33
.DS_Store
44
.vscode
55
.history
6-
lib/
6+
dist/
77
src/**/.antlr

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ package-lock.json
77
.history
88
site
99
src/
10-
docs
10+
docs
11+
lib/grammar

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# dt-sql-parser
2+
3+
summary
4+
5+
## How to contribute
6+
7+
## Prerequisites
8+
9+
## Semantic Versioning
10+
11+
## Branch Organization
12+
13+
## Release Process
14+
15+
## Source Code Organization

NeREADME.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# dt-sql-parser
2+
3+
[![NPM version][npm-image]][npm-url]
4+
5+
[npm-image]: https://img.shields.io/npm/v/dt-sql-parser.svg?style=flat-square
6+
[npm-url]: https://www.npmjs.com/package/dt-sql-parser
7+
8+
## Installation
9+
10+
## Usage
11+
12+
### Basic
13+
14+
### Syntax validation
15+
16+
### Visitor
17+
18+
### Listener
19+
20+
## Example
21+
22+
## Roadmap
23+
24+
- Unify parser generate to Antlr4
25+
- Generic SQL
26+
- Flink SQL
27+
- Libra SQL
28+
- TiDB
29+
MySQL Compatible Syntax
30+
31+
## Contributing
32+
33+
## License

build/antlr4.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ const exec = require('child_process').exec;
33

44
const antlr4 = path.resolve(__dirname, 'antlr-4.8-complete.jar');
55
const grammars = path.resolve(__dirname, '../src/grammar');
6-
const output = path.resolve(__dirname, '../src/parser');
6+
const output = path.resolve(__dirname, '../src/lib');
77

88
const entry = [
99
'generic',
10-
'mysql',
1110
'hive',
1211
'plsql',
1312
'spark',
14-
'tsql',
13+
'impala',
1514
];
1615

1716
entry.forEach((language) => {

docs/Roadmap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@
1717
- Generic SQL
1818
- Flink SQL
1919
- Libra SQL
20-
- Oracle SQL
2120
- TiDB
2221
MySQL Compatible Syntax

docs/Tutorials.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Tutorials
22

3+
## Antlr4 installation
4+
5+
## How to extend new grammar
6+
7+
## How to expose Javascript interface in this project
8+
9+
## Integrate with Monaco Editor
10+
311
## Reference
412

513
- <https://tomassetti.me/writing-a-browser-based-editor-using-monaco-and-antlr/>

jest.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = {
2727
// coverageDirectory: null,
2828

2929
// An array of regexp pattern strings used to skip coverage collection
30-
coveragePathIgnorePatterns: ["/node_modules/"],
30+
coveragePathIgnorePatterns: ['/node_modules/'],
3131

3232
// A list of reporter names that Jest uses when writing coverage reports
3333
// coverageReporters: [
@@ -57,7 +57,7 @@ module.exports = {
5757

5858
// A set of global variables that need to be available in all test environments
5959
globals: {
60-
window: {},
60+
window: {},
6161
},
6262

6363
// An array of directory names to be searched recursively up from the requiring module's location
@@ -129,7 +129,7 @@ module.exports = {
129129
// snapshotSerializers: [],
130130

131131
// The test environment that will be used for testing
132-
testEnvironment: "node",
132+
testEnvironment: 'node',
133133

134134
// Options that will be passed to the testEnvironment
135135
// testEnvironmentOptions: {},
@@ -144,7 +144,7 @@ module.exports = {
144144
// ],
145145

146146
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
147-
testPathIgnorePatterns: ["/node_modules/"],
147+
testPathIgnorePatterns: ['/node_modules/'],
148148

149149
// The regexp pattern or array of patterns that Jest uses to detect test files
150150
// testRegex: [],
@@ -163,11 +163,11 @@ module.exports = {
163163

164164
// A map from regular expressions to paths to transformers
165165
transform: {
166-
"^.+\\.(t|j)sx?$": "ts-jest",
166+
'^.+\\.(t|j)sx?$': 'ts-jest',
167167
},
168168

169169
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
170-
transformIgnorePatterns: ["/node_modules/"],
170+
transformIgnorePatterns: ['/node_modules/'],
171171

172172
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
173173
// unmockedModulePathPatterns: undefined,
@@ -180,4 +180,4 @@ module.exports = {
180180

181181
// Whether to use watchman for file crawling
182182
// watchman: true,
183-
};
183+
};

lib/index.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

lib/utils/index.js

Lines changed: 0 additions & 123 deletions
This file was deleted.

0 commit comments

Comments
 (0)