/// <summary> /// Tries to interpret the statement as "for" loop. /// </summary> /// <param name="stmt">assumed "for" loop</param> /// <param name="level">pattern matching restrictions</param> /// <returns>an explicit SysDOM representation of the "for" loop, or <c>null</c> if the statement /// does not match the expected pattern</returns> public static LoopBlock AsForLoop(this Statement stmt, EForLoopLevel level) { ForLoopRecognizer flr = new ForLoopRecognizer() { Level = level }; stmt.Accept(flr); return(flr.Result); }
/// <summary> /// Tries to interpret the statement as "for" loop. /// </summary> /// <param name="stmt">assumed "for" loop</param> /// <param name="level">pattern matching restrictions</param> /// <returns>an explicit SysDOM representation of the "for" loop, or <c>null</c> if the statement /// does not match the expected pattern</returns> public static LoopBlock AsForLoop(this Statement stmt, EForLoopLevel level) { ForLoopRecognizer flr = new ForLoopRecognizer() { Level = level }; stmt.Accept(flr); return flr.Result; }