Пример #1
0
        /// <summary>
        /// Ends an if statement
        /// </summary>
        /// <param name="IfCommand">If command to end</param>
        public virtual void EndIf(If IfCommand)
        {
            SetCurrentMethod();
            EndIf TempCommand = new EndIf(IfCommand);

            TempCommand.Setup();
            Commands.Add(TempCommand);
        }
Пример #2
0
        /// <summary>
        ///     Ends an if statement
        /// </summary>
        /// <param name="ifCommand">If command to end</param>
        public virtual void EndIf(If ifCommand)
        {
            SetCurrentMethod();
            var tempCommand = new EndIf(ifCommand);

            tempCommand.Setup();
            Commands.Add(tempCommand);
        }
Пример #3
0
        private IMSILConstruction CreateEndIf(IASTNode node)
        {
            bool isIfElseOperator = (_nodeCounter < _nodes.Count - 1) && IsElseBegin(_nodes [_nodeCounter + 1]);

            if (isIfElseOperator)
            {
                _beginElseMetka = _metkaList.Last();
                _metkaList.RemoveAt(_metkaList.Count - 1);
                _metkaList.Add(GetMetkaName());
                return(new EndIf(_metkaList.Last(), true));
            }
            var result = new EndIf(_metkaList.Last());

            _metkaList.RemoveAt(_metkaList.Count - 1);
            return(result);
        }