Esempio n. 1
0
        /// <summary>
        /// Returns the current and the next labels for a match rule.
        /// </summary>
        public MatchRuleLabelSet GetRuleLabels(MatchRuleBase rule)
        {
            var currIndex = _RuleLabels.FindIndex(x => x.Item1 == rule);
            if(currIndex == -1)
                throw new ArgumentException("Rule does not belong to current match block!");

            var next = currIndex < _RuleLabels.Count - 1
                ? _RuleLabels[currIndex + 1].Item2
                : (_MustReturnValue ? _DefaultLabel : EndLabel);

            return new MatchRuleLabelSet
            {
                CurrentRule = _RuleLabels[currIndex].Item2,
                NextRule = next
            };
        }