Add Java 8 stream support to ASTNode

Create issue
Issue #264 new
Jesper Öqvist created an issue

The Java 8 stream API allows functional style programming with Java collections. For example:

List<String> names = myElements.stream().map(element -> element.getName()).collect(Collectors.toList());

It would be very useful if AST nodes could be used similarly. We already have a astChildren() method which returns an Iterable view of the children of an ASTNode, but to use the stream API we would need a new method returning a stream.

Since the stream API is only available in Java 8 we would need an option to enable this feature to still support generating Java 6 code as the default.

Comments (1)

  1. Log in to comment