// This code fetches the name of a symbol. Symbol { traversal nameOf (NameOfVisitor) { to Ident; } public String getName() = nameOf(NameOfVisitor); } NameOfVisitor { {{ String the_name; }} public String get_return_val() {{ return the_name; }} before Varname {{ the_name = host.get_v().toString(); }} }