if (this.workingCommentStack.isEmpty()) {
if (debugMode) {
System.out.println("ERROR: Why is the working stack empty? need to end node [" + name + "]");
}
} else {
MetaNode thisNode = this.workingCommentStack.pop();
if (!thisNode.getName().equals(name)) {
if (debugMode) {
System.out.println("ERROR: Why is the last item on the stack not me? me=[" + name
+ "]; last item = [" + thisNode.getName() + "]");
}
} else {
// looks good!
MetaNode priorNode = this.workingCommentStack.peek();
if (priorNode == null) {
// add to toplevel list
this.toplevelList.add(thisNode);
} else {
// add to prior node as child
priorNode.addChild(thisNode);
}
}
}
}