-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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/antlr4] Implement target agnostic ports for antlr4. #4435
Draft
kaby76
wants to merge
33
commits into
antlr:master
Choose a base branch
from
kaby76:g4-4434
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
All ports need to be rewritten in target agnostic format.
…ntlr-ng generator for Antlr4ng testing.
Antlr4 "@Header" blocks are target specific. But, we need this to work for any target. So, we use a comment in the grammar and transformGrammar.py to fix up the problem. _insideOptionsBlock is removed because it's not used anywhere. Untabify source code--tabs are presentation specific and thus depend on the editor used to open it. We don't use the same editors people.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #4434, implements the rest of the ports for the antlr/antlr4 grammar, and fixes the build for split grammars for the Cpp target by updating the the latest Trash Toolkit.
The build was broken for PR #4424, so that PR never got a clean bill of health from testing. The old Maven tester could have been used instead, but it wasn't done either. The .errors files needed to be remastered. In addition, the changes broken the Python3 and Cpp ports.
To get things back on track, I fixed the build--more or less--with #4425. That PR removed the Cpp and Python3 ports for the antlr/antlr4 grammar, and it remastered a couple of .errors files that changed due to a change in the grammar. The changes that Mike did to antlr/antlr4 grammar itself were fine and I kept them.
But, that didn't fix everything. This PR completes the fixes.
NB: I did not add a Go port because it goes back to the problem with the Go target not implementing a class structure correctly. I can't really do justice because I need to define
emit()
, and I have to jump through hoops to bypass the problem. I'm just not interested.As it is, I had to do some incredibly bad things because Antlr Python3 has issues of trying to reference mode constants, and because the Dart target does not have a way to get the size of the mode stack!