Antlr Install

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 version

Released:

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 the ast-viewer container.

Run tests

Or run the test locally, first build the grammar then run:

Travis deployment

Antlr
  • 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

Antlr Install

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.

Files for antlr-tsql, version 0.12.6
Filename, sizeFile typePython versionUpload dateHashes
Filename, size antlr-tsql-0.12.6.tar.gz (264.4 kB) File type Source Python version None Upload dateHashes
Close

Hashes for antlr-tsql-0.12.6.tar.gz

Hashes for antlr-tsql-0.12.6.tar.gz
AlgorithmHash digest
SHA2568b3a41da30b7b8299e316abb08e815e6bfd89e06fa86121ce2da00318605c5f9
MD5fbefdc5bdb8268c4077eab763ebe14da
BLAKE2-2566def9c5be4cbe024ebacd45b4c6c7e6418b847ba5b081bfb627b833853a83eb4
ANTLRWorks: The ANTLR GUI Development Environment
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?
ANTLRWorks speeds up development for experts and beginners alike.

See also the Romanian translation of this web page (by Web Geek Science)

Download ANTLRWorks 1.5.2

On Mac OS X you can just click on that jar and it will start up the GUI. Same for Windows unless you use IE (IE thinks it's a zip). On Linux, you have to save to the disk and run from the command line (read this tutorial for more information about launching ANTLRWorks). That jar includes all the other jars necessary to run it including ANTLR 3.5rc2, StringTemplate 4.0.7rc2, and StringTemplate 3.2.1.
Note: ANTLRWorks requires Java 1.5 or later to run

Previous Versions
Take your pick from download directory.

Bugs

  • Bugs: sorry, I am not fixing bugs anymore
Antlr installation guide
Screen shots and movies
Editor Window
Integrated Debugger
Click the following link to watch the debugger in action:
Decision DFA Visualization

Documentation

Antlr Install

Editor

  • Single window editing
  • Syntax highlighting
  • Rule navigation tree
  • Jump to rule or token definition
  • Go To Rule
  • Find usages of tokens or rules
  • Find and Replace using regular expression
  • Sensitive keyword, rule, and token auto-completion
  • Rules and actions folding
  • Tips and ideas
  • Auto-indentation
  • Refactoring - remove left recursion, extract or inline rule, etc.
  • Show generated lexer or parser code using syntax coloring
  • Syntax diagram display for lexer and parser rule
  • Show unreachable alternative(s) in syntax diagram
  • Display nondeterminism warning as ambiguous paths through the syntax diagram
  • Highlight decision DFA
  • Rule dependency graph
  • Export syntax diagram, NFA and parse tree to bitmap image or EPS file
  • Perforce integration
  • emacs key bindings (Mac OS X only)
  • Contextual menus
  • Print

Grammar interpreter

ANTLRWorks can immediately interpret a grammar and test it againstsome sample input--without generating anything! Great for rapidprototyping. You get the parse tree as a result of interpreting agrammar. Imagine passing some input to a rule in your grammar andinstantly seeing how the rule matches the input.

  • Dynamically interpreter any input text
  • Display parse trees as list or graph

Grammar debugger

ANTLR v3 has a sophisticated debug event mechanism that allows ANTLRWorks to follow along as a parser processes input. ANTLR v3 includes a well-defined protocol for communicating with remote parsers so ANTLRWorks can actually connect to a parser generated in any language with a socket library. We designed the debugger to work like TiVo: you can pause a running parser and then rewind it! Once a parse has completed, ANTLRWorks has a complete trace and allows the user to walk back and forth over the input stream like a video camera.

  • Local or remote debugger
  • Language agnostic
  • Dynamic parse tree
  • Dynamic AST
  • Tree grammar debugging
  • Lookahead highlighting
  • Breakpoint in grammar
  • Breakpoint in input text!
  • Breakpoint on any events - LT, consume token, exception, etc.
  • Step over rule
  • Show corresponding grammar location and parse tree node for each input token
  • Detachable panels