Пример #1
0
        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);
            }
        }
Пример #2
0
 private void PushIfStatement(IfStatement ifStatement)
 {
     this.m_ifStatements.Add(ifStatement);
 }
Пример #3
0
 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;
     }
 }