private GExpansion traverseUniqueChildSequences(GExpansion expansion) { main: while (expansion.kind == GExpansion.Kind.Sequence) { GExpansion child = null; List<GExpansion> children = expansion.children; for (int i = 0; i < children.size(); i++) { GExpansion otherChild = children.get(i); if ((otherChild.kind != GExpansion.Kind.LookAhead || otherChild.semanticLookahead == null) && otherChild.kind != GExpansion.Kind.Action) { if (child == null) child = otherChild; else break main; } } expansion = child; } return expansion; }