gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] navidoc ./Makefile ./TODO-navidoc doc/syntax.rs...


From: Asko Soukka
Subject: [Gzz-commits] navidoc ./Makefile ./TODO-navidoc doc/syntax.rs...
Date: Thu, 26 Jun 2003 11:20:00 -0400

CVSROOT:        /cvsroot/navidoc
Module name:    navidoc
Branch:         
Changes by:     Asko Soukka <address@hidden>    03/06/26 11:19:59

Modified files:
        .              : Makefile TODO-navidoc 
        doc            : syntax.rst 
        navidoc        : parser.py 
        navidoc/mp     : uml.py 

Log message:
        syntax doc

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/Makefile.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/TODO-navidoc.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/doc/syntax.rst.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/parser.py.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/mp/uml.py.diff?tr1=1.20&tr2=1.21&r1=text&r2=text

Patches:
Index: navidoc/Makefile
diff -u navidoc/Makefile:1.19 navidoc/Makefile:1.20
--- navidoc/Makefile:1.19       Fri Jun 13 08:00:29 2003
+++ navidoc/Makefile    Thu Jun 26 11:19:59 2003
@@ -1,4 +1,4 @@
-#$Id: Makefile,v 1.19 2003/06/13 12:00:29 humppake Exp $
+#$Id: Makefile,v 1.20 2003/06/26 15:19:59 humppake Exp $
 
 all: java docs
 
@@ -59,7 +59,7 @@
 
 ##########################################################################
 # General documentation targets
-docs: java-doc navidoc navilink
+docs: java-doc navi-doc navilink
 
 DOCPKGS= -subpackages org
 #DOCPKGS= org.nongnu.navidoc.util
@@ -79,7 +79,7 @@
 #
 ##########################################################################
 # Navidoc targets
-navidoc: # Compiles reST into HTML
+navi-doc: # Compiles reST into HTML
        make html RST="doc/"
 
 navilink: # Bi-directional linking using imagemaps
Index: navidoc/TODO-navidoc
diff -u navidoc/TODO-navidoc:1.22 navidoc/TODO-navidoc:1.23
--- navidoc/TODO-navidoc:1.22   Mon Jun 16 13:16:23 2003
+++ navidoc/TODO-navidoc        Thu Jun 26 11:19:59 2003
@@ -5,29 +5,26 @@
 0.1alpha1: First separate release    
 =================================
 
-humppake:
+tasks in humppake's journal
+
+0.2alpha1:
+==========
+
   - syntax to follow Fenfire coding standards
     * or is this necessary?
-
   - add a subtitle into javodoc/docxx output before
     diagrams from different projects?
-
   - NavBar update for gzz.css, to allow using NavBar with
     design documentation
-
   - documenting, tests
   - document docutils.conf:datestamp -additions (CVS_DATE,
     CVS_VERSION, SSI_LASTMOD) somewhere
   - more?
 
-0.2alpha1:
-==========
-
 Design Issues
 -------------
 
   - plugin issues
-    + make sure that umltool works also with pure doccxx
     + nested classes in javadoc: grep for MipzipLoader.Level 
     + Currently diagrams are embedded into html-documents after
       the first header-tag. This could be enough for javadoc and
@@ -43,8 +40,6 @@
 ------------
 
   - fix umltool graphics to be closer to the UML 3amigos books
-  - ??? Fix UML sequence diagram: now you have to put
-    seqobjects *after* the sequence...
 
 Docutils latex writer
 ---------------------
@@ -63,8 +58,7 @@
 anybody:
   - all UML diagrams in UML reference manual
     and user's guide should be easy to do
-  - reimplement uml.py completely, or standardize on another
-    UML tool; required features:
+  - standardize on another UML tool; required features:
     + supports qualifiers, n-ary associations,
       class and sequence diagrams
     + supports arbitrary drawing on the diagrams
Index: navidoc/doc/syntax.rst
diff -u navidoc/doc/syntax.rst:1.9 navidoc/doc/syntax.rst:1.10
--- navidoc/doc/syntax.rst:1.9  Mon Jun 16 13:11:27 2003
+++ navidoc/doc/syntax.rst      Thu Jun 26 11:19:59 2003
@@ -1,146 +1,248 @@
-============
+==========
 UML syntax
-============
+==========
 
-.. UML:: testikaavio
+Defining UML diagram begins like any directive definition in reStructuredText::
 
-   bigpackage foobar
-       class foo "abstract"
-
-               fields
-                       barfield1
-                       barfield2
-                       barfieldn
-               methods
-                       barmethod1
-                       barmethod2
-                       barmethodn
-
-       package fof
-       
-       bigpackage jaajaa
-               package jeejee
-
-       class fooboo "abstract"
-
-               fields
-                       barfield1
-                       barfield2
-                       barfieldn
-               methods
-                       barmethod1
-                       barmethod2
-                       barmethodn
+  ..UML:: foobar
 
-   ---
-   horizontally(50, hor_c, foo, fooboo, fof);
-   horizontally(200, hor_d, fof, jeejee);
+After the definition follows an indented content. The content should
+contain definition part and usually also layout part.
 
+Definition
+==========
 
-Elements
-========
+There are several possibilities for definition of UML elements. The
+first variant is the most clearest, but the others allow explict
+definition of variables for elements. After the first definition the
+element is referred using its name, after the later definitions the
+element is referred using its variable.
 
-component
----------
+.. UML:: syntax-defining-1
 
-.. UML:: elements-component
+   class foo
 
-   component foo
+Syntax::
 
+   class foo
 
-Syntax::
+.. UML:: syntax-defining-2
 
-   component foo
+   foo = class foo123
 
-package
--------
+Syntax::
 
-.. UML:: elements-package
+   foo = class foo123
 
-   package foo
+.. UML:: syntax-defining-3
 
+   class (foo) foo123
 
 Syntax::
 
-   package foo
+   class (foo) foo123
 
+Because of MetaPost elements' variable names cannot contain any
+numbers. Therefore, when e.g. a class name contains numbers one of the
+two later variants must be used to define legal variable for element.
 
-interface
----------
+Layout
+======
 
-.. UML:: elements-interface
+Layout part is distinguished from definition part using a line with
+three or more ``-``. The layout part is actually just MetaPost, but
+some helpful macros and attributes are provided to help placing
+elements. Also pure MetaPost is allowed.
+
+horizontally
+------------
 
-   interface foo
+.. UML:: elements-layout-horizontally
 
+   class foo
+   class bar
+   ---
+   horizontally(50, horiz, foo, bar);
 
 Syntax::
 
-   interface foo
+   class foo
+   class bar
+   ---
+   horizontally(50, horiz, foo, bar);
+
+The first parameter ("50") the for space between objects.
+The second parameter("horiz") is variable name for the layout's
+coordinate system.
 
-bigpackage
+vertically
 ----------
 
-.. UML:: elements-bigpackage
+.. UML:: elements-layout-vertically
 
-   bigpackage foo
+   class foo
+   class bar
    ---
-   foo.sw = (0, 0);
-   foo.ne = (200,100);
+   vertically(50, vert, foo, bar);
 
 Syntax::
 
-   bigpackage foo
+   class foo
+   class bar
+   ---
+   vertically(50, vert, foo, bar);
+
+Mixed use
+---------
+
+.. UML:: elements-layout-mixed
+
+   class foo
+   class bar
+   class foobar
    ---
-   foo.sw = (0, 0);
-   foo.ne = (200,100);
+   horizontally(50, horiz, foo, bar);
+   vertically(50, vert, horiz, foobar);
+
+Syntax::
 
-Proposal::
+   class foo
+   class bar
+   class foobar
+   ---
+   horizontally(50, horiz, foo, bar);
+   vertically(50, vert, horiz, foobar);
 
-   bigpackage foo
-      elementfoo bar1
-      elementfoo bar2
-      elementfoo barn
+Elements
+========
 
 class
 -----
 
 .. UML:: elements-class
 
-   class foo "abstract"
+   class foo
+
+   class bar "abstract"
        fields
-               barfield1
-               barfield2
-               barfieldn
+               field1
+               field2
+               fieldn
        methods
-               barmethod1
-               barmethod2
-               barmethodn
-
-   class (bar) bar1 "abstract"
+               method1
+               method2
+               methodn
    ---
    horizontally(50, hor_c, foo, bar);
 
 Syntax::
 
-   class foo "abstract"
+   class foo
+
+   class bar "abstract"
        fields
-               barfield1
-               barfield2
-               barfieldn
+               field1
+               field2
+               fieldn
        methods
-               barmethod1
-               barmethod2
-               barmethodn
-
-   class bar bar1
+               method1
+               method2
+               methodn
    ---
    horizontally(50, hor_c, foo, bar);
 
-Because MetaPost interprets specially integers within a variable name,
-class names containing integers must precede an additional variable
-name refering to that class in UML syntax.
+Note: a class' name may contain a stereotype like "abstract" within
+quotation marks.
+
+component
+---------
+
+.. UML:: elements-component
+
+   component foo
+
+Syntax::
+
+   component foo
+
+
+interface
+---------
+
+.. UML:: elements-interface
+
+   component foo
+       assoc foobarA
+       assoc foobarB
+   foobarA = interface bar1
+   foobarB = interface bar1
+   ---
+   horizontally(50, horiz, foobarA, foobarB);
+   vertically(25, vert, horiz, foo);
+
+Syntax::
+
+   component foo
+       assoc foobarA
+       assoc foobarB
+   foobarA = interface bar1
+   foobarB = interface bar1
+   ---
+   horizontally(50, horiz, foobarA, foobarB);
+   vertically(20, vert, horiz, foo);
+
+package
+-------
+
+.. UML:: elements-package
 
-Note: "abstract" is additional.
+   package foobar
+
+Syntax::
+
+   package foobar
+
+
+bigpackage
+----------
+
+.. UML:: elements-bigpackage
+
+   bigpackage foobar
+       class foo
+       class bar
+   ---
+   horizontally(50, horiz, foo, bar);
+
+Syntax::
+
+   bigpackage foobar
+       class foo
+       class bar
+   ---
+   horizontally(50, horiz, foo, bar);
+
+.. UML:: elements-bigpackage-explicit
+
+   bigpackage foobar
+   class foo
+   class bar
+   ---
+   foo.sw = (50,25);
+   horizontally(50, horiz, foo, bar);  
+   foobar.sw = (0, 0);
+   foobar.ne = (200,75);
+
+Syntax::
+
+   bigpackage foobar
+   class foo
+   class bar
+   ---
+   foo.sw = (50,25);
+   horizontally(50, horiz, foo, bar);  
+   foobar.sw = (0, 0);
+   foobar.ne = (200,75);
 
 Connections
 ===========
@@ -189,22 +291,20 @@
 .. UML:: elements-dep
 
    class foo
-       dep "uasdfsadsdfsdfsdffds" bar
+       dep "create" bar
    class bar
-       dep "buubuu" foobar
-   class foobar
    ---
-   horizontally(100, hor_c, foo, bar, foobar);
+   horizontally(100, hor_c, foo, bar);
 
 Syntax::
 
    class foo
-       dep "use" bar 
+       dep "create" bar 
    class bar
    ---
    horizontally(100, hor_c, foo, bar);
 
-Note: "dependency" is obligatory
+Note: stereotype within quotation marks is obligatory.
 
 use
 ---
@@ -233,11 +333,11 @@
    class (fooA) foo1 
        assoc barA
    class (fooB) foo2
-       assoc role(foo) multi(1) - barB
+       assoc multi(1) - multi(0..1) barB
    class (fooC) foo3
-       assoc compos - multi(*) barC
+       assoc aggreg multi(0..1) - multi(*) role(part-of) barC
    class (fooD) foo4
-       assoc role(foo) multi(1) compos - multi(*) compos role(bar) barD
+       assoc compos multi(0..1)- multi(*) role(part-of) barD
    class (barA) bar1
    class (barB) bar2
    class (barC) bar3
@@ -254,11 +354,11 @@
    class (fooA) foo1 
        assoc barA
    class (fooB) foo2
-       assoc role(foo) multi(1) - barB
+       assoc multi(1) - multi(0..1) barB
    class (fooC) foo3
-       assoc compos - multi(*) barC
+       assoc aggreg multi(0..1) - multi(*) role(part-of) barC
    class (fooD) foo4
-       assoc role(foo) multi(1) compos - multi(*) compos role(bar) barD
+       assoc compos multi(0..1)- multi(*) role(part-of) barD
    class (barA) bar1
    class (barB) bar2
    class (barC) bar3
@@ -270,15 +370,6 @@
    horizontally(150, hor_cD, fooD, barD);
    vertically(50, ver_c, fooA, fooB, fooC, fooD);
 
-Proposal::
- 
-   in
-
-   class fooA foo1 
-       assoc - barA
-
-   "-" should be conditional
-
 naryassoc
 ---------
 
@@ -313,11 +404,11 @@
 
 .. UML:: elements-qual
 
-   class foo 
+   class foo
    qual q
        fields
                foobar
-       assoc multi(*) compos - multi(1) bar    
+       assoc multi(*) - multi(0..1) bar        
    class bar
    ---
    horizontally(150, hor_c, foo, bar);
@@ -329,12 +420,14 @@
    qual q
        fields
                foobar
-       assoc multi(*) compos - multi(1) bar    
+       assoc multi(*) - multi(0..1) bar        
    class bar
    ---
    horizontally(150, hor_c, foo, bar);
    q.w = foo.e;
 
+Note: unfortunately, qualifier must be attached manually (see the line ``q.w = 
foo.e;``).
+
 supply
 ------
 
@@ -354,88 +447,6 @@
    ---
    horizontally(50, hor_c, foo, bar);
 
-vobin
------
-
-.. UML:: elements-vobin
-
-   class foo
-       vobin - bar
-   class bar
-   ---
-   horizontally(50, hor_c, foo, bar);
-
-Syntax::
-
-   class foo
-       vobin - bar
-   class bar
-   ---
-   horizontally(50, hor_c, foo, bar);
-
-Note: like assoc 
-
-vobtransform
-------------
-
-.. UML:: elements-vobtransform
-
-   class foo
-       vobtransform - bar
-   class bar
-   ---
-   horizontally(50, hor_c, foo, bar);
-
-Syntax::
-
-   class foo
-       vobtransform - bar
-   class bar
-   ---
-   horizontally(50, hor_c, foo, bar);
-
-Note: like assoc
-
-vobtransformsub
----------------
-
-.. UML:: elements-vobtransformsub
-
-   class foo
-       vobtransformsub - bar
-   class bar
-   ---
-   horizontally(50, hor_c, foo, bar);
-
-Syntax::
-
-   class foo
-       vobtransformsub - bar
-   class bar
-   ---
-   horizontally(50, hor_c, foo, bar);
-
-Note: like assoc
-
-vobsubmatch
------------
-
-.. UML:: elements-vobsubmatch
-
-   class foo
-       vobsubmatch bar
-   class bar
-   ---
-   horizontally(50, hor_c, foo, bar);
-
-Syntax::
-
-   class foo
-       vobsubmatch bar
-   class bar
-   ---
-   horizontally(50, hor_c, foo, bar);
-
 seqobject
 ---------
 
@@ -482,132 +493,89 @@
    ---
    horizontally(50, hor_c, foo, bar);
 
-Layout
-======
 
-horizontally
-------------
+Linking
+=======
 
-.. UML:: elements-horizontally
+regular
+-------
 
-   class (fooA) foo1
-   class (fooB) foo2
-   class (fooC) foo3
-   class (fooD) foo4
-   ---
-   horizontally(50, hor_c, fooA, fooB, fooC, fooD);
+.. UML:: syntax-linking
+
+   page (syntax) "Navidoc UML syntax"
+       link
+               syntax.gen.html
 
 Syntax::
 
-   class (fooA) foo1
-   class (fooB) foo2
-   class (fooC) foo3
-   class (fooD) foo4
-   ---
-   horizontally(50, hor_c, fooA, fooB, fooC, fooD);
+   page (syntax) "Navidoc UML syntax"
+       link
+               syntax.gen.html
 
-The first parameter ("50") the for space between objects.
-The second parameter("hor_c") is variable name for the layout's
-coordinate system.
+from module
+-----------
 
-Proposal::
+Syntax::
 
-   horizontally(50, fooA, fooB, fooC, fooD);
+   page bar
+       link foobar
+               bar.html
 
-Is name for CS could be optional. If not given, could use random
-name.
 
-vertically
-----------
+Note: available modules must be specified in config.
 
-.. UML:: elements-vertically
+from javadoc
+------------
 
-   class (fooA) foo1
-   class (fooB) foo2
-   class (fooC) foo3
-   class (fooD) foo4
-   ---
-   vertically(50, hor_c, fooA, fooB, fooC, fooD);
+Syntax a)
 
-Syntax::
+::
 
-   class (fooA) foo1
-   class (fooB) foo2
-   class (fooC) foo3
-   class (fooD) foo4
-   ---
-   vertically(50, ver_c, fooA, fooB, fooC, fooD);
+   class org.foobar.foo
+       jlink
 
-The first parameter ("50") the for space between objects.
-The second parameter("ver_c") is variable name for the layout's
-coordinate system.
+Syntax b)
 
-Proposal::
+::
 
-   vertically(50, fooA, fooB, fooC, fooD);
+   class foo
+       jlink
+               org.foobar.foo
 
-Is name for CS could be optional. If not given, could use random
-name.
+Syntax c)
 
-Linking
-=======
+::
 
-.. uml:: elements-linking
+   jlinkpackage org.foobar
+   class foo
+       jlink
 
-   page foo
-       link
-               syntax.gen.html
+Note: available javadocs must be specified in config.
 
-   page (bar) "Fenfire project"
-       link fenfire
-               projects.gen.html
+from doc++
+----------
 
-   jlinkpackage org.fenfire.loom
-   class View
-       jlink
+Syntax a)
 
-   jlinkpackage
-   class LoomView
-       jlink
-               org.fenfire.loom.View
-
-   clinkpackage Vob
-   class Vob
-        clink
+::
 
-   clinkpackage
-   class CVob
+   class foobar::foo
        clink
-               Vob.Vob
-   ---
-   horizontally(50, hor_c, foo, bar, View, LoomView, Vob, CVob);
 
-Syntax::
+Syntax b)
 
-   page foo
-       link
-               syntax.gen.html
+::
 
-   page (bar) "Fenfire project"
-       link fenfire
-               projects.gen.html
+   class foo
+       clink
+               foobar
 
-   jlinkpackage org.fenfire.loom
-   class View
-       jlink
+Syntax c)
 
-   jlinkpackage
-   class LoomView
-       jlink
-               org.fenfire.loom.View
-
-   clinkpackage Vob
-   class Vob
-        clink
+::
 
-   clinkpackage
-   class CVob
+   jlinkpackage foobar
+   class foo
        clink
-               Vob.Vob
-   ---
-   horizontally(50, hor_c, foo, bar, View, LoomView, Vob, CVob);
\ No newline at end of file
+
+Note: available doc++ documentations must be specified in config.
Index: navidoc/navidoc/mp/uml.py
diff -u navidoc/navidoc/mp/uml.py:1.20 navidoc/navidoc/mp/uml.py:1.21
--- navidoc/navidoc/mp/uml.py:1.20      Fri Jun 13 03:34:28 2003
+++ navidoc/navidoc/mp/uml.py   Thu Jun 26 11:19:59 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: uml.py,v 1.20 2003/06/13 07:34:28 humppake Exp $
+# $Id: uml.py,v 1.21 2003/06/26 15:19:59 humppake Exp $
 
 #
 # Written by Tuomas Lukka, Asko Soukka
@@ -375,17 +375,23 @@
         if hasattr(element, 'var') and element.var:
             self.elements.append(element.var)
     def setup_code(self):
+        titlebox = """
+           addto %%.titl.pict doublepath 
(urcorner(%%.titl.pict)--lrcorner(%%.titl.pict)) withpen currentpen;
+           addto %%.titl.pict doublepath 
(ulcorner(%%.titl.pict)--llcorner(%%.titl.pict)) withpen currentpen;
+           addto %%.titl.pict doublepath 
(ulcorner(%%.titl.pict)--urcorner(%%.titl.pict)) withpen currentpen;
+            """
        s = """
            picture %%.titl.pict;
            %%.titl.pict = classTitle("%name%");
             setbounds %%.titl.pict to bbox %%.titl.pict;
-           addto %%.titl.pict doublepath 
(urcorner(%%.titl.pict)--lrcorner(%%.titl.pict)) withpen currentpen;
-           addto %%.titl.pict doublepath 
(ulcorner(%%.titl.pict)--llcorner(%%.titl.pict)) withpen currentpen;
-           addto %%.titl.pict doublepath 
(ulcorner(%%.titl.pict)--urcorner(%%.titl.pict)) withpen currentpen;
+            """
+        if not self.elements: s = s + titlebox
+        s = s + """
            unknownpicmeasurements(%%);
            picmeasurements(%%.titl);
            %%.titl.sw = %%.nw;
            """
+        if self.elements: s = s + titlebox
        return self.repl(s)
     def draw_code(self):
         s = ''
Index: navidoc/navidoc/parser.py
diff -u navidoc/navidoc/parser.py:1.18 navidoc/navidoc/parser.py:1.19
--- navidoc/navidoc/parser.py:1.18      Wed Jun 11 05:32:59 2003
+++ navidoc/navidoc/parser.py   Thu Jun 26 11:19:59 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: parser.py,v 1.18 2003/06/11 09:32:59 humppake Exp $
+# $Id: parser.py,v 1.19 2003/06/26 15:19:59 humppake Exp $
 
 #
 # Written by Tuomas Lukka, Asko Soukka
@@ -150,12 +150,12 @@
         # element's variable name can't contain any numbers
         if hasattr(element, 'var') and element.var:
             can_s = re.subn('[0-9]', '', element.var)[0]
-            if can_s != element.var: raise UMLException(
+            if can_s != element.var: raise ParserException(
 """
-Class name %s contains numbers.
+Class variable name %s contains numbers.
 Please, use syntax "foo = class foo123" or "class (foo) foo123"
 and refer it later using "foo".'
-""" % (s))
+""" % (element.var))
 
         if isinstance(element, navidoc.link.Link):
             element.bbox = 'bboxmeasuredpic(%s)' % (element.var)




reply via email to

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