svoid ai_parseTree_makeTotalWeights(Element e, double weight) { e.totalWeight = weight*e.weight; for (Element child : ai_parseTree_getChildren(parser, productions, e)) ai_parseTree_makeTotalWeights(child, e.totalWeight); }