Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning

Parsers generated for Python require the same version of the runtime as the ANTLR tool used. Right now the Python target is only functional up to v3.1.3, so you'll have to use that version of ANTLR and the runtime.

The python-antlr packages available with distributions like Ubuntu are not current. Install the appropriate runtime for your version of ANTLR using the instructions below.

...

  1. Download the "Complete ANTLR 3.x Java binaries jar" from the ANTLR download page, extract it, and run the Python installer.
    • On a Linux shell for version 3.3:
      No Format
      wget http://www.antlr.org/download/antlr-3.1.3.tar.gz
      tar xzf antlr-3.1.3.tar.gz
      cd antlr-3.1.3/runtime/Python
      sudo python setup.py install
      
  2. (tick) Check your installation by using the Python shell:
    No Format
    $ python
    Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
    [GCC 4.4.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import antlr3
    >>>
    

...