This is more convenient that using Transforms because the reducer here is bundled with the parser and will follow the parser wherever the parser is used (more composable). Also, the reducer will only be applied to exactly the nodes of the tree where an infix expression occurs (not the whole tree).
This adds support for a custom reducer when using
infix_expression
. This allows you to change the way the tree is generated:This is more convenient that using
Transform
s because the reducer here is bundled with the parser and will follow the parser wherever the parser is used (more composable). Also, the reducer will only be applied to exactly the nodes of the tree where an infix expression occurs (not the whole tree).