Exemple #1
0
        // reads a bare collection type expression
        // which might represent a bare named type expression
        // or an indefinitely nested collection of element type, represented as bare named type expression
        private IStonType ReadBareCollection(StonTokenReader reader, string preread, ref bool collectionStarted)
        {
            IStonType result = ReadBareNamedType(reader, preread);

            if (result == null)
            {
                return(null);
            }

            // each collection suffix adds one more nesting of collection
            while (reader.Peek().HasChartype(StonChartype.CollectionSuffixBegin))
            {
                if (!reader.ReadCollectionTypeSuffix(true))
                {
                    collectionStarted = true;
                    break;
                }
                else
                {
                    result = ElementFactory.CreateCollectionType(result);
                }
            }

            return(result);
        }
Exemple #2
0
        // reads a wrapped collection type expression
        // which might represent a wrapped named type expression
        // or an indefinitely nested collection of element type, represented as wrapped named type expression
        private IStonType ReadWrappedCollection(StonTokenReader reader)
        {
            IStonType result = ReadWrappedNamedType(reader);

            // each collection suffix adds one more nesting of collection
            while (reader.Peek().HasChartype(StonChartype.CollectionSuffixBegin))
            {
                reader.ReadCollectionTypeSuffix(false);
                result = ElementFactory.CreateCollectionType(result);
            }

            return(result);
        }