예제 #1
0
        public override void doAction(CSsemi.CSemiExp semi)
        {
            TypeElement elem = new TypeElement();

            elem.Type     = semi[0]; // expects type
            elem.TypeName = semi[1]; // expects name
            repo_.userDefinedTypes.Add(elem);
        }
예제 #2
0
 private void TryActionOnAggregation(CSsemi.CSemiExp semi)
 {
     if (isInterestedType(semi[1]))
     {
         string      relationship = semi[0];
         TypeElement parent       = allLocallyDeclaredTypes.GetTypeElement(getContainingClass());
         TypeElement child        = interestedTypes.GetTypeElement(semi[1]);
         repo_.relationshipTable.add(parent, child);;
     }
 }
예제 #3
0
        // extracts the FunctionComplexityResults for the given file
        protected override void UpdateResults(string fileName)
        {
            List <TypeElement> _results = Repository.getInstance().userDefinedTypes;

            for (int i = 0; i < _results.Count; i++)
            {
                TypeElement result = _results.ElementAt(i);
                result.FileName = fileName;
                userDefineTypes_.Add(result);
            }
        }
예제 #4
0
        private bool TryActionOnComposition(CSsemi.CSemiExp semi)
        {
            string type = semi[0];

            if (type == "Composition")
            {
                if (isInterestedStructOrEnum(semi[1]))
                {
                    string      relationship = semi[0];
                    TypeElement parent       = allLocallyDeclaredTypes.GetTypeElement(getContainingClass());
                    TypeElement child        = interestedTypes.GetTypeElement(semi[1]);
                    repo_.relationshipTable.add(parent, child);
                }

                return(true);
            }
            return(false);
        }
예제 #5
0
        private bool TryActionOnInheritance(CSsemi.CSemiExp semi)
        {
            string type = semi[0];

            if (type == "class" || type == "interface")
            {
                for (int i = 2; i < semi.count; i += 2)
                {
                    if (isInterestedType(semi[i + 1]))
                    {
                        string      relationship = semi[i];
                        TypeElement parent       = allLocallyDeclaredTypes.GetTypeElement(getContainingClass());
                        TypeElement child        = interestedTypes.GetTypeElement(semi[i + 1]);
                        repo_.relationshipTable.add(parent, child);
                    }
                }
            }
            return(false);
        }
예제 #6
0
        public bool add(string Name, string Namespace, string Filename, string ServerName, string Type)
        {
            TypeElement elem = new TypeElement();

            elem.Namespace  = Namespace;
            elem.Filename   = Filename;
            elem.ServerName = ServerName;
            elem.Type       = Type;

            return(lockit <bool>(() =>
            {
                if (types.Keys.Contains(Name) && types[Name].Namespace == Namespace)
                {
                    return false;
                }
                types[Name] = elem;
                return true;
            }));
        }