Skip to content
Merged
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
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,24 @@ complete and the default reference.
The generated parser is not uploaded to the repository since it's huge, to use the package locally or
to build a different version use the build script.

At the end of the build script `setup_grammar.py` the target and the versions can be modified.

The script needs two dependencies `pip install antlr4-python3-runtime requests` you can either
install those manually or use the `pyproject.toml` from the python target, both options can be used to build targets.

```python
if __name__ == '__main__':
version = '5.6.4'
target = Antlr4Target.python
download_cratedb_grammar(version)
compile_grammar(target)
patch_lexer(target)
set_version(target, version)
```
#### Clone the project
`git clone [email protected]:crate/cratedb-sqlparse.git`

#### Install the dependencies
`pip install antlr4-python3-runtime requests`

#### Run the build script
`python3 setup_grammar.py`


> At the end of the build script `setup_grammar.py` the target and the CrateDB version can be modified.
>
> ```python
> if __name__ == '__main__':
> version = '5.6.4'
> target = Antlr4Target.python
> download_cratedb_grammar(version)
> compile_grammar(target)
> patch_lexer(target)
> set_version(target, version)
>```