boolean (DoStatement stat) { LoopType oldLoop = stat.getLoopType(); switch (oldLoop) { case DO -> { // identify a while loop if (matchWhile(stat)) { // identify a for loop - subtype of while matchFor(stat); } else { // identify a do{}while loop matchDoWhile(stat); } } case WHILE -> matchFor(stat); } return (stat.getLoopType() != oldLoop); }