本文整理汇总了C#中IStatement.AllStatementsAfter方法的典型用法代码示例。如果您正苦于以下问题:C# IStatement.AllStatementsAfter方法的具体用法?C# IStatement.AllStatementsAfter怎么用?C# IStatement.AllStatementsAfter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStatement
的用法示例。
在下文中一共展示了IStatement.AllStatementsAfter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckForVariableAsResult
/// <summary>
/// Given a statement, check to see if somewhere else the variable is modified or altered, both before or after
/// the current statement.
/// </summary>
/// <param name="s2"></param>
/// <param name="variables"></param>
/// <returns>true if it was used as a result somewhere else, false otherwise</returns>
private static bool CheckForVariableAsResult(IStatement s2, IEnumerable<string> variables)
{
// Check that we can get past each parental boundary.
if (s2.WalkParents(false).Select(s => s.CheckForVariableAsInternalResult(variables)).Where(t => t).Any())
return true;
// Now check that we aren't also going to try to do something with a variable that is
// being set somewhere else... that gets into grouping statements which is too much for this
// optimizer. :-)
if (s2.AllStatementsPrevious().Select(s => s.CheckForVariableAsReult(variables)).Where(t => t).Any())
return true;
if (s2.AllStatementsAfter().Select(s => s.CheckForVariableAsReult(variables)).Where(t => t).Any())
return true;
return false;
}