-
Notifications
You must be signed in to change notification settings - Fork 235
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
Parameterize preprocessor behavior to allow mode overrides. #13
Conversation
In response to benfry#11, allow client code to override preprocessing edit behabior by providing a subclass of PdeParseTreeListener. This does make the construction for PdePreprocessor.java a little bit messier but a builder may help and moving dependent types within enclosing classes can hopefully keep things coherent.
Some difficult to generate code is managed by the RewriterCodeGenerator and some modes may need to modify that logic. This commit makes it easier to extend parts of RewriterCodeGenerator without requiring client code to duplicate too much effort.
…cessing4 into tree_listener_parameter
To support modes, allow for public instantiation of PdeParseTreeListener and for its public extension.
Sync to master
In support of modes, allow client code override of core and default imports for PdeParseTreeListener.
Hey @monkstone! Not 100% sure but this may be relevant to your work as well? See #11. Thanks! |
@sampottinger Thanks for heads up, but I never tried to create a ruby mode for the Processing Ide @tyfkda did here. I have instead created an atom plugin. |
Allow client code to provide a destination package for generated code and removed some (now dead) code for RewriterCodeGenerator.
…cessing4 into tree_listener_parameter
Thanks for the clarification @monkstone |
Quick thing: Trying to remove |
Per @benfry goal of reducing class count, rolled RewriteParams into PdeParseTreeListener now that the code rewrite utils are also rolled into PdeParseTreeListener.
RewriteParams rolled into PdeParseTreeListener (per low class count target for project). Ok to merge again. |
@sampottinger quick question, where is the ProcessingBaseListener base class that PdeParseTreeListener extends? |
Never mind, I just realized it is generated during the build :-) |
Hey @codeanticode! Thanks for following up. Just for progeny, you are correct about |
Also @codeanticode, fdcaf7d addresses your request. It can be used like so:
This should keep the ANTLR types from leaking out into modes unless they need to modify the edit behavior at a deeper level. Thank you for your hard work. Please let me know if there is more that I can do. Thanks, |
[Fork] Refactor within PdePreprocessor to allow for override of edits.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
In response to processing#11, allow client code to override preprocessing edit behavior by providing a subclass of PdeParseTreeListener. Specifically, given the changes necessitated by #1's swtich to ANTLR 4, this PR formalizes the interfaces to parameterize that behavior and adjusts internal code to improve mode developer experience.
For a demonstration of this new interface (prepared for @codeanticode) please see https://gist.github.com/sampottinger/11c453f5f641d96b4244f947d93cca33.
Note that many of the small interfaces were refactored to keep consistent with @benfry's goal for low class count.