Skip to content

Commit

Permalink
Update antlr version to 4.11.1 (#368)
Browse files Browse the repository at this point in the history
* Update antlr version to 4.11.1

* add notes for next time

* update lockfiles

* run pre-commit

* appease codacy

---------

Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com>
  • Loading branch information
rcomer and trexfeathers authored Sep 13, 2023
1 parent 5684bca commit 2ac94d3
Show file tree
Hide file tree
Showing 16 changed files with 7,483 additions and 1,055 deletions.
8 changes: 6 additions & 2 deletions cf_units/_udunits2_parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ the multi-mode tokenizer of the UDUNITS-2 grammar.
The [parser](udunits2Parser.g4) defines the grammar of the tokens, along with
a number of convenient lexical elements.


### Generating the parser from the grammar

Once the Jinja2 template has been expanded, the
Expand All @@ -23,8 +22,13 @@ deployment and testing (we know it isn't ideal, but it really does make things e
Please commit the changed parser at the same time as any
changes to the grammar being proposed so that the two can remain in synch.

### Updating the ANTLR version

The above script downloads a Java Jar which needs updating to the same version
as antlr4-python3-runtime specified in the python requirements. Once these have
been updated, run [the script](compile.py) to regenerate the parser.

### Testing the gammar
### Testing the grammar

An extensive set of tests exist to confirm that the parser produces equivalent results
to the UDUNITS-2 reference implementation.
Expand Down
2 changes: 1 addition & 1 deletion cf_units/_udunits2_parser/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
raise ImportError("Jinja2 needed to compile the grammar.")


JAR_NAME = "antlr-4.7.2-complete.jar"
JAR_NAME = "antlr-4.11.1-complete.jar"
JAR_URL = f"https://www.antlr.org/download/{JAR_NAME}"
HERE = Path(__file__).resolve().parent

Expand Down
5,867 changes: 5,569 additions & 298 deletions cf_units/_udunits2_parser/parser/udunits2Lexer.py

Large diffs are not rendered by default.

Loading

0 comments on commit 2ac94d3

Please sign in to comment.