christoph2 / pyA2L

ASAM ASAP2 Library for Python
GNU General Public License v2.0
139 stars 71 forks source link

Autogenerate code when running setup.py #14

Closed bessman closed 4 years ago

bessman commented 4 years ago

As discussed in https://github.com/christoph2/pyA2L/issues/13.

setup.py will now generate python code from the antlr grammars as part of the build_py step. It looks for the antlr jar-file in the locations suggested by antlr's documentation. Alternatively, the location of the jar can be specified via the environment variable ANTLR_JAR. I will update the documentation accordingly.

This pull request also removes the py2/3 subpackages (since python2 is deprecated), so the Lexers and Parsers are now part of the main pya2l package. It also removes aml.g, which is superseded aml.g4, as well as all antlr *tokens-files, which are not needed at run-time.

Finally, it adds a .gitignore which, among other things, is configured to ignore Lexer.py and Parser.py to avoid those files being added by mistake in the future.

Types of changes

bessman commented 4 years ago

Most of the pylint warnings look like false positives to me. Not sure why ANTLR_JAR isn't being set in AppVeyor.

christoph2 commented 4 years ago

OK, let's give it a try.

christoph2 commented 4 years ago

CLASSPATH needs also to be considered, I will fix it.