コード例 #1
0
        private TypeInfo TypeInfoFromValueTypeContext(string name, ExpressParser.ValueTypeContext ctx)
        {
            TypeInfo typeInfo = null;

            // ENUMERATION
            if (ctx.enumeration() != null)
            {
                typeInfo = new EnumInfo(name);
            }
            //SELECT
            else if (ctx.select() != null)
            {
                typeInfo = new SelectInfo(name);
                Selects.Add((SelectInfo)typeInfo);
            }
            //COLLECTION
            else if (ctx.collection() != null)
            {
                typeInfo = new CollectionInfo(name);
            }
            // DEFINED TYPE
            else if (ctx.atomicType() != null)
            {
                typeInfo           = new DefinedTypeInfo(name);
                typeInfo.ValueType = TypeInfo.ToSystemType(ctx.atomicType().GetText());
            }
            return(typeInfo);
        }
コード例 #2
0
        public override void EnterInverseAttribute(ExpressParser.InverseAttributeContext context)
        {
            var attr = new AttributeDeclaration();

            TypeInfo typeInfo = null;
            var      name     = context.Identifier()[0].GetText();

            //COLLECTION
            if (context.collection() != null)
            {
                typeInfo = new CollectionInfo(name);
            }
            // DEFINED TYPE
            else if (context.Identifier()[1] != null)
            {
                typeInfo           = new DefinedTypeInfo(name);
                typeInfo.ValueType = TypeInfo.ToSystemType(context.Identifier()[1].GetText());
            }

            attr.TypeInfo   = typeInfo;
            currentTypeInfo = typeInfo;

            currentEntityInfo.Attributes.Add(attr);
        }