示例#1
0
        private bool IsSingleCharToken(string value)
        {
            if (positionInLine < value.Length)
            {
                var found     = true;
                var character = value.Substring(positionInLine, 1);
                switch (character)
                {
                case StringConstants.COMMA:
                    parser.Comma();
                    break;

                case StringConstants.RANGE_CHAR:
                    parser.Range();
                    break;

                case StringConstants.OPEN_BRACKET:
                    parser.OpenBracket();
                    break;

                case StringConstants.CLOSE_BRACKET:
                    parser.CloseBracket();
                    break;

                case StringConstants.OPEN_CURLY_BRACKET:
                    parser.OpenCurlyBracket();
                    break;

                case StringConstants.CLOSE_CURLY_BRACKET:
                    parser.CloseCurlyBracket();
                    break;

                case StringConstants.OPEN_SQUARE_BRACKET:
                    parser.OpenSquareBracket();
                    break;

                case StringConstants.CLOSE_SQUARE_BRACKET:
                    parser.CloseSquareBracket();
                    break;

                default:
                    found = false;
                    break;
                }

                if (found)
                {
                    positionInLine++;
                }

                return(found);
            }

            return(false);
        }