private IfBlock BuildIfBlock()
        {
            if (_ConditionalList[_ConditionalIndex].Keyword == Keyword.Fail)
            {
                var failBlock = new IfBlock {
                    Fail = _ConditionalList[_ConditionalIndex++]
                };
                ValidateIndex();
                return(failBlock);
            }

            var ifBlock = new IfBlock {
                If = _ConditionalList[_ConditionalIndex++]
            };

            ValidateIndex();

            while (_ConditionalList[_ConditionalIndex].Keyword == Keyword.If)
            {
                ifBlock.IfContent.Add(BuildIfBlock());
            }
            ValidateIndex();

            if (_ConditionalList[_ConditionalIndex].Keyword != Keyword.Then)
            {
                throw new VoteSubstitutionException("Expected Then, found \"{0}\"",
                                                    _ConditionalList[_ConditionalIndex].MatchValue);
            }

            ifBlock.Then = _ConditionalList[_ConditionalIndex++];
            ValidateIndex();

            while ((_ConditionalList[_ConditionalIndex].Keyword == Keyword.If) ||
                   (_ConditionalList[_ConditionalIndex].Keyword == Keyword.Fail))
            {
                ifBlock.ThenContent.Add(BuildIfBlock());
            }
            ValidateIndex();

            switch (_ConditionalList[_ConditionalIndex].Keyword)
            {
            case Keyword.Else:
                ifBlock.Else = _ConditionalList[_ConditionalIndex++];
                ValidateIndex();
                while ((_ConditionalList[_ConditionalIndex].Keyword == Keyword.If) ||
                       (_ConditionalList[_ConditionalIndex].Keyword == Keyword.Fail))
                {
                    ifBlock.ElseContent.Add(BuildIfBlock());
                }
                ValidateIndex();
                break;

            case Keyword.ElseIf:
                ifBlock.Else = Conditional.CreateElseFromElseIf(_ConditionalList[_ConditionalIndex]);
                ifBlock.ElseContent.Add(BuildIfBlock());
                ValidateIndex();
                break;
            }

            if (_ConditionalList[_ConditionalIndex].Keyword != Keyword.EndIf)
            {
                throw new VoteSubstitutionException("Expected EndIf, found \"{0}\"",
                                                    _ConditionalList[_ConditionalIndex].MatchValue);
            }

            ifBlock.Endif = ifBlock.If.Keyword == Keyword.ElseIf
        ? Conditional.CreateEndifForElseIf(_ConditionalList[_ConditionalIndex])
        : _ConditionalList[_ConditionalIndex++];

            return(ifBlock);
        }