-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implement syntax for specifying a specific occurrence of a node in a transformation rule #71
Comments
Let's clarify. Let's say our code contains two such expressions: a = 1 + 2 + 3 + 4 Accordingly, the syntax tree will contain branches for two such expressions. You want the rule to be applied only once for each such expression, that is, like this: a = 1 - 2 + 3 + 4 ? |
With the proposed syntax, I would expect the tree transformer to change only one node for the entire given tree in the Also, I believe it would be convenient to have a method that returns the number of nodes that can be transformed by a given rule. So if I have this number in the for (int i = 0; i < possibleTransformations; i++) {
treeTransformer.transform(tree, i);
} to get a list of all possible variants with the mutation applied only once to different nodes. |
Working on the implementation of this feature in API. |
@rultor release, tag is |
@rultor release, tag is |
For more accurate mutations, it will be more convenient to replace not all occurrences of a node that fits the transformation rule, but to indicate the number of a specific occurrence of the node.
For example, if I give the tree transformer the rule
and the occurence number
1
, I expect for the example5 + 4 + 5 + 4
get form the tree trasnformer5 - 4 + 5 + 4
up to the way the nodes in the tree are numbered.The text was updated successfully, but these errors were encountered: