Allow token parameterisation with multiple parameters#25
Open
homedirectory wants to merge 3 commits intoOriRoth:masterfrom
Open
Allow token parameterisation with multiple parameters#25homedirectory wants to merge 3 commits intoOriRoth:masterfrom
homedirectory wants to merge 3 commits intoOriRoth:masterfrom
Conversation
This corrects the generation of variable names corresponding to terminal parameters, such as Class or Enum. Previous implementation could erronously generate code such as: `java.lang.Enum enum = ...;` or `Type method(Class class)`
AST visitor generation was producing visitors that were hardly useful:
1. `visit` methods were final which prevented implementations from
controlling the descending behaviour
2. `whileVisiting` methods were hardly useful due to point 1
Consider the task of wrapping a parent AST node in parentheses,
including its children. This could not be achieved using previous AST
visitors.
This change makes visitors be generated in the fashion of
javax.lang.model.util.ElementScanner. It allows implementations to
control the descent like so:
void visit(ParentNode node) {
print("("); // before visiting children
Visitor.super.visit(node); // descend
print(")"); // after having visited children
}
This file contains hidden or 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
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.
I found the lack of specifying multiple distinct parameters to a token limiting. For example: