private static <I extends Info, N extends AbstractNode<I, N>, CN extends AbstractConstructionNode<I, CN>, A extends RuleAnnotations> N convertAnnotationTreeToRegularNodes(CN oldLhs, Map<CN, A> oldAnnotationAlignments, Map<N, A> newAnnotationAlignments, AnnotationRuleCompileServices<I, N, CN, A> compilationServices) { N newLhs = compilationServices.newNode(oldLhs.getInfo()); newAnnotationAlignments.put(newLhs, oldAnnotationAlignments.get(oldLhs)); if (oldLhs.hasChildren()) for (CN child : oldLhs.getChildren()) { N newChild = convertAnnotationTreeToRegularNodes(child, oldAnnotationAlignments, newAnnotationAlignments, compilationServices); newLhs.addChild(newChild); newChild.setAntecedent(newLhs); } return newLhs; } }