ANother Tool for Language Recognition, is a language tool that provides a framework for constructing recognizers, interpreters, compilers, and translators from grammatical descriptions containing actions in a variety of target languages. Package Manager.NET CLI. ANTLR requires Java, so we suggest you use Docker when building grammars. The Makefile contains directives to clean, build, test and deploy the ANTLR grammar. It does not run Docker itself, so run make inside Docker. Build the grammar # Build the docker container docker build -t antlrtsql. ANTLR 4.9.2 runtime for Python 3.7. Download the file for your platform. If you're not sure which to choose, learn more about installing packages. In this example we will parse a simple text with ANTLR to see how to set up and use ANTLR with Intellij IDEA or Android Studio. Afterward you can extend the example or write your own files to parse more complex input. First you need to install the ANTLR plugin. Open the preferences and select “Plugins Browse repositories”. Npm install antlr4 Or, you can download antlr-javascript-runtime-4.9.2.zip. The runtime is provided in the form of source code, so no additional installation is required. Simply refer to the JavaScript in that zip from your project, and eventually webpack it.
Latest versionReleased:
A transact sql parser, written in Antlr4
Project description
Development
ANTLR requires Java, so we suggest you use Docker when building grammars. The Makefile
contains directives to clean, build, test and deploy the ANTLR grammar. It does not run Docker itself, so run make
inside Docker.
Build the grammar
Set up the Python module
Install Antlr Nuget
Now that the Python parsing files are available, you can install them with pip
:
And parse SQL code in Python:
Using the AST viewer
If you're actively developing on the ANLTR grammar or the tree shaping, it's a good idea to set up the AST viewer locally so you can immediately see the impact of your changes in a visual way.
- Clone the ast-viewer repo and build the Docker image according to the instructions.
- Spin up a docker container that volume mounts the Python package, symlink-installs the package and runs the server on port 3000:
When simultaneously developing other packages, volume mount and install those too:
- If you update the tree shaping logic in this repo, the app will auto-update.
- If you change the grammar, you will have to first rebuild the grammar (with the
antlr_tsql
docker image) and restart theast-viewer
container.
Run tests
Or run the test locally, first build the grammar then run:
Travis deployment
- Builds the Docker image.
- Runs the Docker image to build the grammar and run the unit tests.
- Deploys the resulting python files to PyPi when a new release is made, so they can be installed easily.
Release historyRelease notifications | RSS feed
0.12.6
0.12.5
0.12.3
0.12.2
0.12.1
0.12.0
0.11.1
0.11.0
Antlr Install Ubuntu
0.10.1
0.10.0
0.9.2
0.9.1
0.9.0
0.8.1
0.8.0
0.7.3
0.7.2
0.6.2
0.6.1
0.6.0
0.5.0
0.4.0
0.3.3
0.3.2
0.3.1
0.3.0
0.2.0
0.1.2
0.1.1
0.1.0
0.0.3
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size antlr-tsql-0.12.6.tar.gz (264.4 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for antlr-tsql-0.12.6.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 8b3a41da30b7b8299e316abb08e815e6bfd89e06fa86121ce2da00318605c5f9 |
MD5 | fbefdc5bdb8268c4077eab763ebe14da |
BLAKE2-256 | 6def9c5be4cbe024ebacd45b4c6c7e6418b847ba5b081bfb627b833853a83eb4 |
ANTLRWorks is a novel grammar developmentenvironment for ANTLR v3 grammars written by Jean Bovet (withsuggested use cases from Terence Parr). It combines an excellentgrammar-aware editor with an interpreter for rapid prototyping and alanguage-agnostic debugger for isolating grammar errors. ANTLRWorkshelps eliminate grammar nondeterminisms, one of the most difficultproblems for beginners and experts alike, by highlightingnondeterministic paths in the syntax diagram associated with agrammar. ANTLRWorks' goal is to make grammars more accessible to theaverage programmer, improve maintainability and readability ofgrammars by providing excellent grammar navigation and refactoringtools, and address the most common questions and problems encounteredby grammar developers:
- Why is this grammar fragment nondeterministic?
- Does this rule match a sample input?
- Why is this grammar improperly matching this complete input?
- Why is there a syntax error given this input?
- Why is there no syntax error given this ungrammatical input?
See also the Romanian translation of this web page (by Web Geek Science)
|
|
|
|
|
|
|