Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANTLR Tool version 4.13.0 used for code generation does not match the current runtime version 4.11.1 on mvn clean install #3588

Closed
ris58h opened this issue Jul 6, 2023 · 4 comments

Comments

@ris58h
Copy link
Contributor

ris58h commented Jul 6, 2023

  1. Go to css3 grammar.
  2. mvn clean install
[INFO] --- antlr4test:1.22:test (default) @ CSS3 ---
[INFO] Evaluating Scenario: Default Scenario
[INFO] Parsing :/Users/ris/projects/grammars-v4/css3/examples/mdn-at-font-face.css
ANTLR Tool version 4.13.0 used for code generation does not match the current runtime version 4.11.1
ANTLR Runtime version 4.13.0 used for parser compilation does not match the current runtime version 4.11.1
ANTLR Tool version 4.13.0 used for code generation does not match the current runtime version 4.11.1
ANTLR Runtime version 4.13.0 used for parser compilation does not match the current runtime version 4.11.1
[INFO] Parsing :/Users/ris/projects/grammars-v4/css3/examples/bootstrap.min.css
@kaby76
Copy link
Contributor

kaby76 commented Jul 8, 2023

The root pom.xml contains one version for Antlr4 (4.13.0), but the plugin sets a different version. The version selected in grammars-v4 is not overriding the version in the plugin as intended. The easiest would be to update the plugin, upgrade here. But that would not fix an entry in the root pom.xml that does not work. Why even have it? The latest version of the plugin is 1.22.

@kaby76
Copy link
Contributor

kaby76 commented Jul 8, 2023

I added an issue requesting a new version of the plugin be published. antlr/antlr4test-maven-plugin#89

The problem is that the version in the grammars-v4/pom.xml is the version of the tool, but the version of the Antlr Java runtime is 4.11.1. The tester should not be using two different version numbers. This, again, is why you should be using the Trash toolkit. It uses one, and only one, version number for the tool and runtime, not only for Java, but for all targets. I worked very hard to get this working across all targets.

The alternative is to keep the version fixed on both tool and runtime and never ever change it. This would mean any grammars that have been updated to use specific features of a new version of Antlr have to be removed from Maven testing, or we request a new version of the plugin. I am anticipating the next version of Antlr to have StringTemplate actions, to clean out the "transformGrammars.py" hack. That will mean any "target agnostic grammars" will be converted over to ST actions and untestable with the Maven test plugin.

@kaby76
Copy link
Contributor

kaby76 commented Jul 11, 2023

@ris58h Please update and check that the fix works.

@ris58h
Copy link
Contributor Author

ris58h commented Jul 11, 2023

@kaby76 no warnings anymore. Thanks!

@ris58h ris58h closed this as completed Jul 11, 2023
rvrooman-codelogic pushed a commit to CodeLogicIncEngineering/grammars-v4-public-fork that referenced this issue Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants