Beispiel #1
0
        private void ReadClafer(ClaferClassNode clafer, AtlasFeature feature)
        {
            bool isAbstract          = ReadAbstract(clafer.Derivations[0]);
            AtlasConnectionType type = ReadGCard(clafer.Derivations[1]);
            string name = ReadIdent(clafer.Derivations[2]);

            AtlasFeature newFeature = new AtlasFeature(name);

            newFeature.IsAbstract = isAbstract;

            atlas.AddFeature(newFeature, feature, type);

            ReadElements(clafer.Derivations[5], newFeature);
        }
Beispiel #2
0
        private AtlasFeature buildFeature(Node node, AtlasFeature parent, ref AtlasFeatureModel atlas)
        {
            AtlasFeature f = new AtlasFeature(node.Name);

            atlas.AddFeature(f);

            //children
            foreach (Node n in node.Children)
            {
                AtlasFeature    ff  = buildFeature(n, f, ref atlas);
                AtlasConnection con = null;

                switch (n.Type)
                {
                case NodeType.Mandatory:
                case NodeType.Root:
                    con = new AtlasConnection(f, ff, AtlasConnectionType.Mandatory);
                    break;

                case NodeType.Optional:
                    con = new AtlasConnection(f, ff, AtlasConnectionType.Optional);
                    break;

                case NodeType.Or:
                    con = new AtlasConnection(f, ff, AtlasConnectionType.OrRelation);
                    break;

                case NodeType.Xor:
                    con = new AtlasConnection(f, ff, AtlasConnectionType.Alternative);
                    break;
                }
                atlas.AddConnection(con);
            }

            return(f);
        }