Esempio n. 1
0
        public override void EnterCollectionType(ExpressParser.CollectionTypeContext context)
        {
            if (context.Parent.Parent is ExpressParser.TypeBodyContext)
            {
                var simple = (SimpleType)currTypeData;
                simple.IsCollectionType = true;
                simple.Rank++;
            }

            if (currAttrDatas.Any())
            {
                foreach (var ad in currAttrDatas)
                {
                    ad.IsCollection = true;
                    ad.Rank++;
                }
            }
        }
Esempio n. 2
0
        private string ParseCollectionType(ExpressParser.CollectionTypeContext context, ref int rank, ref bool isCollection, ref bool isGeneric)
        {
            rank++;
            isCollection = true;

            if (context.arrayType() != null)
            {
                return(ParseCollectionTypeSel(context.arrayType().collectionTypeSel(), ref rank, ref isCollection, ref isGeneric));
            }
            else if (context.listType() != null)
            {
                return(ParseCollectionTypeSel(context.listType().collectionTypeSel(), ref rank, ref isCollection, ref isGeneric));
            }
            else if (context.setType() != null)
            {
                return(ParseCollectionTypeSel(context.setType().collectionTypeSel(), ref rank, ref isCollection, ref isGeneric));
            }
            else if (context.bagType() != null)
            {
                return(ParseCollectionTypeSel(context.bagType().collectionTypeSel(), ref rank, ref isCollection, ref isGeneric));
            }

            throw new Exception("I could not parse the collection type.");
        }