for (int i = 0; i < nIfNodeChildren; ++i)
{
IASNode ifNodeChild = ifNode.getChild(i);
if (ifNodeChild instanceof ConditionalNode)
{
ConditionalNode conditionalNode = (ConditionalNode) ifNodeChild;
IASNode conditionalBlockNode = conditionalNode.getContentsNode();
assert conditionalBlockNode != null;
populateLabelMap(labelMap, conditionalBlockNode);
}
else if (ifNodeChild instanceof TerminalNode)
{
TerminalNode terminalNode = (TerminalNode) ifNodeChild;
IASNode terminalBlockNode = terminalNode.getContentsNode();
assert terminalBlockNode != null;
populateLabelMap(labelMap, terminalBlockNode);
}
}
}
break;
case LabledStatementID:
{
LabeledStatementNode labelNode = (LabeledStatementNode) node;
String labelName = labelNode.getLabel();
if (labelName != null)
labelMap.put(labelName, labelNode);
populateLabelMap(labelMap, labelNode.getLabeledStatement());
}
break;
case FileID:
case BlockID:
case MXMLEventSpecifierID:
{
int childCount = node.getChildCount();
for (int i = 0; i < childCount; ++i)
{
IASNode child = node.getChild(i);
assert child != null;
populateLabelMap(labelMap, child);
}
}
break;
case SwitchID:
{
SwitchNode switchNode = (SwitchNode)node;
populateLabelMap(labelMap, switchNode.getStatementContentsNode());
}
break;
case ConditionalID:
{
ConditionalNode conditionalNode = (ConditionalNode)node;
populateLabelMap(labelMap, conditionalNode.getStatementContentsNode());
}
break;
}
}