cp-tools-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cp-tools-discuss] Getting Doc and Tag contexts


From: Mark Wielaard
Subject: [Cp-tools-discuss] Getting Doc and Tag contexts
Date: 07 May 2002 15:37:06 +0200

Hi,

Is there a good way to get the Doc and Tag context?
To get a better idea where the remaining errors/warnings come from while
generating documentation for Classpath I added the following patch which
helps, but there might be a better way to get the context of a Tag or
Doc.

Cheers,

Mark


Index: src/gnu/classpath/tools/doclets/xmldoclet/Driver.java
===================================================================
RCS file: 
/cvsroot/cp-tools/gjdoc/src/gnu/classpath/tools/doclets/xmldoclet/Driver.java,v
retrieving revision 1.5
diff -u -r1.5 Driver.java
--- src/gnu/classpath/tools/doclets/xmldoclet/Driver.java       5 May 2002 
12:53:55 -0000       1.5
+++ src/gnu/classpath/tools/doclets/xmldoclet/Driver.java       7 May 2002 
13:31:23 -0000
@@ -186,19 +186,19 @@
       printOpenTag(1, "packagedoc name=\""+packageDoc.name()+"\"");
       if (packageDoc.firstSentenceTags().length > 0) {
         printOpenTag(2, "firstSentenceTags");
-        outputTags(3, packageDoc.firstSentenceTags(), true);
+        outputTags(3, packageDoc.firstSentenceTags(), true, packageDoc);
         printCloseTag(2, "firstSentenceTags");
       }
 
       if (packageDoc.tags().length > 0) {
         printOpenTag(2, "tags");
-        outputTags(3, packageDoc.tags(), true);
+        outputTags(3, packageDoc.tags(), true, packageDoc);
         printCloseTag(2, "tags");
       }
 
       if (packageDoc.seeTags().length > 0) {
         printOpenTag(2, "seeTags");
-        outputTags(3, packageDoc.seeTags(), true);
+        outputTags(3, packageDoc.seeTags(), true, packageDoc);
         printCloseTag(2, "seeTags");
       }
       printCloseTag(1, "packagedoc");
@@ -276,25 +276,25 @@
       }
       if (doc.inlineTags().length > 0) {
         printOpenTag(level, "inlineTags");
-        outputTags(level+1, doc.inlineTags(), true);
+        outputTags(level+1, doc.inlineTags(), true, doc);
         printCloseTag(level, "inlineTags");
       }
 
       if (doc.firstSentenceTags().length > 0) {
         printOpenTag(level, "firstSentenceTags");
-        outputTags(level+1, doc.firstSentenceTags(), true);
+        outputTags(level+1, doc.firstSentenceTags(), true, doc);
         printCloseTag(level, "firstSentenceTags");
       }
 
       if (doc.tags().length > 0) {
         printOpenTag(level, "tags");
-        outputTags(level+1, doc.tags(), true);
+        outputTags(level+1, doc.tags(), true, doc);
         printCloseTag(level, "tags");
       }
 
       if (doc.seeTags().length > 0) {
         printOpenTag(level, "seeTags");
-        outputTags(level+1, doc.seeTags(), true);
+        outputTags(level+1, doc.seeTags(), true, doc);
         printCloseTag(level, "seeTags");
       }
    }
@@ -323,7 +323,8 @@
         printAtomTag(level, "isStatic");
    }
 
-   protected void outputTags(int level, Tag[] tags, boolean descend) {
+   protected void outputTags(int level, Tag[] tags, boolean descend,
+                            Doc context) {
       for (int i=0, ilim=tags.length; i<ilim; ++i) {
         Tag tag = tags[i];
         printOpenTag(level, "tag kind=\""+tag.kind()+"\" 
name=\""+tag.name()+"\"");
@@ -333,7 +334,13 @@
               outputType(level+1, "exception", throwsTag.exception());
            }
            else {
-              rootDoc.printWarning("In ThrowsTag: Exception 
'"+throwsTag.exceptionName()+"' not found.");
+              rootDoc.printWarning("In ThrowsTag: Exception '"
+                                   + throwsTag.exceptionName()
+                                   + "' not found in '"
+                                   + context.name()
+                                   + " "
+                                   + context.getRawCommentText()
+                                   + "'");
               printAtomTag(level+1, "exception 
typename=\""+throwsTag.exceptionName()+"\"");
            }
         }
@@ -349,13 +356,13 @@
         if (descend) {
            if (tag.firstSentenceTags().length>0) {
               printOpenTag(level+1, "firstSentenceTags");
-              outputTags(level+2, tag.firstSentenceTags(), false);
+              outputTags(level+2, tag.firstSentenceTags(), false, context);
               printCloseTag(level+1, "firstSentenceTags");
            }
            
            if (tag.inlineTags().length>0) {
               printOpenTag(level+1, "inlineTags");
-              outputTags(level+2, tag.firstSentenceTags(), false);
+              outputTags(level+2, tag.firstSentenceTags(), false, context);
               printCloseTag(level+1, "inlineTags");
            }
         }
Index: src/gnu/classpath/tools/gjdoc/MemberDocImpl.java
===================================================================
RCS file: 
/cvsroot/cp-tools/gjdoc/src/gnu/classpath/tools/gjdoc/MemberDocImpl.java,v
retrieving revision 1.3
diff -u -r1.3 MemberDocImpl.java
--- src/gnu/classpath/tools/gjdoc/MemberDocImpl.java    24 Feb 2002 01:28:38 
-0000      1.3
+++ src/gnu/classpath/tools/gjdoc/MemberDocImpl.java    7 May 2002 13:31:23 
-0000
@@ -174,7 +174,11 @@
         }
         else {
            //throw new Error("Class not found: "+className);
-           Main.getRootDoc().printError("Class not found: "+className);
+           Main.getRootDoc().printError("Class not found '"
+                                        + className
+                                        + "' in context '"
+                                        + containingClass()
+                                        + "'");
         }
       }
    }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]