Is it possible to print all node ids / values that are traversed in a visit? Take the following code sample:
top-down visit(asts) {
case x: println(typeOf(x));
}
I now get all types of the nodes that were visited. I would instead like to know the ids / values of all x that were encountered (without printing the entire tree). In other words, I am curious as to how Rascal traverses the list[Declaration] asts
containing lang::java::m3::AST
s.
As a corrolary, is it possible to print direct ascendants / descendants of a Declaration regardless of their type? Or print the total number of children of an ast?
In the documentation (https://www.rascal-mpl.org/docs/rascal/expressions/visit/) there is no mention of this.
md5sum
for example from the IO function: case value x : println(md5sum(x));
top-down
mode it first visits the entire list and in bottom-up
mode it goes first to the children.(0 | it + 1 | /_ <- t)
import Node;
, case node n: println(getChildren(n));