[csdoc-patches] CVS: csdoc/src/csdoc driver.cs,1.9,1.10 namespace.cs,1.1,1.2 ChangeLog,1.21,1.22
Status: Planning
Brought to you by:
mastergaurav
From: Gaurav V. <mas...@us...> - 2003-04-08 06:24:45
|
Update of /cvsroot/csdoc/csdoc/src/csdoc In directory sc8-pr-cvs1:/tmp/cvs-serv16374 Modified Files: driver.cs namespace.cs ChangeLog Log Message: 2003-04-08 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * driver.cs : Easier way to get exception / attribute. * namespace.cs : AllNamespaces { get; } - Added property. Index: driver.cs =================================================================== RCS file: /cvsroot/csdoc/csdoc/src/csdoc/driver.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- driver.cs 8 Apr 2003 06:16:22 -0000 1.9 +++ driver.cs 8 Apr 2003 06:24:42 -0000 1.10 @@ -875,9 +875,45 @@ TypeContainer root = RootContext.Tree.Types; Console.WriteLine("Root type: " + root.GetType()); + ManageAttributeTypes(RootContext.AttributeTypes); + ManageTypeContainer(root); + Console.WriteLine(); +/* + ArrayList allns = Namespace.AllNamespaces; + foreach(Namespace nsallns in allns) + { + if(nsallns.Name.Trim().Length > 0) + { + Console.WriteLine("->" + nsallns.Name); + } + } +*/ +/* + Hashtable nss = RootContext.Tree.Namespaces; + //Hashtable nss = TypeManager.GetNamespaces(); + + Console.WriteLine("Total namespaces: " + nss.Count); + foreach(object objk in nss.Keys) + { + SourceFile sf = (SourceFile) objk; + object obj = nss[objk]; + Console.WriteLine("-> " + sf.Name); + //Console.WriteLine("\t-> " + ((Namespace)nss[sf.Name]).Name); + //Console.WriteLine("->" + obj.ToString()); + //Console.WriteLine("->" + obj.GetType()); + if(obj is Hashtable) + { + Hashtable ht = (Hashtable) obj; + foreach(object objht in ht.Keys) + { + Console.WriteLine("\t->" + ((Namespace)ht[objht]).Name); + } + } + } Console.WriteLine(); +//*/ return Report.Errors == 0; // @@ -997,6 +1033,16 @@ //return (Report.Errors == 0); } + static void ManageAttributeTypes(ArrayList types) + { + Console.WriteLine("\n Attributes:"); + foreach(TypeContainer tc in types) + { + Console.WriteLine(" " + tc.Name); + } + Console.WriteLine(); + } + public static void ManageTypeContainer(TypeContainer tc) { //ManageTypeContainer("", tc); @@ -1049,31 +1095,15 @@ public static bool IsException(TypeContainer tc) { Type baseType = tc.BaseType; - while(baseType != null) - { - //Console.WriteLine("Base: " + baseType.ToString()); - if(baseType.IsSubclassOf(TypeManager.exception_type)) - { - return true; - } - baseType = baseType.BaseType; - } - return false; + return (baseType == TypeManager.exception_type || + baseType.IsSubclassOf(TypeManager.exception_type)); } public static bool IsAttribute(TypeContainer tc) { Type baseType = tc.BaseType; - while(baseType != null) - { - //Console.WriteLine("Base: " + baseType.ToString()); - if(baseType.IsSubclassOf(TypeManager.attribute_type)) - { - return true; - } - baseType = baseType.BaseType; - } - return false; + return (baseType == TypeManager.attribute_type || + baseType.IsSubclassOf(TypeManager.attribute_type)); } public static void ListTCs(string tab, TypeContainer tc) @@ -1085,8 +1115,7 @@ string type = "Struct: "; if(objs is Class) type = "Class: "; - Console.WriteLine(type + /*tab + */ objs.Name); - //Console.WriteLine("\t\t" + objs.BaseType.BaseType); + Console.WriteLine(type + /*tab + */ objs.Name);// + " -:- " + objs.BaseType); if(IsException(objs)) { Console.WriteLine("\t\t" + objs.Name + " is Exception"); Index: namespace.cs =================================================================== RCS file: /cvsroot/csdoc/csdoc/src/csdoc/namespace.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- namespace.cs 19 Feb 2003 05:50:12 -0000 1.1 +++ namespace.cs 8 Apr 2003 06:24:42 -0000 1.2 @@ -45,7 +45,21 @@ Used = false; } } - + + /// <summary> + /// Returns the list of all the added namespaces. + /// </summary> + /// <remarks> + /// Master's Quick Hack + /// </remarks> + public static ArrayList AllNamespaces + { + get + { + return all_namespaces; + } + } + /// <summary> /// Constructor Takes the current namespace and the /// name. This is bootstrapped with parent == null Index: ChangeLog =================================================================== RCS file: /cvsroot/csdoc/csdoc/src/csdoc/ChangeLog,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- ChangeLog 8 Apr 2003 06:16:22 -0000 1.21 +++ ChangeLog 8 Apr 2003 06:24:42 -0000 1.22 @@ -1,4 +1,9 @@ +2003-04-08 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * driver.cs : Easier way to get exception / attribute. + * namespace.cs : AllNamespaces { get; } - Added property. + 2003-04-07 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * codegen.cs : No need for file name while |