-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
Add tree transformation capabilities to Node and Tree #9
Comments
danieldietrich
changed the title
Add tree transformation capabilities to Node and Tree
[tree] Add tree transformation capabilities to Node and Tree
Aug 22, 2014
danieldietrich
changed the title
[tree] Add tree transformation capabilities to Node and Tree
[collection] Add tree transformation capabilities to Node and Tree
Aug 22, 2014
Closed
danieldietrich
changed the title
[collection] Add tree transformation capabilities to Node and Tree
Add tree transformation capabilities to Node and Tree
Oct 3, 2014
I want Tree transformation look like this (stolen from databricks): tree.transform {
case Add(Literal(c1), Literal(c2)) => Literal(c1+c2)
case Add(left, Literal(0)) => left
case Add(Literal(0), right) => right
} |
We need a function Tree.transform(Function<? super Tree<? super T>, ? extends Tree<? extends T> f) or Tree.transform(UnaryOperator<Tree<T>> f) Currently a Node has children of type |
Note: Removed the transform method because |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wire together tree traversal (with walkers: preorder, inorder, postorder, level-order) and tree transformation.
Suggestion: Take the rewrite-rule approach using the Match API (enhanced by #8).
The text was updated successfully, but these errors were encountered: