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); }
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);; } }
// 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); } }
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); }
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); }
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; })); }