Skip to content

Commit

Permalink
Merge 35f01c5 into 957ce18
Browse files Browse the repository at this point in the history
  • Loading branch information
ferraith committed Aug 30, 2018
2 parents 957ce18 + 35f01c5 commit f487c5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ A ``setuptools`` command for generating ANTLR based parsers.

This is an extension for `setuptools <https://pypi.org/project/setuptools/>`__ integrating the famous `ANTLR <http://www.antlr.org/>`__ 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 have the choice to pass the options on the command line or configure ANTLR in a dedicated section in the ``setup.cfg`` file.
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.

Expand All @@ -40,7 +40,7 @@ Installation
``setuptools-antlr`` can be installed in various ways. To run it the following prerequisites have to be fulfilled:

- Python 3.5+
- setuptools 29.0.0+
- setuptools
- Java JRE 1.7+

The source distribution is already shipped with ANTLR 4.7.1. It isn't necessary to download ANTLR additionally.
Expand Down Expand Up @@ -180,7 +180,7 @@ A reference configuration is provided in the ``resources`` directory.
Sample
******

Alongside 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.
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:

Expand Down
7 changes: 3 additions & 4 deletions setuptools_antlr/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ class AntlrCommand(setuptools.Command):
An extra command for setuptools to generate ANTLR based parsers, lexers, listeners and visitors.
The antlr command wraps the Java based generator provided by ANTLR developers. It searches for
all grammar files and generates a Python package containing a modules specified in the user
options. Please keep in mind that only grammars are generated which aren't included by other
grammars. This prevents generation of shared content like common terminals.
all grammar files. For each grammar a Python package is generated containing the modules
specified in the user options.
:cvar _MIN_JAVA_VERSION: Minimal version of java required by ANTLR
:cvar _EXT_LIB_DIR: Relative path to external libs directory
Expand Down Expand Up @@ -162,7 +161,7 @@ def finalize_options(self):
as late as possible, ie. after any option assignments from the command-line or from other
commands have been done.
"""
# parse grammars
# parse grammars option
if self.grammars:
self.grammars = shlex.split(self.grammars, comments=True)

Expand Down

0 comments on commit f487c5c

Please sign in to comment.