Esempio n. 1
0
        void OpenGroup(bool value)
        {
            count++;
            Join();

            BitStack.Push(ref groupOperators);
            BitStack.SetCurrent(ref groupOperators, value);
            BitStack.Push(ref groupUsage);

            buffer.Append('(');
        }
Esempio n. 2
0
        public void Condition(string condition, params string[] others)
        {
            Join();

            BitStack.SetCurrent(ref groupUsage, true);

            buffer.Append(condition);
            if (others != null)
            {
                foreach (var other in others)
                {
                    buffer.Append(other);
                }
            }

            lastGoodClose = buffer.Length;
        }
Esempio n. 3
0
        public void Pop()
        {
            count--;
            if (BitStack.Pop(ref groupUsage))
            {
                buffer.Append(')');
                lastGoodClose = buffer.Length;

                if (count > 0)
                {
                    BitStack.SetCurrent(ref groupUsage, true);
                }
            }
            else if (lastGoodClose > 0)
            {
                buffer.Length = lastGoodClose;
            }
            else
            {
                buffer.Length--;
            }

            BitStack.Pop(ref groupOperators);
        }