示例#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;
     }
 }