From a758e84cae645754db287e0d3b266c03f154e4a3 Mon Sep 17 00:00:00 2001 From: CaS Date: Mon, 28 Nov 2005 12:59:59 +0000 Subject: [PATCH] Improve markup for overriding methods git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22110 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 8 +- Tools/AGSHtml.m | 5 + Tools/AGSOutput.m | 27 +- Tools/autogsdoc.m | 5 + Tools/gsdoc-1_0_3.dtd | 626 ++++++++++++++++++++++++++++++++++++++++++ Tools/gsdoc.gsdoc | 10 +- 6 files changed, 675 insertions(+), 6 deletions(-) create mode 100644 Tools/gsdoc-1_0_3.dtd diff --git a/ChangeLog b/ChangeLog index 482babcea..5bf7acefd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,8 +3,14 @@ * Tools/AGSOutput.m: * Tools/AGSParser.h: * Tools/AGSParser.m: + * Tools/AGSHtml.m: + * Tools/autogsdoc.m: + * Tools/gsdoc-1_0_3.dtd: + * Toold/gsdoc.gsdoc: + Added override=dummy attribute for methods which have dummy + implementations intendeed to be ocerridden in subclasses. Update to log warning about unimplemented methods which are not - tagged as "". ie intentionally empty. + tagged as intended to be overridden. 2005-11-22 Richard Frith-Macdonald diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 78fcf78a4..095afca73 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -1621,6 +1621,11 @@ static NSString *mainFont = nil; [buf appendString: @"Subclasses should " @"override this method.
\n"]; } + else if ([str isEqual: @"dummy"] == YES) + { + [buf appendString: @"An empty method provided for subclasses " + @"to override.
\n"]; + } else if ([str isEqual: @"never"] == YES) { [buf appendString: @"Subclasses should NOT " diff --git a/Tools/AGSOutput.m b/Tools/AGSOutput.m index 7a4921a9e..aa3df10aa 100644 --- a/Tools/AGSOutput.m +++ b/Tools/AGSOutput.m @@ -331,8 +331,8 @@ static BOOL snuggleStart(NSString *t) [str appendString: @"\n"]; [str appendString: @"\n"]; + [str appendString: @"\"-//GNUstep//DTD gsdoc 1.0.3//EN\" "]; + [str appendString: @"\"http://www.gnustep.org/gsdoc-1_0_3.xml\">\n"]; [str appendFormat: @" 0); + do + { + r = [comment rangeOfString: @""]; + if (r.length == 0) + r = [comment rangeOfString: @""]; + if (r.length == 0) + r = [comment rangeOfString: @""]; + if (r.length > 0) + { + if (m == nil) + { + m = [comment mutableCopy]; + } + [m deleteCharactersInRange: r]; + comment = m; + override = @"dummy"; + /* + * If a method should be overridden by subclasses, + * we don't treat it as unimplemented. + */ + [d setObject: @"NO" forKey: @"Empty"]; + } + } while (r.length > 0); do { r = [comment rangeOfString: @""]; diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index 9ee429e77..ddfae58ff 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -203,6 +203,11 @@ The method is marked as being one which subclasses must override (e.g. an abstract method). + <override-dummy /> + The method is marked as being one which is a dummy implementation + intended for subclasses to override, though not one they are forced + to implement. + <override-never /> The method is marked as being one which subclasses should NOT override. diff --git a/Tools/gsdoc-1_0_3.dtd b/Tools/gsdoc-1_0_3.dtd new file mode 100644 index 000000000..15040ad1f --- /dev/null +++ b/Tools/gsdoc-1_0_3.dtd @@ -0,0 +1,626 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tools/gsdoc.gsdoc b/Tools/gsdoc.gsdoc index 8666d499b..6b10875f4 100644 --- a/Tools/gsdoc.gsdoc +++ b/Tools/gsdoc.gsdoc @@ -792,9 +792,13 @@ notice and this notice are preserved. init attribute (also taking "yes" / "no") specifies whether this is the designated constructor. An optional override - attribute specifies whether this method should be overridden - (if "yes" enter "subclass", if "no" enter - "never"). + attribute specifies whether this method should be overridden. + If it must be overridden enter "subclass", + if it must not be overridden enter never", + if it is an empty/dummy implementation which is intended to be + overridden enter dummy, otherwise (for most methods + which may be but are not particularly designed to be overridden) + leave this attribute unset.

The elements in a <method> are - the method's name (in a sel element), the