Пример #1
0
        private void ParseBigParanthesesPair(CharEnumerator charSequence, SetableNumberDisk symbol)
        {
            var c = PeekNextChar(charSequence);

            if (c == null || c != '{')
            {
                return;
            }
            var list = new List <char>();

            charSequence.MoveNext();
            while (charSequence.MoveNext() && charSequence.Current != '}')
            {
                list.Add(charSequence.Current);
            }
            int number = -1;

            try {
                number = int.Parse(new string(list.ToArray()));
            }
            catch {
                throw new InvalidExpressionException(
                          @"in  Big Parantheses block must be a number for skip , ex :\d{3}");
            }

            symbol.Skip = number;
        }
Пример #2
0
 private void CheckSkipAndAdd(CharEnumerator charSequence, SetableNumberDisk symbol)
 {
     ParseBigParanthesesPair(charSequence, symbol);
     Dispenser.Append(symbol);
 }