use of com.google.security.zynamics.binnavi.disassembly.CReference in project binnavi by google.
the class CCodeNodeParser method parseReferences.
/**
* Parses the outgoing references of an operand expression.
*
* @param expressionId The expression ID of the operand expression.
* @param dataset Provides the reference data.
*
* @return The outgoing references of the operand expression.
*
* @throws ParserException Thrown if the reference data could not be read.
*/
private static List<CReference> parseReferences(final int expressionId, final ICodeNodeProvider dataset) throws ParserException {
final List<CReference> references = new ArrayList<CReference>();
boolean hasReferences = false;
do {
final CReference reference = dataset.getReference();
if (reference == null) {
if (hasReferences) {
dataset.prev();
}
break;
}
hasReferences = true;
final int currentExpressionId = dataset.getExpressionTreeId();
if (expressionId != currentExpressionId) {
dataset.prev();
break;
}
references.add(reference);
} while (dataset.next());
return references;
}
Aggregations