/// <summary> /// Tries to interpret the statement as "while" loop. /// </summary> /// <param name="stmt">assumed "while" loop</param> /// <returns>an explicit SysDOM representation of the "while" loop, or <c>null</c> if the statement /// does not match the expected pattern</returns> public static LoopBlock AsWhileLoop(this Statement stmt) { WhileLoopRecognizer wlr = new WhileLoopRecognizer(); stmt.Accept(wlr); return(wlr.Result); }
/// <summary> /// Tries to interpret the statement as "while" loop. /// </summary> /// <param name="stmt">assumed "while" loop</param> /// <returns>an explicit SysDOM representation of the "while" loop, or <c>null</c> if the statement /// does not match the expected pattern</returns> public static LoopBlock AsWhileLoop(this Statement stmt) { WhileLoopRecognizer wlr = new WhileLoopRecognizer(); stmt.Accept(wlr); return wlr.Result; }