if (parent == null) {
return position;
}
// Traverse the expression until the expression
for (Iterator<StringExpression> iter = parent.orderedChildren(); iter.hasNext(); ) {
StringExpression childExpression = iter.next();
// Continue to calculate the position by going up the hierarchy
if (childExpression == expression) {
return calculatePosition(parent, position);