Skip to content
Snippets Groups Projects
Commit 2295a773 authored by Johannes Mey's avatar Johannes Mey
Browse files

add a tree structure fixer

parent ff141d35
No related branches found
No related tags found
No related merge requests found
aspect Helpers {
public void ASTNode.checkTreeStructure() {
for (ASTNode child : astChildren()) {
if (child.getParent() != this) {
throw new RuntimeException();
}
child.checkTreeStructure();
}
}
public void ASTNode.fixTreeStructure() {
for (ASTNode child : astChildren()) {
if (child.getParent() != this) {
// System.err.println("fixed parent of " + child);
child.parent = this;
}
child.fixTreeStructure();
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment