meta, C++




62 Methoden:

/* private: */ void RoseUt ::   AufgabenDerAnwendung
/* private: */ void RoseUt ::   Comment
/* private: */ void RoseUt ::   Name
/* private: */ void RoseUt ::   Number
/* private: */ void RoseUt ::   TextUmbruch
/* private: */ void RoseUt ::   cash_Anfo
/* private: */ void RoseUt ::   cash_prof3_Anfo
/* private: */ void RoseUt ::   checkActorExists
/* private: */ void RoseUt ::   compare_Actors
/* private: */ void RoseUt ::   doComm
/* private: */ void RoseUt ::   formArrow
/* private: */ void RoseUt ::   formClass
/* private: */ void RoseUt ::   formDiagr
/* private: */ void RoseUt ::   formDoWrk
/* private: */ void RoseUt ::   formMetho
/* private: */ void RoseUt ::   formParam
/* private: */ void RoseUt ::   formSpace
/* private: */ void RoseUt ::   getCallBacks
/* private: */ void RoseUt ::   getSpec_GUI
/* private: */ char * RoseUt ::   op_attributes
/* private: */ void RoseUt ::   check_Nest
/* private: */ void RoseUt ::   check_nn
|
/* public: */ RoseUt ::   RoseUt
/* public: */ void RoseUt ::   CashObjOfClass
/* public: */ void RoseUt ::   CashObjects
/* public: */ void RoseUt ::   RoseToClassform
/* public: */ void RoseUt ::   aus_WinWord
/* public: */ void RoseUt ::   cash_Anforderungen
/* public: */ void RoseUt ::   gen_ERD
/* public: */ void RoseUt ::   getSpaltenWerte
/* public: */ void RoseUt ::   show_model_structure



#define static #include roseut.h : cpp #include roseut.c1 : cpp // #define LB_( x ) { checkPoint = x ; // #define LB_( x ) { if ( *x == 'R' ) printf( "\n-> %s", x ); fflush(stderr); /* public: */ RoseUt :: RoseUt /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( char * form // m... = Maestro // e... = Emacs (= pure ascii text) ) LB_("RoseUt.RoseUt") pure_ascii = ( *form != 'm' ); H0 = "\n#!#208(4,12,4)(80,15,0)" ; // c1s3-- mark Stufe 0 H1 = "\n#!#448(4,15,6)(80,15,0)" ; // c2s3-- mark Stufe 1 H2 = "\n#!#464(4,15,9)(80,15,0)" ; // c3s2-- mark Stufe 2 H3 = "\n#!#464(4,15,10)(80,15,0)" ; // c4s3-- mark Stufe 3 Hf = "\n#!#128(4,3,2)(80,3,0)" ; // c1s3-- fett if ( pure_ascii ) H0 = H1 = H2 = H3 = Hf = "" ; int n = max_actor ; while ( --n ) actor[n] = 0 ; countActions = 1 ; anzActions = 0 ; LE_ /* public: */ void RoseUt :: show_model_structure /* ----------------------------------------------------------------------------- create the skeleton 'cat.sk: The model to be shown to Gebhard ----------------------------------------------------------------------------- */ ( char * cat // path to a *.cat or *.mdl file ( *.sub ) , char * j2h ) LB_("RoseUt.show_model_structure") #define check_nest( a,b ) check_Nest( __LF__, a, b ) char * kopf = "\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\"><HTML><HEAD>" "\n<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"j2h.css\"></HEAD>" "\n<BODY text=\"#000000\"" "\n LINK=\"#FF6600\" VLINK=\"#FF6600\" ALINK=\"#0000FF\">" "\n<font face=\"Verdena,Arial\" size=2>\n" ; char * t1 = "\n<table" "\n id=\"Header\" border=0 cellpadding=0 cellspacing=0 width=\"100%\"" "\n <tr><td><center><font size=\"4\">" ; char * t2 = "\n</font></center></td></tr></table>" ; if ( ! cat || not_is_file( cat ) ) fErr1( cat ) if ( ! j2h || not_is_dir ( j2h ) ) fErr1( j2h ) nst[0] = 'c' ; mo_Class cls ; mo_Operation op ; mo_Parameter par ; Btree ClassIsView ; Btree Views ; rBuffer B( cat, " " ); while ( B.find( 1, "View::", 0 ) ) { __ char * e = B.z + B.a ; char * v = e ; to_( e, '"' ) *e = 0 ; char * c = e ; while not_in_str( *v, "|\"" ) v-- ; if ( *v == '|' ) continue ; v += 1 ; while ( *c != ':' ) c-- ; c++ ; if ( not_At( c , "<unspecified>" ) && not_At( c-15, "Use Case View" ) && not_At( c-7 , " View::" ) ) { c -= 3 ; while ( *c != ':' ) c-- ; c++ ; } if At( c, "<unspecified>" ) c += 13 ; c[-2] = 0 ; if substr( ":include:", v ) continue ; if At( c, "include::" ) continue ; if ( *c ) ClassIsView.StrIns( 'e', c, v ); c[-2] = ':' ; Views.StrIns( 'e', v ); B.a = e - B.z ; __ } __ // ----------------------------------------------------------------------------- str_set such ; such.insert( "(" ); such.insert( ")" ); such.insert( "\"" ); such.insert( "\nfile: " ); such.insert( "\n|" ); // documentation in UML such.insert( "documentation" ); // documentation in UML B.open_rBuffer( cat, " " ); char * tmp = "tmp_rose_1" ; FILE * f = create( tmp ); char * doc = "tmp_docu_1" ; FILE * D = create( doc ); char * com = "tmp_docu_2" ; int i = 0 ; int k = 0 ; int offset = 1 ; while ( B.find( offset, such, f ) ) { B.getmore( 8000 ); char * c = B.z + B.a ; offset = 1 ; if ( 0 ) then { traceStr( "XXX", B.z + B.a , 100 ); traceStr( "xxx", B.z + B.a - 30, 100 ); } if ( *c == '(' ) then { fprintf( f, "%i~%i~", ++i, ++k ); char * x = c ; while not_in_str( *x, ")\n" ) x++ ; char m = *x ; *x = 0 ; fprintf( D, "\n%s", c ); *x = m ; } esif ( *c == ')' ) { fprintf( D, "\n)" ); fprintf( f, "~" ); if ( --k < 0 ) { close( f ); rBuffer B( tmp, "\n" ); str_set xxx ; xxx.insert( "(" ); xxx.insert( ")" ); xxx.insert( "\n|" ); xxx.insert( "\"" ); while ( B.find( 1, xxx, 0 ) ) { if ( B.z[ B.a ] == '"' ) then { rB_( B, 1, "\"", 0 ) } esif ( B.z[ B.a ] == '\n' ) { rB_( B, 1, "\n", 0 ) } esif ( B.z[ B.a-1 ] != '~' ) { traceStr( "kkk", B.z + B.a - 4, 100 ); break ; } } printf( "\nerror in rose_1 ..." ); continue ; } if ( k < 0 ) fErr2( k, tmp ) } esif ( *c == '"' ) { c++ ; to_( c, '"' ) while escaped( c ) // while ( c[-1] == '\\' && c[-2] != '\\' ) { c++ ; to_( c, '"' ) } *c = 0 ; fprintf( f, "%s\"", B.z + B.a ); offset = 0 ; B.a = c+1 - B.z ; } esif At( c, "\nfile:" ) { // da Rose nicht alle Klammern selbst zumacht: while ( 0 < k ) { k-- ; // hier nicht schon in der Abfrage !!! fprintf( f, "\n)" ); fprintf( D, "\n)" ); } } esif At( c, "\n|" ) { // UML comment der Form: documentation \n|... \n|... while At( B.z + B.a, "\n|" ) { fprintf( D, "\n<br>" ); if ( B.z[ B.a + 2 ] == ' ' ) fprintf( D, "     " ); B.a += 2 ; rB_( B, 0, "\n", D ) } offset = 0 ; } esif At( c, "documentation" ) { // UML comment der Form: documentation "..." char * c = B.z + B.a + 14 ; skip_space( c ); if ( *c == '|' ) then { continue ; } esif ( *c == '"' ) { char * x = ++c ; to_( x, '\n' ) x-- ; if ( *x = '"' ) then { *x = 0 ; fprintf( f, "\n|%s", c ); B.a = x+1 - B.z ; offset = 0 ; continue ; } else fErr } else fErr } else fErr } __ while ( 0 < k-- ) // da Rose nicht alle Klammern zumacht { fprintf( f, "\n)" ); fprintf( D, "\n)" ); } close( D ); close( f ); // ----------------------------------------------------------------------------- Btree classDocu ; f = create( com ); { char * stack[ 1000 ]; int deep = 0 ; int spot = 0 ; B.open_rBuffer( doc, "" ); while ( B.find( 0, "\n", 0 ) ) { char * c = B.z + B.a + 1 ; // traceStr( "RRR",c,30 ); if ( *c == '(' ) then { char * x = c ; to_( x, '\n' ) if ( x[1] == ')' ) { B.a = x+2 - B.z ; continue ; } *x = 0 ; if ( deep >= 1000 ) fErr1( deep ) stack[ deep++ ] = such.take( c+1 ); B.a = x - B.z ; *x = '\n' ; } esif ( *c == ')' ) { B.a += 1 ; if ( --deep < 0 ) fErr } esif ( *c == '<' ) { B.getmore( 10000 ); char * x = c = B.z + B.a ; B.z[ B.e ] = '\n' ; while ( x[1] == '<' ) { x += 2 ; to_( x, '\n' ); } if ( B.z + B.e <= x ) fErr *x = 0 ; char10 nr ; s_( nr, "%i", ++spot ); char * nam = stack[ deep-1 ]; fprintf( f, "\n-%i:" "\n<a name=%s></a>" "\n+%i:%s%s", deep-1, nr, deep-1, nam, c ); if At( nam, "object Class " ) { char * x = nam += 14 ; to_( x, '"' ) *x = 0 ; classDocu.StrIns( 'e', nam, nr ); *x = '"' ; } B.a = x - B.z ; *x = '\n' ; } esif ( At( c, "file:" ) && deep ) fErr1( deep ) } fprintf( f, "\n-0:\n" ); if ( deep ) fErr1( deep ) // ----------------------------------------------------------------------------- close( f ); f = create( "UMLdocu.htm" ); fprintf( f, "\n%s<a name=top></a>%sModel Documentation in UML%s<font size=2>" "\n<p id=1> <br>" , kopf, t1, t2 ); B.open_rBuffer( com, "" ); while ( B.find( 0, "\n", f ) ) { char * c = B.z + B.a + 1 ; if ( *c == '+' ) then { to_space( c ) c++ ; char * x = c ; to_( x, '"' ) x++ ; to_( x, '"' ) x++ ; char m = *x ; *x = 0 ; fprintf( f, "<br><br><font size=4>%s</font><br>", c ); B.a = x - B.z ; *x = m ; } esif ( *c == '-' ) rB_( B, 1, "\n", 0 ) else B.a++ ; } fprintf( f, "\n</p></body></html>" ); } close( f ); // ----------------------------------------------------------------------------- #define defT while ( T && deep_k[T] >= k ) T-- ; deep_k[ ++T ] = k ; Btree desComp ; char * oper[ 100000 ] ; uint deep_k[ 1000 ]; deep_k[0] = 0 ; B.open_rBuffer( tmp, " " ); such.insert( "\n|" ); int anz_classes = 0 ; int anz_op = 0 ; int anz_par = 0 ; int seePar = 0 ; int T = 0 ; Btree classes ; char100 component ; *component = 0 ; char800 sk ; s_( sk, "%s.sk", cat ); f = create( sk ); fprintf( f, "\nThe skeleton of Rose MODEL( %s ):\n\n", cat ); __ while ( B.find( 1, such, 0 ) ) { B.getmore( 8000 ); char * c = B.z + B.a ; if ( *c == '(' ) then { char * u = c-2 ; while ( u[-1] != '~' ) u-- ; k = decNr( u ); c++ ; skip_space( c ) nst[k] = upper( nst[k-1] ); // if ( 310 < anz_op ) traceStr( "VVV", c, 500 ); _1( anz_op ) char * e = c ; to_( e, '\n' ) *e = 0 ; if(1) if At( c-1, "(object ClassDiagram" ) { // Die Zahl erkannter Klassen - siehe letzte Zeile in *.sk - // wird dadurch nicht geringer. int k = 1 ; B.z[ B.e ] = '?' ; while ( k && c < B.z + B.e ) { while not_in_str( *( ++c ), "()?" ); if ( *c == '?' ) then { B.a = c-2 - B.z ; B.getmore( 8000 ); B.z[ B.e ] = '?' ; c = B.z + B.a + 3 ; if ( B.z + B.e <= c ) fErr1( k ) } else k = ( *c == '(' )? k+1 : k-1 ; } continue ; } if At( c-1, "(object Class_Category" ) { to_( c, '"' ) char * e = ++c ; to_( e, '"' ) *e = 0 ; strcpy( component, c ); B.a = e - B.z ; continue ; } if At( c, "object" ) { c += 7 ; if ( At( c, "Instantiated_Class" ) || At( c, "Class" ) ) then seePar = false ; if At( c, "Class " ) // space muss sein then { nst[k] = 'c' ; defT ; cls.deep = T ; to_( c, '"' ) char * e = ++c ; to_( e, '"' ) *e = 0 ; cls.nam = store.take( c ); char10 nr ; s_( nr, "%i", ++anz_classes ); classes.StrIns( 'e', cls.nam, nr ); fprintf( f, "\n" "\n%*s |" "\n%*s class %s [for %s]" , T, "", T, "", cls.nam, component ); KVStore st ; if ( classDocu.Get( cls.nam, st ) ) { fprintf( f, " <a href=UMLdocu.htm#%s>doc</a>", st.c ); } char800 xx ; s_( xx, "%s~%s", component, cls.nam ); strcpy( xx + 250, " ..." ); desComp.StrIns( 'e', xx ); check_nest( k, "c" ); } esif ( seePar && At( c, "Parameter" ) ) { if ( nst[k] == 'C' ) continue ; char * e = c ; to_( e, '"' ) e++ ; to_( e, '"' ) e++ ; skip_space( e ) if ( *e == ')' || e[1] == ')' ) continue ; anz_par++ ; defT ; nst[k] = 'p' ; to_( c, '"' ) c++ ; skip_space( c ) e = c ; to_( e, '"' ) *e = 0 ; par.nam = such.take( c ); *e = '"' ; if At( c-1, "\"\"" ) par.nam = "noNamePar" ; c = e+1 ; while ( c++ ) { if ( At( c, "type" ) && space( c[-1] ) && space( c[ 4] ) ) break ; } to_( c, '"' ) e = ++c ; to_( e, '"' ) *e = 0 ; par.typ = such.take( c ); *e = '"' ; fprintf( f, "\n%*s - %s %s" , cls.deep + 6, "" , par.typ, par.nam ); if ( ! *par.nam ) fErr1( anz_op ) check_nest( k, "o" ); } esif At( c, "Attribute" ) { if ( nst[k] == 'C' ) continue ; nst[k] = 'a' ; to_( c, '"' ) c++ ; if At( c, "cg\"" ) then { rB_( B, 1, "value", 0 ); c = B.z + B.a ; if not_space( c[-1] ) fErr if not_space( c[ 5] ) fErr c += 6 ; skip_space( c ) char m = '"' ; if ( *c == '"' ) then { e = ++c ; to_( e, '"' ) *e = 0 ; } esif At( c, "TRUE" ) {} esif At( c, "FALSE" ) {} else { m = ')' ; to_( c, '(' ) e = ++c ; to_( e, ')' ) *e = 0 ; } // B.a = e-1 - B.z ; *e = m ; } else { rB_( B, 1, "value", 0 ); c = B.z + B.a ; if not_space( c[-1] ) fErr if not_space( c[ 5] ) fErr c += 6 ; skip_space( c ) if ( *c == '(' ) c = skip_nest( c, '(', ')' ); B.a = c-1 - B.z ; } check_nest( k, "oc" ); } esif At( c, "Operation" ) { // okAt = -1000 ; seePar = true ; defT ; anz_op++ ; // _1( anz_op ) nst[k] = 'o' ; check_nest( k, "c" ); to_( c, '"' ) char * e = ++c ; to_( e, '"' ) *e = 0 ; op.nam = store.take( c ); strcpy( B.z + B.e, "\n\n(" ); B.z[ B.e ] = 0 ; e = op_attributes( e+1, op ); if ( e == B.z + B.e + 2 && ( ! B.ateof )) fErr uint t = cls.deep + 3 ; if is_( op.exp, "Public" ) op.exp = "?1" ; esif is_( op.exp, "Protected" ) op.exp = "?2" ; esif is_( op.exp, "Private" ) op.exp = "?3" ; fprintf( f, "\n%*s |" "\n%*s %s %s %s(" , t, "", t, "", op.exp, op.res, op.nam ); if ( ! *op.nam ) fErr1( anz_op ) oper[ anz_op ] = op.nam ; check_nest( k, "c" ); } } B.a = e-1 - B.z ; } esif ( *c == '\n' ) { rB_( B, 1, "\n", 0 ) B.a -= 1 ; // here Docu in model } } __ fprintf( f, "\n\n" "\nclasses = %6i" "\noperations = %6i" "\nparameters = %6i \n\n", anz_classes, anz_op, anz_par ); if ( f ) close( f ); __ // ----------------------------------------------------------------------------- B.open_rBuffer( tmp, "" ); i = 0 ; oper[0] = "-" ; while ( B.find( 1, "(object Operation \"", 0 ) ) { char * c = B.z + B.a + 19 ; if not_At( c, oper[ ++i ] ) then { traceStr( "ooo", B.z + B.a, min( 100, B.e - B.a ) ); fErr3( i, oper[i], oper[i-1] ) } else B.a += 18 ; } if ( i != anz_op ) fErr2( i, anz_op ) unlink( tmp ); // ----------------------------------------------------------------------------- char800 htm ; strcpy( htm, sk ); strcpy( eos( htm ) - 7, ".htm" ); f = create( htm ); fprintf( f, "\n<HTML><a name=\"top\"></a><style type=\"text/css\"><!--" "\n" "\n h1 { font-size:20pt; }" "\n h2 { font-size:16pt; }" "\n h3 { font-size:12pt; }" "\n p { font-size:10pt; }" "\n" "\n .n { margin: 0pt 0pt 6pt 0pt; }" "\n .s { margin: 0pt 0pt 6pt 50pt; }" "\n .c { margin: 0pt 0pt 6pt 50pt; }" "\n .m { margin: 0pt 0pt 6pt 80pt; }" "\n" "\n--></style><BODY text=\"#000000\"" "\n<body text=#000000 link=#FF6600 vlink=#FF6600 alink=#FF0000>" "\n<font face=\"ARIAL,VERDANA\"><br><center>" "\n<h2>The UML Model</h2>" "\n<font size=1>" "\n<br><a href=UMLDesComp/views.htm>Views</a>," "\n<a href=UMLDesComp/components.htm>Components</a><br>" "\n<br>%i Classes, %i Methods ( public is default )" "\n</p></center><br><p class=m><a name=classes></a>" , anz_classes, anz_op ); FILE * U = create( "xx_U" ); KVStore st ; Surr s = classes.GetFirst( st ); while ( s ) { char * e = st.k ; to_( e, ' ' ) *e = 0 ; fprintf( f, "\n<br><a href=#%s>%s</a>", st.c, st.k ); fprintf( U, "\n~%s~%s~" , st.k, st.c ); *e = ' ' ; s = classes.Next( st ); } fprintf( f, "\n<br><br>" ); close( U ); B.open_rBuffer( sk, "" ); i = 0 ; while ( B.find( 1, "\n", f ) ) { char * c = B.z + B.a + 1 ; fprintf( f, "<br>" ); if ( *c == 'c' ) break ; if ( *c == ' ' ) then { skip_space( c ); if ( *c == '|' ) then { *c = ' ' ; B.a = c - B.z ; } esif At( c, "class " ) { c += 6 ; char * e = c ; to_( e, '\n' ) *e = 0 ; char * u = e ; if ( u[-1] == ']' ) { while ( *u != '[' ) u-- ; u[-1] = 0 ; } fprintf( f, "\n<br><a name=%i><br></a></p><p class=c>UML class" "\n <a href=#classes>" "<font size=4>%s</font></a> %s</p><p class=m>" , ++i, c, u ); e[-1] = ' ' ; B.a = e-1 - B.z ; *e-- = '\n' ; } esif ( *c == '-' ) { fprintf( f, "          " ); } else { if At( c, "?2" ) fprintf( f, "protected  " ); if At( c, "?3" ) fprintf( f, "private  " ); c += 2 ; skip_space( c ); char * e = c ; to_( e, '(' ); *e = 0 ; char * x = e-1 ; while ( *x != ' ' ) x-- ; *x++ = 0 ; fprintf( f, "%s  <b>%s</b>", c, x ); B.a = e - B.z ; *e = ' ' ; } } } // ----------------------------------------------- show UML Design Components: { char100 comp ; *comp = 0 ; uint compNr = 0 ; FILE * f2 = 0 ; char * dir = "UMLDesComp" ; dir_exist_empty( dir ); FILE * f1 = create( "UMLDesComp/j2h.css" ); fprintf( f1, "\nbody { background-color: #FFFFFF; }" "\nbody { color: #000000 } /* for normal code */" "\n#Header { color: #000000; background-color: #CCCCFF }" "\n#ko1 { color: #000000; background-color: #CCFFCC }" "\n#Classes A:link { color: #FF0099; }" "\n#Classes A:visited { color: #FF0099; }" "\n#Classes PRE { color: #000000; }" "\n#co { color: #008000; } /* for comment */" "\n#kw { color: #0000FF; } /* for keywords */" "\n#str { color: #FF00FF; } /* for quoted text */" ); // warum funktioniert font-size nicht close( f1 ); // ----------------------------------------------------------------------------- f1 = create( "UMLDesComp/components.htm" ); fprintf( f1, "\n%s<a name=top></a>%sComponents named in UML%s<font size=2>" , kopf, t1, t2 ); s = desComp.GetFirst( st ); while ( s ) { char * u = st.k ; to_( u, '~' ) *u = 0 ; if not_is_( comp, st.k ) { strcpy( comp, st.k ); char100 xx ; s_( xx, "UMLDesComp/%i.htm", ++compNr ); if ( f2 ) close( f2 ); f2 = create( xx ); fprintf( f2, "\n%s<a name=top></a>%s%s%s<font size=2>" , kopf, t1, comp, t2 ); fprintf( f1, "\n<br>Component <a href=%i.htm>%s</a>", compNr, comp ); } fprintf( f2, "\n<br>%s: %s", st.k, u+1 ); *u = '~' ; s = desComp.Next( st ); } fprintf( f1, "\n<br><br>%u Components", compNr ); close( f1 ); // ----------------------------------------------------------------------------- uint components = compNr ; char800 view ; strcpy( view, "?" ); char800 pred ; *pred = 0 ; f1 = create( "UMLDesComp/Views.htm" ); fprintf( f1, "\n%s<a name=top></a>%sUse Case Views in UML%s<font size=2>" , kopf, t1, t2 ); s = Views.GetFirst( st ); uint offs = 0 ; while ( s ) { if ( *st.k == 'U' ) // Use Case { char * u1 = st.k ; to_( u1, ':' ) char * u2 = u1 + 2 ; to_( u2, ':' ) char * u3 = u2 + 2 ; to_( u3, ':' ) if not_At( st.k, view ) { char100 xx ; s_( xx, "UMLDesComp/%i.htm", ++compNr ); if ( f2 ) close( f2 ); f2 = create( xx ); *u1 = *u2 = 0 ; fprintf( f2, "\n%s<a name=top></a>%s<font size=3><br>" "\n<font size=3>%s<br><br><b>%s</b></font>" "\n<font size=2><br> %s" , kopf, t1, st.k, u1 + 2, t2 ); fprintf( f1, "\n<br>%s <a href=%i.htm>%s</a>", st.k, compNr, u1+2 ); s_( view, "%s::%s", st.k, u1+2 ); *pred = 0 ; } char * sec = At( u2+2, pred )? "" : "|<br>" ; fprintf( f2, "\n<br>%s%s", sec, u2+2 ); *u3 = 0 ; strcpy( pred, u2+2 ); *u1 = *u2 = *u3 = ':' ; } // s = Views.Next( st ); } fprintf( f1, "\n<br><br>%i Views", compNr - components ); close( f1 ); if ( f2 ) close( f2 ); } // ----------------------------------------------------------------------------- close( f ); // S_ "%s", htm _Do LE_ /* private: */ void RoseUt :: check_nn // ----------------------------------------------------------------------------- ( char * c , char * e ) LB_("RoseUt.check_nn") char * x = c-1 ; int anz = 0 ; while ( ++x < e ) if ( ! *x ){ if ( ++anz == 2 ) fErr1(x-c) } LE_ /* private: */ void RoseUt :: check_Nest // ----------------------------------------------------------------------------- ( int Line , char * File , int k , char * str ) LB_("RoseUt.check_Nest") while( lower( nst[--k] ) == 'a' ) {} if not_in_str( lower( nst[k] ), str ) { // ?err( "not in %s at Line %i", str, Line ) } LE_ /* private: */ char * RoseUt :: op_attributes // ----------------------------------------------------------------------------- ( char * c , mo_Operation & op ) LB_("RoseUt.op_attributes") op.res = "void" ; while not_At( c, "quid" ) c++ ; while ( *c != '~' ) { // traceStr( "AAA", c, 10 ); if At( c, "opExpo" ) then { to_( c, '"' ) char * e = ++c ; to_( e, '"' ) *e = 0 ; op.exp = store.take( c ); *e = '"' ; c = e+1 ; } esif At( c, "result" ) { to_( c, '"' ) char * e = ++c ; to_( e, '"' ) *e = 0 ; op.res = store.take( c ); *e = '"' ; c = e+1 ; } esif At( c, "xxceptions" ) { } else to_( c, '\n' ) skip_space( c ); if At( c, "uid" ) break ; } LE_ret( c ) /* public: */ void RoseUt :: CashObjects /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Hole alle in ''cat definierten Objekte nach ''(this -> objects). Hinweis: Sie in einer Summe ''cat von *.cat Dateien direkt zu finden ist besser als einen durch Rational Rose erzeugten Report zu Rete zu ziehen. Deswegen ersetzt diese Methode die zuerst definierte Methode CashObjOfClass(). So sieht ein Object in *.cat aus (Example): (object Object "TheWeitermeldungslisteSendendeOrgE" collaborators (list link_list (object Link supplier "ThePoolEmpfangendeOrgE" messages (list Messages (object Message "schreibeMeldung ( )" frequency "Aperiodic" synchronization "Simple" dir "FromClientToSupplier" sequence "" ordinal 4))) (object Link supplier "TheTUE_S" messages (list Messages (object Message "merkenErinnerungstermin" frequency "Aperiodic" synchronization "Simple" dir "FromClientToSupplier" sequence "" ordinal 7 Operation "merkenErinnerungstermin")))) class "WeitermeldungsListe" persistence "Transient" multi FALSE) Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( char * catfile // path to file ) LB_("RoseUt.CashObjects") if not_path_exists( "profil_5" ) { int fehler = 0 ; FILE * f = create( "profil_5" ); fprintf( f, "\n Fachkonzept ERBIS: Objects auf Konsistenz geprft" "\n#!#464(6,15,6)(80,15,0)\n\n" "\n" "\n object\"of_type\"" "\n" "\n" ); str_set suche ; suche.insert( "object Object" ); suche.insert( "class " ); suche.insert( "persistence" ); struct Object { char * name ; char * type ; char pers ; } ; rBuffer B( catfile, "" ); int anz = 0 ; BOOL at_o = 0 ; Object o ; o.pers = ' ' ; while ( B.find( 1, suche, 0 ) ) { char * c = B.z + B.a ; // showStr( "", c, 33 ); if ( *c == 'o' ) then { at_o = 1 ; char * a = c += 14 ; // ok !! while ( *c != '"' ) c++ ; *c = 0 ; o.name = store.ensure( a ) -> str ; o.type = "?" ; o.pers = '?' ; } else if ( *c == 'd' ) // documentation { } else if ( at_o ) { if ( *c == 'p' ) then { c += 11 ; while ( *c != '"' ) c++ ; o.pers = *( ++c ); anz++ ; fprintf( f, "\n o:t %s\"%s\"", o.name, o.type ); if ( *( o.type ) == '?' ) fehler++ ; else if ( o.pers == '?' ) fehler++ ; o.type = "?" ; o.pers = ' ' ; at_o = 0 ; } esif is( c, "classes", 6 ) c += 5 ; esif ( *c == 'c' ) { c += 5 ; while ( *c != '"' ) c++ ; char * a = ++c ; while ( *c != '"' ) c++ ; *c = 0 ; o.type = store.ensure( a ) -> str ; } else fErr } B.a = c - B.z ; } if ( ! anz ) fErr int prozent = ( fehler )? 1 + ( 100 * fehler )/anz : 0 ; fprintf( f, "\n\n\n " "Wie man sieht, bedrfen %i Stellen (ca. %i %%) einer Nachbesserung." "\n#!#128(4,3,2)(80,3,0)" , fehler, prozent ); close( f ); S_ "ersetze -ersetze" _Do } rBuffer B( "profil_5", "" ); while ( B.find( 0, "o:t ", 0 ) ) { char * x = B.z + B.a + 5 ; char * o = x ; while ( *x != '"' ) x++ ; *x++ = 0 ; char * c = x ; while ( *x != '"' ) x++ ; *x++ = 0 ; match_rec * mr = objects.ensure( o ); if is( c, "(Unspecified)", 10 ) c = mr -> str ; if is( c, "The" , 3 ) c = c + 3 ; // for robustness mr -> w2 = store.ensure( c ) -> str ; B.a = x - B.z ; } FILE * f = create( "o_t" ); objects.sort(0); int r = -1 ; while ( ++r < objects.card ) { fprintf( f, "\n %3i. %s: %s", r+1, objects.elem[ r ] -> str , objects.elem[ r ] -> w2 ); } close( f ); LE_ /* public: */ void RoseUt :: CashObjOfClass /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Hole den Rational Rose Report ''(All Objects defined) nach ''(this -> objects). Der Report ist nicht lexikographisch geordnet und kann Objekte durchaus auch mehrfach enthalten: Object name: TheWeitermeldung Class: Weitermeldung Persistence: Transient Object name: TheAUF_SQL Class: AUF_SQL Persistence: Transient . . . Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( char * rep_o // path to file ) LB_("RoseUt.CashObjOfClass") if not_path_exists( "profil_5" ) { int fehler = 0 ; FILE * f = create( "profil_5" ); fprintf( f, "\n Fachkonzept ERBIS: Objects auf Konsistenz geprft" "\n#!#464(6,15,6)(80,15,0)\n\n" "\n" "\n object\"of_type\"" "\n" "\n" ); rBuffer B( rep_o, "" ); int anz = 0 ; while ( B.find( 0, "Object name:", 0 ) ) { char * c = B.z + B.a + 13 ; while space( *( ++c ) ){} char * a = c ; while not_space( *( ++c ) ){} *c = 0 ; while ( *( ++c ) != ':' ){} ; if not_is( a, "Class:", 6 ) { match_rec * mr = objects.ensure( a ); while space( *( ++c ) ){} a = c ; while not_space( *( ++c ) ){} *c = 0 ; fprintf( f, "\n o:t %s\"%s\"", mr->str, a ); anz++ ; if is( a, "(Unspecified)", 10 ) a = mr -> str ; if is( a, "The" , 3 ) a = a + 3 ; char * cls = store.ensure( a ) -> str ; if ( mr -> w2 ) then { if not_is_( cls, ( char * ) mr -> w2 ) { fprintf( f, "\n" "\n--> Inkonsistenz oder Lcke: Is %s" "\n of type %s " "\n or of type %s ?? \n", mr->str, cls, mr->w2 ); fehler++ ; } } else mr -> w2 = cls ; } B.a = c - B.z ; } int prozent = ( fehler )? 1 + ( 100 * fehler )/anz : 0 ; fprintf( f, "\n\n\n " "Wie man sieht, bedrfen %i Stellen (ca. %i %%) einer Nachbesserung." "\n#!#128(4,3,2)(80,3,0)" , fehler, prozent ); close( f ); S_ "ersetze -ersetze" _Do } rBuffer B( "profil_5", "" ); while ( B.find( 0, "o:t ", 0 ) ) { char * x = B.z + B.a + 5 ; char * o = x ; while ( *x != '"' ) x++ ; *x++ = 0 ; char * c = x ; while ( *x != '"' ) x++ ; *x++ = 0 ; match_rec * mr = objects.ensure( o ); if is( c, "(Unspecified)", 10 ) c = mr -> str ; if is( c, "The" , 3 ) c = c + 3 ; // for robustness mr -> w2 = store.ensure( c ) -> str ; B.a = x - B.z ; } FILE * f = create( "o_t" ); objects.sort(0); int r = -1 ; while ( ++r < objects.card ) { fprintf( f, "\n %3i. %s: %s", r+1, objects.elem[ r ] -> str , objects.elem[ r ] -> w2 ); } close( f ); LE_ /* private: */ void RoseUt :: Name /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Erkenne den Namen, schreibe eine Kopie nach ''store und mache ''dest zum Pointer auf diese Kopie. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( int offset , char * & c , char * & dest ) LB_("RoseUt.Name") char * a = c += offset ; if ( *( c-1 ) != '"' ) fErr while ( *c != '"' ) c++ ; *c = 0 ; path x1 ; char * x = x1 ; while ( *a ) { *x++ = *a++ ; if is( x-2, " (", 2 ) memcpy( x-2, "( ", 2 ); } *x = 0 ; if ( not_space( x[-2] ) && x[-1] == ')' ) memcpy( x-1, " )", 4 ); if ( x[-4] == '(' ) memcpy( x-4, "()" , 3 ); if not_in_name( *x1 ) { printf( "\n??: (%s)", x1 ); strcpy( x1, "??" ); } dest = store.ensure( x1 ) -> str ; LE_ /* private: */ void RoseUt :: Comment /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Erkenne den Comment, schreibe eine Kopie nach ''store und mache ''dest zum Pointer auf diese Kopie. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( int offset , char * & c , char * & dest ) LB_("RoseUt.Comment") c += offset ; while space( *( ++c ) ){} char quote = ( *c == '"' )? '"' : '\n' ; char * a = ++c ; while ( *( ++c ) != quote ){} while space( *c ) c-- ; if ( *c == '"' ) *c++ = 0 ; else { c[1] = 0 ; c += 2 ; } dest = store.ensure( a ) -> str ; LE_ /* private: */ void RoseUt :: doComm /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Erkenne Documentation (= Comment) Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( char * & c , char * & dest , char * & e ) LB_("RoseUt.doComm") *e = '"' ; // nicht ganz korrekt, aber e == end of buffer B.z c += 12 ; while ( *c != '"' ) c++ ; char *a = ++c ; while ( *c != '"' ) c++ ; *c = 0 ; store.st_clone( dest, a ); LE_ /* public: */ void RoseUt :: RoseToClassform /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Transformiere ''from (eine Datei im Rational Rose Format *.cat) nach ''to unter Nutzung des Formats der Klassenformulare. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( char * s // , char * from // , char * to // ) LB_("RoseUt.RoseToClassform") // cash_prof3_Anfo(); sys = s ; rBuffer B( from, "" ); B.remember( 200 ); str_set match ; match.insert( "gory \"" ); // Class_Category match.insert( "s \"" ); // Class match.insert( "n \"" ); // Operation (= Method) match.insert( "doc" ); // documentation match.insert( "r \"" ); // Parameter match.insert( "_Rel" ); // Relationships match.insert( "Public\"" ); // match.insert( "Private\"" ); // match.insert( "Protected\"" ); // match.insert( "ionDiagram" ); // (object InteractionDiagram match.insert( "View" ); // (object InterObjView match.insert( "MessView" ); // (object InterMessView match.insert( "SelfMess" ); // (object SelfMessView match.insert( "t Label" ); // (object Label str_set cardi ; cardi.insert( ")" ); // if Relationship without cardinality cardi.insert( "y \"" ); // if Relationship has a cardinality type_L = 0 ; at_diagr = diagrams = 0 ; at_space = spaces = 0 ; at_text = 0 ; char ** access = 0 ; char ** comm = 0 ; while ( B.find( 0, match, 0 ) ) { #define M_next( oc, at, offset ) \ { \ oc * x = new oc ; Name( offset, c, x -> name ); \ \ if ( at ) at -> next = x ; \ \ at = x ; x -> comm = "?" ; comm = &( x -> comm ); \ \ access = &( x -> access ); *access = "private" ; \ } if ( B.e < B.a + 100 ) B.getmore( 4000 ); char * c = B.z + B.a ; char * e = B.z + B.e ; L1_( *c ) if ( *c == '_' ) then { /* (object Has_Relationship [ documentation ] = Kommentar [ label ] = Name supplier = Typ [ Containment ] = [ supplier_cardinality ] = ) Beispiele: (object Has_Relationship supplier "Standardauftrag" supplier_cardinality (value cardinality "0..n")) (object Has_Relationship supplier "Weitermeldung" Containment "By Reference" supplier_cardinality (value cardinality "0..n")) (object Has_Relationship label "Satzart" supplier "Text") (object Has_Relationship documentation "Die Auftragsnummer der Bestellung" label "Umlaufnummer" supplier "Nummer") (object Has_Relationship label "BearbeitungsstandZIS_Typ" supplier "Text" Containment "By Reference") */ char * r = c-1 ; *c = 0 ; c += 13 ; if not_space( *c ) { showStr( "X1", c, 80 ); fErr } while not_space( *r ) r-- ; r++ ; // r == name of relation E_Arrow * a = new E_Arrow ; a->type = store.ensure( r ) -> str ; a->name = "?" ; a->comm = "" ; if ( at_arrow ) then at_arrow -> next = a ; else at_class -> a = a ; at_arrow = a ; while space( *c ) c++ ; if is( c, "documentation", 13 ) Comment( 13, c, a->comm ); while space( *c ) c++ ; if is( c, "label", 5 ) { c += 5 ; while space( *c ) c++ ; // if ( *c++ != '"' ) { showStr( "", c-6, 20 ); fErr } // char * a = c ; char * a = ++c ; while ( *c != '"' ) c++ ; *c++ = 0 ; at_arrow -> name = store.ensure( a ) -> str ; } while space( *c ) c++ ; if is( c, "supplier ", 9 ) then { c += 9 ; while ( *c++ != '"' ) {} Name( 0, c, a -> to ); if ( ! a -> name ) a -> name = a -> to ; a -> to[0] = upper( a -> to[0] ); // Now read the Arrows Cardinality: B.a = c - B.z ; if ( ! B.find( 20, cardi, 0 ) ) fErr if ( B.z[ B.a ] == ')' ) then { a -> card = "" ; } else { r = c = B.z + B.a + 3 ; while ( *c != '"' ) c++ ; *c = 0 ; store.st_clone( a->card, r ); } } else { a -> to = "?" ; a -> card = "1" ; } if is_( a -> type, "Has" ) then { has.ensure( a -> to ); at_class -> n_has++ ; } esif is_( a -> type, "Uses" ) uses.ensure( a -> to ); char * s = a->comm + strlen( a->comm ) - 8 ; if is_( s, "-stellig" ) then { if is_( a->to, "Text" ) { *s = 0 ; path x ; sprintf( x, "CHAR(%s)", a->comm ); a -> to = store.ensure( x ) -> str ; a -> comm = "" ; } } } esif ( *c == 'r' ) { M_next( E_Param, at_param, 3 ) if ( ! at_metho -> par ) at_metho -> par = at_param ; c += 6 ; while ( *c != '"' ) c++ ; Name( 1, c, at_param -> type ); at_metho -> type_L = max( at_metho -> type_L, strlen( at_param->type ) ); para.ensure( at_param -> type ); } esif ( *c == 's' ) { M_next( E_Class, at_class, 3 ) at_class -> at_rr = "rr" ; at_class -> n_has = 0 ; at_metho = 0 ; at_arrow = 0 ; if ( ! classes.insert( at_class -> name ) ) fErr } esif ( *c == 'n' ) { M_next( E_Metho, at_metho, 3 ) if ( ! at_class -> meth ) at_class -> meth = at_metho ; at_metho -> at_rr = "rr" ; at_metho -> type_L = 0 ; at_param = 0 ; // if not_in_name( at_metho -> name[0] ) // S_ "(%s)\n", at_metho -> name _fErr } esif ( *c == 'g' ) { M_next( E_Space, at_space, 6 ) if ( ! spaces ) spaces = at_space ; at_space -> c = at_class = new E_Class ; at_space -> next = 0 ; at_class -> name = at_space -> name ; at_class -> comm = at_space -> comm ; at_class -> n_has = 0 ; at_diagr = 0 ; } esif ( *c == 'd' ) { B.getmore( 4000 ); c = B.z + B.a ; doComm( c, *comm, e ); } esif ( *c == 'P' ) { if ( access ) if is( c-1, "\"Public\"" , 8 ) *access = "public" ; esif is( c-1, "\"Private\"" , 9 ) *access = "private" ; esif is( c-1, "\"Protected\"", 11 ) *access = "protected" ; } esif ( *c == 'i' ) { if is( c-16, "(object InteractionDiagram", 16 ) { if ( ! at_space ) fErr E_Diagr * dia = new E_Diagr ; if ( ! B.find( 0, "title", 0 ) ) fErr if ( ! B.find( 0, "\"" , 0 ) ) fErr c = B.z + B.a ; Name( 1, c, dia -> name ); if ( at_diagr ) then { at_diagr -> next = dia ; at_diagr = dia ; } else at_diagr = dia ; if ( ! at_space -> diagr ) at_space -> diagr = dia ; if ( ! diagrams ) diagrams = dia ; at_actor = 0 ; at_text = 0 ; at_dowrk = 0 ; } else { show_str( "DDD", c, 44 ); fErr } } esif ( *c == 'V' ) { if is( c-16, "(object InterObjView", 16 ) // = actor { if ( ! at_diagr ) fErr E_Actor * act = new E_Actor ; Number( B, act -> nr ); if ( ! B.find( 4, "label", 0 ) ) fErr if ( ! B.find( 4, "label", 0 ) ) fErr c = B.z + B.a + 6 ; while not_alpha( *c ) c++ ; // if is( c, "The", 3 ) c += 3 ; *( --c ) = '"' ; char * x = c+1 ; while in_name( *x ) x++ ; *x = '"' ; Name( 1, c, act -> name ); if ( max_actor <= act -> nr ) fErr actor[ act -> nr ] = act -> name ; match_rec * mr = objects.ensure( act -> name ); char * xx = 0 ; if ( mr ) then { if ( mr -> w2 ) then { xx = ( char * ) mr -> w2 ; act -> name = act -> cls = ( char * )( mr -> w2 ); } esif is( act->name, "The", 3 ) act->name += 3 ; } // if is( act->name, "The", 3 ) { L1_( objects ) // S_ "\n%p xx = %p (%s) %s ", mr, xx, act->name, mr->w2 _fErr } if ( ! at_diagr -> actor ) at_diagr -> actor = act ; if ( at_actor ) at_actor -> next = act ; at_actor = act ; B.a = c - B.z ; B.find( 0, "(object", 0 ); c = B.z + B.a ; if is( c + 8, "Label", 5 ) { B.a = c - B.z ; B.find( 0, "label", 0 ); c = B.z + B.a + 5 ; Comment( 0, c, act -> comm ); } } } esif ( *c == 'M' ) { if is( c-13, "(object InterMessView", 17 ) // Pfeil (= Work) { if ( ! at_actor ) fErr if ( ! at_diagr ) fErr E_DoWrk * wrk = new E_DoWrk ; wrk->diagr = at_diagr ; if ( ! B.find( 4, "label", 0 ) ) fErr if ( ! B.find( 4, "label", 0 ) ) fErr if ( ! B.find( 4, "\"" , 0 ) ) fErr c = B.z + B.a ; Name( 1, c, wrk -> name ); Number( B, wrk -> nr_from ); Number( B, wrk -> nr_to ); if ( ! B.find( 1, "ordinal", 0 ) ) fErr c = B.z + B.a + 7 ; sscanf( c, "%i", &( wrk -> nr ) ); if ( ! at_diagr -> dowrk ) at_diagr -> dowrk = wrk ; if ( at_dowrk ) at_dowrk -> next = wrk ; at_dowrk = wrk ; } } esif ( *c == 'S' ) { if is( c, "SelfMessView", 12 ) { c -= 9 ; memcpy( c, "(object InterMessView", 13 ); } } esif ( *c == 't' ) // object Label { c++ ; if ( at_diagr ) { /* (object Label location (2187, 549) font (object Font size 9 face "" bold FALSE italics FALSE underline FALSE strike FALSE color 0 default_color TRUE) nlines 1 max_width 600 label "M1") */ B.a = c - B.z ; if ( ! B.find( 0, "label", 0 ) ) fErr c = B.z + B.a ; E_Text * t = new E_Text ; Comment( 5, c, t -> text ); if ( ! at_diagr -> text ) at_diagr -> text = t ; if ( at_text ) at_text -> next = t ; at_text = t ; } } else fErr B.a = c - B.z + 1 ; #undef M_next } // ----------------------------------------------------------------------------- if ( ! spaces ) fErr if ( ! spaces -> c ) fErr f1 = xfopen( "fkz_erd", "a" ); fprintf( f1, " Das Erweiterte ERD zu Subsystem %s" "\n#!#448(4,15,9)(80,15,0)\n\n\n", spaces -> c -> name ); fo = create( to ); all_comment = 0 ; /* getSpec_GUI( sys ); fprintf( fo, "\n\n\nNun die Szenarien und was sich sonst noch in Rational " "Rose findet:" ); */ printf( "\n\n Profil des Fachkonzepts zu %s" "\n#!#448(15,15,9)(80,15,0)" "\n\n soweit es in Rational Rose kommt." , spaces -> c -> name ); printf( "\n\n comm = Umfang des Kommentars in Bytes" "\n diagr = Zahl der Interaktionsdiagramme" "\n meth = Zahl Methoden zur Klasse \n\n" ); formSpace( spaces ); printf( "\n\n\nGesamtumfang allen Kommentars: %i chars." "\nRechnet man 50 Zeilen pro Seite und 60 Zeichen pro Zeile, so entspricht " "das \nweniger als %i Seiten Text in Aufsatzform.", all_comment, 1 + all_comment/( 50 * 60 ) ); close( fo ); close( f1 ); LE_ /* private: */ void RoseUt :: formSpace /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Schreibe nach ''from.ic im Format der ERBIS Klassenformulare. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( E_Space * s ) LB_("RoseUt.formSpace") if ( ! s ) ret_ s -> n_classes = 0 ; E_Class * c = s -> c ; while ( c ) { s -> n_classes++ ; c = c -> next ; } int comment = ( *( s -> comm ) == '?' )? 0 : strlen( s -> comm ); all_comment += comment ; printf( "\n%4i comm, %2i classes = Subsystem %s" , comment, s -> n_classes, s -> name ); // ----------------------------------------------------------------------------- NameSpacece = "ERBIS" ; at_space = s ; nirgendwo[0] = 0 ; s -> c -> diagr = s -> diagr ; formClass( s -> c ); // formSpace( s -> next ); LE_ /* private: */ void RoseUt :: checkActorExists /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Schreibt Warnung nach stdout, wenn die Klasse nicht existiert. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( char * cname ) LB_("RoseUt.checkActorExists") if ( ! cname ) fErr if ( actors.element( cname ) ) ret_ actors.insert( cname ); printf( "\n No such Actor: %s", cname ); LE_ /* private: */ void RoseUt :: formClass /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Schreibe nach ''from.ic im Format der ERBIS Klassenformulare. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( E_Class * c ) LB_("RoseUt.formClass") if ( ! c ) ret_ if ( ! NameSpacece ) fErr if ( ! c -> name ) fErr if ( ! c -> comm ) fErr c -> n_diagr = 0 ; E_Diagr * d = c -> diagr ; c -> n_meth = 0 ; E_Metho * m = c -> meth ; c -> n_attr = 0 ; E_CAttr * a = c -> attr ; while ( d ) { c -> n_diagr++ ; d = d -> next ; } while ( m ) { c -> n_meth ++ ; m = m -> next ; } while ( a ) { c -> n_attr ++ ; a = a -> next ; } path cls ; memcpy( cls, c->name, 3 ); cls[3] = 0 ; match_rec * mr = anfordere.element( cls ); char * anfo = ( mr )? mr -> str2 : "" ; int comment = ( *( c -> comm ) == '?' )? 0 : strlen( c -> comm ) + strlen( anfo ); all_comment += comment ; printf( "\n\n\n%4i comm, %2i diagr, %2i meth = Class %s" "\n-----------------------------------------------------------------------" , comment , c -> n_diagr , c -> n_meth , c -> name ); char u1 = ( uses.element( c -> name ) != 0 )? 'J' : 'N' ; char u2 = ( has.element( c -> name ) != 0 )? 'J' : 'N' ; char u3 = ( para.element( c -> name ) != 0 )? 'J' : 'N' ; if ( u1 == 'N' && u2 == 'N' && u3 == 'N' ) printf( nirgendwo ); sprintf( nirgendwo, "\n%31s nirgendwo genutzt - ein Fehler?", "" ); E_Diagr * dia = c -> diagr ; while ( dia ) { printf( "\n diagr: %s", dia -> name ); dia = dia -> next ; } if ( c -> diagr ) printf( "\n\n The actors in these diagrams are:\n" ); char * father = ( ! c->name[3] )? ": Subsystem" : "" ; fprintf( fo, "\n\n\n class %s %s %s\n\n/* " "////////////////////////////////////////////////////////////////////////////" "\n" "\n Current Designer : ez.@telekom" "\n Current Programmer : ...@softlab.de" "\n" "\n Topics: NameSpacece : M_%s" "\n Layer : VS" "\n Analyse : Fachkonzept: Top Object Model" "\n Reuse for : ERBIS" , c -> name, father, H1, NameSpacece ); formArrow( c->a, "" ); fprintf( fo, "\n\n// Purpose ////" "////////////////////////////////////////////////////////////////" ); TextUmbruch( fo, "\n\n", " ", c -> comm ); fprintf( fo, "\n" ); if ( is_( c -> name, "Bestand" ) // Die 4 ERBIS Moduln || is_( c -> name, "AD" ) || is_( c -> name, "QM" ) || is_( c -> name, "ZM" ) ) { fprintf( fo, " Diese Klasse hat zu Subsystemen: \n" ); E_Space * subsys = at_space -> next ; while ( subsys ) { fprintf( fo, "\n - %s", subsys -> name ); subsys = subsys -> next ; } c -> next = 0 ; } if ( strlen( c -> name ) == 3 ) cash_Anforderungen( c -> name ); { E_Arrow * rsh = c -> a ; fprintf( f1, "\n\n\n- e? E_%s" "\n#!#128(12,15,13)(80,15,0)\n", c -> name ); while ( rsh ) { if is_( rsh -> type, "Has" ) { fprintf( f1, "\n- eca A_%-26s %4s ?_%s", rsh -> name , rsh -> card , rsh -> to ); TextUmbruch( f1, "\n\n", " ", rsh -> comm ); } rsh = rsh -> next ; } } TextUmbruch( fo, "\n\n", " ", anfo + min( 7, strlen( anfo ) ) ); fprintf( fo, "\n\n\n " "____________________________________________________________________________" "\n {" ); AufgabenDerAnwendung( c -> diagr ); if is_( c->name, sys ) { fprintf( fo, "\n\n\n0 Grobdesign der do_.. Methoden %s", H1 ); getSpec_GUI( sys ); } anzActions = ( countActions )? actions.cardinality( ) : 0 ; if ( anzActions ) { printf( "\n\n These actors call %i different methods:\n", anzActions ); actions.sort(0); int r = -1 ; while ( ++r < actions.card ) printf( "\n --> %s", actions.elem[ r ] -> str ); } countActions = 0 ; if ( pure_ascii ) then { fprintf( fo, "\n };" "\n\n\n // Review Ergebnisse" "\n\n\n // Noch offene Fragen, Diskussion, Zeitplanung" "\n\n\n " ); } else fprintf( fo, "\n };" "\n#!#16848(4,15,10)(6,15,0)" "\n\n#!#16400" "\n\n#!#16400" "\n // Review Ergebnisse" "\n#!#16576(4,15,10)(24,15,0)" "\n\n#!#16384" "\n\n#!#16384" "\n // Noch offene Fragen, Diskussion, Zeitplanung" "\n#!#16576(4,15,10)(50,15,0)" "\n\n#!#16384" "\n\n#!#16384" ); if ( ! NameSpacece ) fErr NameSpacece = at_space -> name ; at_class = c ; formMetho( c -> meth ); formClass( c -> next ); LE_ /* private: */ void RoseUt :: formMetho /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Schreibe nach ''from.ic im Format der ERBIS Klassenformulare. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( E_Metho * m ) LB_("RoseUt.formMetho") if ( ! m ) ret_ if ( ! m -> name ) fErr if ( ! m -> comm ) fErr if ( ! m -> access ) fErr m -> n_params = 0 ; E_Param * p = m -> par ; while ( p ) { m -> n_params++ ; p = p -> next ; } { char * x = m -> name ; // ( ! *x ) fErr while in_name( *x ) x++ ; *x = 0 ; } path meth ; memcpy( meth, at_class->name, 3 ); sprintf( meth + 3, ".%s", m->name ); match_rec * mr = anfordere.element( meth ); char * anfo = ( mr )? mr -> str2 : "" ; int comment = ( *( m -> comm ) == '?' )? 0 : strlen( m -> comm ) + strlen( anfo ); all_comment += comment ; printf( "\n%4i comm, %2i params = Method %s" , comment, m -> n_params, m -> name ); // ----------------------------------------------------------------------------- int L = strlen( m->access ) + 7 ; path a1 ; if ( pure_ascii ) *a1 = 0 ; else sprintf( a1, "\n#!#448(4,79,77)(%i,76,4)(80,255,0)", L ); char * x = m->name - 1 ; while ( *( ++x ) ) if ( ! in_name( *x ) ) *x-- = 0 ; fprintf( fo, "\n\n %s: %s :: %s%s\n (", m->access, at_class -> name , m->name, a1 ); type_L = -max( m -> type_L+1, L-3 ); formed_param = 0 ; formParam( m -> par ); fprintf( fo, "\n )\n/* " "----------------------------------------------------------------------------" "\n" "\n Auftrag und Vorbedingungen: %s\n\n%s", Hf, anfo ); TextUmbruch( fo, "", " ", m -> comm ); fprintf( fo, "\n Antwort in errno: %s" "\n" "\n - E_ok,%s" "\n wenn der Auftrag komplett erledigt werden konnte. \n" "\n " "--------------------------------------------------------------------------" "\n*/ LB_\n LE_\n" , Hf, Hf ); formMetho( m -> next ); LE_ /* private: */ void RoseUt :: formParam /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Schreibe nach ''from.ic im Format der ERBIS Klassenformulare. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( E_Param * p ) LB_("RoseUt.formParam") if ( ! p ) ret_ if ( ! p -> name ) fErr if ( ! p -> type ) fErr if ( ! p -> comm ) fErr char * anf = "," ; if ( ! formed_param ) anf = " " ; fprintf( fo, "\n%s %*s %*s ", anf, type_L, p->type , type_L, p->name ); // fprintf( fo, "\n%s %*s %*s // %s", anf, type_L, p->type // , type_L, p->name, p->comm ); // if not_is_( p->comm, "?" ) printf( "MISSING ParComm: %s\n", p->comm ); formed_param++ ; formParam( p -> next ); LE_ /* private: */ void RoseUt :: TextUmbruch /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Breche um. Ab der zweiten Zeile beginne die Zeile stets mit einer Kopie des ''pre Strings. Silbe ''pre kann z.B. " // " sein (was man in Parameterlisten gut gebrauchen kann). Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( FILE * f , char * pre_1 , char * pre_2 , char * c ) LB_("RoseUt.TextUmbruch") if ( ! f ) fErr if ( ! pre_1 ) fErr if ( ! pre_2 ) fErr if ( ! c ) fErr if ( ! *c ) ret_ fprintf( f, "%s%s", pre_1, pre_2 ); int n = strlen( pre_2 ); int m = 0 ; while ( *c ) { while space( *c ) c++ ; char * e = c + 80 - n ; char * a = c ; while ( *c && c < e ) c++ ; if ( *c ) { while not_space( *c ) c-- ; *c++ = 0 ; e = c-1 ; while( a <= e && space( *e ) ) *e-- = 0 ; } fprintf( f, "%*s%s\n", m, "", a ); m = n ; } LE_ /* private: */ void RoseUt :: formArrow /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Schreibe nach ''from.ic die Arrows der Klasse. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( E_Arrow * a , char * r ) LB_("RoseUt.formArrow") if ( ! a ) ret_ if ( ! a -> type ) fErr if ( ! a -> card ) fErr if ( ! a -> to ) fErr if ( r != a -> type ) fprintf( fo, "\n" ); char * name = a -> name ; if ( is_( name, "?" ) || is_( name + 1, a -> to + 1 ) ) name = "" ; if ( a->comm[0] ) fprintf( fo, "\n" ); fprintf( fo, "\n%10s R_%-5s %4s %-9s %s", "" , a -> type, a -> card, a -> to, name ); TextUmbruch( fo, "\n", " ", a -> comm ); formArrow( a->next, a->type ); LE_ /* private: */ void RoseUt :: Number /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Erkenne die n„chste Nummer N der Form @N . Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( rBuffer & B , int & dest ) LB_("RoseUt.Number") if ( ! B.find( 1, "@", 0 ) ) fErr sscanf( B.z + B.a + 1, "%i", &dest ); if ( ! dest ) fErr LE_ /* private: */ void RoseUt :: formDiagr /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Schreibe nach ''from.ic die Interactionsdiagramme. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( E_Diagr * d ) LB_("RoseUt.formDiagr") if ( ! d ) ret_ if ( ! d -> name ) fErr aufrufer = "1" ; gerufener = "-" ; fprintf( fo, "\n\n\n1 %s%s\n\n", d -> name, H2 ); if ( ! d -> actor ) ret_ if ( ! d -> dowrk ) S_ "\nDia( %s )\n", d -> name _fErr E_DoWrk * step[ 200 ] ; E_DoWrk * s = d -> dowrk ; int u = 0 ; while ( u < 200 ) step[ u++ ] = 0 ; int n = 0 ; int m = 0 ; while ( s ) { step[ s->nr ] = s ; m = max( m, s -> nr ); s = s -> next ; n++ ; } if ( m+1 != n ) { s = d -> dowrk ; while ( s ) { printf( "s.nr %i:(%s)\n", s->nr, s->name ); s = s->next ; } S_ "%i = m+1, n = %i, (%s) \n", m+1, n, d->name _fErr } BOOL anf = 1 ; int j = 1 ; if ( 10 <= m ) j = 2 ; int i = 0 ; while ( i <= m ) formDoWrk( step[ i++ ], j, anf ); E_Text * t = d -> text ; n = 0 ; while ( t ) { if ( ! n++ ) fprintf( fo, "\n\n\n Kommentare im Diagramm:" "\n#!#144(4,3,2)(80,3,0)\n" ); path x ; sprintf( x, " %-2i ", n ); if not_is_( t->text, d->name ) { TextUmbruch( fo, "\n", x, t -> text ); } t = t -> next ; } formDiagr( d->next ); LE_ /* private: */ void RoseUt :: formDoWrk /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Schreibe nach ''from.ic die Pfeile im Interaktionsdiagramm. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( E_DoWrk * w , int j , BOOL & anf ) LB_("RoseUt.formDoWrk") if ( ! w ) ret_ if ( ! w -> name ) fErr if ( ! w -> diagr ) fErr E_Actor * a = w -> diagr -> actor ; int mm = INT_MAX ; char * UI = "" ; while ( a ) { if ( ! a -> name ) fErr mm = min( mm, a->nr ); if ( w -> nr_from == a -> nr ) w -> from = a -> name ; if ( w -> nr_to == a -> nr ) w -> to = a -> name ; if is_( a -> name + 4, "UI" ) UI = a -> name ; a = a->next ; } if ( anf ) { fprintf( fo, "\n User's Action: ?\n %s:\n", UI ); anf = 0 ; } if ( ! w -> from ) { printf( "\nNo From( @%i ): %s", w -> nr_from, w -> diagr -> name ); w -> from = "" ; } if ( ! w -> to ) { printf( "\nNo To( @%i ): %s", w -> nr_to, w -> diagr -> name ); w -> to = "" ; } if ( ! w->from || ! w->to ) fErr if (1) then { aufrufer = w -> from ; char * fett = ( aufrufer == gerufener )? "" : Hf ; char * z = ( aufrufer != gerufener )? "\n" : "" ; if ( aufrufer == gerufener && is_( aufrufer + 4, "UI" ) ) { fprintf( fo, "%s\n\n User's Action: ?" // fprintf( fo, "%s\n\n User's Action: %s" "\n %s:%s\n" , z , aufrufer , fett ); } checkActorExists( aufrufer ); } if (1) // ( w -> to != w -> from ) then { if is( w->to + 4, "UI", 2 ) then { fprintf( fo, "\n\n %1s %s.%s", "", w->to, w->name ); } else fprintf( fo, "\n %5s %s.%s", "", w->to, w->name ); checkActorExists( w -> to ); } else fprintf( fo, "\n %s" , w->name ); gerufener = w -> to ; // ------------------------------------------------------------------------- path x ; sprintf( x, "%s.%s", w->to, w->name ); actions.ensure( x ); LE_ /* private: */ void RoseUt :: AufgabenDerAnwendung /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Schreibe nach ''from.ic im Format der ERBIS Klassenformulare. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( E_Diagr * dia ) LB_("RoseUt.AufgabenDerAnwendung") if ( ! dia ) ret_ fprintf( fo, "\n\n\n0 Aufgaben der Anwendung %s%s", sys, H1 ); fprintf( fo, "\n\n Dieser Abschnitt entspricht den in Rational Rose " "gegebenen Interaktions-\n diagrammen (Szenarien). Man lese sie so:\n " "\n Beschrieben werden die Aufgaben der Anwendung und wie in etwa das System" "\n sie aus Sicht des Anwenders untersttzt und realisiert. Dabei nennt," "\n" "\n - was nicht eingerckt ist, einen Aktor," "\n - was eingerckt ist aber die T„tigkeit, die auszufhren er direkt oder" "\n indirekt fordert." "\n" "\n Die Zuordnung der einzelnen Schritte dieser T„tigkeit zu Klassen ist nur" "\n Vorschlag. Der Designer darf andere Zuordnungen treffen. Er muá nicht" "\n einmal an den genannten Klassen festhalten. Wo immer er sich aber anders" "\n entscheidet, muá er zuerst das Szenario entsprechend abzu„ndern: Es hat" "\n aktuelle, stets zutreffende Dokumentation des Designs zu bleiben und muá" "\n belegen, wie das System auf Benutzeraktionen inhaltlich reagiert - diese" "\n Szenarien rechnen mit zum Vertrag mit der Fachseite. Wo immer es Zweifel" "\n gibt, werden Details erst mal hier nachzutragen und abzustimmen sein:" ); formDiagr( dia ); LE_ /* public: */ void RoseUt :: aus_WinWord /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Merge a class description found in WinWord format. This description was normed by WinWord :: ClassDescr(). Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( char * from ) LB_("RoseUt.aus_WinWord") LE_ /* public: */ void RoseUt :: getSpaltenWerte /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Lese die n„chsten ''n Werte {<wert>} . Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( int anz , rBuffer & B ) LB_("RoseUt.getSpaltenWerte") if ( B.e < B.a + anz * 200 ) B.getmore( 4000 ); char * c = B.z + B.a ; int n = 0 ; while ( n < anz ) { while ( *c != '{' ) c++ ; char * a = ++c ; while ( *c != '}' ) c++ ; ; *c = 0 ; spwert[ ++n ] = store.ensure( a ) -> str ; } B.a = c - B.z ; LE_ /* private: */ void RoseUt :: getSpec_GUI /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Frage XXX_gui.rtf nach einer Spezifikation aller notwendigen Callbacks. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( char * sys ) LB_("RoseUt.getSpec_GUI") /* fprintf( fo, "\n Zuerst der Inhalt der GUI-Beschreibung" "\n#!#448(4,15,9)(80,15,0)\n" "\n soweit er fr Softlabs Arbeit relevant erscheint. Mehrfach auftretende" "\n Callback Methoden sind nur einmal genannt.\n" ); */ fprintf( fo, "\n\n\n Die Aufschreibung gehorcht folgenden Muster:" "\n\n\n- <Layout> <Titel dieses Layouts>" "\n ********************************************************************** " "\n- UIco <User interface complexity> " "\n " "\n " "\n- e <Name eines Events fachlicher Semantik> " "\n ---------------------------------------------------------------------- " "\n- s <Name des Szenarios dazu (es sollte wie das Event heiáen)> " "\n " "\n- m_P <Methode (P sagt: enth„lt nur Pr„sentationscode)> " "\n- m_V <Methode (V sagt: ben”tigt Dienste der Schicht VS)> " "\n- ( " "\n- pe <ParameterTyp> // <Semantik des in Parameters> " "\n- pa <ParameterTyp> // <Semantik des out Parameters> " "\n- pea <ParameterTyp> // <Semantik des inout Parameters> " "\n- ) " "\n- " "\n- a <Aufgabe der Funktion> " "\n- " "\n- u <Benutzerklassen> " "\n- FPts <Function Points> " "\n " "\n " "\n Hinweise zum Muster: " "\n " "\n Der Name der Methode ist errechneter Vorschlag - der Designer dar einen " "\n besseren w„hlen, doch soll er wieder mit Silbe 'do_' beginnen, damit klar" "\n bleibt, welche Methoden auf Wunsch des Autors der GUI-Beschreibung ent- " "\n standen und daher mit ihm abgestimmt werden mssen: Genau die Methoden " "\n VS_%s.do_.. und ihre Datensprache. " "\n " "\n Wo die Pr„sentationsschicht eine Klasse K dieser Datensprache ableitet, " "\n bekomme die Ableitung den Namen, der durch Voranstellen der Silbe PS_ " "\n aus dem Namen der Klasse K hervorgeht. Umgekehrt darf der Name einer " "\n Klasse nur dann mit PS_ beginnen, wenn sie Ableitung einer durch die " "\n Schicht VS exportierten Klasse ist: Nur so wird stets klar bleiben, wo " "\n die Definitionen der Schicht PS auf denen der Schicht VS aufbauen. " "\n " "\n Layout und Szenario sollten denselben Titel haben. Wo das derzeit nicht " "\n der Fall ist, dient der Eintrag dazu, sp„ter die Rose Dateien *.cat per " "\n Programm entsprechend korrigieren zu k”nnen und so das Fachkonzept fr " "\n die Entwickler besser durchschaubar zu machen. " "\n " "\n Wo die Beschreibung der Aufgabe der Funktion Namen fr einen Parameter " "\n ben”tigt, habe <Semantik des Parameters> die Form // <Name>: <Semantik>. " , sys ); path rtf ; sprintf( rtf, "%s_gui.rtf", sys ); if ( ! path_exists( rtf ) ) { printf( "\n\n\nNicht gefunden: %s", rtf ); fprintf( fo, "\n\n\nNicht gefunden: %s", rtf ); ret_ } S_ "RtfTab %s_gui", sys _Do rBuffer B( "x1x.txt", "" ); path x ; sprintf( x, "%s/", sys ); str_set suche ; suche.insert( "Funktionen\nder\nMenueleiste" ); suche.insert( "Menueleistenpunkt:" ); suche.insert( "Beschreibung\nder\nKnoepfe" ); suche.insert( "BZ>!Knopf" ); suche.insert( ">!nae" ); // naechstes Layout path aa ; *aa = 0 ; strcpy( punkt, "Knopf" ); while ( B.find( 1, suche, 0 ) ) { char * c = B.z + B.a ; // showStr( "222", c, 40 ); if ( *c == 'F' ) then { if ( ! B.find( 5, x, 0 ) ) fErr c = B.z + B.a ; char * a = c ; c += 7 ; *c = 0 ; if not_is_( a, aa ) fprintf( fo, "\n\n\n- %s ?\n **********************" "******************************************************" "\n- UIco ? ", a ); strcpy( aa, a ); } esif ( *c == 'B' ) { strcpy( punkt, "Knopf" ); getCallBacks( B, aa ); } esif ( *c == 'M' ) { while ( *c != ':' ) c++ ; c++ ; while space( *c ) c++ ; char * a = c ; while not_space( *c ) c++ ; *c = 0 ; strcpy( punkt, a ); } esif ( *c == '>' ) getCallBacks( B, aa ); else fErr } fflush( fo ); // unlink( "x1x.txt" ); LE_ /* private: */ void RoseUt :: getCallBacks /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Frage XXX_gui.rtf nach einer Spezifikation aller notwendigen Callbacks. zum eben gefundenen Layout XXX/nnn. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( rBuffer & B , char * maske ) LB_("RoseUt.getCallBacks") str_set suche ; suche.insert( "Funktionen\nder\nMenueleiste" ); suche.insert( "<BZ>!Knopf" ); suche.insert( "!<EZ" ); if ( ! B.find( 0, suche, 0 ) ) fErr while ( B.find( 0, suche, 0 ) ) { if ( B.z[ B.a ] != '!' ) { B.a-- ; ret_ } char * c = B.z + B.a + 6 ; while space( *c ) c++ ; if not_is( c, "!<BZ>!", 4 ) ret_ // end of table c += 6 ; while space( *c ) c++ ; char * a = c ; if ( B.z + B.e <= c ) fErr while ( *c != '!' ) c++ ; while space( *( --c ) ); *( ++c ) = 0 ; if ( B.z + B.e <= c ) fErr path u ; char * x = u ; a-- ; while ( *( ++a ) ) *x++ = in_name( *a )? *a : '_' ; *x = 0 ; while ( u < x && not_in_name( *( --x ) ) ){} x[1] = 0 ; x = u ; if ( *x == 'U' ) if is( x, "Ue_ber", 6 ) memcpy( ++x, "Ueber", 5 ); if ( *x == 'A' ) if is( x, "Ae_nde", 6 ) memcpy( ++x, "Aende", 5 ); fprintf( fo, "\n\n\n- e %s: %s: %s \n#!#64\n -----------" "------------------------------------------------------------------" "\n- s ? " "\n " "\n- m_? do_%s" "\n ( " "\n- pe ... " "\n- pa ... " "\n- pea ... " "\n ) " "\n " , maske, punkt, x, x ); B.a = c - B.z + 4 ; if ( ! B.find( 0, "!<BZ>!", 0 ) ) fErr if ( B.e < B.a + 4000 ) B.getmore( 4000 ); c = B.z + B.a ; B.z[ B.e ] = '!' ; c += 6 ; while space( *c ) c++ ; a = c ; while ( *c != '!' ) c++ ; while space( *( --c ) ); *( ++c ) = 0 ; if ( B.z + B.e <= c ) fErr x = a ; while ( *( ++x ) ) if space( *x ) *x = ' ' ; if ( ! *a ) fprintf( fo, "\n- a ?" ); char * s = "- a " ; while ( *a ) { char * e = a + 68 ; while in_name( *e ) e-- ; if ( e < c ) *e = 0 ; fprintf( fo, "\n%s%s", s, a ); s = " " ; a = ( e < c )? e+1 : c ; } fprintf( fo, "\n\n- u ? " "\n- fPts ? " "\n LB_ " "\n LE_ " ); B.a = c - B.z ; } LE_ /* public: */ void RoseUt :: cash_Anforderungen /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Frage ANF_DIE.rtf nach einer Spezifikation aller Anforderungen an die subsystem-bergreifenden Schnittstellen. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( char * an_sys // or 0 ) LB_("RoseUt.cash_Anforderungen") path rtf ; sprintf( rtf, "anf_die.rtf" ); if ( ! path_exists( rtf ) ) { printf( "\n\n\nNicht gefunden: %s", rtf ); fprintf( fo, "\n\n\nNicht gefunden: %s", rtf ); ret_ } S_ "RtfTab anf_die" _Do rBuffer B( "x1x.txt", "" ); while ( B.find( 1, "!A_", 0 ) ) { char * c = B.z + B.a + 1 ; if ( *c != 'A' ) goto L1 ; esif is( c, "A_SSS", 5 ) goto L1 ; memcpy( anfo, "\n Anforderung A_.../...: ", 34 ); memcpy( anfo + 20, c, 9 ); B.a = c - B.z ; cash_Anfo( B ); } L1: // unlink( "x1x.txt" ); // ----------------------------------------------------------------------------- anfordere.sort(0); int r = - 1 ; if ( an_sys ) then { fprintf( fo, "\n\n\n Anforderungen an %s seitens anderer " "Subsysteme:" "\n#!#192(4,15,10)(80,15,0)\n", an_sys ); while ( ++r < anfordere.card ) { match_rec * mr = anfordere.elem[ r ]; if ( is_( an_sys, mr->str ) && 6 < strlen( mr->str2 ) ) TextUmbruch( fo, "\n\n", " - ", mr -> str2 ); } fprintf( fo, "\n\n end Anforderungen" ); } else { FILE * f3 = create( "profil_3" ); while ( ++r < anfordere.card ) { fprintf( f3, "\n\n\nan %s\n%s", anfordere.elem[ r ] -> str , anfordere.elem[ r ] -> str2 ); } close( f3 ); compare_Actors(); } LE_ /* private: */ void RoseUt :: cash_Anfo /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Erkenne die eben gefundene Anforderung. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( rBuffer & B ) LB_("RoseUt.cash_Anfo") // showStr( "cc1", anfo, 29 ) if ( ! B.find( 0, "!<ES", 0 ) ) fErr B.getmore( 2000 ); char * c = B.z + B.a + 12 ; while ( *c == '!' ) { while ( *c == '!' ) c += 6 ; while space( *c ) c++ ; } // showStr( "cc2", c, 22 ) if is( c, "Anforderung", 11 ) c += 11 ; while not_alpha( *c ) c++ ; if ( B.e < c - B.z ) fErr B.a = c - B.z ; if ( B.e < B.a + 4000 ) B.getmore( 4000 ); c = B.z + B.a ; memcpy( B.z + B.e, "M_M_M_M_", 8 ); char buf[ 10000 ] ; char * e1 = buf + 31 ; memcpy( buf, anfo, 34 ); char * a = buf ; while ( not_is( c, "M_", 2 ) || alpha( c[-1] ) ) { if is( c, "!<", 2 ) then { while is( c, "!<", 2 ) c += 6 ; } else { *e1 = *c++ ; if space( *e1 ) { *e1 = ' ' ; if space( e1[-1] ) e1-- ; } e1++ ; } if ( B.z + B.e < c ) fErr } *e1 = 0 ; if ( mL_anfo <= strlen( a ) ) fErr sprintf( anfo, a ); B.a = c - B.z ; if ( ! B.find( 0, "M_", 0 ) ) fErr c = B.z + B.a + 2 ; memcpy( an, c, 3 ); an[3] = '.' ; an[4] = 0 ; int L = 4 ; // showStr( "cc4", c-2, 30 ); char * x = an + 4 ; while ( *c != '!' ) c++ ; while is( c, "!<", 2 ) { c += 6 ; while space( *c ) c++ ; } while in_name( *c ) *x++ = *c++ ; char * e = x ; while space( *x ) x++ ; if ( *x != '(' ) an[3] = 0 ; *e = 0 ; B.a = c - B.z + 1 ; char * meth = an ; // printf( "\nPROC( %s )\nPPP %s\n", anfo, meth ); // showStr( "EEE", B.z+B.a, 65 ); anfordere.insert( meth, anfo ); if not_alpha( meth[4] ) exit(1); methods_A.ensure( meth ); methods_a.ensure( meth ); LE_ /* private: */ void RoseUt :: compare_Actors /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Vergleiche, wo berall Methoden spezifiziert wurden. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( ) LB_("RoseUt.compare_Actors") rBuffer B( "profil_1", "" ); while ( B.find( 0, "Actor:", 0 ) ) { char * c = B.z + B.a + 7 ; char * a = c ; while not_space( *c ) c++ ; *c = 0 ; methods_A.ensure( a ); methods_a.ensure( a ); B.a = c - B.z ; } B.open_rBuffer( "profil_2", "" ); while ( B.find( 0, ". D", 0 ) ) { char * c = B.z + B.a + 15 ; char * a = c ; while not_space( *c ) c++ ; *c = 0 ; methods_D.ensure( a ); methods_a.ensure( a ); B.a = c - B.z ; } B.open_rBuffer( "methods", "" ); B.remember( 100 ); while ( B.find( 0, "::", 0 ) ) { char * a = B.z + B.a - 1 ; while space( *a ) a-- ; char * e = a+1 ; while not_space( *a ) a-- ; a++ ; char * c = B.z + B.a + 2 ; while space( *c ) c++ ; *e++ = '.' ; while in_name( *c ) *e++ = *c++ ; *e = 0 ; methods_C.ensure( a ); methods_a.ensure( a ); B.a = c - B.z ; } methods_C.sort(0); methods_D.sort(0); methods_A.sort(0); methods_a.sort(0); printf( "\n Fachkonzept ERBIS: Wozu ANF_DIE.doc Anforderungen nennt" "\n#!#464(4,15,6)(80,15,0)\n\n" "\n" "\n Alle in Rose und/oder ANF_DIE.doc genannten Methoden:" "\n#!#448(4,15,10)(80,15,0)\n" "\n" "\n Wenigstens wo ? steht, muá der Fkz-Autor nachbessern." "\n" "\n" "\n A als Methode in ANF_DIE.doc genannt" "\n D als Methode in einem Diagramm genannt" "\n C als Methode einer Klasse genannt" "\n" "\n | | | " "\n | | | " "\n" "\n" ); int r = -1 ; path ADC ; int nachbess = 0 ; while ( ++r < methods_a.card ) { sprintf( ADC, ". . ." ); ADC[ 5 ] = 0 ; char * m = methods_a.elem[ r ] -> str ; if ( methods_A.element( m ) ) ADC[ 0 ] = 'A' ; if ( methods_D.element( m ) ) ADC[ 2 ] = 'D' ; if ( methods_C.element( m ) ) ADC[ 4 ] = 'C' ; char * a = m ; while ( *m && *m != '.' ) m++ ; char fz = ( ADC[4] == 'C' )? ' ' : ( ( *m )? '?' : ' ' ); if ( fz == '?' ) nachbess++ ; printf( "\n %3i.%c %s %s", r+1, fz, ADC, a ); } int prozent = ( nachbess )? 1 + ( 100 * nachbess )/r : 0 ; printf( "\n\n\n Wie man sieht, bedrfen %i Stellen (ca. %i %%) einer " "Nachbesserung.\n#!#128(4,3,2)(80,3,0)" , nachbess, prozent ); LE_ /* private: */ void RoseUt :: cash_prof3_Anfo /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Hole die Menge aller Anforderungen aus ''profil_3 nach ''anfordere. Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( ) LB_("RoseUt.cash_prof3_Anfo") if not_path_exists( "profil_3" ) ret_ rBuffer B( "profil_3", "\n\n" ); while ( B.find( 0, "\nan ", 0 ) ) { B.getmore( 2000 ); memcpy( B.z + B.e, "\n\n\n", 3 ); char * m = B.z + B.a + 4 ; char * c = m ; while ( *c != '\n' ) c++ ; *c++ = 0 ; while space( *c ) c++ ; char * a = c ; while ( *a != '\n' ) a-- ; while not_is( c, "\n\n", 2 ) while ( *( ++c ) != '\n' ){} char merke = c[2] ; c[2] = 0 ; anfordere.insert( m, a+1 ); c[2] = merke ; B.a = c - B.z ; } LE_ /* public: */ void RoseUt :: gen_ERD /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Cash report.cat Die Funktion garantiert: fErr || ok ----------------------------------------------------------------------------- */ ( ) LB_("RoseUt.gen_ERD") str_set report ; str_set suche ; suche.insert( "Class name:" ); suche.insert( "Has-A" ); rBuffer B( "report.cat", "" ); while ( B.find( 0, suche, 0 ) ) { B.getmore( 3000 ); char * c = B.z + B.a ; if ( *c == 'C' ) // Class then { c += 11 ; while space( *( ++c ) ){} char * a = c ; while not_space( *( ++c ) ){} *c = 0 ; match_rec * mr = report.ensure( a ); mr -> x1 = 1 ; // is a Class } esif ( *c == 'H' ) c += 4 ; else fErr B.a = c - B.z ; } B.reset(); FILE * f = create( "fkz.erd" ); unlink( "INDX\\fkz.erd" ); ok while ( B.find( 0, suche, 0 ) ) { B.getmore( 3000 ); char * c = B.z + B.a ; if ( *c == 'C' ) // Class then { c += 11 ; while space( *( ++c ) ){} char * a = c ; while not_space( *( ++c ) ){} *c = 0 ; match_rec * mr = report.ensure( a ); fprintf( f, "\n\n\n- ec E_%s" "\n#!#128(15,15,13)(80,15,0)\n\n" , mr -> str ); } esif ( *c == 'H' ) // Has_A { while ( *( ++c ) != '\n' ){} c++ ; while ( *c != '\n' ) { while space( *( ++c ) ){} char * t = c ; while not_space( *( ++c ) ){} ; char merke = *c ; *c++ = 0 ; if is_( t, "(Unspecified)" ) t = "?" ; char * n ; char * D = "E_" ; path p ; if ( merke != '\n' ) then { while space( *( ++c ) ){} n = c ; while not_space( *( ++c ) ){} merke = *c ; D = "D_" ; *c++ = 0 ; char * x = c ; while space( *x ) x++ ; if ( digit( *x ) ) { char * a = x ; while not_space( *( ++x ) ){} c = x ; *c++ = 0 ; sprintf( p, "%s_%s", t, a ); t = p ; } } else n = t ; if ( merke == '\n' && *t != '(' ) // not Schrott then { fprintf( f, "\n- eca A_%-28s %s%s" , n, D, t ); } } } else fErr B.a = c - B.z ; } close( f ); LE_ #undef static #endif
top . is_inc_for . C++
Include-structure of
todir / roseut.cpp

roseut.c1
.   roseut.h
.   .   for_spu.h
.   .   .   for_all.h
.   .   .   .   exec_ut.h
.   .   .   .   .   exec_ut.h3
.   .   .   .   .   macros_1.h
.   .   .   .   .   traceco.h
.   .   .   .   precomp.h
.   .   .   .   .   basis.h
.   .   .   .   .   .   compiler.h
.   .   .   .   .   .   dmlerr.h
.   .   .   .   .   en.h
.   .   .   .   .   .   en_lec.h
.   .   .   .   .   limits.h
.   .   .   .   .   mt.h
.   .   .   .   .   obsolete.h
.   .   .   .   .   ot.h
.   .   .   .   .   st.h
.   .   .   .   .   trace.h
.   .   .   .   standard.h
.   .   .   .   toscreen.h
.   .   .   spu.h
.   .   .   .   help_gen.h
.   .   .   .   .   help_gen.h3
.   .   .   .   rbuffer.h
.   .   .   .   .   rbuffer.h3
.   .   .   .   .   str_set.h
.   .   .   .   .   .   str_set.h3
.   .   .   .   safe_uts.h
.   .   .   .   .   safe_uts.h3
.   .   .   .   ut_repl.h
.   .   roseut.h3

33 include files
top . is_inc_for . C++