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

Upgrade to JavaCC 5.0 #919

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

ahelwer
Copy link
Contributor

@ahelwer ahelwer commented Apr 27, 2024

This is needed to make parser generation work on Windows now that we added Unicode characters, since JavaCC 5.0 added the -GRAMMAR_ENCODING command line flag. This takes us from a version of JavaCC released in 2006 to one released in 2009.

All the text files in this PR are auto-generated except for customBuild.xml, tla+.jj, and ParseExceptionExtended.java.

There were some minor changes needed in response to breaking changes in the generated parser code:

  • Removal of reference to a now-nonexistent global variable lookingAhead; this does not change how the parser functions, as ensured by the parser test corpus
  • Removal of reference to now-nonexistent field specialConstructor in ParseExceptionExtended.java, mirroring change in the generated code of its parent class

I also took the opportunity to remove three isolated tab characters in the tla+.jj file, so it now only uses spaces for indentation.

One of the weirder changes in the generated parser file is that "\n" is now emitted as "\u005cn". I have tested in a simple hello world java project and confirmed they function identically.

@ahelwer ahelwer force-pushed the fix-javacc-windows branch 3 times, most recently from 56b176e to 078b9ad Compare April 27, 2024 21:31
@ahelwer ahelwer marked this pull request as draft April 27, 2024 22:10
@ahelwer ahelwer force-pushed the fix-javacc-windows branch 2 times, most recently from 978396c to 96ccf59 Compare April 30, 2024 21:04
Signed-off-by: Andrew Helwer <2n8rn1w1f@mozmail.com>
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.

None yet

1 participant