antlr / antlr4test-maven-plugin

A maven plugin used to test the grammars-v4 repo grammars
BSD 3-Clause "New" or "Revised" License
17 stars 16 forks source link

Adds Grammar Initialization and Multiple Test Scenarios #19

Closed gilcesarf closed 4 years ago

gilcesarf commented 4 years ago

This pull request adds grammar initialization capabilities to the plugin. It also adds possibility to configure multiple test scenarios for a single grammar. All new configuration options are described within Readme.md file. Unit tests were also updated to test new options added.

Theses changes were made to allow tests of more sophisticated grammars that uses superClass antlr4 option and need initialization before use. For example, a Lexer/Parser superclass that allows multiple modes and/or language versions being parsed within the same grammar would need to be setup to reflect those mode/options within the test. A very simple grammar that uses a "IgnoreSpace" option were included within src/test/resources/dummy to support unit tests.

teverett commented 4 years ago

@gilcesarf thanks, this is a significant improvement.

From my look at the PR it appears to be backwards compatible. Is that right?

gilcesarf commented 4 years ago

Yes, I thought the change would be accepted easier if it was backward compatible. This way we don't break any project using the plugin. I just do not know how you are controlling version numbers, so I left it unchanged. I also made PR to master, but do not know if you have another intermediary branch to merge to.

teverett commented 4 years ago

@gilcesarf thanks!

gilcesarf commented 4 years ago

@teverett happy to help ...

teverett commented 4 years ago

@gilcesarf I've merged it and made a release. Will update the pom.xml on grammars-v4 shortly.