Ejemplo n.º 1
0
        public static void InitializeNoun(STS ssys, List <SemanticTypeDecl> decls, List <SemanticTypeStruct> structs)
        {
            // Reflective noun necessary for self-referential definition.
            SemanticTypeDecl decl = new SemanticTypeDecl()
            {
                OfTypeName = "Noun"
            };

            decl.AttributeValues.Add(new AttributeValue()
            {
                Name = "Name", Value = "Noun"
            });
            decls.Add(decl);

            SemanticTypeStruct sts = new SemanticTypeStruct()
            {
                DeclTypeName = "Noun"
            };

            sts.NativeTypes.Add(new Clifton.SemanticTypeSystem.NativeType()
            {
                Name = "Name", ImplementingType = "string"
            });
            structs.Add(sts);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a root semantic type.
        /// </summary>
        public static SemanticTypeStruct CreateSemanticType(string name, bool unique, List <SemanticTypeDecl> decls, List <SemanticTypeStruct> structs)
        {
            SemanticTypeDecl decl = new SemanticTypeDecl()
            {
                OfTypeName = "Noun"
            };

            decl.AttributeValues.Add(new AttributeValue()
            {
                Name = "Name", Value = name
            });
            SemanticTypeStruct sts = new SemanticTypeStruct()
            {
                DeclTypeName = name, Unique = unique
            };

            decls.Add(decl);
            structs.Add(sts);

            return(sts);
        }