Skip to content

[core] Fix #4972: Update ANTLR from 4.9.3 to 4.13.2#6621

Merged
adangel merged 7 commits into
pmd:mainfrom
UncleOwen:issue-4972-update-antlr
May 8, 2026
Merged

[core] Fix #4972: Update ANTLR from 4.9.3 to 4.13.2#6621
adangel merged 7 commits into
pmd:mainfrom
UncleOwen:issue-4972-update-antlr

Conversation

@UncleOwen

@UncleOwen UncleOwen commented Apr 24, 2026

Copy link
Copy Markdown
Member

Describe the PR

Questions

Is updating apex-parser a breaking change that requires a major version?
I haven't investigated why SwiftNameDictionary needs the added slash. I just know that this makes the test green. Is this a sign of a bigger problem?

-> yes. Actually these are tokens/keywords that don't exist and should be removed. But we can't due to #6655.

Related issues

Ready?

  • [n/a] Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • [n/a] Added (in-code) documentation (if needed)

Bumps [io.github.apex-dev-tools:apex-parser](https://github.com/apex-dev-tools/apex-parser) from 4.4.1 to 5.0.0.
- [Release notes](https://github.com/apex-dev-tools/apex-parser/releases)
- [Changelog](https://github.com/apex-dev-tools/apex-parser/blob/main/CHANGELOG.md)
- [Commits](apex-dev-tools/apex-parser@v4.4.1...v5.0.0)

---
updated-dependencies:
- dependency-name: io.github.apex-dev-tools:apex-parser
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@UncleOwen UncleOwen changed the title [core][apex][swift] Fix #4972: Update antlr from 4.9.3 to 4.13.2 [chore][apex][swift] Fix #4972: Update antlr from 4.9.3 to 4.13.2 Apr 24, 2026
@pmd-actions-helper

pmd-actions-helper Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
There are 0 changed duplications, 0 new duplications and 0 removed duplications.
There are 0 changed CPD errors, 0 new CPD errors and 0 removed CPD errors.

Regression Tester Report

(comment created at 2026-05-08 10:08:20+00:00 for d4b7d81)

@UncleOwen UncleOwen force-pushed the issue-4972-update-antlr branch from 2c8d48e to 1307e2b Compare April 24, 2026 14:09
@UncleOwen

Copy link
Copy Markdown
Member Author

The different unicode escaping in SwiftNameDictionary seems to be necessary because of antlr/antlr4#2281, so I think this should be fine.

@UncleOwen UncleOwen added the dependencies Pull requests that update a dependency file label May 1, 2026

@adangel adangel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Note, that upgrading antlr will be a breaking change:

https://github.com/antlr/antlr4/releases/tag/4.10

4.10-generated parsers incompatible with previous runtimes

ANTLR not only generates recursive-descent parsers; it generates a state machine called an augmented transition network (ATN) in serialized form as a bunch of integers stored in the generated parser and lexer files. This serialization format was changed for 4.10 to remove a size limit on the supported ATNs. See antlr/antlr4#3591.

The key point here is that we changed the version number stored inside the serialization format and so, in order to use this new version of ANTLR, you must regenerate all of your lexers and parsers using the 4.10 tool and then use the new runtime. Parsers generated with 4.10 or not compatible with previous versions of the runtime.

I guess, we will know, how many downstream users use PMD with antlr and not rebuilding their grammar when building their custom language module, when we release 7.25.0.

But upgrading this allows us to upgrade apex-parser to a version 5+ which hopefully fixes some grammar issues (unfortunately not part of 5.0.0 yet: apex-dev-tools/apex-parser#84 would be needed for #6478 ). So, we should definitely upgrade, then the next upgrade is easier.

I'll update this PR, update release notes, fix swift grammar (remove the hyphen completely) and incorporate #6612

Needed for upgrading antlr, see pmd#4972 / pmd#6621
@adangel adangel added this to the 7.25.0 milestone May 8, 2026
@adangel adangel changed the title [chore][apex][swift] Fix #4972: Update antlr from 4.9.3 to 4.13.2 [core] Fix #4972: Update antlr from 4.9.3 to 4.13.2 May 8, 2026
@adangel adangel force-pushed the issue-4972-update-antlr branch from 1307e2b to d4b7d81 Compare May 8, 2026 09:53
@adangel adangel merged commit f657de2 into pmd:main May 8, 2026
13 checks passed
@UncleOwen UncleOwen deleted the issue-4972-update-antlr branch May 8, 2026 13:17
@adangel adangel changed the title [core] Fix #4972: Update antlr from 4.9.3 to 4.13.2 [core] Fix #4972: Update ANTLR from 4.9.3 to 4.13.2 May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[core] Update ANTLR to 4.13.2

2 participants