Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Support for the Python target is currently only available in the source repository.
It is still under development and not yet ready for any real use.

Simple lexers and parsers are already working, but there are still many bits and pieces missing (e.g. malformed input will crash the parser or even result in an infinite loop).

The following Python versions are supported: 2.3 2.4 2.5

Caveats

Actions

Actions must not have any extra whitespace on the left side, antlr does not yet properly dedent action code so it will end up with too much indention in the generated code. For one-liners make sure that there is no whitespace between the '{' and the code, e.g. {print "foobar"}. For longer blocks use something like

rule:
    subrule
    {
if condition:
    print "foobar"
    }

instead of the more readable

rule:
    subrule
    {
        if condition:
            print "foobar"
    }

This has to be fixed.

  • No labels