private void ProcessIf(Match m) { string condition = StripComment(m.Groups["condition"].Value); IfStatement ifStatement = new IfStatement(condition); if (!this.IsProcessingTokens) { ifStatement.SupressAllBranches = true; } else { this.ApplyDecisionTo(ifStatement, condition); } if (m.Groups["endif"].Success) { return; } else { this.PushIfStatement(ifStatement); } }
private void PushIfStatement(IfStatement ifStatement) { this.m_ifStatements.Add(ifStatement); }
private void ApplyDecisionTo(IfStatement statement, string condition) { if (statement.HasTakenBranch) { statement.HasTakenBranch = false; } else if (this.m_evaluator.Evaluate(condition)) { statement.HasTakenBranch = true; statement.TakingBranch = true; } }