Пример #1
0
 private void Switch(Rules.SwitchInfo info)
 {
     for (int i = 0; i < info.pops; i++)
     {
         stack.Pop();
     }
     if (info.next != null)
     {
         stack.Add(info.next);
     }
 }
Пример #2
0
        private Rules.SwitchInfo GetSwitchInfo(string text)
        {
            string contextName;
            int    pops;

            ParseSwitch(text, out pops, out contextName);
            Rules.SwitchInfo info = new Rules.SwitchInfo();
            info.pops = pops;
            if (contextName != null)
            {
                contextOf.TryGetValue(contextName.ToLowerInvariant(), out info.next);
            }
            else
            {
                info.next = null;
            }
            return(info);
        }