-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Export recognizer class for dart target #3119
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
Conversation
I guess this could be merged before #3116 since after that PR the runtime will no longer be compatible with projects that uses dart pre 2.12. |
Yeah I agree. @ericvergnaud can you please help review this PR? Since this is a target runtime only change, when merged I'll make a patch release (like 4.9.2+1) with Dart runtime only without needing to release the whole ANTLR. |
@lingyv-li This is a good change but it's incomplete. It does not fix the bug because Interval is still missing, which I noted in the bug. For grammars-v4/sql/mysql/pom.xml, the parser requires a class that rewrites the character input stream to uppercase. I've implemented this for all targets, but I can't do this for Dart because Interrval is not exported, required by the Antlr stream class I am trying to create. I can't proceed further with the Dart target for this type of rewrite stream parsing. (Note, as noted by Mike Lischke, a unilateral uppercase rewrite of the character stream is really a bad way to do this, a lazy person's way out of writing the grammar properly, but that's what's done right now for the mysql grammar.) All types that are exported in Java should be reviewed and exported for Dart. This should be checked against the other targets as well. |
It seems I have a workaround: I can continue to develop a case insensitive stream by providing a "noSuchMethod()" method to my class (which is based on CharStream). So, I don't actually need to define a method that I can't define (getText(Interval))! This is a strange, unsafe language. |
Can you please elaborate or show the error? The Interval class is defined in the
Good point, though I checked Java target and found all top level classes except for 3 are exported. We can follow Java target and export all types, but not sure if it's a good idea. |
Actually, I was wrong. Not only was I not testing against the changes in the PR (pubspec.yaml references 4.9.2), but I forgot that the Interval and IntervalSet classes are in one file, which is confusing because it's unlike the Java and CSharp runtimes. Thanks for fixing this. |
fixes #3108
Exports recognizer, interval and intervalset classes.