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

[build] Fix for #3575 #3598

Closed
wants to merge 6 commits into from
Closed

[build] Fix for #3575 #3598

wants to merge 6 commits into from

Conversation

kaby76
Copy link
Contributor

@kaby76 kaby76 commented Jul 10, 2023

This is a fix for #3575, in response to antlr/antlr4test-maven-plugin#88 and #3574 (comment).

Tracking what tokens are produced in a parse is just as important as tracking the parse tree. The main problem with the .tree output file trace is that it doesn't print out detailed information about a token.

The change here automatically computes the tokens and places them in a file named after the input file with ".token" appended. Note, the suffix/extension of the file cannot be ".tokens" because that conflicts with the Antlr4 tool generated .tokens files. The .gitignore contains a pattern to ignore .tokens files!

To track the differences in the tokens produced, simply git add the file to the repo. To generate the file from scratch, run _scripts/test.sh or test.ps1. If you check in the token file, you should updated the pom.xml, and make sure to specify a wildcard pattern for the files to parse, e.g., examples/.sys`. If you do not, the old Maven test plugin will try to parse the .token file!*

The changes are:

  • Add code to the drivers to output to a .token file.
  • Add code to the target-specific test.* to run with -tokens and reset the lexer back to the beginning. Note, this will slow testing down because the input is lexed twice. But, it is a good test for the reset function of the port.

@kaby76 kaby76 changed the title Fix for #3575 [build] Fix for #3575 Jul 14, 2023
@kaby76 kaby76 closed this by deleting the head repository Sep 24, 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

Successfully merging this pull request may close these issues.

1 participant