Latest version
Released:
The first step is to install ANTLR Language Support extension for Visual Studio, you just have to search for it in for Visual Studio going to Tools → Extensions and Updates. This will allow to easily integrate ANTLR into your workflow by generating automatically the parser and, optionally, listener and visitor starting from your grammar. Mak, Install and Configure ANTLR 4 for C 18 In the right panel, type “ExprCpp” for the configuration name (Figure 21). If the Projectfield is empty, click the first Browsebutton to select the project. ANTLRWorks: The ANTLR GUI Development Environment. ANTLRWorks is a novel grammar development environment for ANTLR v3 grammars written by Jean Bovet (with suggested use cases from Terence Parr). It combines an excellent grammar-aware editor with an interpreter for rapid prototyping and a language-agnostic debugger for isolating grammar errors.
Setuptools command for generating ANTLR based parsers.
Project description
Overview
A setuptools command for generating ANTLR based parsers.
This is an extension for setuptools integrating the famous ANTLR parser generator into the Python packaging process. It encapsulates the Java based generator of ANTLR and provides the user a single command to control the generation process.
All command line options of ANTLR are also available through the setuptools command. The user has the choice to pass the options on the command line or configure ANTLR in a dedicated section in the setup.cfg file.
ANTLR grammars and its dependencies like imported grammars or token files are automatically detected. For each grammar a Python package will be generated during execution of the antlr command.
Installation
setuptools-antlr can be installed in various ways. To run it the following prerequisites have to be fulfilled:
- Python 3.5+
- setuptools
- Java JRE 1.7+
The source distribution is already shipped with ANTLR 4.7.1. It isn’t necessary to download ANTLR additionally.
After installation, the used Python environment has a new setuptools command called antlr.
From PyPI
Usage
Integration
For a smooth user experience it’s recommended to pass setuptools-antlr using the setup_requires argument of setup function. Additionally each generated parser requires the ANTLR runtime library which should be added to install_requires argument:
Before generating a parser setuptools will automatically check the Python environment and download setuptools-antlr from PyPI if it’s missing. During the installation of the project package pip will install antlr4-python3-runtime into the Python environment.
Configuration
setuptools-antlr provides two possibilities to configure the ANTLR parser generator.
All options of ANTLR can be passed on the command line after the antlr command:
It’s also possible to pass several options to ANTLR or execute multiple commands at once:
See python setup.py antlr --help for available command line options:
The ANTLR documentation explains all command line options and grammar options in detail.
Apart from passing options on the command line it’s also possible to add a dedicated [antlr] section to setup.cfg. The following example section contains all available options:
A reference configuration is provided in the resources directory.
Sample
Besides the setuptools-antlr source code a sample project called foobar is provided in the samples directory. This sample consists of the two ANTLR grammars Foo and Bar. During the execution of setuptools-antlr two Python packages will be generated into the foobar package directory containing a parser for each grammar.
To generate parsers for both grammars and build a foobar wheel package execute the following command:
Release historyRelease notifications | RSS feed
0.4.0
0.3.0
0.2.2
0.2.1
Antlr Install Ubuntu
0.2.0
0.1.2
0.1.1
0.1.0
Install Antlr Nuget
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
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 setuptools_antlr-0.4.0-py3-none-any.whl (2.1 MB) | File type Wheel | Python version py3 | Upload date | Hashes |
Filename, size setuptools-antlr-0.4.0.tar.gz (2.1 MB) | File type Source | Python version None | Upload date | Hashes |
Hashes for setuptools_antlr-0.4.0-py3-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | d11e38c5631bbe03c76d9d35fa8c8dd0f524ca221be61fd14ca50ae1b0a4a2ca |
MD5 | 39257ef6594b634e8bd16f70c8cdcaf5 |
BLAKE2-256 | 242640c3800730577665ad0ba0c70eec55eee8212ccf788f3866ca7880614640 |
Hashes for setuptools-antlr-0.4.0.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 7851e3e9ac7bebe35d44f6c6e020328cf0a88ccbdeb8048dbd00f829236eab97 |
MD5 | 160ef036e25e8eff9bd19338d2255f8f |
BLAKE2-256 | eb7530e004ca974397d74119d96a50ab95e32f9bcf041a3fb5826d339a50c60d |
The C# target of the ANTLR 4 parser generator for Visual Studio 2010+ projects. This package supports projects targeting .NET 2.0 or newer, and built using Visual Studio 2010 or newer.
Antlr Installers
Requires NuGet 2.7 or higher.
Release Notes
Dependencies
- Antlr4.CodeGenerator(>= 4.6.6)
- Antlr4.Runtime(>= 4.6.6)
Used By
NuGet packages (30)
Install Antlr Windows
Showing the top 5 NuGet packages that depend on Antlr4:
Package | Downloads |
---|---|
NCalc2 NCalc is a mathematical expressions evaluator in .NET. NCalc can parse any expression and evaluate the result, including static or dynamic parameters and custom functions. | |
EntityGraphQL A GraphQL library for .NET Core. Compiles queries into .NET Expressions (LinqProvider) for runtime execution against object graphs. E.g. against an ORM data model (EntityFramework or others) or just an in-memory object. | |
Microsoft.ProgramSynthesis.Compiler Library for generating code for a DSL from its grammar. Part of the Microsoft PROgram Synthesis using Examples SDK (PROSE). | |
Tool.NuPrep A Tool™ to automate build, pack, and push of multi-target .net based nuget packages. | |
Jql Jql is a url friendly query language which has the capability to directly generate a linq expression. |
GitHub repositories (13)
Showing the top 5 popular GitHub repositories that depend on Antlr4:
Repository | Stars |
---|---|
p-org/P | |
rubberduck-vba/Rubberduck Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE). | |
Azure/iotedge | |
PistonDevelopers/VisualRust Visual Studio extension for Rust | |
TabularEditor/TabularEditor This is the code repository and issue tracker for Tabular Editor 2.X (free, open-source version). |
Version History
Version | Downloads | Last updated |
---|---|---|
4.6.6 | 705,968 | 12/23/2018 |
4.6.6-rc001 | 6,168 | 10/1/2018 |
4.6.5 | 58,475 | 8/31/2018 |
4.6.5-rc002 | 10,333 | 5/25/2018 |
4.6.5-rc001 | 1,041 | 5/13/2018 |
4.6.5-beta002 | 22,562 | 4/8/2018 |
4.6.5-beta001 | 12,283 | 7/16/2017 |
4.6.4 | 712,028 | 7/12/2017 |
4.6.3 | 1,674 | 7/11/2017 |
4.6.2 | 1,012 | 7/7/2017 |
4.6.1 | 24,939 | 5/30/2017 |
4.6.1-beta002 | 73,964 | 3/9/2017 |
4.6.1-beta001 | 125,468 | 3/8/2017 |
4.5.4-beta001 | 2,603 | 10/8/2016 |
4.5.3.1-beta001 | 2,358 | 7/22/2016 |
4.5.3 | 76,847 | 7/21/2016 |
4.5.3-rc1 | 2,912 | 6/9/2016 |
4.5.0-alpha003 | 13,809 | 10/31/2015 |
4.5.0-alpha002 | 3,719 | 5/22/2015 |
4.4.1-alpha001 | 4,747 | 9/30/2014 |
4.3.0 | 283,706 | 7/7/2014 |
4.2.2-alpha001 | 7,474 | 4/8/2014 |
4.2.1-alpha001 | 2,323 | 3/25/2014 |
4.2.0-alpha001 | 2,209 | 2/18/2014 |
4.1.0-alpha003 | 3,354 | 8/6/2013 |
4.1.0-alpha002 | 1,208 | 8/6/2013 |
4.1.0-alpha001 | 3,114 | 8/5/2013 |