meta,
C++
302 Methoden:
/* private: */ int Java2Htm :: wesZeile
/* private: */ BOOL Java2Htm :: API_code
/* private: */ BOOL Java2Htm :: AtFunc
/* private: */ BOOL Java2Htm :: AtFunc_ALT
/* private: */ BOOL Java2Htm :: make_path_to_basis
/* private: */ BOOL Java2Htm :: schema
/* private: */ BOOL Java2Htm :: shrink_path
/* private: */ BOOL Java2Htm :: erledigt
/* private: */ BOOL Java2Htm :: not_selected
/* private: */ BOOL Java2Htm :: rootClass
/* private: */ FILE * Java2Htm :: create_mit_meta
/* private: */ FILE * Java2Htm :: create_mit_meta_bas
/* private: */ FILE * Java2Htm :: create_mit_meta_cpp
/* private: */ FILE * Java2Htm :: create_mit_meta_php
/* private: */ Surr Java2Htm :: in_index
/* private: */ char Java2Htm :: do_Comment
/* private: */ char * Java2Htm :: AtMeth
/* private: */ char * Java2Htm :: Tips_to_htm
/* private: */ char * Java2Htm :: escape
/* private: */ char * Java2Htm :: escape_to_htm
/* private: */ char * Java2Htm :: htmAusz
/* private: */ char * Java2Htm :: norm
/* private: */ char * Java2Htm :: nz
/* private: */ char * Java2Htm :: ourVers
/* private: */ char * Java2Htm :: rest_of_path
/* private: */ char * Java2Htm :: rest_of_path
/* private: */ char * Java2Htm :: set_ww
/* private: */ char * Java2Htm :: skip_1char_and_comment
/* private: */ char * Java2Htm :: to_className
/* private: */ char * Java2Htm :: to_end_of_WHERE
/* private: */ char * Java2Htm :: escstr
/* private: */ char * Java2Htm :: gutLesbar
/* private: */ char * Java2Htm :: htm_esc
/* private: */ char * Java2Htm :: semiPath
/* private: */ char * Java2Htm :: weiter
/* private: */ long Java2Htm :: pretty_CPP
/* private: */ uint Java2Htm :: ADD_namespaces_to_packages
/* private: */ uint Java2Htm :: anz_of
/* private: */ uint Java2Htm :: callees
/* private: */ uint Java2Htm :: nestDepth
/* private: */ uint Java2Htm :: show_INCs
/* private: */ uint Java2Htm :: srcfile
/* private: */ uint Java2Htm :: ASP_to_htm
/* private: */ uint Java2Htm :: BAS_to_htm
/* private: */ uint Java2Htm :: COB_to_htm
/* private: */ uint Java2Htm :: CPP_to_htm
/* private: */ uint Java2Htm :: CSharp_to_htm
/* private: */ uint Java2Htm :: JSP_to_htm
/* private: */ uint Java2Htm :: PHP_to_htm
/* private: */ uint Java2Htm :: defNameNr
/* private: */ uint Java2Htm :: show_subClasses
/* private: */ void Java2Htm :: ADD_inc_structure
/* private: */ void Java2Htm :: ALLAufrufe
/* private: */ void Java2Htm :: DB_Cursors
/* private: */ void Java2Htm :: add_ALL_htm_entry_Links
/* private: */ void Java2Htm :: add_htm_entry_Links
/* private: */ void Java2Htm :: add_refcpp
/* private: */ void Java2Htm :: better_cpp
/* private: */ void Java2Htm :: cob_data_dependencies
/* private: */ void Java2Htm :: cob_file_dependencies
/* private: */ void Java2Htm :: cpp_Dialogs
/* private: */ void Java2Htm :: create_cases_Verz
/* private: */ void Java2Htm :: create_execs_Verz
/* private: */ void Java2Htm :: create_mBoxes_Verz
/* private: */ void Java2Htm :: create_php_ref
/* private: */ void Java2Htm :: create_traceUs
/* private: */ void Java2Htm :: create_useObj_Verz
/* private: */ void Java2Htm :: einAufruf
/* private: */ void Java2Htm :: end_zuA
/* private: */ void Java2Htm :: extract_from_mak
/* private: */ void Java2Htm :: funcAusz
/* private: */ void Java2Htm :: j2h_break
/* private: */ void Java2Htm :: make_ABC
/* private: */ void Java2Htm :: make_path
/* private: */ void Java2Htm :: name_ALL_code_docu_files
/* private: */ void Java2Htm :: seeAufrufe
/* private: */ void Java2Htm :: see_server_API
/* private: */ void Java2Htm :: see_table_synonyms
/* private: */ void Java2Htm :: showALLMethods
/* private: */ void Java2Htm :: show_ALLAufrufe
/* private: */ void Java2Htm :: show_Aufrufe
/* private: */ void Java2Htm :: show_DLLs
/* private: */ void Java2Htm :: show_Exceptions
/* private: */ void Java2Htm :: show_Module_Dependencies
/* private: */ void Java2Htm :: show_incsMe_Relation
/* private: */ void Java2Htm :: show_messMap
/* private: */ void Java2Htm :: show_messMap
/* private: */ void Java2Htm :: show_metrics
/* private: */ void Java2Htm :: show_notA
/* private: */ void Java2Htm :: show_sorted
/* private: */ void Java2Htm :: show_statics
/* private: */ void Java2Htm :: tables_not_in_use
/* private: */ void Java2Htm :: to_incNames
/* private: */ void Java2Htm :: code_uses
/* private: */ void Java2Htm :: report_syntaxError
/* private: */ void Java2Htm :: CSharp_to_htm
/* private: */ void Java2Htm :: ERD_to_htm
/* private: */ void Java2Htm :: JAVA_to_htm
/* private: */ void Java2Htm :: SQL_to_htm
/* private: */ void Java2Htm :: cash_classComment
/* private: */ void Java2Htm :: check_code_rose_diff
/* private: */ void Java2Htm :: check_noCode
/* private: */ void Java2Htm :: check_package_name
/* private: */ void Java2Htm :: corrSep
/* private: */ void Java2Htm :: create_class_map
/* private: */ void Java2Htm :: create_path_under_ourRoot
/* private: */ void Java2Htm :: create_subClasses_Relation
/* private: */ void Java2Htm :: def_sample
/* private: */ void Java2Htm :: do_alles
/* private: */ void Java2Htm :: gen_title_page
/* private: */ void Java2Htm :: hide_the_forget_files
/* private: */ void Java2Htm :: js_functions
/* private: */ void Java2Htm :: js_used_in_src
/* private: */ void Java2Htm :: js_user
/* private: */ void Java2Htm :: methods_of_superClasses
/* private: */ void Java2Htm :: nachbessere
/* private: */ void Java2Htm :: nachbessere
/* private: */ void Java2Htm :: put_incs
/* private: */ void Java2Htm :: see_EXEC_SQL_sections
/* private: */ void Java2Htm :: shorter
/* private: */ void Java2Htm :: show_class_map
/* private: */ void Java2Htm :: show_methods
/* private: */ void Java2Htm :: show_rootClasses
/* private: */ void Java2Htm :: show_superClasses
/* private: */ void Java2Htm :: show_the_ASP_includes
/* private: */ void Java2Htm :: show_the_CPP_includes
/* private: */ void Java2Htm :: show_the_JSP_includes
/* private: */ void Java2Htm :: show_xml_files
/* private: */ void Java2Htm :: the_useOf
/* private: */ void Java2Htm :: toSeeDefaultVis
/* private: */ void Java2Htm :: to_INCs
/* private: */ void Java2Htm :: up
/* private: */ void Java2Htm :: use_sample
/* private: */ void Java2Htm :: zu_codef
|
/* public: */ BOOL Java2Htm :: quote_not_found
/* public: */ Java2Htm :: Java2Htm
/* public: */ Java2Htm :: ~Java2Htm
/* public: */ char * Java2Htm :: nr2
/* public: */ char * Java2Htm :: strNr2
/* public: */ void Java2Htm :: code_vs_ccom
/* public: */ void Java2Htm :: code_vs_rose
/* public: */ void Java2Htm :: cppsecs_vs_UMLsecs
/* public: */ void Java2Htm :: diff_to_htm
/* public: */ void Java2Htm :: JSP_uses
/* public: */ void Java2Htm :: List_our_packages
/* public: */ void Java2Htm :: check_imports
/* public: */ void Java2Htm :: create_exe_List
/* public: */ void Java2Htm :: create_ourDoc
/* public: */ void Java2Htm :: make_htm_dir
/* public: */ void Java2Htm :: show_imports
|
/* pure: */ uint create_our_tree
#define static
#include java2htm.h : cpp
#include java2htm.c1 : cpp
#undef BB
#undef BBStr
#undef bb
#undef bbStr
#define BB
#define BBStr( x,y,z ) ;
#define bb
#define bbStr( x,y,z ) ;
#ifndef procNestOn
#undef BB
#undef BBStr
#undef bb
#undef bbStr
#undef LB_
#undef LE_
#undef LE_ret
#undef ret
#undef ret_
#undef __
#undef ___
#define BB if ( 1 < call_nr || errno )
#define bb if ( 1 < call_nr || errno )
#define BBStr( x,y,z ) { BB traceStr( x,y,z ); }
#define bbStr( x,y,z ) { bb traceStr( x,y,z ); }
#define __ { bb { printf( "\nLine %i", __LINE__ ); }}
#define ___
#define ret_ { __ return ; }
#define LE_ __ return ; }
#define LE_ret( x ) __ return( x ); }
#define ret( x ) { __ return( x ); }
#define LB_( x ) { bb printf( "\n-> %s", x ); safe_ut.showSysCalls = 1 ;
#endif
// #define nr2( x ) nrX( x, __LINE__ )
// #define _
#define sourceNr( f,c ) srcfile( __LINE__, f, c );
#define continue_ze { B.a = ze - B.z ; *ze = '\n' ; continue ; }
#define Var_htm __ char * htm = htm_LA ; \
St_htm u ; u.to_htm( c, htm, htm_LE - htm_LA );
#define j2h_eof( fn, ext ) { j2h_break( fn, ext ); break ; }
// #define j2h_eof( fn, ext )
// #define bb if ( call_nr >= 888000 )
#define bb if ( 0 )
// #define BB if ( call_nr >= 1 )
#define BB if ( 0 )
#define ___
#define __
// #define __ { bb { printf( "\nLine %i", __LINE__ ); fflush(stdout); }}
#define LB_( x ) {
// #define LB_( x ) { { printf( "\n-> %s", x ); fflush(stdout); }
/* public: */ Java2Htm :: ~Java2Htm (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.~Java2Htm")
__
Delete( phpClasses ); __
Delete( htm_LA ); __
Delete( Esc ); __
//
if ( ! done_1 ) exit( 1 );
// nachbessere( index ); s.u.
//
// codefile->traceAbs( "codefile" );
// not_indexed->traceAbs( "not_indexed" );
// index.traceAbs( "index" );
// noInc.traceAbs( "noInc" );
// incsMe.traceAbs( "incsMe" );
// supNames.traceAbs( "supNames" );
// cppsecs.traceAbs( "cppsecs" );
// DDX.traceAbs( "DDX" );
// incNames.traceAbs( "incNames" );
// srcFiles.traceAbs( "srcFiles" );
// cobUses.traceAbs( "cobUses.TR" );
// DBUse.traceAbs( "DBUse" );
__ showALLMethods();
__
char800 sp ; s_( sp, "%s/cppsecs", j2h );
if is_dir( j2h ) cppsecs.to_file( sp ); else _1(j2h)
//
// This Btree export is needed in jaco.exe (for creating hyperlinks in
// trace presentation that point to the source pages implementing the
// methods covered).
if ( fwp ) close( fwp );
if ( ourCode ) close( ourCode );
if ( fJSU && ! jsfuncs ) close( fJSU );
if ( fJSU )
{
KVStore st ; Surr s = jsfuncsUsed -> GetFirst( st );
while ( s )
{
if not_in_str( '~', st.k ) fErr
char * x = st.k ; to_( x, '~' ) *x = 0 ;
js_used_in_src( st.k, x+1 );
*x = '~' ;
s = jsfuncsUsed -> Next( st );
}
s = jsfuncs -> GetFirst( st );
while ( s )
{
if ( *st.c == '-' ) js_used_in_src( st.k, "." );
s = jsfuncs -> Next( st );
}
close( fJSU );
}
close( fsrc );
if ( xx_dvc )
{
S_ "+diffsm M xx_src xx_dvc > src_dvc_diff" _Do
printf( "\no k - see src_dvc_diff\n" );
}
see_server_API();
if is_dir( j2h )
{
name_ALL_code_docu_files();
Unlink( tmp1 ) // _1( tmp1 )
Unlink( tmp2 ) // _1( tmp2 )
printf( "\n%8sLOC = %i, %i main() methods\n", "", LOC, mNr );
if ( action == '+' )
{
List_our_packages(); S_ "packages" _Do
}
S_ "DEL \"%s/../alles_*\"", j2h _Do
S_ "DEL \"%s/../*.xxx\"" , j2h _Do
printf( "\no k - see the file packages\n" );
}
delete( schon ); S_ "rm -rf tempNr" _Do
___
// -----------------------------------------------------------------------------
// MFC Code mit DDX_... (= Presentation Layer):
// -----------------------------------------------------------------------------
// Unlink( ALLCode );
// Unlink( roMo ); // ALLRoseUML
// Unlink( coMo );
__ show_messMap(); ___
__ Delete( cases );
Delete( noAufrufe );
Delete( Aufrufe );
Delete( mBoxes );
Delete( crObjs );
Delete( ourDocu );
__ Delete( jsfuncsUsed );
Delete( jsfuncs );
Delete( messMap );
Delete( server );
Delete( statics );
Delete( DLLs );
Delete( Exceptions );
__ Delete( classComm );
Delete( subClasses );
Delete( file_uses_file );
Delete( cursordef );
Delete( cursors );
delete( ( char* ) tocArr );
__
s_( sp, "%s/../traceUs", j2h );
__
if ( is_file( sp ) && ! file_len( sp ) ) Unlink( sp );
__
LE_
/* public: */ Java2Htm :: Java2Htm (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.Java2Htm")
posNrAtComment = false ;
phpClasses = 0 ;
eofNr = 0 ;
cases = new Btree();
noAufrufe = new Btree();
Aufrufe = new Btree();
mBoxes = new Btree();
crObjs = new Btree();
execs = new Btree();
mBoxNr = 0 ;
crObNr = 0 ;
execNr = 0 ;
Esc = ( char* ) malloc( 300000 ); eEsc = Esc + 300000 ;
htm_LA = ( char* ) malloc( 300000 );
htm_LE = htm_LA + 300000 ;
escBuffer = ( char* ) malloc( 300000 );
escBufferMax = escBuffer + 300000 ;
mxetoc = 100000 ;
tocArr = ( char** ) malloc( mxetoc * sizeof( char* ) + 8 );
__
cursordef = new Btree();
cursors = new Btree();
aufgerufen = new Btree();
not_indexed = new Btree();
codefile = new Btree();
file_uses_file = new Btree();
to_2B = "\n<p class=c align=right><a href=../cpp.htm>C++</a> ."
"\n<a href=../../1.htm>ALL</a> ."
"\n<a href=#top>top</a> ."
"\n<a href=#eof>meta</a>"
"\n </p><p class=c>"
;
to_1B = "\n<p class=c align=right><a href=cpp.htm>C++</a> ."
"\n<a href=../1.htm>ALL</a> </p><p class=c>"
;
ohne_tables = true ;
done_dep =
done_cpp =
done_UML =
done_ALLAufr =
done_classComm = "not found" ;
done_traceUs = "not found" ;
done_ = " found" ;
Vis = "" ;
xx_dvc = is_file( "xx_dvc" );
synonyms = 0 ;
done_1 = 0 ;
zuCob = 0 ;
LRootDir = 0 ;
ourCode = 0 ;
fJSU = 0 ;
fsrc = create( "xx_src" );
*projweb = 0 ;
Exceptions = statics = DLLs = server = messMap = classComm = 0 ;
subClasses = 0 ;
ourDocu = jsfuncs = jsfuncsUsed = 0 ; min_Ljsfunc = 1000 ;
cfNr = anz_assert = 0 ;
vs_rose = vs_ccom = 0 ;
compare_code_rose = false ;
coMo = "xx_code_mo" ; fcoMo = create( coMo );
roMo = "xx_ALLRose" ; froMo = create( roMo ); skMo = "xx_ALLRose.sk" ;
ALLCode = "xx_ALLCode" ; fcode = create( ALLCode );
typeOfCode = "?" ;
selector = "" ;
suchpr.insert( "</pre>" );
suchpr.insert( "<table" );
suchpr.insert( "\n" );
suchpr.insert( "\"" );
suchpr.insert( "{" );
suchpr.insert( "}" );
suchpr.insert( "/" );
suchpr.insert( "?-END" );
suchpr.insert( "ain" ); // main, DLLMain, ...
schon = 0 ;
codenr = 0 ;
codesz = 0 ;
nam_Nr = 0 ;
anz_files = 0 ;
anz_cpp_commands = 0 ;
anz_bas_commands = 0 ;
anz_php_commands = 0 ;
anz_cob_commands = 0 ;
anz_asp_commands = 0 ;
anz_jsp_commands = 0 ;
anz_samples = 0 ;
tempNr = 0 ; temp = "tempNr" ;
noAutoComment = true ;
see_asp_comment = see_jsp_comment = false ;
nskip = mNr = custom_code = anz_files = 0 ;
thisWeb_0 = thisWeb_t = thisWeb_s = docuWeb = "" ;
action = 0 ;
serr = 0 ;
ALoComm = 0 ; strcpy( j2h, "?" );
int i = 0 ; while ( i < 100 ) sam[ i++ ] = 0 ;
anzTips = -1 ; anz_samples = LOC_cpp = LOC = usNr = 0 ; M = 0 ;
tmp1 = "__j1" ;
tmp2 = "__j2" ;
*muster = 0 ;
muster_L = 8484 ; // = length of file ic/muster/patt_j2h as shown by dir
_1( eofNr )
LE_
/* private: */ void Java2Htm :: j2h_break
// -----------------------------------------------------------------------------
(
char * fn
, char * ext
)
LB_("Java2Htm.j2h_break")
printf( "\n\n//break: %s", fn );
if ( ! eofNr++ ) dir_exist( "eof" );
path res ; s_( res, "eof/eof_%u.%s", eofNr, ext );
cp_file( res, fn );
LE_
/* private: */ void Java2Htm :: create_mBoxes_Verz ( FILE * f
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.create_mBoxes_Verz")
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a><br>"
"\n<font size=\"+1\">We have %i Calls of MsgBox in VB Code:"
"\n</font><br><br>"
, kopf, mBoxNr );
if ( ! mBoxes || mBoxNr == 0 ) ret_
Btree & mB = *mBoxes ;
KVStore st ; Surr s = mB.GetFirst( st );
while ( s )
{
char * x = in_str( '~', st.k );
if ( x ) *x = 0 ; else fErr1( st.k )
fprintf( f, "\n<br><a href=bas%s#mB%s>MsgBox</a> %s", st.c, st.k, x+1 );
*x = '~' ;
s = mB.Next( st );
}
LE_
/* private: */ void Java2Htm :: create_useObj_Verz ( FILE * f
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.create_useObj_Verz")
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a><br>"
"\n<font size=\"+1\">We have %i Calls of CreateObject in VB Code:"
"\n</font><br><br>"
, kopf, crObNr );
if ( ! crObjs ) ret_
Btree & cr = *crObjs ;
KVStore st ; Surr s = cr.GetFirst( st );
while ( s )
{
char * x = in_str( '~', st.k );
if ( x ) *x = 0 ; else fErr1( st.k )
fprintf( f, "\n<br><a href=bas%s#cr%s>CreateObject</a> %s", st.c, st.k, x+1 );
*x = '~' ;
s = cr.Next( st );
}
LE_
/* private: */ void Java2Htm :: create_execs_Verz ( FILE * f
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.create_execs_Verz")
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a><br>"
"\n<font size=\"+1\">We have %i Calls of ExecuteFile in VB Code:"
"\n</font><br><br>"
, kopf, execNr );
if ( execNr == 0 ) ret_
Btree & ex = *execs ;
KVStore st ; Surr s = ex.GetFirst( st );
while ( s )
{
char * x = in_str( '~', st.k );
if ( x ) *x = 0 ; else fErr1( st.k )
fprintf( f, "\n<br><a href=bas%s#ex%s>ExecuteFile</a> %s", st.c, st.k, x+1 );
*x = '~' ;
s = ex.Next( st );
}
LE_
/* private: */ void Java2Htm :: create_cases_Verz ( FILE * f
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.create_cases_Verz")
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a><br>"
"\n<font size=\"+1\">Here ALL Case Statements in VB Code:"
"\n</font><br><br>"
, kopf );
if ( execNr == 0 ) ret_
Btree & ex = *cases ;
KVStore st ; Surr s = ex.GetFirst( st );
while ( s )
{
char * w = in_str( '~', st.k );
if ( w ) *w = 0 ; else fErr1( st.k )
char * x = in_str( '~', w+1 );
if ( x ) *x = 0 ; else fErr1( st.k )
char * z = in_str( '~', x+1 );
if ( z ) *z = 0 ; else fErr1( x+1 )
fprintf( f, "\n<br>%s : <a href=bas%s#%s>%s</a>", st.k, w+1, st.c, x+1 );
*w = '~' ;
*x = '~' ;
*z = '~' ;
s = ex.Next( st );
}
LE_
/* private: */ void Java2Htm :: show_messMap (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.show_messMap")
if ( ! messMap ) ret_
str_set such ; such.insert( "ON_MESSAGE(" );
such.insert( "/" );
FILE * f = create_( "messMap" );
KVStore st ; Surr s = messMap -> GetFirst( st );
while ( s )
{
show_messMap( f, st.k, st.c, such );
s = messMap -> Next( st );
}
close( f );
__
LE_
/* private: */ void Java2Htm :: show_messMap
/* -----------------------------------------------------------------------------
Find the server API of an MFC App
-----------------------------------------------------------------------------
*/ (
FILE * f
, char * cpp
, char * htm
, str_set & sch
)
LB_("Java2Htm.show_messMap")
___
rBuffer B( cpp, "" );
while ( B.find( 1, "ON_COMMAND(", 0 ) )
{
char * c = B.z + B.a ;
c += 11 ; skip_space( c )
char * n = c ; while in_name( *c ) c++ ; *c++ = 0 ;
while not_in_name( *c ) c++ ;
char * e = c ; to_( e, ')' )
e-- ; while space( *e ) e-- ; e[1] = 0 ;
char m = '+' ;
if ( At( n, "IDOK" ) || substr( "_ABOUT" , n )
|| substr( "_DEBUG" , n )
|| substr( "_HELP" , n )
|| substr( "_HILFE" , n )
|| substr( "_PREVIEW" , n )
|| substr( "_PRINT" , n )
|| substr( "_EDIT_" , n )
|| At( n, "IDCANCEL" )
)
m = '-' ;
char400 xx ; s_( xx, "%c%s~%s", m, htm, c );
if ( m == '+' )
{
m = ' ' ; server -> StrIns( 'e', xx, n );
}
}
__
LE_
/* private: */ void Java2Htm :: see_server_API (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.see_server_API")
__
// Btree SS, fz ; //DDX.traceAbs( "DDX" );
Btree * SS = new Btree();
KVStore st ; Surr s = DDX.GetFirst( st );
while ( s && *st.k )
{
char * e = eos( st.k ); while ( *e != '/' ) e-- ;
SS -> StrIns( 'e', e+1, st.k );
s = DDX.Next( st );
}
// __ SS.traceAbs( "SS" );
s = SS -> GetFirst( st );
while ( s )
{
char * e = st.c - 2 ;
if At( e, ".h" )
then {
strcpy( e, ".cpp" );
if ( ! SS -> contains( st.c ) ) printf( "\nUI: %s", st.c );
}
else {
// Includes not in DDX seem to be UI/Server Interface:
rBuffer B( st.c, "" );
while ( B.find( 1, "#include", 0 ) )
{
char * e = B.z + B.a + 8 ; skip_space( e )
if ( *e == '"' )
{
e++ ; to_( e, '"' ) *e = 0 ;
char * c = e-1 ; while not_in_str( *c, "/\\\"" ) c-- ;
KVStore zz ;
if ( SS -> Get( c+1, zz ) )
{
char * e = eos( zz.k ) - 2 ;
if At( e, ".h" )
{
strcpy( e, ".cpp" );
if ( ! SS -> contains( zz.k ) )
{
printf( "\nUI: %s", zz.c );
}
}
}
}
}
}
s = SS -> Getmin_GR( st, st.k );
}
delete( SS );
LE_
/* public: */ char * Java2Htm :: nr2 ( Surr k // nr2 => nrX
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.nr2")
Surr k1 = k/100 ; s_( deepNumber, "%i/%i", k1, k - k1 * 100 );
LE_ret( deepNumber )
/* public: */ char * Java2Htm :: strNr2
// -----------------------------------------------------------------------------
(
uint k
, char * str
)
LB_("Java2Htm.strNr2")
fErr
int k1 = k/100 ; s_( deepNumber, "%s%i/%i", str, k1, k - k1 * 100 );
LE_ret( deepNumber )
/* private: */ char * Java2Htm :: escape
/* -----------------------------------------------------------------------------
escape the '<' because this is, in HTML, a meta character
|----------------------------------------------------------------------------
*/ (
char * c
, char * ee
)
LB_("Java2Htm.escape")
char * e = Esc ;
char * ec = eos( c );
while ( c > ec )
// while ( *c )
{
if ( ee <= e ) fErr2( c, e-ee )
if ( *c == '<' )
then {
c++ ; memcpy( e, "<", 3 ); e += 3 ;
}
else *e++ = *c++ ;
if ( eEsc <= e )
{
m_errMess "System: zu klein: Esc, e-eEsc = " m_
e-eEsc, ret_error
}
;
}
*e = 0 ;
if ( eEsc <= e )
{
m_errMess "System: zu klein: Esc" m_
ret_error
}
;
LE_ret( Esc )
/* private: */ void Java2Htm :: gen_title_page
/* -----------------------------------------------------------------------------
present *.java in form of *.htm
|----------------------------------------------------------------------------
*/ (
char * j2h
)
LB_("Java2Htm.gen_title_page")
path tp ; s_( tp, "%s/1.htm", j2h ); FILE * f = create( tp ); fprintf( f,
"\n%s<center><br><br>"
"\n<h1>Sample Enterprise Java Beans</h1>"
"\n<font size=2>coded automatically by GAZELLE (gaz.exe)</font>"
"\n<br><br><br><br>"
"\nBecause this is a sample that shall be good, first of all, for training"
"\npurposes, most beans were given both remote and local interfaces. Usually"
"\nhowever you should use the default design which says:<b><br><br>"
"\nEntity Beans should be given only local interfaces,<br>"
"\nSession Bean interfaces should be remote.</b><br><br>"
"\n<br><br><a href=../our_ERD.txt>"
"\nHere Spec of Beans to be created</a>"
"\n<br><br><a href=f.htm>"
"\nHere Generator's OUTPUT: Code and Documentation"
"\n<br><br><a href=tips.htm>"
"\nRationale for Design Decisions, Naming of Classes and Interfaces"
"\n</center><br></BODY></HTML>"
, kopf
);
close( f );
LE_
/* private: */ void Java2Htm :: corrSep
/* -----------------------------------------------------------------------------
ensure correct separator
|----------------------------------------------------------------------------
*/ (
char * s
, char * sep
)
LB_("Java2Htm.corrSep")
char c1 = sep[0] ;
char c2 = sep[1] ;
char * dir = s ;
s-- ; while ( *( ++s ) ) if ( *s == c1 ) *s = c2 ;
LE_
/* private: */ void Java2Htm :: cash_classComment (
/* -----------------------------------------------------------------------------
if we have a file j2h/../class_documentation
K”nnte erzeugt worden sein aus
z.B. die Beschreibung des Rechenkerns in S-Depot
z.B. die 2400 Seiten DV-Konzept zu S-Depot
-----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.cash_classComment")
__
char800 docu ; s_( docu, "%s/../class_documentation", j2h );
char1000 CLComm ; s_( CLComm, "%s/../classComm.htm", j2h );
__
if is_file( CLComm )
{
S_ "+sdep1 %s/..", j2h _Do
}
_1(docu)
if not_is_file( docu ) ret_
rBuffer B( docu, "\n" ); classComm = new Btree ;
while ( B.find( 0, "\n-c ", 0 ) )
{
__ B.getmore( 8000 );
char * c = B.z + B.a + 4 ;
char * n = c ; to_space( c ) *c++ = 0 ;
char * e = c ; to_( e, '~' ) *e = 0 ;
if ( c + 250 < e ) c[ 250 ] = 0 ;
B.a = e - B.z ;
classComm -> StrIns( 'e', n, c );
}
__
done_classComm = done_ ;
LE_
/* private: */ void Java2Htm :: js_functions ( char * src
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.js_functions")
if ( ! jsfuncs )
then {
jsfuncsUsed = new Btree ;
jsfuncs = new Btree ;
}
rBuffer B( src, "" );
while ( B.find( 1, "function", 0 ) )
{
char * c = B.z + B.a ; if not_space( c[-1] ) continue ;
c += 8 ; if not_space( *c ) continue ;
skip_space( c );
char * n = c ; while in_name( *c ) c++ ; *c = 0 ;
char100 nc ; s_( nc, "-%s", n ); lower( nc + 1 );
if ( *n ) jsfuncs -> StrIns( 'e', n, nc );
uint L = strlen( n );
if ( min_Ljsfunc > L ) min_Ljsfunc = L ;
}
LE_
/* private: */ void Java2Htm :: js_used_in_src
// -----------------------------------------------------------------------------
(
char * func
, char * src
)
LB_("Java2Htm.js_used_in_src")
fprintf( fJSU, "\n<tr><td>%s</td><td/><td>%s</td></tr>", func, src );
LE_
/* private: */ void Java2Htm :: js_user
// -----------------------------------------------------------------------------
(
char * src
, char * ext
, char * c
)
LB_("Java2Htm.js_user")
if ( ! jsfuncs ) ret_
if ( ! c ) fErr
if At( c, "<%=" ) ret_
char * e = c ; while not_in_str( *e, "(>\"" ) e++ ;
while ( At( e-2, "if(" ) || At( e-3, "if (" ) )
{
to_( e, ')' ); while not_in_str( *e, "(>\"" ) e++ ;
}
if ( *e != '(' || e-c < min_Ljsfunc || 1000 <= e-c ) ret_
char1000 nc ;
char m = *e ; *e = 0 ;
strcpy( nc, c ); lower( nc );
if ( ! jsfuncs ) fErr
Btree & funcs = *jsfuncs ;
KVStore st ; Surr s = funcs.GetFirst( st );
BOOL ask = 1 ;
while ( s )
{
char * x = substr( st.c+1, nc );
if ( nc < x && in_name( x[-1] ) ) x = 0 ;
if ( x )
{
ask = 0 ;
*st.c = '+' ; funcs.StrIns( 'e', st.k, st.c );
char800 xx ;
s_( xx, "%s~%s.%s", st.k, src, ext ); strcpy( xx + 252, " ..." );
unix_me( xx );
jsfuncsUsed -> StrIns( 'e', xx );
}
s = funcs.Next( st );
}
// if ( ask )
*e = m ;
LE_
/* private: */ BOOL Java2Htm :: not_selected ( char * src
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.not_selected")
unix_me( src ); int i = e_see ;
while ( i-- )
{
if substr( see[i], src ) ret( false );
}
LE_ret( true );
/* private: */ void Java2Htm :: do_alles
// -----------------------------------------------------------------------------
(
char * rootDir
, char * ext
)
LB_("Java2Htm.do_alles")
S_ "+jaco cat .%s %s %s/alles_%s", ext, rootDir, rootDir, ext _Do
LE_
/* private: */ void Java2Htm :: hide_the_forget_files
// -----------------------------------------------------------------------------
(
Btree & forget
, char * rootDir
)
LB_("Java2Htm.hide_the_forget_files")
KVStore st ; Surr s = forget.GetFirst( st );
while ( s )
{
char800 xx ; s_( xx, "%s%s", rootDir, st.k );
char800 xk ; s_( xk, "%s%s", rootDir, st.c );
if not_is_file( xx ) fErr1( xx )
if ( is_file( xk ) && not_is_( xx, xk ) )
{
printf( "\nja_forget: %s", st.k );
printf( "\nno_forget: %s", st.c );
S_ "-mv %s %s.forget", xx, xx _Do
}
else printf( "\nNo_forget: %s [%s]", st.k, st.c );
s = forget.Next( st );
}
LE_
/* public: */ void Java2Htm :: make_htm_dir
/* -----------------------------------------------------------------------------
present *.java (and other code) in form of *.htm
|----------------------------------------------------------------------------
*/ (
char * exe
, char * rootDir
, char Action
, char * ourRoot
)
LB_("Java2Htm.make_htm_dir")
__
if ( ! rootDir || not_is_dir( rootDir ) )
{
m_errMess "User: not found: %s" m_
rootDir, ret_error
}
;
LRootDir = strlen( rootDir );
char * CodeName = rootDir ;
if ( 1 )
{
do_alles( rootDir, "mak" );
do_alles( rootDir, "dsp" );
do_alles( rootDir, "dsw" );
do_alles( rootDir, "cpp" );
do_alles( rootDir, "cat" ); // UML in Rose
do_alles( rootDir, "mdl" ); // UML in Rose
do_alles( rootDir, "rc" ); // GUI resource files
}
S_ "+jaco dep %s", rootDir _Do
if ( *rootDir == '[' )
{
typeOfCode = rootDir + 1 ;
while ( *rootDir && *rootDir != ']' ) rootDir++ ; *rootDir++ = 0 ;
}
char * zz = in_str( '=', rootDir );
if ( zz ) { *zz = 0 ; selector = zz+1 ; }
_1( ourRoot )
if ( ourRoot && not_is_dir( ourRoot ) )
{
{
m_errMess "User: no such ourRoot: %s" m_
ourRoot, ret_error
}
}
doc_A = doc_D = 0 ; e_doc = e_see = 0 ;
char * e = eos( rootDir ) - 1 ;
while ( rootDir <= e && in_str( *e, "/\\" ) ) *e-- = 0 ; // muss sein
if not_is_dir( rootDir )
{
m_errMess "User: No such folder: %s" m_
rootDir, ret_error
}
;
LRoot = strlen( rootDir );
_1( rootDir )
e = rootDir - 1 ;
while ( *( ++e ) ) if in_str( *e, "/\\" ) nskip = e - rootDir + 1 ;
e-- ; while in_str( *e, "/\\" )
e = eos( rootDir ) - 4 ;
strcpy( srcRoot, rootDir );
if is_( e, ".j2h" )
{
// read j2h configuration file:
rBuffer B( rootDir, "\n" );
while ( B.find( 0, "\n-", 0 ) )
{
strcpy( B.z + B.e, "\n eof\n" );
char * c = B.z + B.a + 4 ;
char * e = c ; to_( e, '\n' )
char * z = e ;
char * x = e ; while space( *x ) *x-- = 0 ;
switch ( c[-2] )
{
Case '0' : thisWeb_0 = such.take( c );
Case '1' : thisWeb_t = such.take( c );
Case '2' : thisWeb_s = such.take( c );
Case '3' : thisWeb_s = such.take( c );
Case 's' : unix_me( c ); see[ e_see++ ] = such.take( c );
if ( mxsee <= e_see ) fErr1( e_see )
Case 'A' : doc_A = such.take( c );
Case 'D' : doc_D = such.take( c );
Case 'L' : doc[ e_doc ].href = such.take( c );
c = e+1 ; skip_space( c );
e = c ; to_( e, '\n' ) *e = 0 ; z = e ;
doc[ e_doc++ ].name = such.take( c );
if ( mxdoc <= e_doc ) fErr1( e_doc )
Else : fErr1( c-2 )
}
B.a = z - B.z ; *z = '\n' ;
}
___
while ( rootDir < e && not_in_str( *e, "/\\" ) ) e-- ; *e = 0 ;
___
}
___
action = Action ;
if ( ! exe ) fErr
if ( ! rootDir ) fErr
if ( ! *rootDir ) fErr
app = such.take( rootDir ); if not_is_dir( rootDir ) fErr
path xx ; s_( xx, "%s/our_ERD.txt", rootDir ); J2EE = path_exists( xx );
checkPackName = ( *rootDir != '.' );
s_( muster, "%s.exe", exe );
// S_ "wfind \"%s\" > %s", rootDir, tmp1 _Do
wfind( 0, tmp1, rootDir );
// -----------------------------------------------------------------------------
s_( j2h, "%s/j2h/ALL_cscode", rootDir );
ALL_cscode = store.take( j2h );
s_( j2h, "%s/j2h/ALL_ccode", rootDir );
ALL_ccode = store.take( j2h );
s_( j2h, "%s/j2h" , rootDir ); dir_exist_empty( j2h );
s_( j2h, "%s/j2h/index", rootDir ); dir_exist_empty( j2h );
s_( j2h, "%s/j2h" , rootDir );
uint j2h_L = strlen( j2h );
gen_title_page( j2h );
char1000 er2 ; s_( er2, "%s/er1.htm" , rootDir );
char1000 er1 ; s_( er1, "%s/our_ERD.a" , rootDir );
char1000 sql ; s_( sql, "%s/our_ERD.sql", rootDir );
ERD_to_htm( rootDir, er1 );
SQL_to_htm( rootDir, sql );
// -----------------------------------------------------------------------------
s_( xx, "%s/htms", j2h ); create_css( xx );
*xx = ( uchar )13 ; xx[1] = 0 ;
such.insert( "package " );
such.insert( "import " );
such.insert( "class " );
such.insert( "try " );
such.insert( "catch(" );
such.insert( "return " );
such.insert( xx );
such.insert( "\n" );
such.insert( "\"" );
such.insert( "//" );
such.insert( "<" );
// such.insert( "/**" );
such.insert( "/*" );
such.insert( "abstract " );
such.insert( "public " );
such.insert( "protected " );
such.insert( "private " );
such.insert( "interface " );
such.insert( "extends " );
such.insert( "implements " );
such.insert( "throws " );
such.insert( "void " );
such.insert( "static " );
such.insert( ";import " );
FILE * f1 ;
FILE * f2 ;
char1000 h1 ; s_( h1, "%s/f.htm", j2h ); f1 = create( h1 );
char * tips = Tips_to_htm( rootDir );
fprintf( f1,
"\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\"><HTML><HEAD></HEAD>"
"\n<FRAMESET cols=\"27%%,73%%\">"
"\n<FRAMESET rows=\"30%%,70%%\">"
"\n<FRAME src=\"packages.htm\" name=\"frame1\">"
"\n<FRAME src=\"classes.htm\" name=\"frame2\">"
"\n</FRAMESET>"
"\n<FRAME src=docu.htm name=\"frame3\">"
"\n</FRAMESET>"
"\n<NOFRAMES>"
"\n<H2>Frame Alert</H2><P>"
"\nThis document is designed to be viewed using the frames feature."
"\nIf you see this message, you are using a non-frame-capable web client."
"\n<br></HTML>"
);
close( f1 );
if ( ! fJSU )
{
char800 xx ; s_( xx, "%s/jscr.htm", j2h );
fJSU = create( xx ); fprintf( fJSU,
"\n%s<a name=top></a>%sWhere JScript Functions are used%s<font size=2>"
"\n<br><table><thead><tr><td>Function<br> </td>"
"\n<td/><td>Is used in:<br> </td></tr></thead>"
, kopf, t1, t2 );
}
char800 tables_xxx ; s_( tables_xxx, "%s/tables.xxx", rootDir );
fx = create( tables_xxx );
// -----------------------------------------------------------------------------
rBuffer B( tmp1, "\n" ); B.remember( 1000 );
// B.exp_Umlaute( "mae_nach_win", B.e ); // da durch ufind.exe geschrieben
char1000 dir ; *dir = 0 ; int anz = 10000 ;
int cssNr = 0 ;
Btree ALL_ext ;
char2000 xp ; Btree packages ;
char2000 xc ; Btree classes ;
str_set seeMe ; seeMe.insert( "." );
seeMe.insert( "/j2h\n" );
int cut = -1 ;
while ( B.find( 1, seeMe, 0 ) )
{
B.z[ B.e ] = '\n' ;
__
if ( B.z[ B.a + 4 ] != '\n'
&& B.z[ B.a + 3 ] != '\n'
&& B.z[ B.a + 2 ] != '\n'
&& B.z[ B.a + 5 ] != '\n'
)
then continue ;
B.getmore( 1000 ); B.z[ B.e ] = '\n' ;
char * zA = B.z + B.a ; while ( *zA && *zA != '\n' ) zA-- ; zA++ ;
char * ze = B.z + B.a ; to_( ze, '\n' ) *ze = 0 ;
if ( *zA == '<' ) fErr
if ( substr( "/publish/", zA )
|| substr( "/j2h/" , zA )
|| substr( "/bin/" , zA )
|| substr( ".old/" , zA )
|| substr( ".alt/" , zA )
// || substr( "/patch/" , zA )
// || substr( "/gen/" , zA )
)
then continue ;
__
if ( is_( B.z + B.a, "/j2h\n" ) && zA + j2h_L < ze )
then {
S_ "rm -rf %s", zA _Do
continue_ze
}
__
if ( ourRoot )
then {
char * e = ze ;
char * c = e-1 ;
while ( *c != '\n' ) c-- ; c++ ;
if ( cut < 0 )
{
char * s = e-1 ;
while ( c <= s && *s != '\\' ) s-- ; s++ ;
cut = s - c ;
}
create_path_under_ourRoot( ourRoot, cut, c );
continue_ze ;
}
__
if ( 10000 <= cfNr + 2 )
{
m_errMess "System: too many files" m_
ret_error
}
char * ext = B.z + B.a ; lower( ext );
if is_( eos( zA ) - 4, ".pdf" ) continue ;
if ( is_file( zA ) && not_substr( "/j2h", zA ) )
then {
KVStore st ; Surr s = ALL_ext.Get( ext, st );
if ( s )
then s_( st.c, "%u", file_len( zA ) + decNr( st.c ) );
else s_( st.c, "%u", file_len( zA ) );
ALL_ext.StrIns( 'e', ext, st.c );
}
__
if ( is_( ext, ".jsp" )
|| is_( ext, ".asp" ) // error in TestLink code
|| is_( ext, ".php" )
|| is_( ext, ".bas" )
|| is_( ext, ".vbs" )
|| is_( ext, ".cpp" )
|| is_( ext, ".cxx" )
|| is_( ext, ".hxx" )
|| is_( ext, ".hpp" )
|| is_( ext, ".hil" )
|| is_( ext, ".hrc" )
|| is_( ext, ".rc" )
|| is_( ext, ".rh" )
|| is_( ext, ".h1" )
|| is_( ext, ".h2" )
|| is_( ext, ".h3" )
|| is_( ext, ".pc" )
|| is_( ext, ".sch" )
|| is_( ext, ".c" )
|| is_( ext, ".c1" )
|| is_( ext, ".h" )
|| is_( ext, ".htm" ) // es kann *.htm.lnk geben !!!
|| is_( ext, ".html" )
|| is_( ext, ".css" )
|| is_( ext, ".cat" )
|| is_( ext, ".mdl" )
|| is_( ext, ".cs" ) // CSharp
|| is_( ext, ".js" )
|| is_( ext, ".pco" )
|| is_( ext, ".cob" )
|| is_( ext, ".cbl" )
// || is_( ext, ".hvr" )
|| is_( ext, ".cpy" )
|| is_( ext, ".lib" ) // wenn COBOL
)
then {
if is_( ext, ".js" ) js_functions( zA );
//
char c1 = B.z[ B.a+1 ] ;
char * e = ze ;
char * c = e-1 ;
while ( *c && *c != '/' && *c != '\n' ) c-- ;
char * nam = c+1 ;
c = zA ;
if ( ! *c || *c == '(' || substr( "/j2h/", c ) )
then {
continue_ze
}
__ unix_me( c ); lower( c );
if ( *c == '<' ) fErr2( zA, c )
if ( 0 )
if ( is_( ext, ".lib" )
)
{
// extract this code to ./xsrc (so that bugs can be
// analyzed faster on this smaller set of code):
char800 xsrc ;
char * s = c ; if ( s[1] == ':' ) s += 2 ;
while ( *s == '/' ) s++ ;
s_( xsrc, "xsrc/%s", s );
cp_file_( xsrc, c );
}
if ( *selector && ! substr( selector, c ) )
then {
continue_ze
}
if ( At( ext, ".cat" )
|| At( ext, ".mdl" )
)
then {
compare_code_rose = true ;
rBuffer X( c, "\n" ); X.copy_to( froMo );
continue_ze
}
else {
// zu C++ erst in CPP_to_htm():
// rBuffer X( c, "\n" ); X.copy_to( fcode );
}
to_incNames( zA );
anz_files += 1 ;
if ( At ( ext, ".htm" )
|| At ( ext, ".css" )
|| is_( ext, ".js" )
)
then {
c = zA ;
if not_substr( "j2h/", c )
{
char * s = eos( c )-1 ;
while ( c <= s && *s != '/' ) s-- ; s++ ;
char800 zz ;
s_( zz, "%s/htms/%i.hTm", j2h, cssNr );
FILE * f = create_mit_meta( zz, s );
rBuffer B( c, "" );
int comms = 0 ;
while ( B.find( 0, "<", f ) )
{
comms++ ; B.a++ ; fprintf( f, "<" );
}
htmComms += comms ;
fprintf( f, "\n</font><a name=eof></a><font face=\"Verdena,Arial\" size=1>"
"\n<font size=4>%s%s%s<br></font>"
"\n<font size=1><br>%i HTM Commands = <br>%s</font>"
, t1, s, t2, comms, gutLesbar( c ) );
__
close( f );
char400 xx ; s_( xx, "%s~%i", s, cssNr++ );
__
htms.StrIns( xx );
}
__
continue_ze
}
esif ( At ( ext, ".php" )
)
{
sourceNr( c, co_PHP )
}
esif ( At ( ext, ".cls" )
|| At ( ext, ".txt" )
|| At ( ext, ".do" )
)
{
sourceNr( c, co_BAS )
}
esif ( At ( ext, ".cob" )
|| At ( ext, ".cbl" )
|| At ( ext, ".cpy" )
|| At ( ext, ".pco" )
|| At ( ext, ".hvr" )
|| At ( ext, ".lib" )
)
{
zuCob = 1 ;
sourceNr( c, co_COB )
}
else {
if ( 10000 <= cfNr )
{
m_errMess "System: too many files" m_
ret_error
}
;
switch ( c1 )
{
Case 'j' : sourceNr( c, co_JSP )
Case 'a' : sourceNr( c, co_ASP )
Case 'b' : sourceNr( c, co_BAS )
Case 'v' : sourceNr( c, co_BAS )
Case 'c' : sourceNr( c, co_CPP )
Case 'h' : sourceNr( c, co_CPP )
Case 'r' : sourceNr( c, co_CPP )
Case 'p' : sourceNr( c, co_CPP ) // *.pc
Case 's' : sourceNr( c, co_CPP ) // *.sch = schema
Case 'x' : sourceNr( c, co_CPP ) // EXEC SQL in COBOL
Else : fErr
}
}
continue_ze
}
esif not_is_( ext, ".java" )
{
lower( ext );
if ( ! supNames.contains( ext ) )
{
printf( "\nignored: *%s", ext );
supNames.StrIns( ext );
}
continue_ze
}
char * e = B.z + B.a ; e[5] = 0 ;
char * c = e-1 ; while ( *c != '/' && *c != '\n' ) c-- ;
char * s = c ; while ( *c != '\n' ) c-- ; c++ ;
if ( *c == '(' ) continue_ze
*s = 0 ;
if ( e_see && not_selected( c ) ) continue_ze ;
if not_is_( c, xp + 6 )
{
s_( xp, "%i.%s", ++anz, c ); *xp = 'p' ;
sourceNr( xp, co_JAV )
char400 xx ; strcpy( xx, xp );
xx[5] = 0 ; packages.StrIns( 'e', xx + 6, xx );
}
*s = '/' ;
s_( xc, "%i.%s", ++anz, c ); *xc = 'c' ;
sourceNr( xc, co_JAV )
xc[5] = 0 ;
c += strlen( c ) - 5 ; *c = 0 ; while ( *c != '/' ) c-- ;
if ( *(++c) != '(' ) classes.StrIns( 'e', c, xc );
continue_ze
}
int ccfNr = cfNr ;
if ( ourRoot )
{
printf( "\no k - Archive = %s\n", ourRoot );
}
__
// -----------------------------------------------------------------------------
{
char800 toweb ; s_( toweb, "%s/index/to_web", rootDir );
char800 ifrom ; s_( ifrom, "%s/index" , rootDir );
char800 index ; s_( index, "%s/index" , j2h );
dir_exist( index );
if is_file( toweb )
{
__ B.open_rBuffer( toweb, "" );
if ( B.find( 0, "web=", 0 ) )
{
B.z[ B.e ] = '\n' ;
char * w = B.z + B.a + 4 ;
char * e = w ; to_( e, '\n' ) *e = 0 ;
while space( e[-1] ) *( --e ) = 0 ;
strcpy( projweb, w );
s_( ifrom, "%s/index", projweb );
}
}
if is_dir( ifrom ) cp_tree( index, ifrom, 1 );
char * e = eos( index );
s_( e, "/to_docu" ); Btree_ut u ; ourDocu = u.to_tree( index );
s_( e, "/to_code" ); ourCode = create( index );
}
// -----------------------------------------------------------------------------
extract_from_mak( rootDir );
// packages.traceAbs( "packages" ); fErr
// classes .traceAbs( "classes" ); fErr
{
FILE * fC = create( "check.jnt" );
int LOCA = 0 ; if ( LOC ) fErr
int i = -1 ;
// while ( ++i < ccfNr ) { _1( ccfNr-i ) if ( fArt[i] == co_JAV )
while ( ++i < ccfNr ) { if ( fArt[i] == co_JAV )
{
__ char * x = fNam[i] ; x[5] = 0 ;
if ( fNam[i][0] == 'p' )
then {
s_( xp, "%s/%s.htm", j2h, x );
LOCA = LOC ;
def_sample( x+6, x );
}
else {
s_( xp, "%s.htm", x );
JAVA_to_htm( xp, x + 6, f2, fC );
}
if substr( "AbstractEntity",fNam[i] + 7 ) sam[6] =fNam[i] ;
if substr( "AbstractSessio",fNam[i] + 7 ) sam[7] =fNam[i] ;
}}
close( fC ); // the project file for jivelint
Unlink( tmp1 )
Unlink( tmp2 )
__
// -----------------------------------------------------------------------------
char300 pck ; *pck = 0 ;
uint pNr = 0 ;
uint n1 = 0 ;
uint n2 = 0 ;
FILE * f = 0 ; char * ende = " neLoComm</font></BODY></HTML>\n" ;
KVStore st ; Surr s = PACKAGES.GetFirst( st );
while ( s )
{
char * x = in_str( '+', st.k ); *x = 0 ;
if not_is_( st.k, pck )
{
strcpy( pck, st.k );
if ( f )
{
fprintf( f, "\n<br><br><font size=1>%i neLoCode + %i%s", n1, n2, ende );
close( f );
}
s_( xp, "%s/p%i.htm", j2h, ++pNr );
f = create( xp ); fprintf( f,"%s"
"\n<a href=docu.htm TARGET=frame3>Documentation</a><br><br>"
"\nJava Classes and Interfaces in<br><font size=\"+1\">%s:"
"\n</font><br>", kopf, pck );
n1 = n2 = 0 ;
}
*x = '+' ;
if ( f ) fprintf( f, "\n%s", st.c );
x = in_str( '+', x+1 ); n1 += decNr( ++x );
x = in_str( '+', x+1 ); n2 += decNr( ++x );
s = PACKAGES.Next( st );
}
if ( f )
then {
fprintf( f, "\n<br><br><font size=1>%i neLoCode + %i%s", n1, n2, ende );
close( f );
}
}
// -----------------------------------------------------------------------------
uint epNr = 0 ;
{
s_( xp, "%s/packages.htm", j2h ); FILE * f = create( xp );
fprintf( f, kopf );
fprintf( f, "\n<a href=docu.htm TARGET=frame3><b>Overview</a> ."
"\n<a href=\"class.htm\" TARGET=\"frame3\">Map</a> ."
"\n<a href=\"ALLMe.htm\" TARGET=\"frame3\">Methods</a></b><br>"
"\nJava: <a href=\"exes.htm\" TARGET=\"frame2\">All main() Methods</a>"
"\n<br>Java: <a href=\"classes.htm\" TARGET=\"frame2\">"
"\nAll Classes and Interfaces in these</a><br>"
"\n<br><font size=\"+1\">Packages and/or Namespaces:</font><br>"
);
KVStore st ; Surr s = packages.GetFirst( st );
char300 xx ; strcpy( xx, st.k ); uint sam = strlen( xx );
while ( s )
{
int i = 0 ; while ( xx[i] && xx[i] == st.k[i] ) i++ ;
if ( i < sam ) sam = i ;
s = packages.Next( st );
}
while ( sam && xx[ sam-1 ] != '/' ) sam-- ;
s = packages.GetFirst( st );
s = PACKAGES.GetFirst( st ); uint pNr = 0 ;
char300 nspace ; *nspace = 0 ;
int L = -1 ;
char300 pck ; *pck = 0 ;
while ( s )
{
// Beachte: Btree nspaces ist hier noch leer (nicht existent)
char * x = in_str( '+', st.k ); *x = 0 ;
if ( L == -1 )
{
char * e = x ; while ( st.k < e && *e != '.' ) e-- ;
L = e+1 - st.k ;
}
if not_is_( pck, st.k )
{
if ( 0 < L && in_name( st.k[ L-1 ] ) ) L-- ;
strcpy( pck, st.k );
fprintf( f, "\n<br><a href=\"p%i.htm\" TARGET=\"frame2\">%s</a>"
, ++pNr, st.k + L );
}
*x = '+' ;
if(0) fprintf( f, "\n<br><a href=\"%s.htm\" TARGET=\"frame2\">%s</a>"
, st.c, st.k + sam );
// , st.c, st.k + nskip );
s = PACKAGES.Next( st );
}
fprintf( f, "\n</BODY></HTML>\n" );
close( f );
epNr = pNr ;
}
// -----------------------------------------------------------------------------
{
char1000 xx ;
s_( xx, "%s/pack.htm", j2h ); FILE * f = create( xx );
B.open_rBuffer( xp, "" );
// rB_( B, 0, "Java Folders" , f )
rB_( B, 0, "Packages and/or", f ) fprintf( f, "Packages:</font><br>" );
KVStore st ; Surr s = packages.GetFirst( st );
while ( s )
{
if is_( st.k, "app/eBean/bmp/DomainValues" ) fprintf( f, "\n<br>|" );
if is_( st.k, "app/eBean/cmp/DomainValues" ) fprintf( f, "\n<br>|" );
if is_( st.k, "app/eBean/pk" ) fprintf( f, "\n<br>|" );
if is_( st.k, "app/mBean" ) fprintf( f, "\n<br>|" );
if is_( st.k, "app/sBean" ) fprintf( f, "\n<br>|" );
corrSep( st.k, "/." );
fprintf( f, "\n<br><a href=\"%s.htm\" TARGET=\"frame2\">%s</a>"
, st.c, st.k );
s = packages.Next( st );
}
fprintf( f, "\n</BODY></HTML>\n" );
__
close( f );
}
// -----------------------------------------------------------------------------
{
char1000 sp ; int i = 0 ;
s_( sp, "%s/jsp.htm", j2h ); FILE * f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a><br>"
"\n<font size=\"+1\">JSP Pages:</font><br>"
"\n<br><a href=inc/incs_jsp.htm>JSP Includes</a><br>"
, kopf );
i = -1 ;
while ( ++i < ccfNr ) if ( fArt[i] == co_JSP )
{
char10 xx ; s_( xx, "%i", i );
jspNames.StrIns( 'i', fNam[i], xx );
}
i = -1 ; deRe = 0 ; tempNr = 0 ; dir_exist( temp );
while ( ++i < ccfNr ) if ( fArt[i] == co_JSP )
{
char * s = fNam[i] + strlen( fNam[i] ) - 4 ;
char * e = s ; *e = 0 ;
while ( *s != '/' ) s-- ;
fprintf( f, "\n<br><a href=\"%s.htm\" TARGET=frame3>%s</a>"
, nr2( i ), s+1 );
*e = '.' ;
uint de = JSP_to_htm( i, fNam[i] );
if ( deRe < de ) deRe = de ;
}
fprintf( f, "\n</font><br><br><font face=\"Verdena,Arial\" size=1>%i JSP Commands"
"\n</font></BODY></HTML>\n", anz_jsp_commands );
close( f );
JSP_uses(); show_the_JSP_includes(); rm_tree( temp );
__ }
// -----------------------------------------------------------------------------
{
char1000 sp ; int i = 0 ;
s_( sp, "%s/asp.htm", j2h ); FILE * f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a><br>"
"\n<font size=\"+1\">ASP Pages:</font><br>"
"\n<br><a href=inc/incs_asp.htm>ASP Includes</a><br>"
, kopf );
i = -1 ;
while ( ++i < ccfNr ) if ( fArt[i] == co_ASP )
{
char10 xx ; s_( xx, "%i", i ); aspNames.StrIns( 'i', fNam[i], xx );
}
i = -1 ; deRe = 0 ; tempNr = 0 ; dir_exist( temp );
while ( ++i < ccfNr ) if ( fArt[i] == co_ASP )
{
if ( ! fNam[i] ) fErr
char * s = fNam[i] + strlen( fNam[i] ) - 4 ;
char * e = s ; *e = 0 ;
while ( *s != '/' ) s-- ;
fprintf( f, "\n<br><a href=\"asp%i.htm\" TARGET=frame3>%s</a>"
, i, s+1 );
*e = '.' ;
uint de = ASP_to_htm( i, fNam[i] );
if ( deRe < de ) deRe = de ;
}
fprintf( f, "\n</font><br><br><font face=\"Verdena,Arial\" size=1>%i ASP Commands"
"\n</font></BODY></HTML>\n", anz_asp_commands );
close( f );
__
show_the_ASP_includes(); rm_tree( temp );
}
// ----------------///1---------------------------------------------------------
// ----------------///2---------------------------------------------------------
{
char1000 sp ; int i = 0 ;
__
s_( sp, "%s/bas.htm", j2h ); FILE * f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a><br>"
"\n<font size=\"+1\">VB Code:</font><br><br>"
"\n<a href=exec.htm>ALL Calls of ExecuteFile()<br>"
"\n<a href=crOb.htm>ALL Calls of CreateObject()<br>"
"\n<a href=mBox.htm>ALL Calls of MsgBox()<br>"
"\n<a href=case.htm>ALL Case Statements<br>"
"\n<a href=subs.htm>ALL Global Declarations:"
" Classes, Variables, Functions</a>"
"\n<br><br><br>Code Files are:<br>"
, kopf );
i = -1 ;
while ( ++i < ccfNr ) if ( fArt[i] == co_BAS )
{
char10 xx ; s_( xx, "%i", i ); basNames.StrIns( 'i', fNam[i], xx );
}
i = -1 ; deRe = 0 ; tempNr = 0 ; dir_exist( temp );
while ( ++i < ccfNr ) if ( fArt[i] == co_BAS )
{
if ( ! fNam[i] ) fErr
char * s = fNam[i] + strlen( fNam[i] ) - 4 ;
char * e = s ; *e = 0 ;
while ( *s != '/' ) s-- ;
fprintf( f, "\n<br><a href=\"bas%i.htm\" TARGET=frame3>%s</a>"
, i, s+1 );
*e = '.' ;
uint de = BAS_to_htm( i, fNam[i] );
if ( deRe < de ) deRe = de ;
}
fprintf( f, "\n</font><br><br><font face=\"Verdena,Arial\" size=1>%i VB Methods"
"\n</font></BODY></HTML>\n", anz_bas_commands );
close( f );
s_( sp, "%s/subs.htm", j2h ); f = create( sp );
fprintf( f, "%s" "\n<a href=\"subs.htm\" TARGET=\"frame2\"></a><br>"
"\n<font size=\"+1\">VB Public: </font>"
"\n<a href=#cls>Classes</a>,"
"\n<a href=#dim>Vars</a>,"
"\n<a href=#fun>Functions</a>,"
"\n<a href=#sub>Subs</a><br>"
, kopf );
KVStore st ; Surr s = subs.GetFirst( st );
char m = *st.k ;
uint cls = 0 ;
uint dim = 0 ;
uint sub = 0 ;
uint sec = 0 ; char X = 'A' - 1 ;
while ( s )
{
if ( m != *st.k )
{
m = *st.k ; fprintf( f, "<br>|" );
}
char c = *st.k ; if ( c == 'P' ) c = 'p' ;
cls += At( st.k, "Class " );
dim += At( st.k, "Dim " );
sub += At( st.k, "Public Sub " );
sec += At( st.k, "Public Function " );
if ( dim == 1 )
{
fprintf( f, "\n<a name=dim></a>" );
++dim ;
}
if ( cls == 1 )
{
fprintf( f, "\n<a name=dim></a>" );
++cls ;
}
if ( sec == 1 )
{
fprintf( f, "\n<a name=fun></a>" );
ABC( f, "U", "" );
++sec ;
}
if ( sub == 1 )
{
fprintf( f, "\n<br>|<a name=sub></a>" );
ABC( f, "sU", "" );
++sub ;
}
if ( sec && At( st.k, "Public Function " ) )
{
char n = st.k[ 16 ] ;
while ( X < n )
{
X = X+1 ;
if ( ( 'A' <= X && X <= 'Z' ) || ( 'a' <= X && X <= 'z' ) )
fprintf( f, "\n<a name=\"%c%c\"></a>"
, X, ( X == upper( X ) )? 'U' : 'L' );
}
}
esif ( sec && At( st.k, "Public Sub " ) )
{
char n = st.k[ 16 ] ;
while ( X < n )
{
X = X+1 ;
if ( ( 'A' <= X && X <= 'Z' ) || ( 'a' <= X && X <= 'z' ) )
fprintf( f, "\n<a name=\"%c%s\"></a>"
, X, ( X == upper( X ) )? 'sU' : 'sL' );
}
}
esif ( sec )
{
char n = 'z' + 1 ;
while ( X < n )
{
X = X+1 ;
if ( ( 'A' <= X && X <= 'Z' ) || ( 'a' <= X && X <= 'z' ) )
fprintf( f, "\n<a name=\"%c%c\"></a>"
, X, ( X == upper( X ) )? 'U' : 'L' );
}
sec = 0 ;
fprintf( f, "\n<br>|" );
}
fprintf( f, "\n<br><a href=bas%s>%c%s</a>", st.c, c, st.k+1 );
s = subs.Next( st );
}
close( f );
// wirklich erst hier: ---------------------------------------------------------
s_( sp, "%s/mBox.htm", j2h ); f = create( sp );
create_mBoxes_Verz( f );
close( f );
s_( sp, "%s/crOb.htm", j2h ); f = create( sp );
create_useObj_Verz( f );
close( f );
s_( sp, "%s/exec.htm", j2h ); f = create( sp );
create_execs_Verz( f );
close( f );
s_( sp, "%s/case.htm", j2h ); f = create( sp );
create_cases_Verz( f );
close( f );
}
// -----------------------------------------------------------------------------
char1000 sp ;
{
KVStore st ; Surr s = classes.GetFirst( st ); int anz = 0 ;
while ( s ) { anz++ ; s = classes.Next( st ); }
s_( xc, "%s/classes.htm", j2h ); FILE * f = create( xc );
char800 ourDoc ; s_( ourDoc, "ourDoc.htm" );
char800 ourALL ; s_( ourALL, "../../%s/1.htm", docuWeb );
if ( ! *docuWeb ) s_( ourALL, "1.htm" );
if ( doc_A ) s_( ourALL, "%s", doc_A );
if ( doc_D ) s_( ourDoc, "%s", doc_D );
fprintf( f, "\n%s<b><a href=\"../%s\" target=\"_parent\">ALL</a>"
"\n. <a href=\"%s\" target=\"_parent\">Code</a>"
"\n. <a href=\"%s\" TARGET=\"frame3\">Knowhow</a></b>"
"\n<br><a href=\"uses/0.htm\" target=\"frame3\">Where Java uses ...</a>"
"\n<br><a href=\"uses/00.htm\" target=\"frame3\">Where JSP uses ...</a>"
"\n<br><a href=\"nn.htm\" target=\"frame3\">Not imported ...</a>"
"\n<br><br><font size=\"+1\">%i Classes and Interfaces:<br></font>"
, kopf, ourALL, ourALL, ourDoc, anz );
s = classes.GetFirst( st );
while ( s )
{
fprintf( f, "\n<br><a href=\"%s.htm#toc\" TARGET=\"frame3\">%s</a>"
, st.c, st.k );
s = classes.Next( st );
}
fprintf( f, "\n<br><br><font size=1>" );
if ( custom_code )
{
fprintf( f, "%i Custom Code Slots<br>", custom_code );
KVStore st ; Surr s = custom_files.GetFirst( st );
while ( s )
{
printf( "\ncustomize: %s", st.k );
s = custom_files.Next( st );
}
}
fprintf( f, "\n%i neLoCode + %i LoComm</font></font></BODY></HTML>\n"
, LOC, ALoComm );
close( f );
int i = 0 ;
if ( ! *ourALL ) fErr
s_( sp, "%s/cpp.htm", j2h ); f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a><b>"
"\n<a href=\"../%s\" TARGET=\"_parent\">ALL</a> ."
"\n<a href=\"%s\" TARGET=\"_parent\">Code</a> ."
"\n<a href=\"%s\" TARGET=\"frame3\">Knowhow</a><br></b>"
"\n<br><a href=types.htm>ALL Class and Type Declarations</a>"
"\n<br><a href=class.htm>ALL Class Maps</a><br>"
"\n<br><a href=dialogs.htm#toc>C++ Dialogs</a>"
"\n<br><a href=cpps.htm>C++ Files</a>"
"\n<br><a href=inc/incs_cpp.htm>C++ Header Files</a>"
"\n<br><a href=funcs.htm>C++ Methods without a Class</a>"
"\n<br><a href=cppmains.htm>C++ Mains</a>"
"\n<br><a href=defines.htm>C++ Macros</a><br>"
"\n<br><a href=maks.htm>C++ Make Files</a>"
"\n<br><a href=fdep.htm>Dependencies via Include Relation</a><br>"
"\n<br><a href=ddxcode.htm>DDX Code</a>"
"\n<br><a href=notfound.htm>Includes not found, or not always found"
, kopf, ourALL, ourALL, ourDoc );
close( f );
s_( sp, "%s/cs.htm", j2h ); f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a><b>"
"\n<a href=\"../%s\" TARGET=\"_parent\">ALL</a> ."
"\n<a href=\"%s\" TARGET=\"_parent\">Code</a> ."
"\n<a href=\"%s\" TARGET=\"frame3\">Knowhow</a><br></b>"
"\n<br><a href=cscode.htm>ALL *.cs Files</a>"
, kopf, ourALL, ourALL );
close( f );
// -----------------------------------------------------------------------------
s_( sp, "%s/cpps.htm", j2h ); f = create( sp );
fprintf( f, "\n%s<a href=cpp.htm>C++</a>"
"\n<a name=top></a>%sAll C/C++ Files%s<font size=2>"
, kopf, t1, t2 );
i = -1 ;
while ( ++i < ccfNr ) if ( fArt[i] == co_CPP )
{
char10 xx ; s_( xx, "%i", i ); cppNames.StrIns( 'i', fNam[i], xx );
}
i = -1 ; deRe = 0 ; tempNr = 0 ; dir_exist( temp );
// S_ "timer 0" _Do
// while ( ++i < ccfNr ) if ( fArt[i] == co_CPP )
while ( ++i < cfNr ) if ( fArt[i] == co_CPP )
{
char * u = eos( fNam[i] ) - 1 ; while ( *u != '/' ) u-- ;
uint de = CPP_to_htm( i, fNam[i] );
if ( deRe < de ) deRe = de ;
}
// S_ "timer 1" _Do
uint files = 0 ;
s = cppNames.GetFirst( st ); Btree done, abstr ;
while ( s )
{ // fErr2( st.k, st.c )
if ( ! done.contains( st.k ) )
{
char * u = st.k + st.k_L - 1 ;
while ( st.k <= u && *u != '/' ) u-- ;
char100 uu ; strcpy( uu, ourVers( done, u+1, "", st.k ) );
char100 zz ; strcpy( zz, nr2( decNr( st.c ) ) );
if (0) fprintf( f, "\n<br><a href=\"%s.htm\" TARGET=frame3>%s</a>", zz, uu );
*uu = upper( *uu );
abstr.StrIns( 'e', uu, zz );
done.StrIns( st.k ); // wird weiter unten gebraucht
files++ ;
}
s = cppNames.Next( st );
}
__
s = abstr.GetFirst( st );
while ( s )
{
fprintf( f, "\n<br><a href=\"%s.htm\" TARGET=frame3>%s</a>", st.c, st.k );
s = abstr.Next( st );
}
__
fprintf( f, "\n</font><br><br><font face=\"Verdena,Arial\" size=1>"
"\n%u Files = %u neLoCode + %u LoHiddenComm"
"\n<br>Dialog Interface Code >= %u%%"
"\n<br><br>Code selected = %u kB"
"\n</font></BODY></HTML>\n"
, files, LOC_cpp, LoAutoCo, ( 100 * LOC_UI )/max( LOC_cpp, 1 )
, ( ( *selector )? codese : codesz )/1000 );
close( f );
show_the_CPP_includes(); rm_tree( temp );
// --------------------------------- show the cppsecs (= classes + methods):
s_( sp, "%s/m" , j2h ); create_css( sp );
s_( sp, "%s/funcs.htm", j2h ); FILE * M = create( sp );
s_( sp, "%s/class.htm", j2h ); FILE * C = create( sp );
s_( sp, "%s/ALLMe.htm", j2h ); FILE * A = create( sp );
__ cash_classComment();
__
// class .htm is the set of C++ Classes
// classes.htm is the set of Java Classes
fprintf( M, "\n%s<a href=cpp.htm>C++</a>"
"\n<a name=top></a>%sC++ Methods without a Class%s<font size=2>"
, kopf, t1, t2 );
__
fprintf( C, "\n%s<a name=top></a>%sClass Maps%s<font size=2>"
"\n<center>showing superclass and interface names (in Java)</center>"
"\n<center>resp. superclasses (in C++)<br><br>"
, kopf, t1, t2 );
__
FILE * m = 0 ; uint cNr = 0 ; // number of classes found
uint mfNr = 0 ;
char200 VName ; strcpy( VName, "-" ); int sp1 = 0 ;
uchar uc = 'A' - 1 ;
while ( ++uc <= 'z' ) nenne[ uc ] = 0 ;
s = cppsecs.GetFirst( st );
while ( s )
{
if ( *st.c == 'c' ) nenne[ ( uchar ) *st.k ] = 1 ;
s = cppsecs.Next( st );
}
uc = 'A' - 1 ;
while ( ++uc <= 'z' ) if ( nenne[ uc ] )
{
fprintf( C, "\n<a href=\"#%c_%u\">%c</a>", ( char )uc, uc, ( char )uc );
}
fprintf( C, "\n</center>" );
Buchst = 'A' ;
s = cppsecs.GetFirst( st );
__
{
Btree GM ; char100 prec ; strcpy( prec, "?" );
while ( s )
{
char * z = st.c ; to_( z, '#' ); int n = decNr( z+1 );
if ( *st.c == 'c' && At( st.k, prec ) )
then {
}
esif ( *st.c == 'c' )
{
char300 cc ; strcpy( cc, st.k );
char * e = cc ; while in_name( *e ) e++ ;
if At( e, ". " )
then {
e++ ; skip_space( e );
while in_name( *e ) e++ ;
}
while At( e, " . " )
{
e += 3 ; while in_name( *e ) e++ ;
}
*e = 0 ;
s_( prec, "%s ::", cc );
strcpy( VName, cc );
int cppNr = decNr( st.c + 4 ); ++cNr ;
if in_str( '<', cc ) fErr1( cc )
if (0) {
char * x = in_str( '<', cc ); if ( x ) *x = 0 ;
}
KVStore cn ; Surr s = nameNr.Get( cc, cn ); if (s) {{{
if ( ! s )
{
nameNr.traceAbs( "nameNr", stdout );
cppsecs.traceAbs( "cppsecs", stdout );
fErr3( cc, st.k, st.c );
}
typedefs.StrIns( 'e', cc, cn.c );
fprintf( C, "<br>" );
if ( Buchst < *cc )
{
Buchst = *cc ;
fprintf( C, "\n<a name=\"%c_%u\"></a>", Buchst, (uchar) Buchst );
}
fprintf( C, "\n<br>[ <a href=m/%s.htm>toc</a> ] "
"\n<a href=%s>%s</a>"
, cn.c, st.c+1, cc );
show_superClasses( C, cc, 0 );
s_( sp, "%s/m/%s.htm", j2h, cn.c );
char200 sk ; s_( sk, "1_%s~%s", cc, st.c+1 );
supNames.StrIns( 'e', sk, sp );
}}} }
esif ( CFunc.contains( st.c+1 ) )
{
sp1 = -1 ;
char * stk = substr( ":: ", st.k ) + 3 ;
char * x = ( stk-3 )? stk : st.k ;
char300 xk ; s_( xk, "%c%s" , toupper( *x ), x );
char300 xc ; s_( xc, "%i~%s", n, st.c+1 );
GM.StrIns( 'e', xk, xc );
}
L2: s = cppsecs.Next( st );
}
s = GM.GetFirst( st );
while ( s )
{
char * x = st.c ; to_( x, '~' )
fprintf( M, "\n<br><a name=%i></a><a href=%s>%s</a>"
, decNr( st.k ), x+1, st.k+1 );
s = GM.Next( st );
}
}
__
close( M );
close( C );
s = supNames.Getmin_GR( st, "1_" );
while ( s && At( st.k, "1_" ) )
{
char * x = in_str( '~', st.k ); if ( ! x ) fErr1( st.k )
*x = 0 ;
create_class_map( st.k + 2, st.c, x+1 );
*x = '~' ;
s = supNames.Getmin_GR( st, st.k );
}
s_( sp, "%s/types.htm", j2h ); f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sALL Class and Type Declarations%s<font size=2>"
, kopf, t1, t2 );
make_ABC( f, typedefs, 1, 0 );
s = typedefs.GetFirst( st );
while ( s )
{
__ char * e = eos( st.k );
if ( Buchst < *st.k )
then {
Buchst = *st.k ;
fprintf( f, "\n<br>|<a name=\"%c_%u\"></a>", Buchst, (uchar)Buchst );
}
if not_in_str( '.', st.c )
then {
fprintf( f, "\n<br><a href=m/%s.htm>%s</a>", st.c, st.k );
}
else fprintf( f, "\n<br><a href=%s>%s</a>", st.c, st.k );
s = typedefs.Next( st );
}
___
close( f );
s_( sp, "%s/cppmains.htm", j2h ); f = create( sp );
fprintf( f, "\n%s<a href=cpp.htm>C++</a>"
"\n<a name=top></a>%sC++ Main Entry Points%s<font size=2>"
, kopf, t1, t2 );
uint epAnz = 0 ; s = index.GetFirst( st );
while ( s )
{
if At( st.k, "main " )
{
epAnz++ ;
fprintf( f, "\n<br>%c .. <a href=%s>%s</a>", *st.c, st.c+2, st.k );
}
s = index.Next( st );
}
fprintf( f, "\n<br><br>These are %i main programs.", epAnz );
close( f );
___
s_( sp, "%s/defines.htm", j2h ); f = create( sp );
fprintf( f, "\n%s<a href=cpp.htm>C++</a>"
"\n<a name=top></a>%sC++ Macros%s<font size=2>"
, kopf, t1, t2 );
make_ABC( f, defines, 1, 0 );
s = defines.GetFirst( st );
while ( s )
{
if ( Buchst < *st.k )
{
Buchst = *st.k ;
fprintf( f, "\n<br>|<a name=\"%c_%u\"></a>", Buchst, (uchar) Buchst );
}
fprintf( f, "\n<br><a href=%s>%s", st.c, st.k );
s = defines.Next( st );
}
__
close( f );
s_( sp, "%s/ddxcode.htm", j2h ); f = create( sp );
fprintf( f, "\n%s<a href=cpp.htm>C++</a>"
"\n<a name=top></a>%sC++ DDX Modules ( for User Interface )%s"
"\n<font size=2>"
, kopf, t1, t2 );
s = DDX.GetFirst( st );
while ( s )
{
fprintf( f, "\n<br><a href=%s.htm>%s</a>", st.c, semiPath( st.k ) ); __
s = DDX.Next( st );
}
close( f );
__
s_( sp, "%s/notfound.htm", j2h ); f = create( sp );
fprintf( f, "\n%s<a href=cpp.htm>C++</a>"
"\n<a name=top></a>%sIncludes not found %s<font size=2>"
, kopf, t1, t2 );
s = noInc.GetFirst( st );
while ( s )
{
fprintf( f, "\n<br>%s", st.k );
s = noInc.Next( st );
}
close( f );
s_( sp, "%s/alles.htm", j2h ); f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sSize of ALL Content<font size=2>"
"\n%s<font size=3><br>"
"\n<pre>"
, kopf, t1, t2 );
s = ALL_ext.GetFirst( st );
while ( s )
{
___ char20 xx ; xx[15] = 0 ;
unsigned long L = decNr( st.c );
s_( xx + 11, "%i", 1000 + L % 1000 ); L = L/1000 ;
s_( xx + 7, "%i", 1000 + L % 1000 ); L = L/1000 ;
s_( xx + 3, "%i", 1000 + L % 1000 ); L = L/1000 ;
if ( L ) fErr1( L )
xx[3] = xx[7] = xx[11] = '.' ;
char * x = xx + 3 ; while in_str( *x, ".0" ) x++ ;
if ( ! *x ) *( --x ) = '0' ;
fprintf( f, "\nalles_%-5s %12s", st.k + 1, x );
s = ALL_ext.Next( st );
}
fprintf( f, "\n</pre>" );
close( f );
}
___
s_( sp, "%s/des.htm", j2h ); FILE * U = create( sp );
fprintf( U, "\n%s<a href=cpp.htm>C++</a>"
"\n<a name=top></a>%sDesign in UML%s<font size=2><br>"
, kopf, t1, t2 );
// -----------------------------------------------------------------------------
char * webs = "file://NT2/SL_MUC/public/info/eas/J2EE_generator/webs/xs" ;
create_ourDoc(); create_css( j2h );
if ( J2EE )
then {
int i = 0 ; while ( ++i <= 5 ) use_sample( i );
if ( sam[6] )
{
S_ "copy \"%s/%s.htm\" \"%s/ex6.htm\"", j2h, sam[6], j2h _Do
}
if ( sam[7] )
{
S_ "copy \"%s/%s.htm\" \"%s/ex7.htm\"", j2h, sam[7], j2h _Do
}
seeAufrufe( rootDir );
show_Aufrufe( *Aufrufe );
}
else {
s_( xx, "%s/packages.htm", j2h ); cp_file( tmp1, xx );
s_( xx, "%s/docu.htm", j2h ); FILE * f = create( xx );
rBuffer B( tmp1, "" ); rB_( B, 0, "<a " , f );
rB_( B, 1, "</a>", 0 );
char * erd = "" ;
if is_file( er2 )
then {
s_( xx, "%s/er1.htm", j2h ); cp_file( xx, er2 );
erd = "<a href=er1.htm>ERD</a>" ; // the ERD
S_ "cptree UMLDesComp %s/UMLDesComp", j2h _Do
done_UML = done_ ;
}
char * UML = "" ; char * UMLhtm = "xx_ALL.htm" ;
if is_file( UMLhtm )
then {
s_( xx, "%s/UML.htm", j2h ); cp_file( xx, UMLhtm );
UML =
"<br><a href=UML.htm>UML : Classes and Methods</a>"
"<br><a href=UMLDesComp/components.htm>UML : Components</a>"
"<br><a href=UMLDesComp/views.htm>UML : Views</a><br>"
"<br><a href=meter.htm>Metrics</a>" ;
fprintf( U, "\n%s", UML );
UML = "" ;
}
char1000 dep ; s_( dep, "%s/alles_dep", rootDir );
char * deps = "" ;
if is_file( dep )
then {
deps = "<a href=MoDep.htm>ALL Modules in the sense of "
"MS Visual Studio</a><br>" ;
show_Module_Dependencies( dep );
}
char * DLLf = "" ;
if ( DLLs )
then {
DLLf = "<a href=DLLs.htm>ALL DLL Load Commands</a><br>" ;
show_DLLs( *DLLs );
Delete( DLLs )
}
char * exps = "" ;
char * sta = "" ;
if ( Exceptions )
then {
exps = "<a href=exps.htm>ALL Exceptions Thrown</a><br>" ;
show_Exceptions( *Exceptions );
Delete( Exceptions )
}
if ( statics )
then {
sta = "<a href=stat.htm>ALL Statics</a><br>" ;
show_statics( *statics );
__
Delete( statics )
__ }
__ seeAufrufe ( rootDir );
__ show_Aufrufe( *Aufrufe );
__ show_notA ( supNames );
char * see_XML = "\n, <a href=dep.htm>XML</a>"
; char * see_JAVA = "\n, <a href=packages.htm>JAVA</a>"
; char * see_JS = "\n, <a href=jscr.htm>JS</a>"
; char * see_JSP = "\n, <a href=jsp.htm>JSP</a>"
; char * see_HTM = "\n, <a href=htm.htm>HTM</a>"
; char * see_CSS = "\n, <a href=css.htm>CSS</a>"
; char * see_ASP = "\n, <a href=asp.htm>ASP</a>"
; char * see_VB = "\n, <a href=bas.htm>VB</a>"
; char * see_UML = "\n, <a href=des.htm>UML<a>"
; char * see_CPP = "\n, <a href=cpp.htm>C++<a>"
; char * see_CS = "\n, <a href=csfs.htm>C#<a>"
; char * see_PHP = "\n, <a href=phc.htm>PHP<a>"
; char * see_COBOL = "\n, <a href=cobp.htm>COBOL</a>"
;
fprintf( f, "\n<font size=4>ALL Code %s</a>"
"\n<br><br>Views on: </font>"
"\n<a href=alles.htm>Size</a>%s%s%s%s%s%s%s%s%s%s%s%s%s"
"\n<br><br><a href=class.htm>ALL Class Maps</a><br>"
"\n<a href=roots.htm>ALL Most Specific Classes</a><br>"
"\n<a href=types.htm>ALL Class and Type Declarations</a><br>"
"\n%s%s%s%s%s"
"\n<br><a href=rufA.htm>ALL Function Calls: Callees</a>"
"\n<br><a href=rufe.htm>ALL Function Calls: Callers</a>"
"\n<br><a href=ALLf.htm>ALL Method Implementations</a><br>"
"\n<br><a href=fdep.htm>Dependencies via Include Relation</a><br>"
"\n<br><a href=trus.htm>Calls done by selected Methods</a>"
"\n<br><a href=notA.htm>Files not Analysed</a><br>"
"\n<br>%s"
, CodeName
, see_XML
, see_JAVA
, see_JS
, see_JSP
, see_HTM
, see_CSS
, see_ASP
, see_VB
, see_UML
, see_CPP
, see_CS
, see_PHP
, see_COBOL
, deps, sta, DLLf, exps, erd, UML );
char200 selected ; *selected = 0 ;
if ( *selector ) s_( selected, " : %s", selector );
close( f );
s_( xx, "%s/1.htm", j2h ); f = create( xx );
fprintf( f, "\n%s<center><br><br>"
"\n<font size=6>All Code</font>"
"\n<br><br><br><br><center>in the tree"
"\n<br><br><a href=f.htm>[ %s ]%s</a><br>"
"\n<br>%i Source Files as of %s<br><br><br>"
"\n<br><font size=5>%s</font><br>"
"\n<br><a href=f.htm><font size=16pt>%s</font></a><br><br>"
"\n<br><font size=5>%s</font>"
"\npresented by"
"\n<a href=\"mailto:ggreiter@gmx.de\">Gebhard Greiter's</a>"
"\nWeb Generator<br> <br>"
"\n<br>Documentation existing in Word, Powerpoint or simple text"
"\nfiles could also be given a Web presentation. Such papers"
"\nwould then be indexed and easy to browse (see e.g. the"
"\n<a href=\"http://greiterweb.de/spw/xs_WissDB/1/1.htm\">"
"WissDB</a> Project Web)."
"\n</font></center></BODY></HTML>"
, kopf, rootDir, selected, anz_of( co_undef ), cur_date
, thisWeb_0, thisWeb_t, thisWeb_s, webs );
close( f );
}
close( U );
cpp_Dialogs();
__
show_imports(); __ ADD_inc_structure();
__
create_exe_List( 0 ); // exe.htm Warum in C++ exe.htm + cppmain.htm
create_exe_List( 1 );
{
show_rootClasses();
show_incsMe_Relation();
code_vs_rose();
code_vs_ccom();
__
show_metrics();
__
FILE * f = create( "1.bat" );
char800 xx ; s_( xx, "%s/j2h/1.htm", rootDir ); dos_me( xx );
fprintf( f, "\"%s\"", xx );
//
fprintf( f, "\nrm \"%s/x_show\""
"\nrm \"%s/xx_*\""
"\nrm \"%s/incsme\""
"\nrm \"%s/x8\""
"\nrm \"%s/xNUL*\"", rootDir, rootDir, rootDir, rootDir, rootDir );
close( f );
// -----------------------------------------------------------------------------
// PHP Presentation:
// -----------------------------------------------------------------------------
{
char2000 phpMenu ; s_( phpMenu, "<center>"
"\n<p><a href=php.htm>Files</a>"
"\n. <a href=phc.htm>Classes</a>"
"<br></p></center>" );
char1000 sp ; int i = 0 ;
s_( sp, "%s/php.htm", j2h ); FILE * f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sPHP Files%s</font><br>"
"\n<br><a href=phpdep.htm>Dependencies</a><br>"
, kopf, phpMenu, t1, t2 );
i = -1 ;
while ( ++i < ccfNr ) if ( fArt[i] == co_PHP )
{
}
i = -1 ; deRe = 0 ; tempNr = 0 ; dir_exist( temp );
while ( ++i < ccfNr ) if ( fArt[i] == co_PHP )
{
if ( ! fNam[i] ) fErr
char * s = fNam[i] + strlen( fNam[i] ) - 4 ;
char * e = s ; *e = 0 ;
while ( *s != '/' ) s-- ;
fprintf( f, "\n<br><a href=\"%s/php/%s.htm\" TARGET=frame3>%s</a>"
, rootDir, nr2(i), s+1 );
*e = '.' ;
uint de = PHP_to_htm( i, fNam[i] );
if ( deRe < de ) deRe = de ;
}
fprintf( f, "\n</font><br><br><font face=\"Verdena,Arial\" size=1>%i PHP Commands"
"\n</font></BODY></HTML>\n", anz_php_commands );
close( f );
s_( sp, "%s/phc.htm", j2h ); f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sPHP Classes%s</font><br>"
"\n<br><a href=phcdep.htm>Dependencies</a><br>"
, kopf, phpMenu, t1, t2 );
if ( phpClasses )
{
KVStore st ; Surr s = phpClasses -> GetFirst( st );
while ( s )
{
fprintf( f, "\n<br> <a href=%s>%s</a>", st.c, st.k );
s = phpClasses -> Next( st );
}
}
close( f );
}
// -----------------------------------------------------------------------------
// COBOL Presentation darf erst jetzt - als Letztes - passieren:
// -----------------------------------------------------------------------------
{
char2000 cobMenu ; s_( cobMenu, "<center>"
"\n<p><a href=cobe.htm>Entry Points</a>"
"\n. <a href=cobfp.htm>File Dependencies</a>"
"\n. <a href=cobp.htm>Code Dependencies</a>"
"\n. <a href=cobm.htm>Ambiguous</a>"
"\n. <a href=cobns.htm>No Source for</a>"
"<br></p></center>" );
char1000 sp ; int i = 0 ;
s_( sp, "%s/cob.htm", j2h ); FILE * f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sCOBOL Code Modules%s</font><br>"
"\n<br><a href=cobdep.htm>Dependencies</a><br>"
, kopf, cobMenu, t1, t2 );
i = -1 ;
while ( ++i < ccfNr ) if ( fArt[i] == co_COB )
{
char10 xx ; s_( xx, "%i", i ); cobNames.StrIns( 'i', fNam[i], xx );
}
i = -1 ; deRe = 0 ; tempNr = 0 ; dir_exist( temp );
while ( ++i < ccfNr ) if ( fArt[i] == co_COB )
{
if ( ! fNam[i] ) fErr
char * s = fNam[i] + strlen( fNam[i] ) - 4 ;
char * e = s ; *e = 0 ;
while ( *s != '/' ) s-- ;
// Liste aller COBOL sections p + s:
if(0) fprintf( f, "\n<br><a href=\"cob%i.htm\" TARGET=frame3>%s</a>"
, i, s+1 );
*e = '.' ;
uint de = COB_to_htm( i, fNam[i] );
if ( deRe < de ) deRe = de ;
}
fprintf( f, "\n</font><br><br><font face=\"Verdena,Arial\" size=1>%i COB Commands"
"\n</font></BODY></HTML>\n", anz_cob_commands );
close( f );
// -----------------------------------------------------------------------------
__
see_EXEC_SQL_sections( tables_xxx );
__
// -----------------------------------------------------------------------------
char * m1 = "cobUses " ;
char * m2 = "cobUses.tr" ;
printf( "\nanz_elements( %s ) = %i", m1, cobUses.number_of_elements() );
// cobUses.traceAbs( "cobUses1" );
__ cobUses.become_deep_transitive(); // DBUse.traceAbs( "DBUse1" );
__ DBUse .become_deep_transitive(); // DBUse.traceAbs( "DBUse2" );
__
printf( "\nanz_elements( %s ) = %i", m2, cobUses.number_of_elements() );
see_table_synonyms( rootDir );
KVStore st ; Surr s = DBUse.GetFirst( st );
while ( s )
{
__ char * u = substr ( "~t", st.k );
if ( u && *st.k == 'p' )
{
char300 zz ; s_( zz, "1~%s", st.c );
KVStore um ;
if ( synonyms -> Get( u+6, um ) )
{
u[1] = 'u' ;
char300 xx ; s_( xx, "u .. %s~t .. %s", um.k, um.c );
cobUses.StrIns( 'e', xx, zz );
}
cobUses.StrIns( 'e', st.k, zz );
}
char * x = substr( "~c ..", st.k );
if ( x )
{
*x = 0 ;
char300 zz ; s_( zz, "%s~%s~st.c", x+1, st.k );
cursors -> StrIns( 'e', zz, st.c );
*x = '~' ;
}
s = DBUse.Next( st );
}
__
s = codefile -> GetFirst( st );
while ( s )
{
char * x = backtoSucc( st.c, "/" );
if ( x && not_is_( st.k, x ) )
{
char300 xx ; s_( xx, "%s~p .. %s", st.k, x );
char * e = in_str( '~', st.c );
if ( e ) *e = 0 ; else fErr2( st.k, st.c )
char300 zz ; s_( zz, "1~%s", st.c );
cobUses.StrIns( 'e', xx, zz );
}
s = codefile -> Next( st );
}
__ // DBUse.traceAbs( "DBUse" );
DB_Cursors( *cursors, cobMenu );
__
printf( "\nanz_elements( %s ) = %i", m1, cobUses.number_of_elements() );
__
cobUses.become_deep_transitive(); // hier nochmals
__
printf( "\nanz_elements( %s ) = %i", m2, cobUses.number_of_elements() );
// cobUses.traceAbs( "cobUses.Tr" );
__ cob_file_dependencies( cobMenu );
__ cob_data_dependencies( cobMenu );
__
FILE * A = 0 ;
FILE * B = 0 ;
Btree cobNrs, cobfor ;
char300 o1 ; *o1 = 0 ; s = cobUses.GetFirst( st );
char300 o2 ; *o2 = 0 ;
while ( s )
{
char * x = in_str( '~', st.k );
if ( ! x ) fErr
*x = 0 ;
if not_is_( o1, st.k )
{
strcpy( o1, st.k );
char * pos = nr2( cobNrs.retNr( 0, o1 ) );
cobNrs.StrIns( 'e', o1, " B" );
char * op = o1 ;
char300 xop ; KVStore xo ;
if ( in_index( o1 + 5, xo ) )
then {
s_( xop, "<a href=../../%s>%s</a>", xo.c+2, o1 );
strcpy( o2, xo.c+2 );
op = xop ;
}
else {
char4 cc ; s_( cc, "p" ); *cc = *o1 ;
not_indexed -> StrIns( 'e', o1, cc );
}
if ( B ) close( B );
s_( sp, "%s/cobB/%s.htm", j2h, pos ); B = create_( sp );
fprintf( B, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>"
"\n<font size=\"+1\">%s%s%s</font>"
"\n<br><center>is application of:</center><br>"
, kopf, t1, op, t2 );
index.StrIns( 'e', sp, "?../..~p .." );
}
char * z = in_str( '~', st.c );
if ( z )
then {
*z = 0 ;
char * stc = st.c ;
if is_( o2, z+1 ) stc = "is the source" ;
fprintf( B, "\n<br>%s <a href=../../%s> .. %s</a>", x+1, z+1, stc );
char300 xx ; s_( xx, "%s~%s", x+1, st.k );
*z = '~' ;
cobfor.StrIns( 'e', xx, st.c );
}
else {
fprintf( B, "\n<br>%s", x+1 );
}
*x = '~' ;
s = cobUses.Next( st );
}
if ( B ) close( B );
// cobfor.traceAbs( "cobfor" );
// -----------------------------------------------------------------------------
*o1 = 0 ;
s = cobfor.GetFirst( st );
while ( s )
{
__ char * x = in_str( '~', st.k );
if ( ! x ) fErr1( st.k )
*x = 0 ;
if not_is_( o1, st.k )
{
strcpy( o1, st.k );
if ( cobNrs.contains( o1 ) )
then cobNrs.StrIns( 'e', o1, "AB" );
else cobNrs.StrIns( 'e', o1, "A " );
char * pos = nr2( cobNrs.retNr( 0, o1 ) );
char * op = o1 ;
char300 xop ; KVStore xo ;
if ( in_index( o1 + 5, xo ) )
then {
s_( xop, "<a href=../../%s>%s</a>", xo.c+2, o1 );
op = xop ;
}
else not_indexed -> StrIns( 'e', o1, "p" );
if ( A ) close( A );
s_( sp, "%s/cobA/%s.htm", j2h, pos ); A = create_( sp );
fprintf( A, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>"
"\n<font size=\"+1\">%s%s%s</font>"
"\n<br><center>is needed for:</center><br>"
, kopf, t1, op, t2 );
index.StrIns( 'e', sp, "?../..~s .." );
}
char * z = in_str( '~', st.c );
if ( z ) *z = 0 ; else fErr2( st.k, st.c )
fprintf( A, "\n<br>%s <a href=../../%s> .. %s</a>", x+1, z+1, st.c );
*x = '~' ;
s = cobfor.Next( st );
}
if ( A ) close( A );
// -----------------------------------------------------------------------------
// cobNrs.StrIns( 'e', "p" );
// cobNrs.StrIns( 'e', "s" );
// cobNrs.StrIns( 'e', "t" );
// cobNrs.StrIns( 'e', "u" );
char * ss = " . " ;
char * st1 = ": Dependencies via the CALL Relation" ;
char * st2 = ": Access to Storage in Memory" ;
char * st3 = ": Access to Database Tables" ;
s_( sp, "%s/cobp.htm", j2h ); f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sCOBOL Code%s%s</font>"
"\n<br><center>p = Program or Entry %s"
"\n<a href=cobs.htm>s = Storage</a> %s"
"\n<a href=cobt.htm>t = Table</a> %s"
"\n<a href=curs.htm>c = Cursor</a>"
"\n</center>"
, kopf, cobMenu, t1, st1, t2, ss, ss, ss );
make_ABC( f, cobNrs, 1, 5 );
char m = '0' ;
char Art = 'p' ;
s = cobNrs.GetFirst( st );
while ( s )
{
if ( Art != *st.k )
{
Art = *st.k ;
if ( Art == 's' )
{
if ( f ) close( f );
s_( sp, "%s/cobs.htm", j2h ); f = create( sp );
fprintf( f, "%s"
"\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sCOBOL Code%s%s</font>"
"\n<br><center>"
"\n<a href=cobp.htm>p = Program or Entry</a> %s"
"\ns = Storage %s"
"\n<a href=cobt.htm>t = Table</a><br>"
"\n<br>For storage without a below no sources were found:"
"\n</center><br>"
, kopf, cobMenu, t1, st2, t2, ss, ss );
}
}
if ( m != st.k[5] )
{
m = st.k[5] ;
fprintf( f, "\n<a name=\"%c_%u\"></a><br>|", m, (uchar)m );
}
char * pos = nr2( s );
if ( st.k[1] )
{
if At( st.c, "AB" )
then {
fprintf( f, "\n<br><a href=cobA/%s.htm>above</a> ."
" <a href=cobB/%s.htm>below</a> .. %s"
, pos, pos, st.k );
}
esif At( st.c, "A " )
{
char * h = "<font color='#FFFFF'>below</font>" ;
fprintf( f, "\n<br><a href=cobA/%s.htm>above</a> . %s .. %s"
, pos, h, st.k );
if ( ! index.contains( st.k ) )
{
if ( st.k[1] != ' ' ) fErr1( st.k )
st.k[1] = 0 ;
index.StrIns( 'e', st.k + 5, st.k );
st.k[1] = ' ' ;
}
}
else {
char * h = "<font color='#FFFFF'>above</font>" ;
fprintf( f, "\n<br>%s . <a href=cobB/%s.htm>below</a> .. %s"
, h, pos, st.k );
}
}
s = cobNrs.Next( st );
}
__
close( f );
rm_tree( temp );
// -----------------------------------------------------------------------------
s_( sp, "%s/cobe.htm", j2h ); f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sAll COBOL Entry Points"
"\nor Data Structures%s</font><br>"
, kopf, cobMenu, t1, t2 );
make_ABC( f, index, 1, 0 ); m = *st.k ;
fprintf( f, "\n<br><center>"
"\nFor Entry Points shown in black no Source Code was found:"
"\n</center>" );
uint epAnz = 0 ; s = index.GetFirst( st );
uint osAnz = 0 ;
__
while ( s )
{
if ( st.c[1] && ( At( st.c + 2, "cob/" ) || At( st.k, "main " ) ) )
{
epAnz++ ;
if ( m != *st.k )
{
m = *st.k ;
fprintf( f, "\n<a name=\"%c_%u\"></a><br>|", m, (uchar)m );
}
fprintf( f, "\n<br>%c .. <a href=%s>%s</a>", *st.c, st.c+2, st.k );
}
if ( ! st.c[1] )
{
char * e = eos( st.k );
if ( not_At( e-4, ".cob" )
&& not_At( e-4, ".hvr" )
&& not_At( e-4, ".lib" )
&& not_At( e-4, ".pco" )
&& not_At( e-3, ".pc" )
&& not_At( e-2, ".c" )
)
{
epAnz++ ;
osAnz++ ;
fprintf( f, "\n<br>%s .. %s", st.c, st.k );
}
}
s = index.Next( st );
}
fprintf( f, "\n<br><br>These are %i COBOL entry points or data structures"
"\n(%i without source code)."
, epAnz, osAnz );
close( f );
__
// -----------------------------------------------------------------------------
Btree * forget = new Btree();
s_( sp, "%s/cobm.htm", j2h ); f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sMultiply specified COBOL Code Sections"
"\n%s</font><br>"
"\nTo forget code no longer in use, please run j2h.exe twice.<br>"
, kopf, cobMenu, t1, t2 );
make_ABC( f, *codefile, 1, 5 ); m = *st.k ;
uint nuAnz = 0 ; s = codefile -> GetFirst( st );
__
while ( s )
{
char * x = in_str( ',', st.k );
if ( x )
{
nuAnz++ ;
if ( m != st.k[5] )
{
m = st.k[5] ;
fprintf( f, "\n<a name=\"%c_%u\"></a>", m, (uchar)m );
}
char300 nusec ;
*x = 0 ; strcpy( nusec, st.k );
*x = ',' ;
s = codefile -> Get( nusec, st ); if ( !s ) fErr
char300 eins ; *eins = 0 ;
char300 zwei ; *zwei = 0 ;
while ( s && At( st.k, nusec ) )
{
x = in_str( '~', st.c );
if ( x ) *x = 0 ; else fErr1( st.c )
fprintf( f, "\n<br><a href=%s>%s</a> : %s", st.c, st.k, x+1 );
if ( ! *eins ) strcpy( eins, x+1 ); else
strcpy( zwei, x+1 );
if not_in_str( ',', nusec ) strcat( nusec, "," );
s = codefile -> Next( st );
}
fprintf( f, "\n<br>|" );
#define xfor( k,c ) { if not_is_( k,c ) forget -> StrIns( 'e', k, c ); }
if substr( "/patch/", eins ) xfor( zwei, eins )
esif substr( "/dks/" , eins ) xfor( zwei, eins )
esif substr( "/dks/" , zwei ) xfor( eins, zwei )
esif substr( "/kdg/" , eins ) xfor( zwei, eins )
esif substr( "/kdg/" , zwei ) xfor( eins, zwei )
#undef xfor
continue ;
}
if ( s ) s = codefile -> Next( st );
}
__
fprintf( f, "\n<br><br>These are %i multiply specified code sections.", nuAnz );
close( f );
__
hide_the_forget_files( *forget, rootDir );
__
// -----------------------------------------------------------------------------
s_( sp, "%s/cobns.htm", j2h ); f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sNo Sources found for ..."
"\n%s</font><br>"
, kopf, cobMenu, t1, t2 );
make_ABC( f, *not_indexed, 1, 5 ); m = *st.k ;
uint nsAnz = 0 ; s = not_indexed -> GetFirst( st );
while ( s )
{
nsAnz++ ;
if not_At( st.k, "t .." )
if not_At( st.k, "u .." )
if not_substr( ", redundant?", st.k )
{
if ( m != st.k[5] )
{
m = st.k[5] ;
fprintf( f, "\n<a name=\"%c_%u\"></a><br>|", m, (uchar)m );
}
fprintf( f, "\n<br>%s", st.k );
}
s = not_indexed -> Next( st );
}
fprintf( f, "\n<br><br>These are %i sections without source code.", nsAnz );
close( f );
}
// -----------------------------------------------------------------------------
__
printf( "\n"
"\no k - see 1.bat"
"\n |"
"\n %s/j2h/ALL_methods"
"\n %s/j2h/traceUs"
"\n %s/j2h/no_trace_for"
"\n |"
"\n %s: %s/rufe.htm"
"\n %s: %s/traceUs"
"\n %s: %s/alles_dep"
"\n %s: %s/alles_cpp"
"\n %s: UMLDesComp - use rose_1.exe to create it"
"\n %s: noAutoComment"
"\n %s: %s/classComm.htm"
"\n\n"
, rootDir
, rootDir
, rootDir
, done_ALLAufr , j2h
, done_traceUs , rootDir
, done_dep , rootDir
, done_cpp , rootDir
, done_UML , ( noAutoComment )? done_ : "not found"
, done_classComm , rootDir
) ;
}
done_1 = 1 ;
__
add_ALL_htm_entry_Links( ccfNr );
epNr = ADD_namespaces_to_packages( epNr );
LE_
/* private: */ uint Java2Htm :: ADD_namespaces_to_packages ( uint pNr
// -----------------------------------------------------------------------------
// Die Liste aller Java Packages werde erweitert um
// die Liste aller C# Namespaces:
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.ADD_namespaces_to_packages")
if ( ! nspaces ) ret( pNr )
char800 nsp ;
char800 nch ; s_( nch, "%s/packages.htm", j2h );
rBuffer B( nch, "" );
FILE * f = create( nch );
FILE * X = 0 ;
B.find( 0, "</BODY>", f );
char300 nspace ; *nspace = 0 ;
KVStore st ; Surr s = nspaces -> GetFirst( st );
while ( s )
{
char * x = in_str( ' ', st.k ); *x = 0 ;
if not_is_( st.k, nspace )
{
s_( nspace, st.k );
fprintf( f, "\n<br>C# <a href=\"p%i.htm\" TARGET=\"frame2\">%s</a>"
, ++pNr, nspace );
if ( X ) close( X );
s_( nsp, "%s/p%i.htm", j2h, pNr );
X = create( nsp);
fprintf( X, "\n%s<a href=docu.htmTARGET=frame3>Documentation</a><br><br>"
"\n<font size=+1>Nested Namespaces:</font><br>", kopf );
}
*x = ' ' ;
x = in_str( '~', st.k ); *x = 0 ;
fprintf( X, "\n<br><a href='%s#%s' TARGET=frame3>%s</a>", x+1, st.k, st.k );
*x = '~' ;
s = nspaces -> Next( st );
}
if ( X ) close( X );
B.copy_to( f );
close( f );
LE_ret( pNr )
/* private: */ void Java2Htm :: add_ALL_htm_entry_Links ( uint ccfNr
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.add_ALL_htm_entry_Links")
int i = -1 ;
while ( ++i < ccfNr ) if ( fArt[i] == co_COB )
{
if ( fArt[i] == co_COB ) add_htm_entry_Links( i );
}
LE_
/* private: */ void Java2Htm :: add_htm_entry_Links ( int j
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.add_htm_entry_Links")
char800 fn ; s_( fn, "%s/cob/%s.htm", j2h, nr2( j ) );
char * tmp = "xx_tmp" ; FILE * f = create( tmp );
rBuffer B( fn, "" );
while ( B.find( 1, ">C", f ) )
{
char * c = B.z + B.a + 1 ;
char * comm ;
if At( c, "CALL " ) comm = "CALL" ; else
if At( c, "COPY " ) comm = "COPY" ; else continue ;
char * e = c += 5 ;
while not_in_str( *e, "< \n\t" ) e++ ;
char m = *e ; *e = 0 ;
KVStore st ;
if ( index.Get( c, st ) && 7 < strlen( st.c ) )
then {
B.a += 6 ;
fprintf( f, ">%s</a> <a href=../%s>", comm, st.c + 6 );
}
else printf( "\nnoCodeFor: %s", c );
*e = m ;
}
close( f ); cp_file( fn, tmp ); unlink( tmp );
LE_
/* private: */ void Java2Htm :: see_table_synonyms ( char * srcRoot
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.see_table_synonyms")
if ( synonyms ) ret_
char800 xx ; s_( xx, "%s/tables.sch", srcRoot );
synonyms = new Btree();
if not_is_file( xx )
{
if ( ohne_tables ) ret_
{
m_errMess "User: no such file: %s" m_
xx, ret_error
}
}
rBuffer B( xx, "" );
while ( B.find( 1, "CREATE SYNONYM ", 0 ) )
{
char * c = B.z + B.a + 14 ; skip_space( c )
char * e = c ; to_space( e ) *e++ = 0 ;
char * x = in_str( '.', c );
if ( x ) c = x+1 ;
while not_At( e, "FOR " ) e++ ; e += 3 ; skip_space( e )
char * t = e ;
while ( not_space( *e ) && *e != ';' ) e++ ; *e = 0 ;
x = in_str( '.', t );
if ( x ) t = x+1 ;
if not_is_( c,t ) synonyms -> StrIns( 'e', c, t );
}
synonyms -> traceAbs( "synonyms" );
__
LE_
/* private: */ Surr Java2Htm :: in_index
// -----------------------------------------------------------------------------
(
char * nam
, KVStore & st
)
LB_("Java2Htm.in_index")
Surr s = index.Get( nam, st ); if ( s ) ret( s )
char100 n1 ; strcpy( n1, nam );
s = index.Get( upper( n1 ), st ); if ( s ) ret( s )
s = index.Get( lower( n1 ), st ); if ( s ) ret( s )
LE_ret( 0 )
/* private: */ void Java2Htm :: DB_Cursors
/* -----------------------------------------------------------------------------
Create the HTML page showing all DB Cursor specifications
-----------------------------------------------------------------------------
*/ (
Btree & curs
, char * cobMenu
)
LB_("Java2Htm.DB_Cursors")
curs.traceAbs( "cursors" );
char * ss = " . " ;
char800 sp ; s_( sp, "%s/curs", j2h ); dir_exist( sp );
s_( sp, "%s/curs.htm", j2h ); FILE * f = create( sp );
fprintf( f, "%s"
"\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sDatabase Cursors%s</font>"
"\n<br><center>"
"\n<a href=cobp.htm>p = Program or Entry</a> %s"
"\n<a href=cobt.htm>t = Table</a> %s"
"\nc = Cursor"
"\n<br></center>"
, kopf, cobMenu, t1, t2, ss, ss );
// make_ABC( f, accTable, 1, 5 );
uint cursNr = 0 ;
KVStore st ; Surr s = cursordef -> GetFirst( st );
while ( s )
{
char100 cur ; s_( cur, "c .. %s~", st.k );
char400 ab ; s_( ab, "<font color=#FFFFFF>above</font>" );
KVStore us ; Surr u = cursors -> Getmin_GE( us, cur );
uint anz = 0 ;
if ( u )
then {
s_( ab, "\n<a href=curs/%i.htm>above</a>", ++cursNr );
s_( sp, "%s/curs/%i.htm", j2h, cursNr );
FILE * A = create( sp );
fprintf( A, "%s" "\n<a href=../../%s TARGET=frame2></a>"
"\n<font size=\"+1\">%sc .. %s%s</font>"
"\n<br><center>is used in these code:</center><br>"
, kopf, st.c, t1, st.k, t2 );
while ( u && At( us.k, cur ) )
{
anz++ ;
char * x = in_str( '~', us.k );
if ( x ) *x = 0 ; else fErr1( us.k )
char * z = in_str( '~', x+1 );
if ( z ) *z = 0 ; else fErr1( x+1 )
fprintf( A, "\n<br>p .. <a href=../%s>%s</a>", us.c, x+6 );
*z = '~' ;
*x = '~' ;
u = cursors -> Next( us );
}
close( A );
}
else s_( ab, "<font color=#FFFFFF>above</font>" );
fprintf( f, "\n<br>%s . <a href=%s>spec</a> .. c .. %s ."
"\n<font size=1><b>%i</b></font>"
, ab, st.c, st.k, anz );
s = cursordef -> Next( st );
}
close( f );
LE_
/* private: */ void Java2Htm :: cob_data_dependencies
/* -----------------------------------------------------------------------------
data = relational data (SQL tables)
Pre-condition: cobUses is already transitive closure
-----------------------------------------------------------------------------
*/ (
char * cobMenu
)
LB_("Java2Htm.cob_data_dependencies")
Btree accTable ;
KVStore st ; Surr s = cobUses.GetFirst( st );
while ( s )
{
char * x = substr( "~t ..", st.k );
if ( x )
{
*x = 0 ;
char300 xx ; s_( xx, "%s~%s", x+1, st.k );
accTable.StrIns( 'e', xx, st.c );
*x = '~' ;
}
s = cobUses.Next( st );
}
// -----------------------------------------------------------------------------
str_set * grepper = new str_set();
Btree * tables = new Btree();
char * ss = " . " ;
FILE * A = 0 ;
char800 sp ; s_( sp, "%s/cobt.htm", j2h ); FILE * f = create( sp );
fprintf( f, "%s"
"\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sDatabase Tables%s</font>"
"\n<br><center>"
"\n<a href=cobp.htm>p = Program or Entry</a> %s"
"\nt = Table %s"
"\n<a href=curs.htm>c = Cursor</a>"
"\n<br>"
, kopf, cobMenu, t1, t2, ss, ss );
make_ABC( f, accTable, 1, 5 );
fprintf( f, "\n<br><a href=#stat>Statistics for</a> ."
"\n<a href=#unref>Tables not found in the Code</a> ."
"\n<a href=#contr>Contradictions in Domain Specification</a>"
"\n</center><br>" );
char100 o1 ; *o1 = 0 ;
uint fNr = 0 ;
uint anz = 0 ;
s = accTable.GetFirst( st ); char m = st.k[5] ;
while ( s )
{
if ( m != st.k[5] )
{
m = st.k[5] ;
fprintf( f, "\n<a name=\"%c_%u\"></a><br>|", m, (uchar)m );
}
char * x = in_str( '~', st.k );
if ( !x ) fErr1( st.k )
*x = 0 ;
if not_is_( st.k, o1 )
{
fNr++ ;
strcpy( o1, st.k );
char * h = "<font color='#FFFFF'>below</font>" ;
fprintf( f, "\n<br><a href=cobtA/%i.htm>above</a> . %s .. %s"
, fNr, h, st.k );
anz++ ; tables -> StrIns( 'i', st.k + 5, "-c" );
_1(st.k+11-11)
if ( A ) close( A );
s_( sp, "%s/cobtA/%i.htm", j2h, fNr ); A = create_( sp );
fprintf( A, "%s"
"\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>"
"\n<font size=\"+1\">%s%s%s</font>"
"\n<br><center>"
"\n<a href=../cobt.htm>p = Program or Entry</a> %s"
"\nt = Table %s"
"\n<a href=curs.htm>c = Cursor</a>"
"\n</center><br>"
, kopf, t1, o1, t2, ss, ss );
}
KVStore we ; char * h = st.c ;
if ( ! *h && index.Get( x+6, we ) ) h = we.c + 2 ;
char * h1 = in_str( '~', h );
while ( h1 ) { h = h1+1 ; h1 = in_str( '~', h ); }
fprintf( A, "\n<br><a href=../%s>access via</a> .. %s", h, x+1 );
// if in_str( '~', h ) fErr4( st.c, h, we.k, we.c )
if not_in_str( '.', x+6 ) grepper -> insert( x+6 );
*x = '~' ;
s = accTable.Next( st );
}
if ( A ) close( A );
__
tables_not_in_use( f, srcRoot, *tables, anz );
__
close( f );
__
delete( tables );
__ // accTable.traceAbs( "accTable" );
// -----------------------------------------------------------------------------
// create grepper trace:
// -----------------------------------------------------------------------------
__
grepper -> insert( "\nfile:" );
char800 ALLsrc ; s_( ALLsrc, "%s/alles_", srcRoot );
if(0)
if is_file( ALLsrc )
{
rBuffer B( ALLsrc, "\n" );
while ( B.find( 1, *grepper, 0 ) )
{
B.z[ B.e ] = '\n' ;
char * c = B.z + B.a ; while ( *c != '\n' ) c-- ;
char * e = ++c ; to_( e, '\n' ) *e = 0 ;
printf( "\ngr: %s", c );
*e = '\n' ;
}
}
delete( grepper );
__
LE_
/* private: */ void Java2Htm :: tables_not_in_use
/* -----------------------------------------------------------------------------
Let the reader know
- the name of all tables found in the DB schema but not in code
- as well as all contradictions found in domain specification.
-----------------------------------------------------------------------------
*/ (
FILE * f
, char * srcRoot
, Btree & tables
, uint anzCorefTables
)
LB_("Java2Htm.tables_not_in_use")
fprintf( f, "\n<a name=unref></a><br><br>"
"\n<h3>Tables not detected in algorithmic code:</h3>" );
if not_is_dir( srcRoot ) fErr1( srcRoot );
char800 xx ; s_( xx, "%s/tables.er1", srcRoot );
if not_is_file( xx )
{
fprintf( f, "\n<br>Not found: %s", xx );
ret_
}
uint anzUnrefTables = 0 ;
uint anzTables = 0 ;
rBuffer B( xx, "" );
while ( B.find( 1, "- ec ", 0 ) )
{
anzTables++ ;
char * c = B.z + B.a ;
while not_At( c, "E_" ) c++ ; c += 2 ;
char * e = c ; to_space( e ) *e = 0 ; upper( c );
if in_str( '.', c ) fErr1( c )
KVStore st ;
if ( tables.Get( c, st ) )
then {
*st.c = 's' ;
tables.StrIns( 'e', c, st.c );
}
else {
anzUnrefTables++ ;
fprintf( f, "\n<br>t .. %s", c );
tables.StrIns( 'e', c, "s-" );
}
}
fprintf( f, "\n<a name=stat></a><br>"
"\n<br>Number of Tables: %i"
"\n<br>Number of Tables in the DB Schema: %i"
"\n<br>Number of Tables not referred to from Code: %i"
"\n<br>Number of Tables referred to from Code: %i<br>"
, tables.number_of_elements()
, anzTables, anzUnrefTables, anzCorefTables );
tables.traceAbs( "tables" );
// -----------------------------------------------------------------------------
fprintf( f, "\n<a name=contr></a><br>"
"\n<h3>Contradictions in Domain Specifications:</h3>" );
KVStore st ; Btree * doms = new Btree();
B.open_rBuffer( xx, "" );
while ( B.find( 1, " d ", 0 ) )
{
char * c = B.z + B.a + 4 ; while not_At( c, "D_" ) c++ ; c += 2 ;
char * e = c ; to_space( e ) *e++ = 0 ;
char100 dom ; strcpy( dom, c );
c = e+1 ; skip_space( c )
char100 def ; e = def ; c-- ;
while ( *( ++c ) != '\n' )
{
if ( not_space( *c ) ) *e++ = *c ;
}
*e = 0 ;
KVStore st ;
if ( doms -> Get( dom, st ) )
then {
*st.c = 'n' ;
s_( eos( st.c ), ", %s", def );
}
else s_( st.c, "u~%s", def );
doms -> StrIns( 'e', dom, st.c );
}
Surr s = doms -> GetFirst( st );
while ( s )
{
if ( *st.c == 'n' )
{
fprintf( f, "\n<br>|<br><b>%s</b> : %s", st.k, st.c + 2 );
}
s = doms -> Next( st );
}
// doms -> traceAbs( "doms" );
delete( doms );
LE_
/* private: */ void Java2Htm :: cob_file_dependencies
/* -----------------------------------------------------------------------------
Pre-condition: cobUses is already transitive closure
codefile:[ p .. AMQ0GBR0 ][cob/0/88.htm#1~co/cobolsamples/amq0gbr0.cbl]
cobUses: [ p .. AMQ0GBR0~p .. MQCLOSE ][1~cob/0/88.htm#12]
-----------------------------------------------------------------------------
*/ (
char * cobMenu
)
LB_("Java2Htm.cob_file_dependencies")
__
char800 sp ;
Btree * fUses = new Btree();
Btree * above = new Btree();
Btree * below = new Btree();
KVStore st ; Surr s = cobUses.GetFirst( st );
while ( s )
{
__ char * x = in_str( '~', st.k );
if ( !x ) fErr1( st.k )
*x = 0 ;
KVStore st1, st2 ;
{
Surr s1 = codefile -> Get( st.k, st1 );
Surr s2 = codefile -> Get( x+1, st2 );
if (0) {
printf( "\ns1= %u --[%s]", s1, st.k );
printf( "\ns2= %u --[%s]", s2, x+1 );
}
char * un = "unavailable file(s)" ;
char * c1 = ( s1 )? in_str( '~', st1.c ) + 1 : un ;
char * c2 = ( s2 )? in_str( '~', st2.c ) + 1 : un ;
char * cc1 = st.k ;
char * cc2 = x+1 ;
KVStore xx1, xx2 ;
if ( ! synonyms ) fErr
if ( ! s1 && At( cc1, "u .." ) )
{
if ( synonyms -> Get( cc1, xx1 ) ) cc1 = xx1.c ;
}
if ( ! s2 && At( cc2, "u .." ) )
{
if ( synonyms -> Get( cc2, xx2 ) ) cc2 = xx2.c ;
}
if ( ! s1 && At( cc1, "t .." ) ) c1 = cc1 ;
if ( ! s2 && At( cc2, "t .." ) ) c2 = cc2 ;
if ( c1 == un && in_str( '.', cc1 ) ) c1 = cc1 ;
if ( c2 == un && in_str( '.', cc2 ) ) c2 = cc2 ;
if ( c1 == un ) printf( "\nno file 1 for[ %s ]", st.k );
if ( c2 == un ) printf( "\nno file 2 for[ %s ]", x+1 );
__
char800 uu ; s_( uu, "/%s", c2 + 5 );
if ( At( c2, "p .. " ) && substr( uu, c1 ) )
then {
}
else {
s_( uu, "%s~%s", c1, c2 );
fUses -> StrIns( 'e', uu, st.c );
above -> count( c2 );
below -> count( c1 );
}
__ }
*x = '~' ;
s = cobUses.Next( st );
__ }
__ // fUses -> traceAbs( "fUses" );
// -----------------------------------------------------------------------------
FILE * A = 0 ;
FILE * B = 0 ;
Btree cobNrs, cobfor ;
char300 o1 ; *o1 = 0 ; s = fUses -> GetFirst( st );
while ( s )
{
__ char * x = in_str( '~', st.k );
if ( ! x ) fErr
*x = 0 ;
if not_is_( o1, st.k )
{
strcpy( o1, st.k );
__ char * pos = nr2( cobNrs.retNr( 0, o1 ) );
__ cobNrs.StrIns( 'e', o1, " B" );
char * op = o1 ;
if ( B ) close( B );
s_( sp, "%s/cobfB/%s.htm", j2h, pos ); B = create_( sp );
fprintf( B, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>"
"\n<font size=\"+1\">%s%s%s</font>"
"\n<br><center>is application of:</center><br>"
, kopf, t1, op, t2 );
}
fprintf( B, "\n<br>%s", x+1 );
char300 xx ; s_( xx, "%s~%i", x+1, s ); // ~%i for uniqueness
__ cobfor.StrIns( 'e', xx, st.k );
*x = '~' ;
s = fUses -> Next( st );
__ }
if ( B ) close( B );
__ // cobfor.traceAbs( "cobfor.tr" );
// -----------------------------------------------------------------------------
Btree * zuA = 0 ;
*o1 = 0 ;
s = cobfor.GetFirst( st );
while ( s )
{
__ char * x = in_str( '~', st.k );
if ( ! x ) fErr1( st.k )
*x = 0 ;
if not_is_( o1, st.k )
{
strcpy( o1, st.k );
if ( cobNrs.contains( o1 ) )
then cobNrs.StrIns( 'e', o1, "AB" );
else cobNrs.StrIns( 'e', o1, "A " );
char * pos = nr2( cobNrs.retNr( 0, o1 ) );
char * op = o1 ;
if ( A )
{
end_zuA( A, *zuA ); close( A ); Delete( zuA );
}
s_( sp, "%s/cobfA/%s.htm", j2h, pos ); A = create_( sp );
fprintf( A, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>"
"\n<font size=\"+1\">%s%s%s</font>"
"\n<br><center>is needed for:</center><br>"
, kopf, t1, op, t2 );
zuA = new Btree();
}
zuA -> StrIns( 'e', st.c );
//
*x = '~' ;
__ s = cobfor.Next( st );
__ }
if ( A )
{
end_zuA( A, *zuA ); close( A ); Delete( zuA );
}
__
// -----------------------------------------------------------------------------
Btree * sortAbove = new Btree();
s_( sp, "%s/cobfp.htm", j2h ); FILE * f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sCOBOL File Dependencies%s</font><br>"
"\n<br><center><a href=cobsA.htm>"
"\n<font size=\"+1\"><b>sort by size of above</b></font></a><br>"
"\n<br>"
"\n<a href=cobp.htm>p = Program</a>"
"\n<a href=cobs.htm>s = Storage</a>"
"\n</center>"
, kopf, cobMenu, t1, t2 );
char m = '0' ;
// cobNrs.traceAbs( "cobNrs.tr" );
s = cobNrs.GetFirst( st );
while ( s )
{
__ char * pos = nr2( s );
char100 anz ; s_( anz, "%s <font size=1>: ", st.k );
KVStore nn ;
if ( below -> Get( st.k, nn ) ) s_( eos( anz ), "B%s ", nn.c );
if ( above -> Get( st.k, nn ) )
{
s_( eos( anz ), "A%s ", nn.c );
char300 mm ; s_( mm, "%-5s above %s", nn.c, st.k );
char300 ss ; s_( ss, st.k ); ss[30] = 0 ; // ensures sort order
s_( mm, "%i%s~%s.htm>above </a> %s, <b>A%s"
, decNr( nn.c ) - 100000, ss, pos, st.k, nn.c );
sortAbove -> StrIns( 'e', mm );
}
strcat( anz, "</font>" );
if At( st.c, "AB" )
then {
fprintf( f, "\n<br><a href=cobfA/%s.htm>above</a> ."
" <a href=cobfB/%s.htm>below</a> .. %s"
, pos, pos, anz );
}
esif At( st.c, "A " )
{
char * h = "<font color='#FFFFF'>below</font>" ;
fprintf( f, "\n<br><a href=cobfA/%s.htm>above</a> . %s .. %s"
, pos, h, anz );
}
else {
char * h = "<font color='#FFFFF'>above</font>" ;
fprintf( f, "\n<br>%s . <a href=cobfB/%s.htm>below</a> .. %s"
, h, pos, anz );
}
s = cobNrs.Next( st );
__ }
__
close( f );
delete( above );
delete( below );
delete( fUses );
// -----------------------------------------------------------------------------
s_( sp, "%s/cobsA.htm", j2h ); f = create( sp );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a>%s"
"\n<font size=\"+1\">%sCOBOL File Dependencies%s<center>"
"\n<br>sorted by Number of Entry Points in above"
"\n</font><br><br>"
"\n<a href=cobp.htm>p = Program</a>"
"\n<a href=cobs.htm>s = Storage</a>"
"\n</center>"
, kopf, cobMenu, t1, t2 );
s = sortAbove -> GetFirst( st );
while ( s )
{
char * x = in_str( '~', st.k );
if ( !x ) fErr1( st.k )
fprintf( f, "\n<br><a href=cobfA/%s</b>", x+1 );
s = sortAbove -> Next( st );
}
close( f );
// sortAbove -> traceAbs( "sortAbove" );
delete( sortAbove );
LE_
/* private: */ void Java2Htm :: end_zuA
// -----------------------------------------------------------------------------
(
FILE * f
, Btree & zuA
)
LB_("Java2Htm.end_zuA")
KVStore st ; Surr s = zuA.GetFirst( st );
while ( s )
{
fprintf( f, "\n<br>%s", st.k );
s = zuA.Next( st );
}
LE_
/* private: */ void Java2Htm :: showALLMethods (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.showALLMethods")
char800 sp ;
s_( sp, "%s/ALLMe.htm", j2h ); FILE * f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sALL Methods%s<font size=2>"
"\n<center>excluding <a href='constructors.htm'>Constructors</a>"
"\nand getter/setter methods<br><br>"
, kopf, t1, t2 );
KVStore st ; Surr s = ALLMeth.GetFirst( st );
uchar uc = 'A' - 1 ;
while ( ++uc <= 'Z' ) nenne[ uc ] = 0 ;
while ( s )
{
nenne[ ( uchar ) *st.k ] = 1 ;
s = ALLMeth.Next( st );
}
__
uc = 'A' - 1 ;
while ( ++uc <= 'Z' ) if ( nenne[ uc ] )
{
fprintf( f, "\n<a href=\"#%c\">%c</a>", ( char )uc, ( char )uc );
}
fprintf( f, "\n</center>" );
char Buchst = '?' ; s = ALLMeth.GetFirst( st );
while ( s )
{
if ( *st.k != st.k[1] )
if ( not_At( st.k+1, "get" ) && not_At( st.k+1, "set" ) )
{
if ( *st.k != Buchst )
{
Buchst = *st.k ;
fprintf( f, "\n<a name='%c'></a><br>|", Buchst );
}
char * x = st.k ; to_( x, '~' ) *x = 0 ;
fprintf( f, "\n<br><a href=%s>%s</a> -- %s", st.c, st.k+1, x+1 );
*x = '~' ;
}
s = ALLMeth.Next( st );
}
__
close( f );
// -----------------------------------------------------------------------------
s_( sp, "%s/constructors.htm", j2h ); f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sALL Constructors%s<font size=2><br><center>"
, kopf, t1, t2 );
uc = 'A' - 1 ;
while ( ++uc <= 'Z' ) if ( nenne[ uc ] )
{
fprintf( f, "\n<a href=\"#%c\">%c</a>", ( char )uc, ( char )uc );
}
fprintf( f, "\n</center>" );
Buchst = '?' ; s = ALLMeth.GetFirst( st );
__
while ( s )
{
if ( st.k[2] != '_' ) // not E_, B_, ...
{
__ char * x = in_str( '~', st.k );
if ( x ) *x = 0 ; else fErr1( st.k )
if ( x ) *x = 0 ; else goto L2 ;
char300 xx ; s_( xx, "%s ", st.k+1 );
__ if At( x+1, xx )
{
if ( *st.k != Buchst )
{
Buchst = *st.k ;
fprintf( f, "\n<a name='%c'></a><br>|", Buchst );
}
fprintf( f, "\n<br><a href=%s>%s</a>", st.c, st.k+1 );
}
*x = '~' ;
__ }
L2: s = ALLMeth.Next( st );
}
__
close( f );
LE_
/* private: */ void Java2Htm :: make_ABC
// -----------------------------------------------------------------------------
(
FILE * f
, Btree & tree
, BOOL center
, uint offset
)
LB_("Java2Htm.make_ABC")
if ( center ) fprintf( f, "<br><center>" );
uchar uc = '0' - 1 ;
while ( ++uc <= 'z' ) nenne[ uc ] = 0 ;
KVStore st ; Surr s = tree.GetFirst( st );
while ( s )
{
nenne[ ( uchar ) st.k[ offset ] ] = 1 ; s = tree.Next( st );
}
uint anz = 0 ;
uint found = 0 ;
char cnz = 'A' ;
uc = '0' - 1 ;
while ( ++uc <= 'z' ) if ( nenne[ uc ] )
{
// For MS Internet Explorer targets are case-insensitiv. Hence:
if ( anz++ == 0 )
{
if ( 'a' <= uc ) cnz = 'z' ;
esif ( 'A' <= uc ) cnz = 'Z' ;
else cnz = 'A' - 1 ;
}
if ( found && cnz < uc )
{
fprintf( f, "\n<br>" );
if ( 'a' <= uc ) cnz = 'z' ;
esif ( 'A' <= uc ) cnz = 'Z' ;
else cnz = '0' - 1 ;
}
if ( found && alphanum( uc ) )
{
fprintf( f, "\n<a href=\"#%c_%u\">%c</a>", (char)uc, uc, (char)uc );
}
found = 1 ;
}
fprintf( f, "\n</center>" );
Buchst = '0' ;
LE_
/* private: */ void Java2Htm :: show_incsMe_Relation (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.show_incsMe_Relation")
S_ "copy incsMe %s", j2h _Do
incsMe.to_file( "incsMe" );
char1000 sp ; s_( sp, "%s/", j2h ); char * ee = eos( sp );
s_( ee, "bo" ); create_css( sp );
s_( ee, "bf" ); create_css( sp );
s_( ee, "fdep.htm" ); FILE * f1 = create( sp );
fprintf( f1, "\n%s<a href=cpp.htm>C++</a><a name=top></a>"
"\n%sDependencies via Include Relation%s<font size=2><br>"
, kopf, t1, t2 );
KVStore st ; Surr s ; Btree sorter, ksorter ;
int i = -1 ;
while ( ++i < cfNr ) if ( fArt[i] == co_CPP || fArt[i] == co_JSP )
{
char * dies = rest_of_path( i, 2 );
char200 pre ; strcpy( pre, dies );
char * z = in_str( '/', pre );
if ( z ) z[1] = 0 ; else z = pre-1 ;
char100 bo ; s_( bo, "[ below ]" );
char100 bf ; s_( bf, "[ above ]" );
char20 xx ; s_( xx, "/%i=", i );
s = incsMe.Getmin_GR( st, xx );
if ( s && not_At( st.k, xx ) ) s = 0 ;
if ( s )
{
s_( bo, "[ <a href=%s.htm#eof>below</a> ]", nr2(i) );
}
// -----------------------------------------------------------------------
*xx = '>' ;
s = incsMe.Getmin_GR( st, xx );
if ( s && not_At( st.k, xx ) ) s = 0 ;
if ( s )
{
s_( bf, "[ <a href=bf/%i.htm>above</a> ]", i );
s_( ee, "bf/%i.htm", i );
FILE * f = create( sp );
fprintf( f, "\n%s"
"\n<a href=../asp.htm>ASP</a> ."
"\n<a href=../jsp.htm>JSP</a> ."
"\n<a href=../cpp.htm>C++</a>"
"\n<a name=top></a><br><br>"
"\n<b><a href=../%s.htm>%s %s</a></b>"
"\n%s is include for:%s<font size=2><br>"
, kopf, nr2( i ), pre, dies + ( z-pre ) + 1, t1, t2 );
while ( s && At( st.k, xx ) )
{
char * x = st.k ; to_( x, '=' )
int k = decNr( x+1 );
if ( k != i )
{
s_( st.c, "<a href=../%s.htm>", nr2( k ) );
ksorter.StrIns( 'e', rest_of_path( k, 2 ), st.c );
}
s = incsMe.Next( st );
}
show_sorted( f, ksorter, "</a>" );
close( f );
}
s_( st.c, "%s %s", bo, bf );
sorter.StrIns( 'e', dies, st.c );
}
show_sorted( f1, sorter, "" );
close( f1 );
LE_
/* private: */ void Java2Htm :: show_sorted
// -----------------------------------------------------------------------------
(
FILE * f
, Btree & sorter
, char * pst
)
LB_("Java2Htm.show_sorted")
KVStore st ; Surr s = sorter.GetFirst( st );
char200 pre ; strcpy( pre, "?" ); char * z = 0 ;
while ( s )
{
if not_At( st.k, pre )
{
strcpy( pre, st.k );
z = in_str( '/', pre ); if ( z ) z[1] = 0 ;
fprintf( f, "\n<a href=\"#%s\">%s</a><br>", pre, pre );
}
s = sorter.Next( st );
}
s = sorter.GetFirst( st );
strcpy( pre, "?" ); z = 0 ;
while ( s )
{
if not_At( st.k, pre )
{
strcpy( pre, st.k ); z = in_str( '/', pre );
if ( z ) z[1] = 0 ; else z = pre-1 ;
fprintf( f, "\n<br>|<a name=\"%s\"></a>", pre );
}
fprintf( f, "\n<br>%s <b>%s</b> %s%s", st.c, pre, st.k + ( z-pre ) + 1, pst );
sorter.Rem( st.k );
s = sorter.Getmin_GE( st, st.k );
}
LE_
/* private: */ char * Java2Htm :: rest_of_path
// -----------------------------------------------------------------------------
(
int fNr
, int anz_names // in rest of path
)
LB_("Java2Htm.rest_of_path")
if ( cfNr < fNr ) fErr2( cfNr, fNr )
LE_ret( rest_of_path( fNam[ fNr ], anz_names ) )
/* private: */ char * Java2Htm :: rest_of_path
// -----------------------------------------------------------------------------
(
char * n
, int names // in rest of path
)
LB_("Java2Htm.rest_of_path")
char * x = eos( n ) - 1 ;
while ( n < x && names )
{
if ( *x == '/' ) names-- ;
if ( names <= 0 ) { x++ ; break ; } else x-- ;
}
LE_ret( x )
/* private: */ void Java2Htm :: cpp_Dialogs (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.cpp_Dialogs")
char800 xx ; s_( xx, "%s/../alles_rc", j2h );
Btree dias ; rBuffer B( xx, "" );
s_( xx, "%s/dialogs.htm", j2h );
char * c = eos( xx ) - 1 ;
while ( xx <= c && *c != '/' ) c-- ; c++ ;
if ( ! *c ) fErr1( xx );
FILE * f = create( xx );
fprintf( f, "\n%s<a name=top></a><a href=#toc>toc</a>,"
"\n<a href=cpp.htm>C++</a>,"
"\n<a href=../1.htm>ALL</a>,"
"\n%s%s%s<pre class=c><font size=2>", kopf, t1, c, t2 );
uint DIA = 0 ;
while ( B.find( 1, "IDD_", f ) )
{
char * c = B.z + B.a ;
char * e = c ; B.z[ B.e ] = '\n' ;
while ( *e != '\n' && not_At( e, " DIALOG " ) ) e++ ;
if ( *e == '\n' ) continue ;
e = c ; while in_name( *e ) e++ ; *e = 0 ;
char40 zz ; s_( zz, "%i", ++DIA );
dias.StrIns( 'e', c, zz );
fprintf( f, "\n</pre><a name=%i></a>%s"
"\n<font size=4><a href=#toc>%s</a></font>"
"\n<pre class=c><font size=2><hr>"
, DIA, to_1B, c );
B.find( 1, "\n", 0 );
}
fprintf( f, "\n</pre><a name=toc></a>%s"
"\n<h3>There are %u Dialogs:</h3><p class=c>", to_1B, DIA );
KVStore st ; Surr s = dias.GetFirst( st );
while ( s )
{
fprintf( f, "\nDialog <a href=#%s>%s</a><br>", st.c, st.k + 4 );
s = dias.Next( st );
}
fprintf( f, "\n<br><font size=1>%i Dialogs</font>", DIA );
close( f );
LE_
/* private: */ void Java2Htm :: extract_from_mak ( char * rootDir
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.extract_from_mak")
char800 mak ; s_( mak, "%s/alles_mak", rootDir );
str_set such ; such.insert( "file: " );
such.insert( ".obj" );
such.insert( "\nPROJ=" );
such.insert( "\nALL : \"" );
such.insert( "\n#" );
char100 comp ; *comp = 0 ;
char * m1 ;
Btree modu ;
Btree maks ; rBuffer B( mak, "" ); uint anzf = 0 ; int offset = 0 ;
while ( B.find( offset, such, 0 ) )
{
char * c = B.z + B.a ; offset = 1 ;
char * e = c ;
if ( *c == 'f' && c[-1] == '\n' )
then {
anzf++ ;
strcpy( comp, "?" );
to_( e, '\n' ) *e = 0 ; strcpy( mak, c + 6 ); *e = '\n' ;
m1 = eos( mak ) - 1 ;
while ( mak < m1 && *m1 != '/' ) m1-- ; m1++ ;
}
esif At( c+1, "PROJ=" )
{
char * e = c += 6 ; to_space( e ); *e = 0 ;
printf( "\ncomp: %s = %s", comp, c );
if is_( comp, "?" ) strcpy( comp, c );
}
esif At( c+1, "ALL :" )
{
if not_is_( comp, "?" ) continue ;
char * e = c += 8 ; to_( e, '"' ); *e = 0 ;
c = e-1 ; while not_in_str( *c, "\"\\" ) c-- ; c++ ;
strcpy( comp, c );
}
esif ( c[1] == '#' )
{
B.find( 1, "\n", 0 );
offset = 0 ; continue ;
}
esif At( c-1, ").obj" ) continue ;
esif not_is_( comp, "?" )
{
c[4] = 0 ;
char * o = c-1 ;
while ( *o && not_in_str( *o, "/\\ \n" ) ) o-- ; o++ ;
if ( *o && not_in_str( *o, "*.\"" ) )
if not_is_( o, m1 )
{
char * u = in_str( '.', comp );
if ( u ) upper( u+1 );
char800 xx ; s_( xx, "%s~%s~%s", o, comp, m1 );
maks.StrIns( 'e', xx, mak );
*u = 0 ;
s_( xx, "%s %s~%s", u+1, comp, m1 );
*u = '.' ;
modu.StrIns( 'e', xx, mak );
}
}
}
// -----------------------------------------------------------------------------
s_( mak, "%s/maks.htm", j2h ); FILE * f = create( mak );
char * br = "<br> " ;
fprintf( f, "\n%sLoading the table on this page can be slow"
"\n<a name=top></a>%sBinary Code Structure<font size=2>"
"\n%s<font size=2><br>"
"\n<a href=bins.htm>ALL Make File Results: DLL, LIB, EXE</a><br></p>"
"\n<table><thead><tr>"
"\n<td><b>Compilation Unit%s<b></td>"
"\n<td><b>Goes into%s</b></td>"
"\n<td><b>Via Make File%s</td>"
"\n</tr></thead><tbody>"
, kopf, t1, t2, br, br, br );
int Ln = 0 ;
int L = 0 ;
KVStore st ; Surr s = maks.GetFirst( st ); char100 xx ; *xx = 0 ;
uint anz = 0 ;
while ( s )
{
char * x = st.k ; to_( x, '~' ) *x = 0 ;
char * z = x+1 ; to_( z, '~' ) *z = 0 ;
char * stk = st.k ;
if not_is_( xx, st.k )
then {
anz++ ; strcpy( xx, st.k );
}
else stk = "" ;
fprintf( f, "\n<tr><td>%s</td><td>%s</td><td>%s</td></tr>", stk, x+1, z+1 );
if ( L < ( Ln = strlen( x+1 ) ) ) L = Ln ;
*x = *z = '~' ;
s = maks.Next( st );
}
//
br = "__________________________________________________________________" ;
br = eos( br );
fprintf( f, "\n<tr><td>%s</td><td>%s</td><td>%s</td></tr>", br-40, br-L, br-15 );
fprintf( f, "\n</table>"
"\n<font size=1> %i obj files, %i mak files</font>"
, anz, anzf );
printf( "\n %i obj files, %i mak files\n", anz, anzf );
close( f );
// -----------------------------------------------------------------------------
s_( mak, "%s/bins.htm", j2h ); f = create( mak );
fprintf( f, "\n%s<a name=top></a>%sMake File Results: DLL, LIB, EXE<font size=2>"
"\n%s<font size=2><br>"
"\n<a href=maks.htm>Compilation Units (and where we need them)</a>"
"\n<br></p><table><thead><tr><br></p>"
"\n<td><b>Result%s<b></td>"
"\n<td><b>Created via%s</td>"
"\n</tr></thead><tbody>"
, kopf, t1, t2, br, br );
char10 pre ; *pre = 0 ;
L = 0 ;
s = modu.GetFirst( st );
while ( s )
{
char * x = st.k ; to_( x, '~' ) *x = 0 ;
if not_is( pre, st.k, 4 )
{
fprintf( f, "\n<tr><td>|</td><td></td></tr>" );
memcpy( pre, st.k, 4 );
}
fprintf( f, "\n<tr><td>%s</td><td>%s</td></tr>", st.k, x+1 );
Ln = strlen( st.k ); L = max( L, Ln );
*x = '~' ;
s = modu.Next( st );
}
fprintf( f, "\n<tr><td>%s</td><td>%s</td></tr>", br - 4 - L, br - 20 );
fprintf( f, "\n</table>"
"\n<font size=1> %i obj files, %i make files</font>"
, anz, anzf );
close( f );
LE_
/* private: */ void Java2Htm :: create_traceUs
// -----------------------------------------------------------------------------
(
char * trUs
, char * cpp
)
LB_("Java2Htm.create_traceUs")
done_cpp = done_ ;
FILE * f = create( trUs );
rBuffer B( cpp, "" );
while ( B.find( 0, "ON_COMMAND", 0 ) )
{
B.z[ B.e ] = ')' ;
char * c = B.z + B.a + 10 ;
char * e = c ; to_( e, ')' )
while not_in_name( *e ) e-- ; e[1] = 0 ; B.a = e - B.z ;
c = e ; while in_name( *c ) c-- ;
if ( *( ++c ) ) fprintf( f, "\n+%s", c );
}
close( f );
LE_
/* private: */ void Java2Htm :: show_ALLAufrufe
// -----------------------------------------------------------------------------
(
Btree & calls
, Btree & API
, Btree & traceUs
)
LB_("Java2Htm.show_ALLAufrufe")
char1000 sp ; s_( sp, "%s/rufA", j2h ); create_css( sp );
s_( sp, "%s/rufe", j2h ); create_css( sp );
char300 sec ; *sec = 0 ; uint secNr = 0 ; str_set done ;
uint anzAPI = 0 ;
KVStore st, se ; Surr s = calls.GetFirst( st );
Btree sortClass ;
Btree sortFunc ;
while ( s )
{
char * d = st.c ; to_( d, '~' ) *d = 0 ;
if ( not_in_str( ':', st.k ) && not_is_( sec, st.c ) )
{
strcpy( sec, st.c );
char300 xx ; strcpy( xx, st.k );
char * x = st.k ; to_( x, '~' ) *x = 0 ;
char300 uu ; s_( uu, "%s~%i", st.k, ++secNr );
if ( traceUs.contains( st.k ) )
{
char300 zz ; s_( zz, "= %s~%i", st.k, secNr );
traceUs.StrIns( 'e', zz );
}
if ( 1 || API.contains( sec ) || substr( "On", sec ) )
{
s_( sp, "%s/rufe/%i.htm", j2h, secNr );
FILE * f1 = create( sp );
//
fprintf( f1, "\n%s<a name=top></a>"
"\n<a href=../trus.htm>Calls done by</a>"
"\n%s%s<font size=2>%s<font size=2>"
"\n<br>%s"
"\n<br>Calls done by <b>%s</b> :<br><br>"
, kopf, t1, sec, t2, d+1, sec );
uint anz = callees( f1, calls, st.k, 0, done );
done.rm_see( 1, 1, 0 );
char20 zz ; s_( zz, "%i~%i", secNr, anz );
sortClass.StrIns( 'e', sec, zz );
char * x = st.c ; while in_name( *x ) x++ ;
char m = *x ; *x = 0 ;
char10 uz ; s_( uz, "%i~%s", anz-1, st.c );
*x = m ;
sortFunc.StrIns( 'i', uu, uz );
close( f1 );
}
calls.Get( xx, st );
}
s = calls.Next( st );
}
__
// -----------------------------------------------------------------------------
s_( sp, "%s/trus.htm", j2h ); FILE * T = create( sp );
fprintf( T, "\n%s<a name=top></a>%sSelected Methods<font size=2>"
"\n%s<font size=2><br>"
, kopf, t1, t2 );
s = traceUs.Getmin_GR( st, "=" );
while ( s && *st.k == '=' )
{
char * x = st.k ; to_( x, '~' ) *x = 0 ;
fprintf( T, "\n<a href=rufe/%s.htm>%s</a><br>", x+1, st.k + 2 );
*x = '~' ;
s = traceUs.Next( st );
}
close( T );
// -----------------------------------------------------------------------------
s_( sp, "%s/rufA.htm", j2h ); FILE * f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sMethods actually called are:<font size=2>"
"\n%s<font size=2><br>"
, kopf, t1, t2 );
char100 aufr ; *aufr = 0 ; FILE * f1 = 0 ;
int anz1 = 0 ;
int anz2 = 0 ;
int cNr = 0 ;
s = AufrufAus.GetFirst( st );
if ( 1 )
while ( s )
{
if not_substr( " as ", st.k )
{
char * x = st.k ; while not_in_name( *x ) x++ ;
char * z = in_str( '~', x );
if ( z )
{
*z = 0 ;
x = substr( "::", x );
if ( x && not_in_str( '=', st.k ) )
{
char300 xx ; s_( xx, "%s as %s~%s", x+3, st.k, z+1 );
if ( strlen( xx ) > 250 ) fErr2( st.k, xx )
AufrufAus.StrIns( 'e', xx, st.c ); *z = '~' ;
AufrufAus.Get( st.k, st );
}
*z = '~' ;
}
}
s = AufrufAus.Next( st );
}
s = AufrufAus.GetFirst( st );
while ( s )
{
char * x = st.k ; to_( x, '~' ) *x = 0 ;
if not_is_( st.k, aufr )
{
if ( f1 )
{
char * x = substr( " as ", aufr );
fprintf( f1, "\n<br><br><font size=1>Only these %i Methods call</font>"
"\n<br><b>%s</b>"
, anz2, (( x )? x + 4 : aufr ) );
close( f1 );
}
s_( aufr, st.k ); // erst hier, aber auch schon hier !!!
char * x1 = substr( " as ", aufr );
x1 = ( x1 )? x1 + 4 : aufr ;
s_( sp, "%s/rufa/%i.htm", j2h, ++cNr ); f1 = create( sp );
fprintf( f1, "\n%s<a name=top></a>%s%s<font size=2>"
"\n%s<font size=2><br><center><b>is called in</b></center><br>"
, kopf, t1, x1, t2 );
fprintf( f, "\n<br><a href=rufA/%i.htm>%s</a>", cNr, aufr );
anz1++ ; anz2 = 0 ;
}
KVStore ca ; Surr s1 = cppsecs.Get( x+1, ca );
if ( ! s1 || ! *ca.c )
then fprintf( f1, "\n<br>%s", x+1 );
else fprintf( f1, "\n<br><a href=../%s>%s</a>", ca.c+1, ca.k );
anz2++ ;
s = AufrufAus.Next( st );
}
fprintf( f, "\n<br><br><font size=1>%i Functions actually called</font>", anz1 );
close( f ); if ( f1 ) close( f1 );
// -----------------------------------------------------------------------------
s_( sp, "%s/rufe.htm", j2h ); f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sCalls done by Selected Methods<font size=2>"
"\n%s<font size=2><br>"
"\n<a href=rufGUI.htm>Sort GUI Methods</a><br>"
"\n<a href=rufAPI.htm>Sort API Methods</a><br><br>"
//
//
//
, kopf, t1, t2 );
s = sortClass.GetFirst( st ); int anz = 0 ;
while ( s )
{
anz++ ;
char * x = st.c ; to_( x, '~' ) *x = 0 ;
fprintf( f, "\n<a href=rufe/%s.htm>%s</a><font size=1>, %s</font><br>"
, st.c, st.k, x+1 );
s = sortClass.Next( st );
}
fprintf( f, "\n<br><font size=1>%i Selected Methods</font>", anz );
close( f );
// -----------------------------------------------------------------------------
__
s_( sp, "%s/rufAPI.htm", j2h ); FILE * A = create( sp );
s_( sp, "%s/rufGUI.htm", j2h ); FILE * G = create( sp );
fprintf( A, "\n%s<a name=top></a>%sCalls done by API Methods<font size=2>"
"\n%s<font size=2><br>"
"\n<a href=rufe.htm>Sort by Class Name</a><br><br>"
, kopf, t1, t2 );
fprintf( G, "\n%s<a name=top></a>%sCalls done by GUI Methods<font size=2>"
"\n%s<font size=2><br>"
"\n<a href=rufe.htm>Sort by Class Name</a><br><br>"
, kopf, t1, t2 );
s = sortFunc.GetFirst( st );
int anzA = 0 ;
int anzG = 0 ;
while ( s )
{
char * x = st.k ; to_( x, '~' ) *x = 0 ;
char * c = st.c ; to_( c, '~' ) *c = 0 ;
if ( At( st.k, "On" ) && isupper( st.k[2] ) )
then {
if ( c[1] == 'V' && isupper( c[2] )
|| substr( "View", c+1 )
|| substr( "VW" , c+1 )
|| At( c+1, "CSDPW" )
|| At( c+1, "CSecUserInfo" )
|| At( c+1, "CPicEdit" )
|| At( c+1, "rcPrt" )
|| At( c+1, "ObjectTreeCtrl" )
|| At( st.k, "OnCancel" )
|| At( st.k, "OnAbout" )
|| At( st.k, "OnPaint" )
|| At( st.k, "OnPrint" )
|| At( st.k, "OnPreview" )
|| At( st.k, "OnLogConf" )
)
then goto L4 ; // because this is not Business Logic
f = G ; anzG += 1 ;
}
else {
f = A ; anzA += 1 ;
}
fprintf( f, "\n<a href=rufe/%s.htm>%s</a><font size=1> %s, %s</font><br>"
, x+1, st.k, st.c, c+1 );
L4: *x = '~' ;
s = sortFunc.Next( st );
}
fprintf( A, "\n<br><font size=1>%i API Methods</font>", anzA );
fprintf( G, "\n<br><font size=1>%i GUI Methods</font>", anzG );
close( A );
close( G );
__
LE_
/* private: */ uint Java2Htm :: callees
// -----------------------------------------------------------------------------
(
FILE * f
, Btree & calls
, char * func
, uint deep
, str_set & done
)
LB_("Java2Htm.callees")
if ( ! f ) fErr1( f )
if ( 0 < deep ) ret( 1 ) // wirklich 1
if ( 1 < deep ) ret( 1 ) // wirklich 1
if ( done.element( func ) )
{
if ( deep == 0 ) fErr
ret( 0 )
}
done.insert( func ) -> see = 1 ;
char300 sec ; s_( sec, "%s~", func );
uint L = strlen( sec );
KVStore st, sm ; Surr s = calls.Getmin_GE( st, sec );
uint anz = 1 ;
while ( s && At( st.k, sec ) )
{
for ( int i = 0 ; i <= deep ; i++ ) fprintf( f, ".   " );
char * x = st.k + L ;
___ _1(x)
// aufgerufen.traceAbs( "aufgerufen" );
aufgerufen->StrIns( 'e', x );
___
fprintf( f, "%s<br>", x );
anz += callees( f, calls, x, deep + 1, done );
s = calls.GetNext( st );
}
___
LE_ret( anz )
/* private: */ void Java2Htm :: einAufruf
/* -----------------------------------------------------------------------------
register this call
-----------------------------------------------------------------------------
*/ (
char * caller
, char * Aufrufer
, char * x
, Btree & calls
, Btree & AufrufAus
)
LB_("Java2Htm.einAufruf")
if ( ! caller ) ret_
if ( substr( "LoadLib", x ) ) printf( "\nLoadLib in %s", caller );
char300 xx ; s_( xx, "%s~%s", x, caller );
AufrufAus.StrIns( 'e', xx );
char * u = eos( caller ) - 1 ;
while ( caller <= u && in_name( *u ) ) u-- ;
s_( xx, "%s~%s", u+1, x );
xx[ 252 ] = 0 ; calls.StrIns( 'e', xx, Aufrufer );
if ( caller < u )
{
s_( xx, "%s~%s", caller, x );
xx[ 252 ] = 0 ; calls.StrIns( 'e', xx, Aufrufer );
}
LE_
/* private: */ void Java2Htm :: ALLAufrufe
/* -----------------------------------------------------------------------------
Finde alle Methodenaufrufe und sage, aus welcher Methode sie kommen
-----------------------------------------------------------------------------
*/ (
char * rootDir
, Btree & traceUs
)
LB_("Java2Htm.ALLAufrufe")
str_set such ;
char1000 cpp ; s_( cpp, "%s/alles_cpp" , rootDir );
char1000 auf ; s_( auf, "%s/aufrufe" , j2h );
if not_is_file( cpp ) ret_
done_ALLAufr = done_ ;
// -----------------------------------------------------------------------------
such.insert( "\nfile: " );
such.insert( "{" );
such.insert( "}" );
such.insert( "(" );
such.insert( "//" );
such.insert( "/*" );
such.insert( "\"" );
such.insert( "LB_(" );
such.insert( "LE_" );
such.insert( "LM_" );
such.insert( "#def" ); // zu LB_, LE_, LM_
int k = 0 ;
__
char400 Aufrufer ; Btree API ; __
char400 func ; Btree APIm ; __
char * caller = 0 ; Btree * calls = new Btree(); __
BOOL found = 1 ; int Lauf = 1 ; match_rec * mr ; int kk = -1 ;
BOOL API_code = 0 ;
char300 fn ; *fn = 0 ; int offset = 0 ;
rBuffer B( cpp, "" );
while ( mr = B.find( offset, such, 0 ) )
{
B.getmore( 8000 );
char * c = B.z + B.a ; offset = 1 ;
if ( B.e <= B.a ) fErr2( B.e,B.a )
if(0) BB { _2( fn, k ); traceStr( "zzz", c, 400 ); fflush(stdout); }
if ( *c == '"' )
then {
_3( B.z + B.a, B.z + B.e, c )
char * c1 = c ;
__ skip_str( c, B.z + B.e ); char m = c[-1] ; c[-1] = 0 ;
if ( substr( "SELECT", c1 )
|| substr( "UPDATE", c1 )
|| substr( "DELETE", c1 )
|| substr( "CREATE", c1 )
|| substr( "DROP" , c1 )
)
then {
// caller calls SQL:
einAufruf( caller, Aufrufer, "SQL", *calls, AufrufAus );
}
c[-1] = m ;
B.a = c - B.z ; offset = 0 ; continue ;
}
esif ( *c == '(' )
{
__ if ( c[-1] == ' ' ) continue ;
if At( c-1, "'('" ) continue ;
if At( c, "( \"SELECT\", c1 )" ) // wegen dieser Source hier
{
rB_( B, 1, "then", 0 ) continue ;
}
char * x = c+1 ; skip_space( x );
if ( At( x, "//" ) || At( x, "/*" ) ) continue ;
__ __
x = c ;
__ _1(B.file) char * e = scanner.skip_Arguments( c+1, B.z + B.e );
__
if not_in_str( *e, ";{" ) continue ;
__
if ( *e == '{' )
then {
__ k++ ;
while space( x[-1] ) x-- ;
char * xm = x-- ; char m = *xm ; *xm = 0 ;
while in_name( *x ) x-- ;
char * N = x+1 ; //
char * n = x+1 ;
while space( *x ) x-- ;
if At( x-1, "::" )
{
x -= 2 ; while space( *x ) x-- ;
while in_name( *x ) x-- ;
n = x+1 ;
}
while space( *n ) n++ ;
BOOL skip = false ;
switch ( *n )
{
Case 'A' : skip = is_( n, "ASSERT" );
Case 'T' : skip = At ( n, "TRACE" );
Case 'i' : skip = is_( n, "if" );
Case 'f' : skip = is_( n, "for" );
Case 'r' : skip = is_( n, "return" );
Case 'c' : skip = is_( n, "catch" );
Case 'w' : skip = is_( n, "while" );
Case 'v' : skip = is_( n, "void" );
Case 's' : skip = (
is_( n, "switch" ) ||
is_( n, "static" ) );
}
if ( *n && ! skip && ! digit( *n ) )
then {
API_code = ( At( N, "On" ) ||
( substr( "GP_" , fn )
&& not_substr( "View" , fn )
&& not_substr( "VW" , fn )
&& not_substr( "Dlg" , fn )
&& not_At( N, "xn" ) ) );
if ( API_code ) API.StrIns( 'e', N );
strcpy( func, norm( n ) );
if substr( "CLI", fn )
then {
s_( eos( func ), "_CLI" );
}
caller = func ; // _1( caller )
kk = k++ ;
s_( Aufrufer, "%s~%s", caller, fn );
k-- ; B.a = e - B.z ;
}
else B.a = e+1 - B.z ;
* xm = m ; continue ;
}
__ if ( *c != '(' ) fErr
}
esif ( *c == '#' )
{
rB_( B, 1, "\n", 0 ) offset = 0 ; continue ;
}
esif ( *c == 'L' )
{
if At( c, "LB_(" )
then {
B.a-- ; memcpy( c-2, " {", 2 );
offset = 4 ; continue ;
}
esif At( c, "LE_" )
{
to_( c, '\n' ) *c = '}' ;
}
esif At( c, "LM_" )
{
B.find( 1, "\n", 0 ); B.z[ --B.a ] = '}' ;
}
else fErr1( c )
// _1( B.z + B.a + 0 )
}
if ( *c == '\n' )
then {
k = 0 ;
caller = 0 ;
char * e = c += 7 ; to_( e, '\n' ) *e = 0 ;
unix_me( c );
char * x = substr( "/msg/SDepot", c ); if ( x ) c = x + 5 ;
strcpy( fn, c );
B.a = e-1 - B.z ; *e = '\n' ;
}
esif ( *c == '(' && caller )
{
*c = 0 ;
char * x = c-1 ; while space( *x ) x-- ; x[1] = 0 ;
while in_name( *x ) x-- ;
if ( ! *( x+1 ) ) continue ;
if ( API_code && not_At( x+1, "On" ) )
{
APIm.StrIns( 'e', x+1 );
}
char * a = x ; while space( *a ) a-- ;
if At( a-1, "::" )
{
x = a-2 ; while space( *x ) x-- ;
while in_name( *x ) x-- ;
}
x++ ; skip_space( x )
char * e = eos( x ) - 1 ;
while space( *e ) *e-- = 0 ;
BOOL skip = 0 ;
switch ( *x )
{
Case 'i' : skip = is_( x, "if" );
Case 'd' : skip = is_( x, "delete" );
Case 'A' : skip = is_( x, "ASSERT" );
Case 'T' : skip = is_( x, "Trace" );
Case 'r' : skip = is_( x, "return" );
Case 'c' : skip = is_( x, "catch" );
Case 'w' : skip = is_( x, "while" );
Case 'l' : skip = is_( x, "length" );
Case 'S' : skip = is_( x, "SetLength" );
Case 'f' : skip = (
is_( x, "for" ) ||
is_( x, "fprintf" ) );
Case 'm' : skip = (
is_( x, "memcpy" ) ||
is_( x, "memset" ) );
Case 'M' : skip = (
is_( x, "METHOD" ) ||
is_( x, "MQTHROW" ) ||
is_( x, "MTHROW" ) ||
is_( x, "MSGTHROW" ) ||
is_( x, "MSGQTHROW" ) );
Case 's' : skip = (
is_( x, "switch" ) ||
is_( x, "strcat" ) ||
is_( x, "strcpy" ) ||
is_( x, "strlen" ) ||
is_( x, "strncpy" ) ||
is_( x, "sprintf" ) ||
is_( x, "static" ) );
}
if ( *x && ! skip && ! digit( *x ) )
{
x = norm( x );
//
//
//
einAufruf( caller, Aufrufer, x, *calls, AufrufAus );
found = 1 ;
}
}
esif ( *c == '{' )
{
k++ ;
continue ;
}
esif ( *c == '}' )
{
if ( --k < kk ) caller = 0 ;
if ( k < 0 ) k = 0 ;
if ( k < 0 ) fErr1( k )
continue ;
}
esif ( *c == '#' || At( c, "//" ) )
{
to_( c, '\n' )
B.a = c-1 - B.z ; continue ;
}
esif At( c, "/*" )
{
rB_( B, 1, "*/", 0 );
continue ;
}
if ( k < 0 )
then {
if ( caller )
then {
traceStr( "ZZZ", c, 200 );
fErr3( caller, k, mr -> str )
}
else k = 0 ;
}
B.a = c - B.z ;
}
// API.traceAbs( "API" ); fErr
// -----------------------------------------------------------------------------
KVStore st ; Surr s = APIm.GetFirst( st );
while ( s )
{ //
API.Rem( st.k ); s = APIm.Next( st );
}
// API .traceAbs( "API" );
// APIm .traceAbs( "APIm" );
// calls -> traceAbs( "CALL" );
// -----------------------------------------------------------------------------
show_ALLAufrufe( *calls, API, traceUs );
if ( 0 )
{
KVStore st ; Surr s = calls -> GetFirst( st );
while ( s )
{
s = calls -> Next( st );
}
}
LE_
/* private: */ BOOL Java2Htm :: API_code
// -----------------------------------------------------------------------------
(
char * fn
, char * N
)
LB_("Java2Htm.API_code")
then ret( 1 )
LE_ret( 0 )
/* private: */ char * Java2Htm :: norm ( char * funcName
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.norm")
char * x = funcName ;
char * z = Norm ;
while in_name( *x ) *z++ = *x++ ;
if ( *x )
{
while ( *x && not_in_name( *x ) ) x++ ;
*z++ = ' ' ;
*z++ = ':' ;
*z++ = ':' ;
*z++ = ' ' ;
while ( *x ) *z++ = *x++ ;
}
*z = 0 ;
LE_ret( Norm )
/* private: */ void Java2Htm :: seeAufrufe ( char * rootDir
/* -----------------------------------------------------------------------------
Trace all function calls such that the name NNN of the function
is listed in 'rootDir/seeAufrufe as a line \n+NNN
-----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.seeAufrufe")
str_set such ;
char1000 fu1 ; s_( fu1, "%s/ALL_funcs" , rootDir );
char1000 fu2 ; s_( fu2, "%s/traceUs" , rootDir );
char1000 fu3 ; s_( fu3, "%s/alles_cpp" , rootDir );
char1000 api ; s_( api, "%s/api" , j2h );
char1000 auf ; s_( auf, "%s/traceUs" , j2h );
if ( not_is_file( fu2 ) && is_file( fu3 ) ) create_traceUs( fu2, fu3 );
Btree TraceUs ;
if not_is_file( fu2 )
{
ALLAufrufe( rootDir, TraceUs ); ret_
}
done_traceUs = done_ ;
FILE * f = create( auf ); fprintf( f, "\n traceUs:\n" );
rBuffer B( fu2, "\n" );
while ( B.find( 0, "\n+", 0 ) )
{
char * c = B.z + B.a + 2 ;
char * e = c ; to_( e, '\n' ) *e-- = 0 ;
while space( *e ) *e-- = 0 ;
TraceUs.StrIns( 'e', c );
Aufrufe -> StrIns( 'e', c );
such.insert( c ) -> see = 1 ;
fprintf( f, "%s\n", c );
B.a = e - B.z ; *e = '\n' ;
}
close( f );
ALLAufrufe( rootDir, TraceUs );
LE_
/* private: */ void Java2Htm :: show_DLLs ( Btree & tree
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.show_DLLs")
char1000 sp ; s_( sp, "%s/DLLs.htm", j2h ); FILE * f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sWhere DLLs are loaded<font size=2>"
"\n%s<font size=2><br>"
, kopf, t1, t2 );
KVStore st ; Surr s = tree.GetFirst( st ); int anz = 0 ;
while ( s )
{
char * x = st.k ; to_( x, '~' ) *x = 0 ;
fprintf( f, "\n[ <a href=%s><<</a> ] %s<br>", x+1, st.k );
anz++ ; *x = '~' ;
s = tree.Next( st );
}
fprintf( f, "\n<br><font size=1>%i DLL Calls in total:</font>", anz );
close( f );
LE_
/* private: */ void Java2Htm :: show_notA ( Btree & tree
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.show_notA")
char1000 sp ; s_( sp, "%s/notA.htm", j2h ); FILE * f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sFiles not Analysed<font size=2>"
"\n%s<font size=2><br>"
, kopf, t1, t2 );
KVStore st ; Surr s = tree.GetFirst( st ); int anz = 0 ;
while ( s )
{
if ( *st.k == '.' ) fprintf( f, "\n%s<br>", st.k );
s = tree.Next( st );
}
close( f );
LE_
/* private: */ void Java2Htm :: show_statics ( Btree & tree
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.show_statics")
char1000 sp ; s_( sp, "%s/stat.htm", j2h ); FILE * f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sStatics<font size=2>"
"\n%s<font size=2><br>"
, kopf, t1, t2 );
KVStore st ; Surr s = tree.GetFirst( st ); int anz = 0 ;
while ( s )
{
char * x = in_str( '~', st.k );
if ( !x ) fErr1( st.k )
*x = 0 ;
char * n = st.k + 7 ; skip_space( n ); to_space( n );
skip_space( n )
char m = n[-1] ; n[-1] = 0 ;
if(0) if not_substr( "THIS_FILE", x+1 )
{
fprintf( f, "\n%s <a href=%s>%s</a><br>", st.k, x+1, n );
}
anz++ ; *x = '~' ; n[-1] = m ;
s = tree.Next( st );
}
fprintf( f, "\n<br><font size=1>%u Statics</font>", anz );
close( f );
LE_
/* private: */ void Java2Htm :: show_Aufrufe ( Btree & tree
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.show_Aufrufe")
char1000 sp ; s_( sp, "%s/aufr", j2h ); create_css( sp );
FILE * f ; KVStore st ; Surr s ; FILE * C = 0 ;
s_( sp, "%s/No_trace_for", j2h ); f = create( sp );
fprintf( f, "\n No trace for:\n" );
s = noAufrufe -> GetFirst( st );
while ( s )
{
fprintf( f, "\n%s", st.k );
s = noAufrufe -> Next( st );
}
close( f );
__
// -----------------------------------------------------------------------------
Btree funcBo ;
s_( sp, "%s/ALL_funcs", j2h ); f = create( sp ); int min_L = 100 ;
fprintf( f, "\n ALL Methods:\n" );
s = Methods.GetFirst( st );
while ( s )
{
char * x = st.k ; to_( x, '~' ) *x = 0 ;
if ( x - st.k < min_L ) min_L = x - st.k ;
fprintf( f, "\n %s", st.k );
*x = '~' ;
x = substr( "::", st.k );
if ( x )
then {
x += 2 ; skip_space( x )
}
else x = st.k ;
funcBo.StrIns( 'i', x );
s = Methods.Next( st );
}
close( f );
// -----------------------------------------------------------------------------
s_( sp, "%s/ALLf" , j2h ); create_css( sp );
s_( sp, "%s/ALLf.htm", j2h ); f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sFunction Bodies<font size=2>"
"\n%s<font size=2><br>"
, kopf, t1, t2 );
char200 pre ; int xNr = 0 ;
s = funcBo.GetFirst( st );
__
while ( s )
{
__ char * x = st.k+1 ; to_( x, '~' ) *x = 0 ;
int N = At( st.k, "On" )? 2 : 3 ;
if in_str( st.k[2], "~t" ) N = 2 ;
if not_is( st.k, pre, N )
{
__ if ( C ) close( C );
memcpy( pre, st.k, N ); strcpy( pre + N, " ..." );
fprintf( f, "\n<a href=ALLf/%i.htm>%s</a><br>", ++xNr, pre );
char400 xx ; s_( xx, "%s/ALLf/%i.htm", j2h, xNr );
C = create( xx );
fprintf( C, "\n%s<a name=top></a>%sFunction Bodies<br>%s<font size=2>"
"\n%s<font size=2><br>"
, kopf, t1, pre, t2 );
}
__ fprintf( C, "\n<a href=../%s>%s</a><br>", x+1, st.k );
*x = '~' ;
s = funcBo.Next( st );
}
__
close( f ); if ( C ) close( C );
__
LE_
/* private: */ void Java2Htm :: show_Exceptions ( Btree & tree
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.show_Exceptions")
char1000 sp ; s_( sp, "%s/exps.htm", j2h ); FILE * f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sWhere Exceptions are thrown<font size=2>"
"\n%s<font size=2><br><center>"
"\nIs to show all calls ... Exception( ... in C++</center><br>"
, kopf, t1, t2 );
KVStore st ; Surr s = tree.GetFirst( st ); int anz = 0 ;
while ( s )
{
char * x = st.k ; to_( x, '~' ) *x = 0 ;
char * k = in_str( '(', st.k ); if ( ! k ) fErr
*k = 0 ;
char * z = k+1 ; while ( *z && not_in_name( *z ) ) z++ ;
fprintf( f, "\n<a href=%s>%s</a>: %s<br>", x+1, st.k, z );
anz++ ; *x = '~' ; *k = '(' ;
s = tree.Next( st );
}
fprintf( f, "\n<br><font size=1>%i Exceptions thrown, %i Assertions</font>"
, anz, anz_assert );
LE_
/* private: */ void Java2Htm :: show_Module_Dependencies ( char * dep
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.show_Module_Dependencies")
rBuffer B( dep, "" ); B.find( 0, "\n+ ", 0 );
char * tmp = "xx_deps" ; FILE * f = create( tmp );
while ( B.find( 0, "<", f ) )
{
B.a++ ; fprintf( f, "<" );
}
close( f );
// -----------------------------------------------------------------------------
char1000 sp ; s_( sp, "%s/MoDep.htm", j2h ); f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sModules in the Sense of MS Studio<font size=2>"
"\n%s<font size=2><center><br>"
"\nSM < <b>LM</b> means: <b>LM</b> depends on SM<br>"
"\n<b>LM</b> > SM means: <b>LM</b> depends on submodule SM<br>"
"\n</center><br>"
, kopf, t1, t2 );
Btree Modules ; int MNr = 0 ;
B.open_rBuffer( tmp, "\n" ); KVStore st ;
while ( B.find( 0, "\n", 0 ) )
{
char * c = B.z + B.a + 1 ;
char * e = c ; to_( e, '\n' ) *e = 0 ;
if ( *c == '+' ) // Module Name
then {
e = c += 3 ;
s_( st.c, "%i", ++MNr ); Modules.StrIns( 'e', c, st.c );
fprintf( f, "\n<br><a name=%s></a>"
"\n<h3><a href=#toc>%s</a></h3>", c, c );
}
esif ( *c == ' ' )
{
char m = e[-1] ;
if ( m == '>' ) fprintf( f, "<a name=U%i></a>", MNr );
if ( m == ';' ) fprintf( f, "<a name=B%i></a>", MNr );
if in_name( m )
then {
char * x = e-1 ;
while ( *x != ' ' ) x-- ; *x++ = 0 ;
fprintf( f, "\n%s <a href=#%s>%s</a><br>", c+3, x, x );
}
else fprintf( f, "\n%s<br>", c+3 );
}
B.a = e - B.z ; *e = '\n' ;
}
fprintf( f, "\n<a name=toc></a>"
"\n<br> <br><a name=toc></a><a href=#top>top</a><br>"
"\n<h3>Command Line Interface Modules are:</h3>" );
Surr s = Modules.GetFirst( st );
while ( s )
{
if substr( "CLI", st.k )
fprintf( f, "\n[ <a href=#B%s><<</a> ] ["
"\n<a href=#U%s>>></a> ] <a href=#%s>%s</a><br>"
, st.c, st.c, st.k, st.k );
s = Modules.Next( st );
}
fprintf( f, "\n<br><font size=1>%s Modules in total:</font>", st.c );
// -----------------------------------------------------------------------------
fprintf( f, "\n<br><a href=#top>top</a><br>"
"\n<h3>There are %i Modules in the sense of MS Studio:</h3>", MNr );
s = Modules.GetFirst( st );
while ( s )
{
fprintf( f, "\n[ <a href=#B%s><<</a> ] ["
"\n<a href=#U%s>>></a> ] <a href=#%s>%s</a><br>"
, st.c, st.c, st.k, st.k );
s = Modules.Next( st );
}
fprintf( f, "\n<br><font size=1>%s Modules in total</font><br>", st.c );
close( f );
LE_
/* private: */ uint Java2Htm :: srcfile
// -----------------------------------------------------------------------------
(
uint Line
, char * fn
, codeArt coArt
)
LB_("Java2Htm.srcfile")
KVStore st ;
if ( srcFiles.Get( fn, st ) ) ret( decNr( st.c ) );
s_( st.c, "%i", cfNr ); srcFiles.StrIns( 'i', fn, st.c );
if ( max_fNr <= cfNr ) fErr2( max_fNr, cfNr )
fNam[ cfNr ] = store.take( fn );
fArt[ cfNr ] = coArt ;
//
LE_ret( cfNr++ )
/* private: */ void Java2Htm :: show_metrics (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.show_metrics")
char1000 sp ;
s_( sp, "%s/meter" , j2h ); create_css ( sp );
s_( sp, "%s/meter.htm", j2h ); FILE * f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sQuality Metrics%s<font size=2>"
, kopf, t1, t2 );
if ( vs_rose ) diff_to_htm( f, vs_rose, "Class Design in UML" );
if ( vs_ccom ) diff_to_htm( f, vs_ccom, "Class Documentation" );
close( f );
check_code_rose_diff(); // um niemand ungerecht zu beschuldigen
LE_
/* public: */ void Java2Htm :: diff_to_htm
// -----------------------------------------------------------------------------
(
FILE * fs
, char * diff
, char * to
)
LB_("Java2Htm.diff_to_htm")
fprintf( fs, "\n<br><a href=meter/%s.htm>Code vs %s</a>", diff, to );
char1000 sp ; char * tmp = "xx_diff_to_htm" ;
FILE * f = create( tmp );
fprintf( f, "\n%s<a name=top></a>%sCode vs %s%s<font size=2><pre>"
, kopf, t1, to, t2 );
rBuffer B( diff, "" ); uint anz = 0 ;
while ( B.find( 0, "found in ", f ) )
{
anz++ ;
char * nam = "Code" ;
if ( anz == 2 ) nam = to ;
if ( anz == 3 ) nam = "both" ;
fprintf( f, "found in %s", nam );
rB_( B, 1, "\n", 0 )
if ( anz == 3 )
{
rB_( B, 1, "only xx", f ); fprintf( f, "only in Code" );
rB_( B, 1, "\n" , 0 );
rB_( B, 1, "only xx", f ); fprintf( f, "only in %s", to );
rB_( B, 1, "\n" , 0 );
}
}
close( f );
s_( sp, "%s/meter/%s.htm", j2h, diff ); f = create( sp );
B.open_rBuffer( tmp, "" ); uint offs = 0 ;
while ( B.find( offs, " class ", f ) )
{
char * c = B.z + B.a + 7 ;
char * e = c ; to_( e, '\n' ) *e = 0 ;
KVStore st ;
if ( cppsecs.Get( c, st ) )
then {
fprintf( f, " class <a href=../%s>%s</a>", st.c+1, c );
B.a = e - B.z ; offs = 0 ;
}
else offs = 1 ;
*e = '\n' ;
}
close( f ); Unlink( tmp )
LE_
/* private: */ uint Java2Htm :: anz_of ( codeArt cA
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.anz_of")
if ( ! cA ) ret( cfNr )
uint anz = 0 ; int i = -1 ;
while ( ++i < cfNr ) if ( fArt[i] == cA ) anz++ ;
LE_ret( anz )
/* public: */ void Java2Htm :: cppsecs_vs_UMLsecs ( char * skMo
/* -----------------------------------------------------------------------------
Nur aufrufbar aus code_vs_rose():
Compare Model in C++ Code to Model in Rose (*.cat + *.mdl)
-----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.cppsecs_vs_UMLsecs")
char100 cNam ; char * eocNam = cNam ; rBuffer B( skMo, "" );
Btree UMLsecs ; str_set such ; such.insert( "class " );
such.insert( "?" );
while ( B.find( 1, such, 0 ) )
{
char * c = B.z + B.a ; if ( c[-1] != ' ' ) continue ;
char * e = c ;
if ( *c == 'c' )
then {
e = c += 6 ; to_( e, '\n' ) *e = 0 ;
s_( cNam, "%s :: ", c ); eocNam = eos( cNam );
}
esif ( *c == '?' && in_str( c[1], "123" ) )
{
e = c ; to_( e, '\n' ) *( --e ) = 0 ; c = e-1 ;
while ( *c != ' ' ) c-- ;
strcpy( eocNam, c+1 ); c = cNam ;
}
else fErr
char * we = "U " ;
if ( cppsecs.contains( c ) || typedefs.contains( c ) ) we = "U C" ;
UMLsecs.StrIns( 'e', c, we ); // e: es kann polymorphe Methoden geben
B.a = e+1 - B.z ;
}
KVStore st ; Surr s = cppsecs.GetFirst( st );
while ( s )
{
if ( ! UMLsecs.contains( st.k ) )
{
UMLsecs.StrIns( 'i', st.k, " C" );
}
s = cppsecs.Next( st );
}
s = UMLsecs.GetFirst( st ); int anzU = 0 ; int anzn = 0 ;
FILE * fc = create( "xx_UC_Classes" );
FILE * fm = create( "xx_UC_Methods" );
fprintf( fc, "\n Source = %s\n"
"\n U im UML Modell genannte Klasse"
"\n C implementierte Klasse\n", srcRoot );
fprintf( fm, "\n Source = %s\n"
"\n U im UML Modell genannte Klasse oder Methode"
"\n C implementierte Klasse oder Methode\n", srcRoot );
char400 constr ; *constr = 0 ;
while ( s )
{ if ( ! *st.k ) break ;
if not_in_str( ':', st.k )
{
break ; fprintf( fc, "\n %s %s", st.c, st.k );
// s_( constr, "%s :: %s", st.k );
s_( constr, "%s :: %s", st.k, st.c ); fErr2( st.k, st.c ) //??
if not_space( st.c[0] ) anzU++ ;
if space( st.c[2] ) anzn++ ;
}
if not_in_str( '~', st.k )
if not_in_str( ',', st.k )
if not_is_( st.k, constr ) fprintf( fm, "\n %s %s", st.c, st.k );
s = UMLsecs.Next( st );
}
fprintf( fc, "\n\n %i der insgesamt %i in UML genannten Klassen fehlen im Code."
, anzn, anzU );
close( fm );
close( fc );
printf( "\n%3i modellierte, NICHT implementierte Klassen? see xx_UC_*", anzn );
LE_
/* public: */ void Java2Htm :: code_vs_ccom (
/* -----------------------------------------------------------------------------
Compare Model in C++ Code to Model in the file classComm
-----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.code_vs_ccom")
if ( ! classComm ) ret_
char * ccom = "xx_ccom" ; FILE * f = create( ccom );
KVStore st ; Surr s = classComm -> GetFirst( st );
while ( s )
{
fprintf( f, "\nclass %s", st.k );
s = classComm -> Next( st );
}
close( f );
vs_ccom = "code_ccom_diff" ;
S_ "+diffsm M %s %s > %s", coMo, ccom, vs_ccom _Do
S_ "+diffsm M xx_rose %s > rose_ccom_diff", ccom _Do
Unlink( ccom )
LE_
/* public: */ void Java2Htm :: code_vs_rose (
/* -----------------------------------------------------------------------------
Compare Model in C++ Code to Model in Rose ( *.cat + *.mdl )
-----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.code_vs_rose")
ret_
close( fcode );
close( fcoMo );
close( froMo );
// _4( coMo, roMo, compare_code_rose, skMo )
if not_is_file( coMo )
{
m_errMess "User: no such file: %s" m_
coMo, ret_error
}
;
if not_is_file( roMo )
{
m_errMess "User: no such file: %s" m_
roMo, ret_error
}
;
char * code = coMo ; char * rose = "xx_rose" ;
if ( compare_code_rose )
{
// create_sk nach rose_2.exe ausgelagert - nur deswegen, weil sonst
// stack overflow passiert:
char800 xx ; s_( xx, "%s.sk", roMo ); Unlink( xx );
S_ "rose_2 create_sk %s %s", roMo, j2h _Do
if not_is_file( xx )
{
m_errMess "System: rose_2.exe did not create %s" m_
xx, ret_error
}
S_ "copy xx_U %s/xx_U && del xx_U", j2h _Do
s_( xx, "%s/UMLDesComp", j2h );
cp_tree( xx, "UMLDesComp", 1 ); rm_tree( "UMLDesComp" );
cppsecs_vs_UMLsecs( skMo );
FILE * f = create( rose ); rBuffer B( skMo, "\n" );
while ( B.find( 1, "class ", 0 ) )
{
char * c = B.z + B.a + 5 ; skip_space( c );
char * e = c ; to_space( e ); *e = 0 ;
fprintf( f, "\nclass %s", c );
}
close( f );
vs_rose = "code_rose_diff" ;
S_ "+diffsm M %s %s > %s", code, rose, vs_rose _Do
__ _4( code, rose, vs_rose, skMo )
check_noCode( vs_rose );
printf( "\n\no k - see %s/*_diff\n\n", j2h );
}
LE_
/* private: */ void Java2Htm :: check_code_rose_diff (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.check_code_rose_diff")
char800 xx ; s_( xx, "%s/meter/code_rose_diff.htm", j2h );
char800 zz ; s_( zz, "%s/not_in_code.bat" , j2h );
if not_path_exists( xx ) ret_
FILE * f = create( zz );
fprintf( f, "\n: UML Classes not found in Code (?):\n" );
rBuffer B( xx, "" );
while ( B.find( 1, "> class", 0 ) )
{
char * c = B.z + B.a + 8 ;
if ( *c != '<' )
{
char * e = c ; to_space( e ) *e = 0 ;
fprintf( f, "\n grep %s ../alles_x", c );
}
}
close( f );
LE_
/* private: */ void Java2Htm :: check_noCode ( char * diffs
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.check_noCode")
Btree notCode ;
str_set such ; rBuffer B( diffs, "" ); rB_( B, 0, "\n >", 0 )
uint anz = 0 ;
while ( B.find( 1, "\n >", 0 ) )
{
char * c = B.z + B.a + 11 ;
char * e = c ; to_( e, '\n' ) *e = 0 ;
such.insert( c );
notCode.StrIns( 'e', c, "n" );
B.a = e-1 - B.z ; *e = '\n' ; anz++ ;
}
if ( anz == 0 ) ret_
B.open_rBuffer( ALLCode, "\n" ); match_rec * mr = 0 ;
while ( mr = B.find( 1, such, 0 ) )
{
char * c = B.z + B.a ;
if ( not_in_name( c[-1] ) && not_in_name( c[ mr->L ] ) )
{
notCode.StrIns( 'e', mr -> str, "c" );
}
}
printf( "\nIn UML, aber nicht im Code gefundene Klassen:\n" );
KVStore st ; Surr s = notCode.GetFirst( st ); anz = 0 ;
while ( s )
{
if ( *st.c == 'n' )
then {
anz++ ; // eine modellierte, aber NICHT implementierte Klasse:
printf( "\nnur in UML: %s", st.k );
}
esif ( ! typedefs.contains( st.k ) )
{
printf( "\n ?: %s", st.k ); // Nicht unter rootDir
}
s = notCode.Next( st );
}
printf( "\n%3i modellierte, NICHT implementierte Klassen.", anz );
LE_
/* private: */ void Java2Htm :: methods_of_superClasses
// -----------------------------------------------------------------------------
(
FILE * f
, char * cName
, uint mfNr
)
LB_("Java2Htm.methods_of_superClasses")
char * e = cName ; if ( ! *e ) ret_
to_( e, ' ' ); *e = 0 ;
char300 cn ; s_( cn, "%s~", cName ); *e = ' ' ;
KVStore st ; Surr s = supNames.Getmin_GR( st, cn );
if ( s && At( st.k, cn ) )
{
fprintf( f, "\n<br><br><b>Superclasses are:</b>==%s ", cName );
s_( cn, "1_%u", mfNr ); supNames.StrIns( cn );
}
LE_
/* private: */ BOOL Java2Htm :: rootClass ( char * cName
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.rootClass")
char300 cn ; s_( cn, "%s~", cName );
KVStore st ; Surr s = supNames.Getmin_GR( st, cn );
LE_ret( ! ( s && At( st.k, cn ) ) )
/* private: */ void Java2Htm :: show_rootClasses (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.show_rootClasses")
char800 sp ; s_( sp, "%s/roots.htm", j2h ); FILE * f = create( sp );
fprintf( f, "\n%s<a name=top></a>%sMost Specific Classes are:%s<font size=2>"
, kopf, t1, t2 );
char * tmp = "root_fz" ; // Was wir schon wissen
if is_file( tmp )
{
rBuffer B( tmp, "\n\n" );
while ( B.find( 1, "\nroot[", 0 ) )
{
B.z[ B.e ] = '\n' ;
char * w = B.z + B.a + 7 ;
char * c = w ; to_( c, ']' )
char * e = c += 2 ; to_( e, '\n' ) *e = 0 ;
if ( *w == '?' ) w = "?" ;
rootClasses.StrIns( 'e', c, w );
*e = '\n' ;
}
}
fprintf( f, "\n\n" );
KVStore st ; Surr s = rootClasses.GetFirst( st ); uint anz = 0 ;
while ( s )
{
anz++ ;
printf( "\nroot[ %s ] %s", st.c, st.k );
fprintf( f, "\n<br>%s", st.k );
s = rootClasses.Next( st );
}
printf( "\n|\nend of new Version of root_fz, %i rootClasses\n\n", anz );
//
close( f );
LE_
/* private: */ void Java2Htm :: show_superClasses
// -----------------------------------------------------------------------------
(
FILE * f
, char * cName
, uint deep
)
LB_("Java2Htm.show_superClasses")
printf( "\nshow_superClasses of %s, deep = %i", cName, deep );
char300 cn ; s_( cn, "%s~", cName );
KVStore st ; Surr s = supNames.Getmin_GR( st, cn );
if ( ! s ) *st.k = 0 ;
if not_At( st.k, cn )
then {
rootClasses.StrIns( 'e', cName, typeOfCode );
ret_
}
while ( s && At( st.k, cn ) )
{
char * c = st.k ; to_( c, '~' ) c++ ;
char * p = in_str( '.', c );
if(0) while ( p && not_space( p[1] ) )
while ( p )
{
// Verursacht Absturz in der roten Zeile oben !!!!
c = p+1 ; skip_space( c )
p = in_str( '.', c );
}
fprintf( f, "\n<br> %s: %s", sP - ( 7 + deep ) * 7, c );
show_superClasses( f, c, deep + 2 );
s = supNames.Getmin_GR( st, st.k );
}
___
LE_
/* private: */ uint Java2Htm :: show_subClasses
// -----------------------------------------------------------------------------
(
FILE * f
, char * cName
, uint deep
)
LB_("Java2Htm.show_subClasses")
char * spac = ". . . . . . "
". . . . . . "
". . . . . . "
". . . . . . "
". . . . . . "
". . . . . . ";
spac = eos( spac );
if ( ! subClasses ) create_subClasses_Relation();
uint anz = 0 ; deep++ ;
char300 cn ; s_( cn, "%s~", cName );
KVStore st ; Surr s = subClasses -> Getmin_GR( st, cn );
if ( ! s ) *st.k = 0 ;
while ( s && At( st.k, cn ) )
{
anz++ ;
char * c = st.k ; to_( c, '~' ) c++ ;
KVStore sc ;
if ( cppsecs.Get( c, sc ) )
then {
fprintf( f, "\n<br>sc %s<a href=../%s>%s</a>"
, spac - 9 * deep, sc.c+1, c );
anz += show_subClasses( f, c, deep );
}
s = subClasses -> Getmin_GR( st, st.k );
}
LE_ret( anz )
/* private: */ void Java2Htm :: create_subClasses_Relation (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.create_subClasses_Relation")
// supNames.traceAbs( "supNames" );
subClasses = new Btree ;
KVStore st ; Surr s = supNames.GetFirst( st );
while ( s )
{
if not_in_str( *st.k, "./" )
{
char * x = st.k ; to_( x, '~' ) *x = 0 ;
char400 xx ; s_( xx, "%s~%s", x+1, st.k );
subClasses -> StrIns( 'e', xx, st.c );
*x = '~' ;
}
s = supNames.Next( st );
}
LE_
/* private: */ void Java2Htm :: create_class_map
// -----------------------------------------------------------------------------
(
char * cName
, char * htm
, char * defAt
)
LB_("Java2Htm.create_class_map")
char * e = eos( htm ) - 1 ;
while ( *e != '/' ) e-- ; e-- ;
while ( *e != '/' ) e-- ; e++ ;
if ( ourCode ) fprintf( ourCode, "\n~%s~%s~", cName, e );
fprintf( fcoMo, "\nclass %s", cName );
FILE * f = create( htm );
char * cco1 = "" ; KVStore st ;
char * cco2 = "" ;
if ( classComm && classComm -> Get( cName, st ) )
{
cco1 = "<br>" ; cco2 = st.c ;
}
char100 docu ; *docu =0 ;
Surr s = ( ourDocu )? ourDocu -> Get( cName, st ) : 0 ;
if ( s )
{
// create Link to class documentation page:
s_( docu, "<br><a href=../../%s>See also class documentation.</a>"
, st.c );
}
fprintf( f, "%s" "\n<font size=\"+1\">Class <a href=../%s>%s</a></font><br>"
"\n%s%s%s<br><a href=../cpp.htm>C++</a>"
"\nInline methods are not shown here."
"\nSuperclasses are shown indented,"
"\nSubclasses <a href=#sc>here</a>.%s"
, kopf, defAt, cName, cco1, cco2, cco1, docu );
char * deep = ". . . . . . "
". . . . . . "
". . . . . . "
". . . . . . ";
deep = eos( deep );
show_class_map( f, cName, deep );
fprintf( f, "\n<br><br><a href=../class.htm>ALL Class Maps</a><br>"
"\n<a href=../types.htm>ALL Class and Type Declarations</a><br><br>"
"\n<a name=sc></a><b>Subclasses of %s are:</b><br>", cName );
uint anz = show_subClasses( f, cName, 0 );
if ( anz == 0 ) fprintf( f, "\n<br><font size=1>%u subclasses</font>" , anz );
if ( anz == 1 ) fprintf( f, "\n<br><br><font size=1>1 subclass</font>" );
if ( anz > 1 ) fprintf( f, "\n<br><br><font size=1>%u subclasses</font>", anz );
close( f );
LE_
/* private: */ void Java2Htm :: show_class_map
// -----------------------------------------------------------------------------
(
FILE * f
, char * cName
, char * deep
)
LB_("Java2Htm.show_class_map")
show_methods( f, cName, deep );
char300 cn ; s_( cn, "%s~", cName );
KVStore st ; Surr s = supNames.Getmin_GR( st, cn );
while ( s && At( st.k, cn ) )
{
char * c = st.k ;
to_( c, '~' ) show_class_map( f, c+1, deep - 9 );
s = supNames.Getmin_GR( st, st.k );
}
LE_
/* private: */ void Java2Htm :: show_methods
// -----------------------------------------------------------------------------
(
FILE * f
, char * cName
, char * deep
)
LB_("Java2Htm.show_methods")
char300 cn ; s_( cn, "%s ::", cName );
char * par = in_str( '<', cName ); char m = 0 ; char * x ;
if ( par )
then {
x = par ;
while ( par < x && space( x[-1] ) )
{
if ( cName < x ) x-- ; else fErr1( cName )
}
m = *x ;
}
else x = par = eos( cName );
KVStore st ; *x = 0 ; Surr s = cppsecs.Get( cName, st );
if ( m )
then {
if ( 30000 < strlen( par+1 ) )
{
fErr4( m, par+1, cName, strlen( par+1 ) )
}
s_( Esc, "< %s", par + 1 );
strcpy( eos( Esc )-1, " >" );
par = Esc ;
}
if ( s )
then {
fprintf( f, "<br><br>%s<a href=../%s>%s</a>%s", deep, st.c+1, cName, par );
}
else {
char * x = cName ;
while ( *x )
{
while ( *x && *x != '.' ) x++ ;
if ( cppsecs.contains( ++x ) ) goto L1 ;
}
fprintf( f, "<br><br>%s%s%s", deep, cName, par );
}
L1: if ( klassenArt.Get( cName, st ) ) fprintf( f, "\n%s", st.c );
*x = m ;
s = cppsecs.Getmin_GR( st, cn );
if ( s && At( st.k, cn ) )
{
char * z = st.c ; to_( z, '#' ); int n = decNr( z+1 );
while ( s && At( st.k, cn ) )
{
//
// , deep, n, st.c+1, st.k );
fprintf( f, "\n<br>%s<a href=../%s>%s</a>", deep, st.c+1, st.k );
char * x = substr( ":: ", st.k );
if ( x )
{
char300 xx ; s_( xx, "%c%s~%s", upper(x[3]), x+3, st.k );
ALLMeth.StrIns( 'e', xx, st.c+1 );
}
s = cppsecs.Next( st );
}
}
LE_
/* private: */ void Java2Htm :: create_path_under_ourRoot
// -----------------------------------------------------------------------------
(
char * ourRoot
, int offset
, char * f
)
LB_("Java2Htm.create_path_under_ourRoot")
if ( ! ourRoot ) fErr
if ( ! f ) fErr
char * cut = f + offset ;
if ( cut < f || eos( f ) <= cut ) fErr2( offset, f )
char800 zz ; s_( zz, "%s/%s", ourRoot, cut );
if is_dir( f ) dir_exist( zz ); else cp_file( zz, f );
LE_
/* public: */ void Java2Htm :: create_exe_List ( BOOL kurz
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.create_exe_List")
char1000 xx ; s_( xx, "%s/j2h/exe%s.htm", app, ( kurz )? "s" : "" );
FILE * f = create( xx );
fprintf( f, "%s" "\n<a href=\"jsp.htm\" TARGET=\"frame2\"></a><br>"
"\n<font size=\"+1\">The %i main() Methods</font><br>"
, kopf, mNr );
int i = -1 ; char800 nam ; Btree sort ; char800 stk ;
while ( ++i < mNr )
{
char * me = main_me[i].me ;
if ( kurz )
then {
me = eos( me ); while in_name( me[-1] ) me-- ;
s_( nam, "\"%s\" target=frame3>%s.main()</a>"
, main_me[i].at, main_me[i].of );
}
else {
s_( nam, "\"%s\" target=frame3>%s.main()</a>: %s"
, main_me[i].at, main_me[i].of, me );
}
s_( stk, "%s%s", main_me[i].of, me ); stk[250] = 0 ;
sort.StrIns( 'e', stk, nam );
}
KVStore st ; Surr s = sort.GetFirst( st );
while ( s )
{
fprintf( f, "\n<br><a href=%s", st.c );
s = sort.Next( st );
}
fprintf( f, "\n</BODY></HTML>\n" );
close( f );
LE_
/* public: */ void Java2Htm :: create_ourDoc (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.create_ourDoc")
char1000 docu ; s_( docu, "%s/j2h/ourDoc.htm", app );
FILE * f = create( docu );
fprintf( f, "\n%s%sCode Documentation:%s<font size=2></center></td></tr></table>"
, kopf, t1, t2 );
int i = -1 ;
while ( ++i < e_doc )
{
fprintf( f, "\n<br><a href=\"%s\">%s</a>", doc[i].href, doc[i].name );
}
close( f );
LE_
/* private: */ void Java2Htm :: def_sample
// -----------------------------------------------------------------------------
(
char * fn
, char * pp
)
LB_("Java2Htm.def_sample")
// Muss mit dem Personen-Beispiel harmonieren:
anz_samples += 1 ;
if substr( "CMP_Sample/eBean/Union_" , fn ) sam[1] = such.take( pp );
esif substr( "BMP_Sample/eBean/Union_" , fn ) sam[2] = such.take( pp );
esif substr( "LoReSession" , fn ) sam[3] = such.take( pp );
esif substr( "ReSession" , fn ) sam[4] = such.take( pp );
esif substr( "mBean" , fn ) sam[5] = such.take( pp );
else anz_samples -= 1 ;
LE_
/* private: */ void Java2Htm :: use_sample
/* -----------------------------------------------------------------------------
Check package name for correctness (may be generated)
|----------------------------------------------------------------------------
*/ (
int s
)
LB_("Java2Htm.use_sample")
char * name ;
if ( s == 1 ) name = "CMP Entity Bean" ;
esif ( s == 2 ) name = "BMP Entity Bean" ;
esif ( s == 3 ) name = "Stateless Session Bean" ;
esif ( s == 4 ) name = "Stateful Session Bean" ;
esif ( s == 5 ) name = "Message Driven Bean" ;
else fErr
if ( ! sam[s] ) ret_
if ( ! sam[s][0] )
{
{
m_errMess "System: s = %i, sam[s] = %p, see def_sample()" m_
s, sam[s], ret_error
}
}
path ex ; s_( ex, "%s/ex%i.htm", j2h, s );
path sa ; s_( sa, "%s/%s.htm" , j2h, sam[s] );
rBuffer B( sa, "" ); FILE * f = create( ex );
rB_( B, 1, "Classes and Interfaces in", f ) fprintf( f, "Study this sample" );
rB_( B, 1, "</font" , 0 ) fprintf( f, "<br><font size=+1>" );
fprintf( f, "%s", name );
while ( B.find( 0, "#toc", f ) ) B.a += 4 ;
close( f );
LE_
/* private: */ void Java2Htm :: check_package_name
/* -----------------------------------------------------------------------------
Check package name for correctness (may be generated)
|----------------------------------------------------------------------------
*/ (
char * from
, char * pack
)
LB_("Java2Htm.check_package_name")
if ( ! checkPackName ) ret_
__
path fn ; strcpy( fn, from );
__
char * e = fn + strlen( fn ) - 1 ; while ( *( --e ) != '/' ); *e = 0 ;
__
while ( fn <= --e ) if ( *e == '/' ) *e = '.' ;
__
if not_is_( pack, fn )
then {
if(0) printf( "\npack falsch in: %s"
"\npack : %s"
"\nfn : %s", from, pack, fn );
}
else packages.StrIns( 'e', fn );
__
LE_
/* public: */ void Java2Htm :: List_our_packages (
/* -----------------------------------------------------------------------------
|----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.List_our_packages")
FILE * f = create( "packages.bat" );
KVStore st ; Surr s = packages.GetFirst( st );
while ( s )
{
char4000 cop ; s_( cop, "%s/%s j:/%s", app, st.k, st.k );
char * x = cop - 1 ;
while ( *( ++x ) ) if in_str( *x, "/." ) *x = '\\' ;
fprintf( f, "\n call cptree %s", cop );
s = packages.Next( st );
}
close( f );
LE_
/* private: */ void Java2Htm :: toSeeDefaultVis
/* -----------------------------------------------------------------------------
show default visibility as public
Default visibility means: The method in question is treated as public
within the package, but as private outside the package.
|----------------------------------------------------------------------------
*/ (
char * nch
, char * aus
)
LB_("Java2Htm.toSeeDefaultVis")
FILE * f = create( nch ); rBuffer B( aus, "" );
while ( B.find( 1, "\n", f ) )
{
char * c = B.z + B.a + 1 ;
if At( c, "/*" )
{
if ( ! B.find( 1, "*/", f ) ) fErr
char * x = B.z + B.a + 2 ; skip_space( x )
B.a = x - B.z ;
fprintf( f, "\n*/\n" );
continue ;
}
char * e = c ; to_( e, '\n' ) *e = 0 ;
char * vis = "" ;
char * x = in_str( '(', c );
if in_str( '}', c ) x = 0 ;
if ( x && not_substr( "public " , c )
&& not_substr( "protected " , c )
&& not_substr( "private " , c )
&& not_substr( "for " , c )
&& not_substr( "for(" , c )
&& not_substr( "new " , c )
&& not_substr( "catch" , c )
)
{
// We found a method with default visibility, hence:
x++ ; skip_space( x ); while in_name( *x ) x++ ;
if space( *x )
{
skip_space( x );
if in_name( *x ) vis = "public defVis " ;
}
skip_space( c ); B.a = c - B.z ;
while in_name( *c ) c++ ; skip_space( c );
if not_alpha( *c ) then vis = "" ;
fprintf( f, "\n%s", vis );
}
*e = '\n' ;
}
close( f );
LE_
/* private: */ void Java2Htm :: CSharp_to_htm
/* -----------------------------------------------------------------------------
present *.cs in form of *.htm
|----------------------------------------------------------------------------
*/ (
char * to
, char * from
, FILE * f2
, FILE * fC
)
LB_("Java2Htm.CSharp_to_htm")
LE_
/* private: */ void Java2Htm :: JAVA_to_htm
/* -----------------------------------------------------------------------------
present *.java in form of *.htm
|----------------------------------------------------------------------------
*/ (
char * to
, char * from
, FILE * f2
, FILE * fC
)
LB_("Java2Htm.JAVA_to_htm")
if substr( "/eof_", from ) ret_
char200 pack ; *pack = 0 ;
char1000 xx ; s_( xx, "%s/%s", j2h, to );
// if not_is_dir( j2h ) fErr1( j2h )
if ( ! substr( ".java", from ) ) ret_
if is_( eos( from ) - 10, "alles.java" ) ret_
fprintf( fC, "\n%s", from ); // for jivelint
SCTr printf( "\ncp %s x8", from );
_1( from ) // cp_file( "d:/xx/err.java", from );
char * tmpV = "x_defVis" ;//toSeeDefaultVis( tmpV, from );
char * tmpp = "x_pretty" ; toSeeDefaultVis( tmpV, from );
BRCode brc ; brc.pretty_PHP( tmpV, tmpp ); __ // = pretty_JAVA
_1( from+111-111 )
rBuffer B( tmpp, "\n" );
// rBuffer B( tmpV, "\n" );
// if substr( ".play();\\n\n", B.z + B.a ) fErr2( from, tmpp ) // for debug
if ( ! B.find( 0, "\npackage", 0 ) )
{
printf( "\nUser's error: no package in %s\n", from );
B.open_rBuffer( from, "\n" );
}
__
char * c = from + strlen( from ) - 5 ; *c = 0 ; while ( *c != '/' ) c-- ;
FILE * f = create( xx ); fprintf( f,"%s"
"\n%s%s%s<pre class=\"Classes\"><font size=2>"
, kopf, t1, c+1, t2
);
char * className[20] ; className[0] = "" ;
int offset = 0 ;
int custom = custom_code ;
BOOL prot = 0 ;
uint depth = 0 ;
char * Art = "-" ;
char * atClass = "" ;
char * toptoc = "top" ;
__
char ** toc = tocArr ;
long etoc = 0 ; long LLOC = 0 ; LoComm = 0 ;
char * xxx = "xxx" ;
match_rec * mr = 0 ;
while ( mr = B.find( offset, such, f ) )
{
B.getmore( 8000, "\n" );
char * c = B.z + B.a ; offset = 0 ;
if ( ! c[-1] ) c[-1] = ' ' ;
if ( *c == '<' )
then {
B.a += 1 ; fprintf( f, "<" );
}
esif ( *c == (uchar)13 )
{
char * e = B.z + B.e ; c-- ;
while ( ++c < e ) if ( *c == (uchar)13 ) *c = '\n' ;
}
esif ( *c == '/' )
{
if At( c, "/*" )
then {
char * e = in_str( '\n', c );
if ( e )
{
*e = 0 ;
if substr( "--- */", c )
{
B.a = e - B.z ; *e = '\n' ; continue ;
}
*e = '\n' ;
}
char * cm = c ;
{{
// Copyright section ingnorieren:
char * x = c ; while not_alpha( *x ) x++ ;
if At( x, "Copyright" )
{
rB_( B, 1, "*/", 0 )
x = B.z + B.a ; to_space( x ) B.a = x - B.z ;
offset = 0 ; continue ;
}
}}
__ if ( noAutoComment )
{
L1: if At( c, "/* START OF PROTECTED" ) // ArcStyler
then {
__ prot = true ;
to_( c, '\n' ); skip_space( c )
if At( c, "/*" ) goto L1 ;
}
esif At( c, "/* END OF PROTECTED" ) // ArcStyler
{
__ prot = false ;
to_( c, '\n' ); skip_space( c )
if At( c, "/*" ) goto L1 ;
}
while ( At( c, "// HTML //" )
|| At( c, "// end" )
|| At( c, "// begin [file=" )
|| At( c, "//GEN-" )
)
{
__ // this is ArcStyler Comment
// this is OptimalJ Comment
to_( c, '\n' ); skip_space( c );
B.a = c - B.z ;
}
if ( B.e <= B.a ) fErr
if ( cm < c ) { B.a = c - B.z ; continue ; }
}
char * x = c-1 ; while space( *x ) x-- ;
if in_str( *x, "{;}" ) fprintf( f, "<br>" );
if ( mxetoc <= etoc ) fErr
toc[ etoc++ ] = 0 ; fprintf( f, "<a name=%i></a>", etoc );
x = c + 3 ; skip_space( x );
if At( x, "*/" )
{
rB_( B, 3, "*/", 0 ); B.a += 2 ; continue ;
}
fprintf( f, "<font class=\"co\">" );
char m = do_Comment( f, B ); //
if ( m )
then fprintf( f, "%c\n", m );
else fprintf( f, "</FONT>\n" );
c = B.z + B.a ; uint ez = wesZeile( c, 2 );
fprintf( f, "\n" );
__ B.a = c - B.z ;
}
esif At( c, "//" )
{
B.z[ B.e ] = '\n' ;
char * e = c ; BOOL PC = 0 ; to_( e, '\n' )
if ( B.z + B.e < e ) fErr
char * x = c + 2 ; skip_space( x )
if At( x, "System.out" )
{
B.a = e - B.z ;
continue ;
}
if ( noAutoComment )
{
char * cm = c ;
while ( At( c, "// HTML //" )
|| At( c, "// end" )
|| At( c, "// begin [file=" )
|| At( c, "//GEN-" )
)
{
// this is ArcStyler Comment
// this is OptimalJ Comment
to_( c, '\n' ); skip_space( c );
B.a = c - B.z ;
}
if ( cm < c ) continue ;
}
if At( c, "// insert custom code" ) custom_code++ ;
if ( etoc && At( c+3, "[ --" ) ) // siehe ERD_JAVA.ic
{
fprintf( f, "<a name=%i></a>", etoc );
toc[ etoc++ ] = "Programmer's Code" ;
}
*e = 0 ;
//
fprintf( f, "<font class=\"co\">%s</font>", escape( c, B.z + B.e ) );
B.a = e - B.z ; *e = '\n' ;
}
else offset = 1 ;
}
esif ( *c == '\n' )
{
if ( c[1] != '\n' ) LLOC += 1 ;
while At( c, "\n\n\n" ) c++ ;
B.a = c - B.z ;
if ( B.ateof ) while ( B.z[ B.e-1 ] == '\n' ) B.e-- ;
__ offset = 1 ;
}
esif ( *c == '"' )
{
if ( asChar( c ) || escaped( c ) ) continue_( 1 )
js_user( from, "java", c+1 );
// traceStr("cmX",c-1,100 );
__ char * e = c+1 ; to_( e, '\n' ); *e = 0 ;
char * x = eos( c+1 );
// _1(c)
while ( x < e ) { *x = ' ' ; x = eos( c+1 ); } // Bug bes.
// _1(c+1)
x = in_str( '"', c+1 );
if ( !x )
{
x = c ;
while ( ++x < e ) _1( (uchar)*x );
traceStr( "cm1", c-1 , 300 );
j2h_eof( B.file, "java" );
fErr
}
while ( x && escaped( x ) ) x = in_str( '"', x+1 );
if ( x )
then {
*e = '\n' ; e = x ;
}
else {
traceStr( "c-1", c-1, 200 );
j2h_eof( B.file, "java" );
{
m_errMess "System: string not ok?" m_
ret_error
}
;
}
while escaped( e ) { e++ ; to_( e, '"' ); }
char m = *e ; *e = 0 ;
__ Var_htm // char4000 htm ; St_htm u ; u.to_htm( c, htm, 4000 );
fprintf( f, "<font class=\"str\">%s\"</font>", htm );
*e = m ;
B.a = e+1 - B.z ;
}
esif space( c[-1] )
{
__ char * x = c ; to_space( x ); skip_space( x );
if not_in_name( *x ) { offset = 1 ; continue ; }
if At( c, "package" )
{
c += 7 ; skip_space( c );
char * e = c ; to_( e, '\n' ) e-- ;
while ( *e != ';' ) e-- ;
while in_str( *e, "; " ) e-- ; e++ ;
char m = *e ; *e = 0 ; fprintf( f,
"<font class=\"kw\">package</font> <a href=#toc>%s</a>", c );
check_package_name( from, c );
packages.StrIns( 'e', c );
strcpy( pack, c );
B.a = e - B.z ; *e = m ; continue ;
}
if At( c, "import" )
{
char * x = c + 6 ; skip_space( x );
char * e = x ; to_( e, ';' ) e-- ;
while space( *e ) e-- ; char m = *( ++e ); *e = 0 ;
char500 xx ; s_( xx, "%s/%s", x, pack );
importedTo.StrIns( 'e', xx, to );
*e = m ;
}
BOOL totoc = 0 ;
__ if ( mxetoc <= etoc ) fErr1( etoc )
if At( c, "interface " ) totoc = 2 ;
if At( c, "class " ) totoc = 2 ;
if ( totoc == 2 )
{
char * x = c-1 ; while ( *x != '\n' ) x-- ;
char * e = ++x ; while not_in_name( *e ) e++ ;
depth = min( e-x, depth + 1 );
BOOL sup = 2 ; x = c ;
to_space( x ); skip_space( x );
char800 supN ; *supN = 0 ; char * cN = supN ;
supN[ 252 ] = 0 ;
while not_in_str( *x, ";{" )
{
// char M = x[100]; x[100] = 0 ; _1(x) x[100] = M ;
if in_name( *x )
then {
char * n = x ;
while ( *x == '.' || in_name( *x ) ) x++ ;
char m = *x ; *x = 0 ;
if ( is_( n, "extends" )
|| is_( n, "implements" )
)
then {
sup = 1 ;
}
esif ( sup == 1 )
{
strcpy( cN, n );
if ( ! supN[ 252 ] )
supNames.StrIns( 'e', supN, Art );
}
esif ( sup == 2 )
{
s_( supN, "%s~", n );
cN = eos( supN );
sup = 0 ;
}
*x = m ;
skip_space( x )
}
esif At( x, "//" )
{
to_( x, '\n' );
}
esif At( x, "/*" )
{
while not_At( x, "*/" ) x++ ; x += 2 ;
}
else goto L8 ;
skip_space( x )
if ( *x == ',' ) { x++ ; skip_space( x ) }
}
goto L2 ;
L8: __ offset = 1 ; continue ;
}
L2: __ char * e = c ; while not_in_str( *e, "\"{\n;(=" ) e++ ;
char * k = e ;
if ( *e == '=' ) continue_( 1 )
if not_At( c, "catch" )
if not_At( c, "return" )
{
if ( *e == '(' ) totoc = 1 ;
e = c ; to_space( e ); skip_space( e )
if At( e, "abstract " ) totoc = 0 ; // postpone toc
esif At( e, "public " ) totoc = 0 ; // postpone toc
esif At( e, "void " ) totoc = 0 ; // postpone toc
esif At( e, "class " ) totoc = 0 ; // postpone toc
esif At( e, "interface " ) totoc = 0 ; // postpone toc
if ( totoc == 0 && in_str( *e, "aci" ) )
{
if ( *e == 'i' ) Art = "-- interface" ; else
if ( *e == 'c' )
{
Art = "-- class" ;
while space( *( --e ) ) {}
while in_name( *e ) e-- ;
if At( e+1, "abstract " ) Art = "-- abstract class" ;
}
}
}
e = c ; to_space( e ); char m = *e ; *e = 0 ;
if At( e+1, "defVis" )
then {
fprintf( f, "<font class=\"kw\">p.%s</font>", c );
// p.public means: public only in this package
// This is in Java the so-called default visibility
e += 7 ;
}
else fprintf( f, "<font class=\"kw\">%s</font>", c );
B.a = e - B.z ; *e = m ;
if ( totoc )
{
if ( *k == ';' )
{ _1(tmpp)
cp_file( "d:/xx/xx.tmpp", tmpp );
fErr1( k )
}
c = e ; skip_space( c ); e = c ; char mk = *k ;
if ( *k == '(' )
then {
e = k ;
c = e-1 ; while space( *c ) c-- ;
while not_space( *c ) c-- ; char * x = c++ ;
while space( *x ) x-- ;
x[1] = '$' ; rB_( B, 0, "$", f )
}
else to_space( e )
__ if ( e[-1] == '{' ) e-- ;
char * e1 = e ; // _1(e1) __ __ _1(xxx)
m = *e ; *e-- = 0 ; while ( *e == ' ' ) *e = 0 ;
char * x = substr( "//", c ); if ( x ) *x = 0 ;
if ( totoc == 2 )
{
className[ depth ] = such.take( c );
if ( ! className[0] ) fErr1( depth )
char400 xx ; strcpy( xx, className[0] ); int i = 0 ;
while ( ++i <= depth )
{
s_( eos(xx), " . %s", className[i] );
}
toptoc = atClass = such.take( xx );
}
__ if ( etoc && toc[ etoc-1 ] ) fprintf( f, "<a name=%i></a>", etoc );
if is_( c, "main" )
{
fprintf( f, "<a name=m%i></a>", mNr );
char200 xx ; s_( xx, "%s#m%i", to, mNr );
if ( 1000 <= mNr ) fErr1( mNr )
main_me[ mNr ].at = such.take( xx );
main_me[ mNr ].of = atClass ;
main_me[ mNr++ ].me = such.take( from );
}
fprintf( f, " <a href=\"#%s\">%s</a>", toptoc , c );
if ( mk != '(' )
{
c -= 4 ; while not_space( *c ) c-- ; c++ ;
if not_in_str( *c, "ci" ) fErr1( c )
c[ strlen( c ) ] = ' ' ; *k = mk ;
to_( k, '{' ); *k = 0 ;
e++ ; skip_space( e ); fprintf( f, "\n%s", e );
mk = '{' ;
}
else
{
char * x = c ;
while not_in_str( *x, "{\n" ) x++ ; x-- ;
if At( x, " {" ) *x = '\n' ;
}
// __ _1(xxx)
// *e1 = m ; //?
__ e = c ; while ( *e && *e != '/' ) e++ ;
__
char m = *e ; *e = 0 ;
if ( mxetoc <= etoc ) fErr1( etoc )
if ( totoc == 2 )
then {
char400 xx ; s_( xx, "%s %s", Art, atClass );
klassenArt.StrIns( 'e', atClass, Art );
toc[ etoc++ ] = such.take( xx );
}
esif not_At( c-4, "new" )
{
toc[ etoc++ ] = such.take( c );
}
B.a = k - B.z ; *e = m ; *k = mk ; // erst *e, dann *k
}
}
esif At( c, ";import " )
{
offset = 0 ; *c = '\n' ; fprintf( f, ";" );
}
else offset = 1 ;
if ( !*xxx ) fErr1( xxx-7 )
}
if ( custom < custom_code )
then {
char400 xx ;
s_( xx, "[ %4i LOC ] %3i %s", LLOC, custom_code - custom, from );
custom_files.StrIns( 'i', xx );
}
// -----------------------------------------------------------------------------
if ( ! *pack ) printf( "\nW a r n i n g : No package in %s.java\n", from );
int i = -1 ; char * nz = "" ;
fprintf( f, "<br><a name=toc></a></pre><font face=\"Verdena,Arial\" size=2>" );
char400 class_or_interface ; strcpy( class_or_interface, "?" );
while ( ++i < etoc )
{
char * e = toc[i] ; if ( ! e ) continue ;
if At( e, "-- " )
then {
// class, abstract class, or interface:
e += 3 ; if ( *e == 'a' ) e += 13 ;
to_space( e ) *e++ = 0 ; skip_space( e ); char * n = e ;
// traceStr( "nnn", n, 200 );
if ( *n == '.' ) n += 2 ;
if not_in_name( *n ) fErr1( n )
fprintf( f, "\n<a name=\"%s\"></a>", n );
while ( *e && not_space( *e ) || At( e, " . " ) )
{
if ( *e == '.' ) e += 2 ; else e++ ;
}
char * x = e ;
if ( *e )
{
*e++ = 0 ; char * x = e + strlen( e ) - 1 ;
while ( e <= x && in_str( *x, "\n {" ) ) *x-- = 0 ;
}
char400 us ; s_( us, "%i.%s", ++usNr, n );
char400 pc ; s_( pc, "%s~%s", to, pack );
useOf.StrIns( 'i', us, pc );
//
uint naNr = defNameNr( n );
fprintf( f, "\n%s<a href=#top>top</a>,"
"\n<a href=\"u/%i.htm\">use</a>,"
"\n<a href=\"m/%i.htm\">map</a>,"
"\n<a href=#%i>%s</a><b><font size+2> %s"
, nz, naNr, naNr, i, toc[i] + 3, n );
char100 nAt ; s_( nAt, "c%s#%i", to, i );
//
// Beachte: Das 'm' oder 'c' vor n/m.htm (n eine Zahl) muss
// stehen bleiben (als eine Art type identifier). Somit ist
// erst nAt+1 der Pfad zur HTML Seite.
cppsecs.StrIns( 'e', n, nAt ); defNameNr( n ); __
if not_in_name( *n ) fErr1( n )
nz = "<br>" ; char * b = "" ;
fprintf( f, "</font></b><br>" );
strcpy( class_or_interface, n );
}
esif not_is_( e, "=" )
{
fprintf( f, "\n<br>. <a href=#%i>%s</a>", i, e );
nz = "<br><br>" ;
KVStore mm ;
s_( mm.k, "%s :: %s", class_or_interface, e );
s_( mm.c, "c%s#%i", to, i );
if ( *class_or_interface != '?' )
{
cppsecs.StrIns( 'e', mm.k, mm.c );
}
}
}
fprintf( f, "\n</font><pre></pre>%s%s%s\n", t1, c+1, t2 );
// Das <pre></pre> hier verbessert tats„chlich das Layout !!!
fprintf( f, "\n<br><font size=1>%i neLoCode"
"\n+ %i LoComm</font></body></HTML>\n", LLOC, LoComm );
close( f ); Unlink( tmpV );
// -----------------------------------------------------------------------------
LOC += LLOC ; ALoComm += LoComm ;
// fErr1(xx)
shorter( xx );
s_( xx, "\n<br><a href=\"%s#toc\"\nTARGET=\"frame3\">%s</a>", to, c+1 );
xx[250] = 0 ;
s_( xx + 300, "%s+%s+%i+%i", pack, c+1, LLOC, LoComm );
PACKAGES.StrIns( 'e', xx + 300, xx );
LE_
/* private: */ void Java2Htm :: shorter ( char * htm
/* -----------------------------------------------------------------------------
besseres Comment Ende und besseres {} Layout
-----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.shorter")
char * tmp = "xx_shorter" ; FILE * f = create( tmp );
__
rBuffer B( htm, "" );
__
while ( B.find( 1, "\n|", f ) )
{
B.getmore( 4000 );
B.z[ B.e ] = B.z[ B.e+1 ] = '\n' ;
char * c = B.z + B.a ;
char * e = c ;
while ( e[1] == '|' ) { e++ ; to_( e, '\n' ) }
while ( e[1] == '\n' ) *e++ = ' ' ;
if ( e[1] != '|' )
then {
*e = 0 ;
char * x = e-1 ;
while ( c < x && *x != '<' ) x-- ;
if ( x == c ) x = e ;
*x = 0 ;
e++ ; skip_space( e )
char * s = e ; to_( s, '<' )
s = iAt( s, "</FONT" )? "" : "</font>\n" ;
// s = iAt( s, "</FONT" )
fprintf( f, "\n%s\n|%s", c+1, s );
B.a = e - B.z ;
}
}
close( f );
// -----------------------------------------------------------------------------
f = create( htm );
B.open_rBuffer( tmp, "" );
while ( B.find( 1, "\n", f ) )
{
char * c = B.z + B.a + 1 ;
if ( *c == '{' )
{
while ( space( *(++c) ) ) *c = ' ' ; c[-1] = '\n' ;
}
skip_space( c )
if ( in_str( *c, "}+" ) && c < B.z + B.e )
{
uint nz = 0 ;
while space( *(--c ) ) if ( *c == '\n' ) if ( nz++ ) *c = ' ' ;
}
}
__
close( f ); unlink( tmp );
printf( "\ndone(shorter): %s", htm );
LE_
/* private: */ uint Java2Htm :: defNameNr ( char * name
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.defNameNr")
if ( ! name || ! *name ) fErr
char400 nA ; strcpy( nA, name );
char * x = in_str( '<', nA ); if ( x ) { *x = 0 ; name = nA ; }
KVStore st ; char400 xx ;
if ( ! nameNr.Get( name, st ) )
then {
s_( xx, "%i", ++nam_Nr ); nameNr.StrIns( 'e', name, xx );
if ( x )
{
*x = '<' ; nameNr.StrIns( 'e', name, xx );
}
ret( nam_Nr )
}
LE_ret( decNr( st.c ) )
/* private: */ void Java2Htm :: show_xml_files
/* -----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/ (
char * app
, char * pageTitle
)
LB_("Java2Htm.show_xml_files")
char1000 xx ; s_( xx, "%s/j2h/dep.htm", app );
_1(xx)
if is_file( xx ) ret_
_1(xx+0)
FILE * f = create( xx ); fprintf( f,"%s"
"\n<a name=top></a><br>%s%s%s<pre></pre>", kopf, t1, pageTitle, t2 );
char * tmp = "__1" ;
// S_ "wfind %s -name *.xml > %s", app, tmp _Do -- geht so nicht, warum?
S_ "wfind \"%s\" | grep \\.xml > %s", app, tmp _Do
path def ; s_( def, "%s/default", app );
rBuffer B( tmp, "\n" );
while ( B.find( 0, "\n", 0 ) )
{
char * c = B.z + B.a + 1 ;
char * e = c ; to_( e, '\n' ) *e = 0 ;
s_( xx, "%s/j2h%s", app, c + strlen( app ) );
char * s = xx + strlen( xx ) - 1 ; unix_me( xx );
while ( *s != '/' ) s-- ; *s = 0 ; dir_exist( xx ); *s = '/' ;
if is_file( c )
{
cp_file( xx, c ); s = xx + strlen( app ) + 5 ;
if not_At( c, def )
{
fprintf( f, "\n<br><a href=\"%s\" TARGET=\"frame3\">%s</a>"
, s, c + nskip );
}
}
B.a = e - B.z ; *e = '\n' ;
}
close( f ); Unlink( tmp )
LE_
/* private: */ char * Java2Htm :: Tips_to_htm
/* -----------------------------------------------------------------------------
present our tips = app/our_Tips in form of *.htm
|----------------------------------------------------------------------------
*/ (
char * app
)
LB_("Java2Htm.Tips_to_htm")
char1000 ourTips ; s_( ourTips, "%s/tips/tips.htm" , app );
char1000 our_ERD ; s_( our_ERD, "%s/our_ERD.txt" , app );
char1000 preTips ; s_( preTips, "%s/j2h/tip" , app );
MsHtm ut ;
if path_exists( ourTips )
then {
anzTips = ut.split_MS_htm( ourTips, ":::", preTips, Tips, such );
if ( mxtip <= anzTips ) fErr1( anzTips )
}
else anzTips = 0 ;
__ show_xml_files( app, "XML Files" ); __
if not_is_file( our_ERD )
{
__ show_xml_files( app, "XML Files" ); ret( "f.htm" )
}
char1000 xx ; s_( xx, "%s/j2h/docu.htm", app );
FILE * f = create( xx ); fprintf( f,"%s"
"\n<a name=top></a><br>%sOverview%s<pre></pre>"
, kopf, t1, t2
);
fprintf( f, "\nClick on a Folder or on a Class to see code,"
"\nor read some of the following documentation:"
"\n<br>"
"\n<br><font size=+1>Sample Application</font>"
"\n<br>"
"\n<br><a href=\"../our_ERD.txt\" TARGET=\"frame3\">"
"\nOur Spec for Data and Sessions</a>"
"\n[= the only text that needs to be maintained manually]"
"\n<br>"
"\n<br><a href=\"er1.htm#toc\" TARGET=\"frame3\">"
"\nOur Data - the Entity Relationship Diagram</a>"
"\n<br><a href=\"sql.htm#toc\" TARGET=\"frame3\">"
"\nOur Data - the Table and View Specifications</a>"
"\n<br>"
"\n<br><a href=packages.htm>Code for our Sample Application</a>"
"\n- not yet tested"
"\n<br><a href=dep.htm>Our Sample's Default Deployment</a>"
"\n- not yet tested"
"\n<br>"
"\n<br>"
"\n<br><font size=+1>EJB 2.0 Know How</font>"
"\n<br><br><a href=\"../tips/j2ee.ppt\" TARGET=\"frame3\">"
"\nA short Introduction to J2EE Architecture"
"\n<br><a href=\"http://java.sun.com/j2ee/tutorial\" TARGET=\"frame3\">"
"\nSun's J2EE Tutorial"
"\n<br><a href=\"tips.htm#toc\" TARGET=\"frame3\">"
"\nRead also: EJB Know How Items</a>"
"\n<br>"
"\n<br><a href=ex6.htm>Abstract Entity Bean</a>"
"\n<br><a href=ex7.htm>Abstract Session Bean</a>"
);
if ( anz_samples == 5 ) fprintf( f,
"\n<br>"
"\n<br>Study this sample <a href=ex1.htm>CMP Bean</a>"
"\n<br>Study this sample <a href=ex2.htm>BMP Bean</a>"
"\n<br>Study this sample <a href=ex3.htm>Stateless Session Bean</a>"
"\n<br>Study this sample <a href=ex4.htm>Stateful Session Bean</a>"
"\n<br>Study this sample <a href=ex5.htm>Message Driven Bean</a>"
);
close( f );
__ show_xml_files( app, "Our Sample's Default Deployment" ); __
// -----------------------------------------------------------------------------
s_( xx, "%s/j2h/tips.htm", app );
f = create( xx ); fprintf( f,"%s"
"\n<a name=top></a>"
"\n<a href=1.htm>Samples</a>"
//
"\n<br>%sEJB 2.0 Know How Items%s<pre></pre>"
, kopf, t1, t2
);
int i = anzTips + 1 ;
while ( --i )
{
fprintf( f, "\n<br><a href=tip%i.htm>%s</a>", i, Tips[i] );
}
fprintf( f, "\n<br><br>This set of Know How Items is to reflect best practices, and"
"\nshould therefore be updated continuously."
"\nContributions or comments from you especially,"
"\ndear reader, would be appreciated. Please send them to"
"\n<a href=mailto:grt@softlab.de>Gebhard Greiter</a>." );
close( f );
S_ "copy \"%s\" \"%s/j2h/tip%i.htm\" > NUL", xx, app, 0 _Do
S_ "copy \"%s\" \"%s/j2h/tip%i.htm\" > NUL", xx, app, anzTips + 1 _Do
// -----------------------------------------------------------------------------
if is_dir( "j2h_res" )
{
S_ "copy j2h_res/j2ee.ppt \"%s/j2h\" > NUL", app _Do
}
LE_ret( "tips.htm#top" )
/* private: */ void Java2Htm :: name_ALL_code_docu_files (
/* -----------------------------------------------------------------------------
Create j2h/docu_files - the list all file containing code documentation
- is for the benefit of projweb.exe -
-----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.name_ALL_code_docu_files")
__
if ( ! app ) fErr
char800 xx ; s_( xx, "%s/j2h/docu_files", app );
FILE * f = create( xx );
// Name all file containing code documentation items:
fprintf( f, "\n- J2EE EJB 2.0~tips.htm~=tip~" );
// This is to say: Each <a href=tip... > found in j2h/f.htm is a link to some
// Know How Item.
fprintf( f, "\n" );
close( f );
__
LE_
/* private: */ int Java2Htm :: wesZeile
/* -----------------------------------------------------------------------------
setze x = Start der n„chsten wesentlichen Zeile
return Zahl der vorangehenden Leerzeilen (at most m)
-----------------------------------------------------------------------------
*/ (
char * & x
, uint m
)
LB_("Java2Htm.wesZeile")
uint ez = 0 ; char * z = x ;
while ( space( *x ) || *x == '*' )
{
if ( *x == '\n' ) ez++ ;
if ( *x == '*' ) z = x ;
x++ ;
}
x = z ;
LE_ret( min( m, ez ) )
/* private: */ void Java2Htm :: up ( char * x
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.up")
x++ ; while ( *x == '*' || space( *x ) ) x++ ; *x = upper( *x );
LE_
/* private: */ char Java2Htm :: do_Comment
/* -----------------------------------------------------------------------------
Find and make hot spots references to Know How Items.
Precondition: Tips_to_htm() was called already
|----------------------------------------------------------------------------
*/ (
FILE * f
, rBuffer & B
)
LB_("Java2Htm.do_Comment")
if ( ! f ) fErr
int ez1 = -2 ; fprintf( f, "\n" );
if ( anzTips < 0 ) fErr // Tips_to_htm() not called so far
char * cz1 = "|\n" ; char * cz = "" ; uint uX = 0 ;
while ( ++uX )
{
if ( B.e <= B.a ) ret( ' ' )
B.getmore( 8000 ); strcpy( B.z + B.e, "\n11" );
char * x = B.z + B.a ; uint ez = 0 ; // _2(x,uX)
if At( x, "/*" )
then {
ez = wesZeile( x, 0 );
}
else ez = wesZeile( x, abs( ez1 ) );
B.z[ B.e ] = 0 ;
char * e = x ; if ( *e == '\n' ) e++ ;
while ( *e && *e != '\n' && ! ( At( e, "**/" ) || At( e, "*/" ) ) )
{
if ( B.z + B.e < e ) fErr1( B.z + B.e - e )
if in_str( *e, "\"'" )
then {
__ while ( *e == '"' ) skip_str( e, B.z + B.e );
__ while ( *e == '\'' ) skip_str1( e, B.z + B.e );
}
else e++ ;
}
if ( *e == '*' )
then {
while ( *e == '*' ) *e++ = ' ' ;
}
BOOL eoc = ( *e == '/' ); if ( eoc ) *e++ = ' ' ;
if ( B.z + B.e < e ) fErr
*e = 0 ;
char * z = e-1 ;
while ( x <= z && space( *z ) )
{
*z-- = 0 ; if is_( z-2, "<p>" ) { z -= 2 ; *z-- = 0 ; }
}
if ( is_( z-3, "<br>" ) || is_( z-3, "<br>" ) ) z[-3] = 0 ;
// char * nz = "\n*\n*\n*\n*" ; if ( *x == '*' ) x++ ;
char * nz = "\n|\n|\n|\n|" ; if ( *x == '*' ) x++ ;
char * x1 = x ; while ( *x1 && space( *x1 ) ) x1++ ; L:
if ( *x1 == '-' )
then {
__ char * c = x1 + 1 ; skip_space( c )
char * x = c ; to_( x, '\n' ) x-- ;
while in_str( *x, " .," ) x-- ;
char m = *( ++x ); *x = 0 ; int i = anzTips + 1 ;
while ( --i ) if is_( c, Tips[i] ) break ;
if ( i )
{
ez1 = 2 ; LoComm++ ;
fprintf( f, "\n%s| - <a href=tip%i.htm>%s</a>", cz, i, c );
B.a = x - B.z ; cz = "" ;
}
*x = m ; if ( i == 0 ) { x1-- ; goto L ; }
}
esif ( *x && not_is_( x, "/**" ) )
{
if is_( x, " <p>" ) { ez = 1 ; *x = 0 ; }
if At( x, "/** " ) { x += 2 ; *x = '|' ; } else
if is_(x, "/*" ) { x += 1 ; *x = '|' ; } else
if At( x, "/* " ) { x += 1 ; *x = '|' ; }
if ( 1 < ez || ez1 < 0 )
{
char * u = x ; while space( *u ) u++ ; *u = upper( *u );
}
char4000 sz ; char * s = sz ; x-- ;
while ( *( ++x ) )
{
if ( *x == '<' )
then {
*s++ = '&' ;
*s++ = 'l' ;
*s++ = 't' ;
*s++ = ';' ;
}
else *s++ = *x ;
}
*s = 0 ;
fprintf( f, "%s%s", nz + ( 8 - 2 * ez ), sz );
ez1 = 2 ; LoComm++ ; cz = cz1 ;
}
B.a = e - B.z ; *e = '\n' ; // traceStr( "EEE", e-5, 10 );
if ( eoc ) ret( 0 )
if ( eoc ) ret( ' ' )
}
LE_ret( 'x' )
/* private: */ void Java2Htm :: show_the_JSP_includes (
/* -----------------------------------------------------------------------------
create a page showing all JSP includes
|----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.show_the_JSP_includes")
char * n = "JSP Includes" ;
char1000 xx ; s_( xx, "%s/inc", j2h ); create_css( xx );
s_( eos( xx ), "/incs_jsp.htm" ); FILE * f = create( xx );
fprintf( f, "\n%s<a name=top></a>%s%s%s<font size=2><br>"
"\nDepth of JSP include relation = %i<br>"
, kopf, t1, n, t2, deRe );
int anz = 0 ;
KVStore st ; Surr s = incs_jsp.GetFirst( st ); int preNr = -1 ;
FILE * f1 = 0 ; char800 zuVor ; *zuVor = 0 ; int anzVers = 1 ;
while ( s )
{
int i = decNr( st.c ); // _1( fNam[i] )
if ( preNr != i )
{
anz++ ;
if ( ! fNam[i] ) fErr2( i, cfNr )
preNr = i ; unix_me( fNam[i] ); // erst hier !!!
char * c = fNam[i] + 1 ;
char * e = eos( c ) - 1 ;
while ( c <= e && *e != '/' ) e-- ; e++ ;
char10 Vers ; *Vers = 0 ;
if not_is_( zuVor, e )
then {
strcpy( zuVor, e ); anzVers = 1 ;
}
else s_( Vers, ", %i", ++anzVers );
fprintf( f, "\n<br>[ <a href=%i.htm>use</a> ]"
"\n <a href=../%s.htm>%s%s</a>"
, i, nr2( i ), e, Vers );
if ( f1 ) close( f1 );
char1000 xx ; s_( xx, "%s/inc/%i.htm", j2h, i );
f1 = create( xx );
fprintf( f1, "\n%s<a name=top></a>%s%s%s<font size=2>"
"\n<br>is included to:<br>"
, kopf, t1, e, t2 );
}
char * c = st.k ; to_( c, '>' ) c++ ;
char * nam = semiPath( fNam[ decNr(c) ] ); __
fprintf( f1, "\n<br><a href=../%s.htm>%s</a>", nr2( decNr( c ) ), nam );
s = incs_jsp.Next( st );
}
fprintf( f, "\n<br><br></font><font face=\"Verdena,Arial\" size=1>"
"\n<font size=4>%s%s%s<br></font>"
"\n<font size=1>%i JSP include files ( used %i times )</font></font>"
, t1, n, t2, anz, anz_of( co_JSP ) );
close( f ); if ( f1 ) close( f1 );
LE_
/* private: */ void Java2Htm :: to_INCs
// -----------------------------------------------------------------------------
(
int i // fNr of include
, int s // fNr of source
)
LB_("Java2Htm.to_INCs")
char40 xx ;
if ( i != s )
{
s_( xx, ">%i=%i", s, i );
winc[i] = true ; INCs.StrIns( 'e', xx );
}
LE_
/* private: */ uint Java2Htm :: JSP_to_htm
// -----------------------------------------------------------------------------
(
int fNr // nr of page
, char * jsp // path to a JSP Page
)
LB_("Java2Htm.JSP_to_htm")
if ( erledigt( 1, jsp ) ) ret( 0 )
char1000 xx ; s_( xx, "%s/%s.htm", j2h, nr2( fNr ) );
if is_file( xx ) ret( 0 )
SCTr printf( "\ncp %s x8", jsp );
BOOL hasIncs = false ;
uint deep = 0 ;
char1000 fn ; strcpy( fn, jsp ); unix_me( fn );
char * c = jsp + strlen( jsp ) - 1 ;
while ( jsp < c && not_in_str( *c, "/\\." ) ) c-- ;
char m = ( *c == '.' )? '.' : 0 ;
char * e = ( m )? c : eos( jsp ); *e = 0 ;
while ( *c != '/' ) c-- ; c++ ;
char * jspfNam = c ;
char1000 ix ; s_( ix, "=%i=%s.jsp", fNr, fn ); incsMe.StrIns( 'e', ix );
s_( ix, "=%i=%s.jsp", fNr, jspfNam ); INCs.StrIns( 'e', ix );
s_( ix, "%s . jsp", c );
char800 resAt ; strcpy( resAt, xx );
__ FILE * f = create_mit_meta( xx, ix );
__
*e = m ; rBuffer B( jsp, "\n" ); *e = 0 ; // muss sein
str_set such ; such.insert( "<" ); int commands = 0 ;
such.insert( "\"" ); int offset = 0 ;
such.insert( "\n\n\n" );
such.insert( "/*" );
such.insert( "//" );
such.insert( "%@" );
such.insert( "javascript:" );
BOOL correct = 1 ;
while ( B.find( offset, such, f ) )
{
B.getmore( 8000 );
char * c = B.z + B.a ; offset = 0 ;
// _1( B.ii )
// if ( 10 < B.ii ) fErr
// if ( call_Nr < 118153 ) traceStr( "ZZZ",c,200 ); //_1( jsp )
__
if ( *c == '\n' )
{
B.a++ ; continue ;
}
if ( *c == 'j' || *c == 'J' )
{
__ js_user( jsp, "jsp", c ); offset = 10 ; continue ;
}
__
if ( *c == '"' )
{
__ js_user( jsp, "jsp", c+1 );
if ( c[-1] == '\\' || At( c-1, "'\"'" ) ) continue_( 1 )
__
B.z[ B.e ] = '\n' ;
char * e = weiter( c+1 );
if ( *e == '"' )
{
while ( e[-1] == '\\' && e[-2] != '\\' )
{
e = weiter( e+1 ); if ( *e == '\n' ) break ;
}
}
char m = *e ;
B.a = e+1 - B.z ;
if ( m == '\n' ) correct = quote_not_found( c, jsp );
*e = 0 ;
Var_htm // char4000 htm ; St_htm u ; u.to_htm( c, htm, 4000 );
*e = m ;
fprintf( f, "<font class=\"kw\">%s\"</font>", htm ); // kw statt str
if ( At( c-5, "code=" ) && e-c < 300 )
{
code_uses( "jsp", fNr, jsp, c+1 );
}
if space( B.z[ B.a ] ) // nicht schon oben !!!
{
while space( B.z[ B.a ] ) B.a++ ; B.z[ --B.a ] = ' ' ;
}
continue ;
}
if ( noAutoComment )
{
char * cm = c ;
L1: if ( At( c, "<%-- START OF PROTECTED" )
|| At( c, "<%-- END OF PROTECTED" )
)
{
rB_( B, 1, "--%>", 0 )
c = B.z + B.a + 4 ; skip_space( c ); B.a = c - B.z ;
if At( c, "<%" ) goto L1 ;
}
L2: if ( At( c, "/* START OF PROTECTED" )
|| At( c, "/* END OF PROTECTED" )
)
{
rB_( B, 1, "*/", 0 )
c = B.z + B.a + 2 ; skip_space( c ); B.a = c - B.z ;
if At( c, "<%" ) goto L1 ;
if At( c, "/*" ) goto L2 ;
}
if ( cm < c ) continue ;
}
if At( c, "<%--" )
{
if ( see_jsp_comment )
then {
B.a += 1 ; fprintf( f, "<font class=\"co\"><" );
}
else fprintf( f, "<font class=\"co\">" );
rB_( B, 1, "--%>", f ) B.a += 4 ;
c = B.z + B.a ; skip_space( c )
while At( c, "<%--" )
{
memcpy( c, "| ", 4 ); rB_( B, 1, "--%>", f ) B.a += 4 ;
c = B.z + B.a ; skip_space( c )
}
fprintf( f, "--%%><br><br></font>" );
B.a = c - B.z ; continue ;
}
if At( c, "<!--" )
{
fprintf( f, "<font class=\"co\">" ); B.find( 1, "-->", f ); B.a += 3 ;
fprintf( f, "--></font>" ); continue ;
}
if ( *c == '<' )
{
commands++ ; B.a += 1 ; fprintf( f, "<" );
}
if At( c, "//" )
{
char * e = c ; to_( e, '\n' ) *e = 0 ;
FILE * f1 = in_str( '"', c )? 0 : f ; *e = '\n' ;
fprintf( f, "<font class=\"co\">" ); B.find( 1, "\n", f1 );
fprintf( f, "</font>" ); continue ;
// f1 in case of unbalanced quotes or code that is obsolete
}
if ( At( c, "/*" ) && c[2] != '/' )
{
fprintf( f, "<font class=\"co\">" ); B.find( 1, "*/", f ); B.a += 2 ;
fprintf( f, "*/</font>" ); continue ;
}
if ( *c == '%' ) // <%@ ...
{
hasIncs = true ; char * z = c ;
to_( c, '"' ) *c++ = 0 ;
char * e = c+1 ; to_( e, '"' ) *e = 0 ; B.a = e+1 - B.z ;
__
while ( c )
{{
char * ko = in_str( ',', c );
if ( ko ) *ko = 0 ;
KVStore st ; char1000 xx ; make_path( jsp, xx, c ); _1(xx+3-3)
char1000 inc ; *inc = 0 ; if ( *xx )
Ls: {{ if ( jspNames.Get( xx, st ) )
then {
if not_digit( *st.c ) fErr2( st.k, st.c )
int i = decNr( st.c ); int x = i/100 ;
fprintf( f, "%s<a href=../%s.htm>\"%s\"</a>", z, nr2( i ), c );
s_( inc, "%s->%i", st.c, fNr );
to_INCs( i, fNr );
}
esif is_file( xx )
{
___ uint sNr = sourceNr( xx, co_JSP )
to_INCs( sNr, fNr );
fprintf( f, "%s<a href=../%s.htm>\"%s\"</a>", z, nr2( sNr ), c );
char20 nr ; s_( nr, "%i", sNr );
s_( inc, "%s->%i", nr, fNr );
jspNames.StrIns( 'e', xx, nr );
}
else {
if ( shrink_path( xx ) ) goto Ls ;
fprintf( f, "%s<font class=\"kw\">\"%s\"</font>", z, c );
// if not_in_str( '*', c )
c = e+1 ; skip_space( c );
if At( c, "import" )
{
to_( c, '"' ) e = ++c ; to_( e, '"' ) *e = 0 ;
B.a = e+1 - B.z ;
fprintf( f, " import=<font class=\"kw\">\"%s\"</font>", c );
while ( *c )
{
if ( *c == ',' ) { c++ ; skip_space( c ) }
z = c ; if ( *c == ';' ) break ;
while ( in_name( *c ) || in_str( *c, ".*" ) ) c++ ;
char m = *c ; *c = 0 ;
code_uses( "jsp", fNr, jsp, z );
*c = m ; if ( *c == ',' ) c++ ;
skip_space( c )
}
}
}
}}
if ( *inc )
then {
char * x = eos( xx ) - 1 ;
while ( xx < x && x[-1] != '/' ) x-- ;
char * u = x ; while ( xx < u && *u == '/' ) u-- ;
while ( xx < u && u[-1] != '/' ) u-- ;
char800 k ; s_( k + 2, "%s~%s", u, inc );
k[0] = upper( *u ); k[1] = *u ; k[250] = 0 ;
incs_jsp.StrIns( 'e', k, inc );
}
if ( ko )
then {
c = ko + 1 ; skip_space( c )
}
else c = 0 ;
}}
}
}
char * se = "" ; if ( ! correct )
se = " <br><b>There seem to be syntax errors "
"( at least one missing \" ).</b>" ;
*e = m ;
if ( winc[ fNr ] )
then {
s_( xx, "<a href=../bf/%i.htm>is_inc_for</a> . ", fNr );
}
else *xx = 0 ;
fprintf( f, "\n</pre></font><a name=eof></a><font face=\"Verdena,Arial\">"
"\n<font size=2><a href=#top>top</a> . %s<a href=../jsp.htm>JSP</a>"
"\n<font size=3>%send of %s%s<br></font>"
"\n%sInclude structure of<br>%s<br><br>"
, xx, t1, c, t2, se, gutLesbar( fn ) );
close( f );
anz_jsp_commands += commands ;
LE_ret( deep )
/* private: */ char * Java2Htm :: gutLesbar ( char * fn
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.gutLesbar")
char * x1 = fn + nskip - 1 ;
char * x2 = sprPath ;
while ( *( ++x1 ) )
{
if ( *x1 == '/' )
then {
*x2++ = ' ' ;
*x2++ = *x1 ;
*x2++ = ' ' ;
}
else *x2++ = *x1 ;
}
*x2 = 0 ;
LE_ret( sprPath )
/* private: */ void Java2Htm :: code_uses
// -----------------------------------------------------------------------------
(
char * code
, int fNr
, char * fn
, char * uses
)
LB_("Java2Htm.code_uses")
char * a = eos( fn ) - 1 ;
while ( fn <= a && *a != '\\' ) a-- ;
char * x = in_str( '"', uses ); if ( x ) *x = 0 ;
char400 us ; s_( us, "%i.%s.%s" , ++usNr, a+1, code );
char400 pc ; s_( pc, "%s%i.htm~%s" , code, fNr, uses );
if ( x ) *x = '"' ;
us[ 380 ] = 0 ; if ( strlen( us ) >= 250 ) fErr1( us )
pc[ 380 ] = 0 ; if ( strlen( pc ) >= 250 ) fErr1( pc )
useOf.StrIns( 'e', us, pc );
LE_
/* private: */ void Java2Htm :: report_syntaxError
// -----------------------------------------------------------------------------
(
char * c
, char * fn
)
LB_("Java2Htm.report_syntaxError")
while ( *c != '\n' ) c-- ;
char * e = c+1 ;
while ( *e != '\n' ) { if ( ! *e ) *e = '"' ; e++ ; }
*e = 0 ;
printf( "\n\n%i. Syntax error (unbalanced \" quotes) in %s:"
"\n--------------------------------------\n[\n%s\n]\n"
, ++serr, fn, c );
*e = '\n' ;
// if ( serr == 4 ) fErr
LE_
/* private: */ char * Java2Htm :: weiter ( char * e
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.weiter")
while not_in_str( *e, "\"\n" ) e++ ;
LE_ret( e )
/* private: */ char * Java2Htm :: escstr ( char * str
/* -----------------------------------------------------------------------------
return pointer to an HTML presentation of 'str
|----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.escstr")
char * e = Esc ;
char * s = str-1 ;
while ( *( ++s ) )
{
if ( *s == '<' )
then {
*e++ = '&' ;
*e++ = 'l' ;
*e++ = 't' ;
*e++ = ';' ;
}
esif ( *s == '"' )
{
char * z = s+1 ; to_( z, '"' )
while ( z[-1] == '\\' && z[-2] != '\\' )
{
z++ ; to_( z, '"' )
}
*z = 0 ;
s_( e, "<font class=\"kw\">%s\"</font>", s );
e = eos( e ); s = z ;
}
else *e++ = *s ;
}
*e = 0 ;
__
LE_ret( Esc )
/* private: */ char * Java2Htm :: semiPath ( char * fn
/* -----------------------------------------------------------------------------
return a semi-qualified pathname
|----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.semiPath")
uint k = 0 ; char * e = eos( fn ) - 1 ;
while ( fn <= e && k < 2 ) if in_str( *(--e), "/\\" ) k++ ;
char * s = sempa ;
while ( *( ++e ) )
{
if ( *e == '/' )
then {
*s++ = ' ' ;
*s++ = ':' ;
*s++ = ' ' ;
}
else *s++ = *e ;
}
*s = 0 ;
LE_ret( sempa )
/* private: */ BOOL Java2Htm :: shrink_path ( char * p
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.shrink_path")
char * e = eos( p )-1 ;
while ( p < e && *e != '/' ) e-- ; char * z = e-2 ;
while ( p < z && *z != '/' ) z-- ;
if ( *z == '/' )
then {
strcpy( z, e );
ret( 1 )
}
LE_ret( 0 )
/* private: */ void Java2Htm :: to_incNames ( char * fn
/* -----------------------------------------------------------------------------
um sp„ter #include Pfade komplettieren zu k”nnen
|----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.to_incNames")
lower( fn );
char * c = fn ; while ( *c && *c != '/' ) c++ ;
while ( *c++ == '/' )
{
if ( incNames.contains( c ) )
{
//
fn = "" ;
}
char200 ck ; strcpy( ck, c ); lower( ck );
incNames.StrIns( 'e', ck, fn ); if ( ! *fn ) break ;
while ( *c && *c != '/' ) c++ ;
}
LE_
/* private: */ void Java2Htm :: make_path
/* -----------------------------------------------------------------------------
retrieve the #include path
|----------------------------------------------------------------------------
*/ (
char * f
, char * xx // the path found
, char * c
)
LB_("Java2Htm.make_path")
if in_str( ',', c ) fErr1( c )
lower( c );
char * x = c ; while ( c <= x && not_in_str( *x, "/\\" ) ) x-- ;
char * nam = x+1 ;
strcpy( xx, c ); unix_me( xx ); lower( xx );
x = eos( xx ); KVStore st ;
char * xx1 = xx + LRoot ;
while ( xx1 < x )
{
x-- ; while ( xx <= x && *x != '/' ) x-- ;
if ( incNames.Get( x+1, st ) && *st.c )
{
strcpy( xx, st.c ); ret_
}
else
{
printf( "\nno such inc_1: %s [aus f= %s]", x+1, f );
}
}
strcpy( xx, f ); unix_me( xx ); x = eos( xx );
while ( xx1 < x-- )
{
while ( xx <= x && *x != '/' ) x-- ; strcpy( x+1, nam );
if is_file( xx ) ret_
}
printf( "\nno such inc_2: %s [aus f= %s]", c, f );
if ( 0 )
{
#define Basis( B ) ( make_path_to_basis( f, xx, c, B ) )
if Basis( "k:/basis_inc/VC98" ) ret_
if Basis( "k:/basis_inc/VC98/MFC" ) ret_
if Basis( "k:/basis_inc/VC98/ATL" ) ret_
if Basis( "k:/basis_inc/sos/common/common 6.1" ) ret_
if Basis( "k:/basis_inc/sos/common/MVC 6.1" ) ret_
if Basis( "k:/basis_inc/sos/OT602" ) ret_
#undef Basis
printf( "\nno such inc_3: %s [aus f= %s]", c, f );
}
uint anzgef = 0 ;
{
// NUN SUCH GROB UND šBERALL:
int i = -1 ;
char300 inc ; s_( inc, "/%s", c );
uint L = strlen( inc );
*xx = 0 ;
while ( ++i < cfNr ) if ( fArt[i] == co_CPP )
{
if iAt( eos( fNam[i] ) - L, inc )
{
strcpy( xx, fNam[i] );
printf( "\ninc doch gefunden: %s = %s", c, xx );
}
}
printf( "\nanzgef= %i: %s = %s", anzgef, c, xx );
}
if ( anzgef == 0 ) noInc.StrIns( 'e', c );
LE_
/* private: */ BOOL Java2Htm :: make_path_to_basis
/* -----------------------------------------------------------------------------
retrieve the #include path
|----------------------------------------------------------------------------
*/ (
char * f
, char * xx // the path found
, char * c
, char * basis
)
LB_("Java2Htm.make_path_to_basis")
s_( xx, "%s/include/%s", basis, c );
if is_file( xx ) ret( 1 )
LE_ret( 0 )
/* private: */ void Java2Htm :: put_incs
/* -----------------------------------------------------------------------------
show the nested include structure of 'fn
Bitte auch asp von dieser ALTEN auf die neue L”sung
umstellen !!!!!!!
|----------------------------------------------------------------------------
*/ (
FILE * f
, uint de
, char * fn
, Btree & names
, char * str
, char * code // "cpp", "jsp", or "asp"
)
LB_("Java2Htm.put_incs")
if ( *code == 'c' ) fErr // for cpp we now use ADD_include_structure()
if ( *code == 'j' ) fErr // for jsp we now use ADD_include_structure()
if ( 4 < de ) ret_ // muss leider sein // maximal 10 macht Sinn
FILE * f1 = 0 ; if ( deRe < de ) deRe = de ;
FILE * fc = 0 ;
if ( de == 0 )
then {
Delete( schon ); schon = new Btree();
}
esif ( de == 1 )
{
KVStore st ; Surr s = tempNames.Get( fn, st );
if ( s )
{
fprintf( f, "<br>" );
rBuffer B( st.c, "" ); B.copy_to( f ); ret_
}
f1 = f ; char40 xx ;
s_( xx, "%s/%i", temp, ++tempNr );
fc = f = create( xx ); tempNames.StrIns( 'i', fn, xx );
}
else fprintf( f, "\n<br>" );
for ( int i = 0 ; i < de ; i++ ) fprintf( f, "%s", ". " );
KVStore st ;
if ( names.Get( fn, st ) )
then {
if is_( code, "cpp" )
then {
fprintf( f, "<a href=../%s.htm>%s</a>"
, nr2( decNr( st.c ) ), semiPath( fn ) );
}
else fprintf( f, "<a href=%s%s.htm>%s</a>", code, st.c, semiPath( fn ) );
}
else {
fprintf( f, "%s", semiPath( fn ) );
de++ ; if ( deRe < de ) deRe = de ;
if ( fc ) close( fc )
ret_
}
// _1( schon -> contains( fn ) ) _1(fn) _1(de) _1( call_nr )
if ( str && ! schon -> contains( fn ) )
then {
rBuffer B( fn, "\n" ); schon -> StrIns( fn );
while ( B.find( 1, str, 0 ) ) // str = #inc, #INC
{
char * c = B.z + B.a ;
if ( *c == '#' && not_space( c[-1] ) ) continue ;
to_space( c ); skip_space( c )
if is_( code, "cpp" )
then {
if ( *c == '<' ) *c = '"' ;
if ( *c != '"' ) continue ;
}
else to_( c, '"' )
char * e = ++c ;
while not_in_str( *e, "\">" ) e++ ; *e = 0 ;
char1000 xx ; make_path( fn, xx, c );
if ( ! *xx ) fErr
if ( is_file( xx ) && ! schon -> contains( xx ) )
{
put_incs( f, de+1, xx, names, str, code );
}
B.a = e+1 - B.z ;
}
}
_1(fn)
if ( f1 ) { close( f ); put_incs( f1, de, fn, names, str, code ); }
if ( fc && f ) close( f );
LE_
/* private: */ void Java2Htm :: ERD_to_htm
/* -----------------------------------------------------------------------------
present our ERD = app/our_ERD.a in form of *.htm
|----------------------------------------------------------------------------
*/ (
char * app // dir
, char * er1 // path to application's our_ERD.er1
)
LB_("Java2Htm.ERD_to_htm")
if not_is_file( er1 ) ret_
char1000 xx ; s_( xx, "%s/j2h/er1.htm", app );
rBuffer B( er1, "" ); rB_( B, 1, "\na:", 0 );
char * c = "ERD for the Relational Data" ;
FILE * f = create( xx ); fprintf( f,"%s"
"\n<a name=top></a><br>"
"\n<a href=#sem>Notation Semantics</a>, "
"\n<a href=#toc>Table of Contents</a><br><br>"
"\n%s%s%s<pre class=\"Classes\"><font size=2>"
, kopf, t1, c, t2
);
char * toc[ 1000 ]; int etoc = 0 ;
while ( B.find( 0, "\na: ", f ) )
{
char * c = B.z + B.a ;
char * e = c + 4 ; skip_space( e ) e-- ; *e++ = 0 ;
char * n = e + 2 ; to_space( n ) ; *n = 0 ;
if At( e, "Notation" )
then {
fprintf( f, "\n</pre><a name=sem></a>"
"\n<font face=\"Verdena,Arial\" size=4>"
"\nERD Notation Semantics:</font><pre>" );
rB_( B, 1, " Prefixes", 0 );
}
else {
fprintf( f, "\n</pre><a name=%i></a>"
"\n<font face=\"Verdena,Arial\" size=4>"
"\n%c<a href=#toc>_</a>%s</font><pre> "
, etoc, *e, e+2 );
toc[ etoc++ ] = such.take( e );
B.a = n - B.z ; *n = '\n' ;
}
}
int i = -1 ;
fprintf( f, "<br><a name=toc></a>\n\n</pre><font face=\"Verdena,Arial\" size=2>" );
fprintf( f, "\n<a href=#top>Back to top</a> -"
"\n<a href=#sem>Back to Notation Semantics</a> -"
"\n<a href=sql.htm#toc><b>goto SQL</b></a><br><br>"
"\n<font face=\"Verdena,Arial\" size=4>All ERD Sections:</font><br>" );
while ( ++i < etoc ) fprintf( f, "\n<br><a href=#%i>%s</a>", i, toc[i] );
fprintf( f, "\n</font><br><br><br>%s%s%s\n", t1, c, t2 );
close( f );
LE_
/* private: */ void Java2Htm :: SQL_to_htm
/* -----------------------------------------------------------------------------
present app/our_ERD.sql in form of *.htm
|----------------------------------------------------------------------------
*/ (
char * app // dir
, char * sql // path to application's our_ERD.sql
)
LB_("Java2Htm.SQL_to_htm")
if not_is_file( sql ) ret_
char1000 xx ; s_( xx, "%s/j2h/sql.htm", app );
rBuffer B( sql, "" ); rB_( B, 1, "\n CREATE", 0 );
char * c = "SQL Schema" ;
FILE * f = create( xx ); fprintf( f,"%s"
"\n<a name=top></a><br>"
"\n<a href=#toc>Table of Contents</a><br><br>"
"\n%s%s%s<pre class=\"Classes\"><font size=2>"
, kopf, t1, c, t2
);
char * toc[ 1000 ]; int etoc = 0 ;
while ( B.find( 0, "\n CREATE", f ) )
{
char * c = B.z + B.a ;
char * n = c + 11 ; to_( n, ' ' ) skip_space( n ) n[-1] = 0 ;
char * e = n ; to_( e, '\n' ) while space( *e ) e-- ; e++ ;
char m = *e ; *e = 0 ;
fprintf( f, "\n</pre><a name=%i></a>%s ."
"\n<font face=\"Verdena,Arial\" size=4>"
"\n<a href=#toc> </a><a href=#toc>%s</a></font><pre> "
, etoc, c, n );
toc[ etoc++ ] = such.take( n );
B.a = e - B.z ; *e = m ;
}
int i = -1 ;
fprintf( f, "<br><a name=toc></a>\n\n</pre><font face=\"Verdena,Arial\" size=2>" );
fprintf( f, "\n<a href=#top>Back to top</a> -"
"\n<a href=er1.htm#toc><b>goto ERD</b></a><br><br>"
"\n<font face=\"Verdena,Arial\" size=4>All Views and Physical Tables:"
"\n</font><br>" );
while ( ++i < etoc ) fprintf( f, "\n<br><a href=#%i>%s</a>", i, toc[i] );
fprintf( f, "\n</font><br><br><br>%s%s%s\n", t1, c, t2 );
close( f );
LE_
/* public: */ void Java2Htm :: JSP_uses (
/* -----------------------------------------------------------------------------
create the list "... is imported by ..."
|----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.JSP_uses")
char1000 uses ; s_( uses, "%s/j2h/uses", app ); create_css( uses );
char * ee = eos( uses ); s_( ee, "/00.htm" );
FILE * f = create( uses );
fprintf( f, "\n%s%sWhere JSP uses ...%s<font size=2></center></td></tr></table>"
, kopf, t1, t2 );
KVStore st ; Surr s = useOf.GetFirst( st ); Btree useMe ;
while ( s )
{
char * k = st.k ; to_( k, '.' )
char * z = st.c ; to_( z, '~' ) *z++ = 0 ;
char400 ek ; s_( ek, "%s~%s", z , st.c );
char400 ec ; s_( ec, "%s~%s", st.c, k+1 );
useMe.StrIns( 'e', ek, ec );
s = useOf.Next( st );
}
char300 zuVor ; *zuVor = 0 ;
char300 USR ;
FILE * f1 = 0 ; s = useMe.GetFirst( st ); uint usNr = 0 ;
while ( s )
{
char * z = st.k ; to_( z, '~' ) *z = 0 ;
char * e = st.c ; to_( e, '~' ) *e = 0 ;
char * x = ( *zuVor && not_is_( zuVor, st.k ) )? "<br>|" : "" ;
if not_is_( zuVor, st.k )
{
strcpy( zuVor, st.k );
fprintf( f, "\n<br><a href=\"0%i.htm\">%s</a>", ++usNr, st.k );
if ( f1 ) close( f1 );
char1000 xx ; s_( xx, "%s/uses/0%i.htm", j2h, usNr );
f1 = create( xx );
fprintf( f1, "\n%s%s%s<br>is used in%s<font size=2>"
"\n</center></td></tr></table>"
, kopf, t1, st.k, t2 );
strcpy( USR, ":" );
}
char * usr = semiPath( e+1 ); char * br = "" ; __
if not_At( usr, USR )
{
br = "<br>|" ;
strcpy( USR, usr ); e = in_str( ':', USR );
if ( e ) e[1] = 0 ;
}
if ( f1 ) fprintf( f1, "\n%s<br><a href=\"../%s\">%s</a>", br, st.c, usr );
*z = '~' ;
s = useMe.Next( st );
}
close( f ); if ( f1 ) close( f1 );
// -----------------------------------------------------------------------------
s_( uses, "%s/htm.htm", j2h ); f = create( uses );
fprintf( f, "\n%s%sStatic HTML%s<font size=2></center></td></tr></table>"
, kopf, t1, t2 );
char200 Vers ; uint VersNr = 0 ;
s = htms.GetFirst( st ); *zuVor = 0 ;
while ( s )
{
char * x = st.k ; to_( x, '~' ) *x = 0 ;
if not_is_( x-3, "css" )
{
char * k = st.k ;
if is_( zuVor, k )
then {
k = Vers ; s_( Vers, "%s, %i", st.k, ++VersNr );
}
else {
VersNr = 0 ; strcpy( zuVor, st.k );
}
fprintf( f, "\n<br><a href=htms/%s.htm>%s</a>", x+1, k );
}
*x = '~' ; s = htms.Next( st );
}
fprintf( f, "\n<br><br><font size=1>%u HTM Commands<br>", htmComms );
close( f );
// -----------------------------------------------------------------------------
s_( uses, "%s/css.htm", j2h ); f = create( uses );
fprintf( f, "\n%s%sCSS Files%s<font size=2></center></td></tr></table>"
, kopf, t1, t2 );
s = htms.GetFirst( st ); *zuVor = 0 ; VersNr = 0 ;
while ( s )
{
char * x = st.k ; to_( x, '~' ) *x = 0 ;
if is_( x-3, "css" )
{
char * k = st.k ;
if is_( zuVor, k )
then {
k = Vers ; s_( Vers, "%s, %i", st.k, ++VersNr );
}
else {
VersNr = 0 ; strcpy( zuVor, st.k );
}
fprintf( f, "\n<br><a href=htms/%s.htm>%s</a>", x+1, k );
}
*x = '~' ; s = htms.Next( st );
}
close( f );
LE_
/* public: */ void Java2Htm :: show_imports (
/* -----------------------------------------------------------------------------
create the list "... is imported by ..."
|----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.show_imports")
char1000 uses ; s_( uses, "%s/j2h/uses", app ); create_css( uses );
// S_ "copy \"%s/j2h/j2h.css\" \"%s\" > NUL", app, uses _Do
char * euses = eos( uses ); int fNr = -1 ;
s_( euses, "/%i.htm", ++fNr ); FILE * fu = create( uses );
fprintf( fu, "\n%s%sWhere Java uses ...%s<font size=2></center></td></tr></table>"
, kopf, t1, t2 );
// -----------------------------------------------------------------------------
FILE * f = 0 ;
char400 pack ; strcpy( pack, "/" );
uint pack_L = 1 ;
KVStore st ; Surr s = importedTo.GetFirst( st );
while ( s )
{
char * e ;
if not_At( st.k, pack )
then {
e = st.k ; to_( e, '/' ) e++ ;
char m = *e ; *e = 0 ;
strcpy( pack, st.k ); *e = m ;
pack_L = e - st.k ; e[-1] = 0 ;
fprintf( fu, "\n<br><a href=\"%i.htm\">%s</a>", ++fNr, st.k );
if ( f ) close( f );
s_( euses, "/%i.htm", fNr ); f = create( uses );
fprintf( f, "\n%s</center>%s%s<font size=2></td></tr></table>"
"\n<br>is imported to:<br>"
, kopf, t1, st.k );
e[-1] = '/' ;
}
else e = st.k + pack_L ;
if ( *e ) fprintf( f, "\n<br>. <a href=\"../%s\">%s<a>", st.c, e );
s = importedTo.Next( st );
}
close( fu );
// -------------------------------------------------------- create j2h/u/*
s_( uses, "%s/j2h/u", app ); dir_exist( uses );
S_ "copy \"%s/j2h/j2h.css\" \"%s\" > NUL", app, uses _Do
s_( uses, "%s/j2h/nn.htm", app ); FILE * nn = create( uses );
fprintf( nn, "\n%s%sNot imported anywhere:%s<font size=2></center></td></tr></table>"
, kopf, t1, t2 );
s = useOf.GetFirst( st ); *zuVor = 0 ;
while ( s )
{
char * x = st.k ; to_( x, '.' )
if not_substr( "$jsp", x )
if not_At( eos(x)-4, ".jsp" )
{
char * c = st.c ; to_( c, '~' ) *c = 0 ;
char400 pck ; s_( pck, "%s.*", c+1 );
char * pack = ( *pck == '.' )? pck+1 : pck ;
the_useOf( nn, x, pack, st.c, importedTo );
}
s = useOf.Next( st );
}
close( nn );
LE_
/* private: */ void Java2Htm :: the_useOf
/* -----------------------------------------------------------------------------
Let j2h/u/fn.htm show where class/interface 'cn is imported
|----------------------------------------------------------------------------
*/ (
FILE * nn
, char * cn
, char * pck
, char * htm
, Btree & us
)
LB_("Java2Htm.the_useOf")
char100 xx ; s_( xx, "%s/j2h/u/%i.htm", app, defNameNr( cn+1 ) );
*cn = '.' ;
FILE * f = create( xx ); KVStore st ; Surr s = us.GetFirst( st );
fprintf( f, "\n%s</center>%s%s<font size=2></td></tr></table>"
"\n<br>is imported to:<br>"
, kopf, t1, cn+1 );
int anz = 0 ;
while ( s )
{
char * e = st.k ; to_( e, '/' ) *e++ = 0 ;
if ( *e && ( substr( pck, st.k ) || substr( cn, st.k ) ) )
{
char200 as ; *as = 0 ; BOOL use = is_( pck, st.k );
if ( use )
then {
char * e = eos( pck ) - 3 ;
while ( pck < e && *e != '.' ) e-- ;
s_( as, " as %s", e+1 );
}
else {
char * e = eos( pck );
s_( e-1, cn+1 ); use = is_( pck, st.k );
*e = 0 ;
}
if ( use )
then {
anz++ ; fprintf( f,
"\n<br>. <a href=\"../%s\">%s<a>%s", st.c, e, as );
}
}
e[-1] = '/' ;
s = us.Next( st );
}
close( f );
if ( anz <= 0 )
then {
char * e = eos( pck ) - 1 ; s_( e, cn+1 );
if not_At( pck, zuVor ) fprintf( nn, "<br>|" );
fprintf( nn, "\n<br><a href=\"%s#toc\">%s</a>", htm, pck );
*e = 0 ; strcpy( zuVor, pck );
}
LE_
/* public: */ void Java2Htm :: check_imports (
/* -----------------------------------------------------------------------------
see if imports correct [code may be generated by GAZELLE]
|----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.check_imports")
S_ "-grep import %s/j2h/c*.htm > %s", app, tmp1 _Do
char100 imp ; s_( imp, "import</font> %s", app );
rBuffer B( tmp1, "" ); B.remember( 100 );
while ( B.find( 1, imp, 0 ) )
{
char * c = B.z + B.a + 14 ; c[-29] = 0 ;
char * x = c ;
while not_in_str( *x, "\n ;/" ) x++ ; x-- ;
char * falsch = in_str( x[-1], "\n/" );
while space( *x ) x-- ; x++ ; char m = *x ; *x = 0 ;
char300 fn ; strcpy( fn, c ); corrSep( fn, "./" );
if ( fn[ strlen( fn )-1 ] == '*' ) fn[ strlen( fn )-2 ] = 0 ;
strcat( fn, ".java" );
if ( falsch || not_path_exists( fn ) )
then {
printf( "\nfalsch: %s in %s", c, c-38 );
}
B.a = x + 10 - B.z ;
}
Unlink( tmp1 )
LE_
/* public: */ BOOL Java2Htm :: quote_not_found
/* -----------------------------------------------------------------------------
report syntax error
|----------------------------------------------------------------------------
*/ (
char * c
, char * src
)
LB_("Java2Htm.quote_not_found")
char * e = c ; to_( e, '\n' ) *e = 0 ;
while ( *c != '\n' ) c-- ; report_syntaxError( c+1, src );
*e = '\n' ;
LE_ret( false )
/* private: */ void Java2Htm :: show_the_ASP_includes (
/* -----------------------------------------------------------------------------
create a page showing all ASP includes
|----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.show_the_ASP_includes")
char * n = "ASP Includes" ;
char1000 xx ; s_( xx, "%s/inc", j2h ); create_css( xx );
s_( eos( xx ), "/incs_asp.htm" ); FILE * f = create( xx );
fprintf( f, "\n%s<a name=top></a>%s%s%s<font size=2><br>"
"\nDepth of ASP include relation = %i<br>"
, kopf, t1, n, t2, deRe );
int anz = 0 ;
KVStore st ; Surr s = incs_asp.GetFirst( st ); int preNr = -1 ;
FILE * f1 = 0 ; char800 zuVor ; *zuVor = 0 ; int anzVers = 1 ;
while ( s )
{
int i = decNr( st.c ); // _1( fNam[i] )
if ( preNr != i )
{
anz++ ;
if ( ! fNam[i] ) fErr2( i, cfNr )
preNr = i ; unix_me( fNam[i] ); // erst hier !!!
char * c = fNam[i] + 1 ;
char * e = eos( c ) - 1 ;
while ( c <= e && *e != '/' ) e-- ; e++ ;
char10 Vers ; *Vers = 0 ;
if not_is_( zuVor, e )
then {
strcpy( zuVor, e ); anzVers = 1 ;
}
else s_( Vers, ", %i", ++anzVers );
fprintf( f, "\n<br>[ <a href=%i.htm>use</a> ]"
"\n <a href=../asp%i.htm>%s%s</a>", i, i, e, Vers );
if ( f1 ) close( f1 );
char1000 xx ; s_( xx, "%s/inc/%i.htm", j2h, i );
f1 = create( xx );
fprintf( f1, "\n%s<a name=top></a>%s%s%s<font size=2>"
"\n<br>is included to:<br>"
, kopf, t1, e, t2 );
}
char * c = st.k ; to_( c, '>' ) c++ ;
char * nam = semiPath( fNam[ decNr(c) ] ); __
fprintf( f1, "\n<br><a href=../asp%s.htm>%s</a>", c, nam );
s = incs_asp.Next( st );
}
fprintf( f, "\n<br><br></font><font face=\"Verdena,Arial\" size=1>"
"\n<font size=4>%s%s%s<br></font>"
"\n<font size=1>%i ASP include files ( used %i times )</font></font>"
, t1, n, t2, anz, anz_of( co_ASP ) );
close( f ); if ( f1 ) close( f1 );
LE_
/* private: */ void Java2Htm :: nachbessere ( Btree & tree
/* -----------------------------------------------------------------------------
Dient der Nachbesserung bestimmter im 'tree genannter HTM files
stc = ?../..~COPY
-----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.nachbessere")
KVStore st ; Surr s = tree.GetFirst( st );
while ( s )
{
if ( *st.c == '?' ) nachbessere( st, tree );
s = tree.GetNext( st, st.k ); // Next() ist hier nicht ausreichend !!!
}
LE_
/* private: */ void Java2Htm :: nachbessere
/* -----------------------------------------------------------------------------
add hrefs not yet known before
nb = ( file, ?../..~COPY )
-----------------------------------------------------------------------------
*/ (
KVStore & nb
, Btree & hrefs
)
LB_("Java2Htm.nachbessere")
char * z = in_str( '~', nb.c );
if ( !z || *nb.c != '?' ) fErr2( nb.k, nb.c )
*z = 0 ;
char * tmp = "xx_nachBessere" ; FILE * f = create( tmp );
uint L = strlen( z+1 );
rBuffer B( nb.k, "" );
while ( B.find( 1, z+1, f ) )
{
char * c = B.z + B.a + L ; skip_space( c )
char * e = c ;
while ( *e != '<' && not_space( *e ) ) e++ ;
char m = *e ; *e = 0 ;
KVStore st ;
if ( hrefs.Get( c, st ) )
then {
*c = 0 ;
fprintf( f, "%s<a href=%s/%s>%s<", B.z + B.a, nb.c+1, st.c, st.k );
B.a = e+1 - B.z ;
if ( B.z[ B.a ] == '<' ) B.a++ ;
}
esif alpha( *c )
{
not_indexed -> StrIns( 'e', c, "?" );
*e = m ;
}
}
close( f ); cp_file( nb.k, tmp ); Unlink( tmp );
LE_
/* private: */ char * Java2Htm :: htm_esc ( char * str
/* -----------------------------------------------------------------------------
escape '<'
-----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.htm_esc")
char * x = str ;
char * z = escBuffer ;
while ( *x )
{
if ( *x == '<' )
then {
strcpy( z, "<" ); z = eos( z ); ++x ;
}
else *z++ = *x++ ;
}
*z = 0 ;
LE_ret( escBuffer )
/* private: */ uint Java2Htm :: PHP_to_htm
/* -----------------------------------------------------------------------------
We analyse - and present in HTML - PHP code:
-----------------------------------------------------------------------------
*/ (
int j // nr of page
, char * php // path to a php Page
)
LB_("Java2Htm.PHP_to_htm")
if ( erledigt( 1, php ) ) ret( 0 )
char800 src ; strcpy( src, php );
char20 fnr ; s_( fnr, "%i", j );
char100 co ; s_( co, "php/%s.htm", nr2( j ) );
char1000 xf ; s_( xf, "%s/%s", j2h, co );
unix_me( xf );
if is_file( xf ) ret( 0 )
uint deep = 0 ;
char1000 fn ; strcpy( fn, php ); unix_me( fn );
char * c = php + strlen( php ) - 1 ;
while ( php < c && not_in_str( *c, "/\\." ) ) c-- ;
char m = ( *c == '.' )? '.' : 0 ;
char * e = ( m )? c : eos( php ); *e = 0 ;
while ( *c != '/' ) c-- ; c++ ;
char100 progr ; strcpy( progr, backtoSucc( src, "/" ) );
char100 entry ; *entry = 0 ;
char * modul = progr ;
if ( ! index.contains( progr ) ) index.StrIns( 'e', progr, co );
printf( "\ncall_nr = %i, php = %s", call_nr, php );
FILE * f = create_mit_meta_php( xf, c );
*e = m ;
char * prphp = "x.php" ;
if (1) S_ "copy %s k:/p/xnn.php", php _Do
BRCode brc ; brc.pretty_PHP( php, prphp ); fflush(stdout);
rBuffer B( prphp, "\n" ); *e = 0 ; // muss sein
B.find( 0, "<?", 0 ); fprintf( f, "<font class=co>" );
str_set such ; such.insert( "class " );
such.insert( "function " );
such.insert( "const " );
such.insert( "public " );
such.insert( "protected " );
such.insert( "private " );
such.insert( "abstract " );
such.insert( "static " );
such.insert( "echo \"" );
such.insert( "print \"" );
such.insert( "return " );
such.insert( "for (" );
such.insert( "{" );
such.insert( "C" );
such.insert( "V" );
such.insert( "F" );
such.insert( "P" );
such.insert( "R" );
such.insert( "r" );
such.insert( "\"" );
such.insert( "\'" );
such.insert( "}" );
such.insert( "#" );
such.insert( "\n" );
such.insert( "\\" );
such.insert( "$" );
such.insert( "\n$" );
such.insert( "<" );
such.insert( "?>" );
such.insert( "/" ); // comment = // or /* or #
Btree funcs, sections ;
int proc = -1 ;
int nest = 0 ;
BOOL pack = 0 ;
BOOL ofphp = 0 ;
BOOL abst = 0 ;
BOOL stat = 0 ;
BOOL fina = 0 ;
BOOL correct = 1 ; unsigned long ii = 0 ;
BOOL suchVar = false ;
while space( B.z[ B.a ] ) B.a++ ;
int offset = 0 ;
int commands = 0 ;
int posNr = 0 ;
boxNam[ 0 ] = 0 ;
boxNam[ 1 ] = 0 ;
boxNam[ 2 ] = 0 ;
char100 ww ;
char100 fNam ; char * ecNam = fNam ;
while ( B.find( offset, such, f ) )
{
B.getmore( 4000 );
char * c = B.z + B.a ; offset = 0 ; B.z[ B.e+1 ] = 0 ;
bb _1(c+1-1)
// traceStr( "EEE", c, 200 );
if ( *c == '\'' || *c == '"' )
{
__ char * e = skip_str( c, B.z + B.e );
char m = *e ; *e = 0 ;
fprintf( f, "<span class=co>%s</span>", c );
B.a = e - B.z ; *e = m ;
continue_( 0 )
}
if At( c, "/*" )
{
if is_( c, "/**" ) c[3] = ' ' ; /////?
char * e = substr( "*/", c );
if ( !e ) { traceStr( "XXX",c,300 ); fErr }
*e = 0 ;
char * x = substr( "* @internal ", c );
if ( x && iAt( x, "* @internal Revisions" ) ) x[1] = 0 ;
fprintf( f, "%s*/</font>", c );
B.a = e+2 - B.z ; continue_( 0 )
}
if At( c, "\\\"" )
{
char * e = c+3 ; to_( e, '"' ); continue_( e+1-c )
}
if At( c, "//" )
{
fprintf( f, "<font class=\"co\">" ); B.find( 1, "\n", f );
while At( B.z + B.a+1, "//" ) B.find( 1, "\n", f );
if At( B.z + B.a+1, "/*" )
{
B.find( 1, "*/", f );
B.a += 2 ;
fprintf( f, "*/" );
}
fprintf( f, "</font><br>" );
while ( B.z[ B.a+1 ] == '\n' ) B.a++ ; continue ;
}
if At( c, "return " )
{
B.find( 1, "\n", f );
continue_( 0 )
}
if At( c, "for (" )
{
B.find( 1, "\n", f );
continue_( 0 )
}
if iAt( c, "\nrequire" )
{
char * e = ++c ;
while ( *(++e) != '\n' )
{
if in_str( *e, "()\'\";" ) *e = ' ' ;
}
*e = 0 ;
create_php_ref( f, c, "</pre>" );
B.a = e - B.z ; *e = '\n' ; continue_( 0 )
}
if iAt( c, "\ninclude" )
{
char * e = ++c ;
while ( *(++e) != '\n' )
{
if in_str( *e, "()\'\";" ) *e = ' ' ;
}
*e = 0 ;
create_php_ref( f, c, "</pre>" );
B.a = e - B.z ; *e = '\n' ; continue_( 0 )
}
if ( *c == 'a' )
{
if not_At( c, "abstract " ) continue_( 1 )
char * x = c + 9 ; skip_space( x )
if ( *x != '$' )
then {
abst = true ; B.a = x - B.z ;
}
else offset = 5 ;
continue ;
}
if ( *c == 's' )
{
if not_At( c, "static " ) continue_( 1 )
char * x = c + 7 ; skip_space( x )
if ( *x != '$' )
then {
stat = true ; B.a = x - B.z ;
}
else offset = 5 ;
continue ;
}
if At( c, "\n$" ) c++ ; //?
if ( *c == '$' || iAt( c, "echo \"" ) || iAt( c, "print \"" ) )
{
if ( alpha( c[1] ) && ! suchVar )
{
char * e = c ;
while ( *e != ';' )
{
if (( *e == '\'' || *e == '"' ) && e[-1] != '\\' )
then {
char m = *e ; *e = 0 ;
fprintf( f, "%s", c );
c = e+1 ;
*e = m ;
e = skip_phpstr( e, B.z + B.e )-1 ;
if ( *e == m ) *e = 0 ; else fErr2( *e, c )
char10 q ; s_( q, "%i;", (uchar)m );
fprintf( f, "%s<span class=str>%s</span>%s"
, q, htm_esc( c ), q );
c = ++e ;
}
else e++ ;
}
*e = 0 ;
fprintf( f, "%s;<br>", c );
B.a = e+1 - B.z ; continue_( 0 )
}
char * x = c ;
while ( *(--x) != '\n' ) if not_alpha( *c ) then
{
x = 0 ; break ;
}
if ( ! x ) continue_( 1 )
if ( Vis )
{
char * e = c ;
while ( *e != ';' )
{
if in_str( *e, "\"'" )
then {
char m = *e ; *e = 0 ; fprintf( f, "%s", c );
*e = m ; e = c = htmAusz( f, e );
}
else e++ ;
}
*e++ = 0 ;
B.a = e - B.z ;
__ uint nst = nestDepth( c );
__ funcAusz( f, funcs, j, posNr, "$", c, "", "", nst, "" ); __
fprintf( f, "</pre>%s%s<pre>", Vis, c );
__ Vis = 0 ; continue ;
}
offset = 2 ; continue ;
}
if ( *c == '#' )
{
fprintf( f, "<font class=co>" );
char * e = c ;
while ( *e == '#' )
{
to_( e, '\n' ) skip_space( e )
}
char m = *e ; *e = 0 ;
fprintf( f, "%s</span>", c );
B.a = e - B.z ; *e = m ; continue ;
}
if ( *c == '"' || *c == '\'' )
{
// Note: In PHP - but not other languages - a string presentation
// may contain line feeds.
if At( c, "''" ) continue_(2)
if escaped( c )
then {
offset = 1 ;
}
else B.a = htmAusz( f, c ) - B.z ;
continue ;
}
if ( *c == 'p' )
{
if space( c[-1] )
then {
if At( c, "public " ) Vis = "" ;
if At( c, "protected " ) Vis = "protected " ;
if At( c, "private " ) Vis = "private " ;
to_space( c ); skip_space( c ); B.a = c - B.z ;
}
else offset = 1 ;
continue ;
}
if ( nest < 2 && At( c, "const " ) ) // muss schon hier stehen !!!
{
__ uint nst = nestDepth( c );
c += 6 ; skip_space( c )
char * e = c ; while in_name( *e ) e++ ; char m = *e ; *e = 0 ;
s_( ecNam, c );
set_ww( ww, "const", stat, abst, fina );
__ funcAusz( f, funcs, j, posNr, ww, fNam, co, "", nst, "" ); __
*e = m ; to_( e, ';' ); e++ ; skip_space( e )
B.a = e - B.z ;
continue ;
}
if in_str( *c, "cCVFPrR{}$" )
{
char * x = c-1 ;
if ( space( *x ) && ( iAt( c, "class " )
|| iAt( c, "function " )
|| iAt( c, "$" )
|| iAt( c, "var " )
|| iAt( c, "public " )
|| iAt( c, "protected " )
|| iAt( c, "private " )
|| iAt( c, "require" )
)
)
then {
if iAt( c, "require" ) // PHP uses statement
{
char * e = c ;
while ( *(++e) != '\n' )
{
if in_str( *e, "()\'\";" ) *e = ' ' ;
}
*e = 0 ;
create_php_ref( f, c, "</pre>" );
char * x = e+1 ; skip_space( x );
while iAt( x, "require" )
{
e = c = x ; to_( e, '\n' ) *e = 0 ;
create_php_ref( f, c, "<br>" );
x = e+1 ; skip_space( x );
}
fprintf( f, "<pre>" );
B.a = e - B.z ; *e = '\n' ; continue_( 0 )
}
if iAt( c, "class =" )
{
offset = 4 ; continue ;
}
if in_str( *c, "rR" ) continue_(1)
while not_space( *(++x) ) *x = lower( *x );
}
else {
if ( *c == '{' ) nest++ ;
if ( *c == '}' )
{
if ( --nest == 0 ) ecNam = fNam ;
}
offset = 1 ; continue ;
}
}
if At( c, "?>\n<?""php" )
{
c += 7 ; while in_name( *c ) c++ ; skip_space( c ) c-- ;
B.a = c - B.z ; *c = '\n' ;
continue ;
}
if ( At( c, "<?" ) || At( c, "?>" ) )
{
ofphp = At( c, "<?" );
if ( *c == '?' )
{
c += 2 ; skip_space( c )
if At( c, "<fprintf( hp" )
{
continue_( 1 )
c += 5 ; skip_space( c )
}
*(--c) = '\n' ;
B.a = c - B.z ; continue ;
}
}
if At( c, "<!--" )
{
fprintf( f, "<font class=co>" );
rB_( B, 4, "-->", f ) B.a += 3 ;
fprintf( f, "%s</font>", c );
continue ;
}
if ( *c == '<' )
{
if iAt( c, "<HTML" )
{
while ( B.find( 1, "<", f ) )
{
fprintf( f, "<" );
B.a++ ;
if iAt( B.z + B.a, "/HTML" ) break ;
}
continue ;
}
fprintf( f, "<" );
B.a++ ; continue ;
}
if At( c, "\n$" )
{
fprintf( f, "</pre>" );
char * e = c ;
while At( e, "\n$" ) // we have a pretty file !!!!
{
e += 2 ;
if ( B.z + B.e < e ) fErr
strcpy( B.z + B.e, "\n\n\n" );
while not_in_str( *e, "\n\"\'" ) e++ ;
char m = *e ;
while ( *e != '\n' )
{
e++ ; while ( *e != m || escaped( e ) ) e++ ;
m = '\n' ;
if ( B.z + B.e <= e ) break ;
}
*e = 0 ;
fprintf( f, "\n%s", c );
if ( B.z + B.e < e ) fErr
B.a = e - B.z ; *e = '\n' ;
if ( ! B.ateof ) B.getmore( 400 );
c = e ; B.a = c - B.z ;
}
fprintf( f, "<pre>" );
B.a = e - B.z ; continue ;
}
if ( *c == '\n' )
{
if ( B.e <= B.a + 2 ) break ; // muss sein
char * x = c ; while space( *x ) x-- ;
char * e = c ; skip_space( e )
char * str = ( *e == '}' || *x == '{' )? "\n\n" : "\n\n\n" ;
while ( *e != '\n' ) e-- ;
while ( c < e && space( *e ) ) *e-- = '\n' ;
while At( B.z + B.a, str ) B.a++ ;
offset = ( c == B.z + B.a )? 1 : 0 ;
continue ;
}
if(0) if At( c, "static " )
{
char * x = c + 7 ; skip_space( x )
if ( *x != '$' )
then {
stat = true ; B.a = x - B.z ;
}
else offset = 5 ;
continue ;
}
if At( c, "final " )
{
char * x = c + 6 ; skip_space( x )
if ( *x != '$' )
then {
fina = true ; B.a = x - B.z ;
}
else offset = 5 ;
continue ;
}
if(0) if At( c, "abstract " )
{
char * x = c + 9 ; skip_space( x )
if ( *x != '$' )
then {
abst = true ; B.a = x - B.z ;
}
else offset = 5 ;
continue ;
}
if iAt( c, "class " )
{
if ( ! ofphp || ! space( c[-1] ) ) { offset = 1 ; continue ; }
__ uint nst = nestDepth( c );
c += 5 ; skip_space( c )
char * e = c ; while in_name( *e ) e++ ; char m = *e ; *e = 0 ;
s_( fNam, "%s.", c ); ecNam = eos( fNam );
set_ww( ww, "class", stat, abst, fina );
__ funcAusz( f, funcs, j, posNr, ww, c, co, "", nst, "" ); __
boxNam[ nst ] = store.take( c );
boxNam[ nst+1 ] = 0 ;
boxNam[ nst+2 ] = 0 ;
char * x = e ; *e = m ;
to_( e, '{' ) *e = 0 ;
fprintf( f, "%s<br><pre> {", x );
B.a = e+1 - B.z ; *e = '{' ;
continue ;
}
if At( c, "function " )
{
char * x = c + 8 ; skip_space( x );
while in_name( *x ) x++ ; skip_space( x )
if ( ! ofphp || ! space( c[-1] ) ) continue_( 1 )
if ( *x != '(' ) continue_(1 )
if ( *x != '(' ) { traceStr( "BBB",B.z+B.a,200 ); fErr1( c ) }
suchVar = false ;
// uint nst = nestDepth( c );
uint nst = 1 ;
c += 8 ; skip_space( c )
char * e = c+1 ; // da *c == '&' sein kann
// while not_in_str( *e, ",)" ) e++ ;
while in_name( *e ) e++ ;
char m = *e ; *e = 0 ;
s_( ecNam, c ); *e = m ;
char * p = e+1 ;
while ( *p == '(' || space( *p ) ) p++ ;
e = p ;
while not_in_str( *e, ";{" )
{
if ( *e == '\'' ) { e++ ; to_( e, '\'' ) e++ ; }
esif ( *e == '"' ) { e++ ; to_( e, '"' ) e++ ; }
else e++ ;
}
char * em = e ;
while ( *e && *e != ')' ) e-- ; *e = 0 ;
char1000 par ; s_( par, "( %s )", p );
set_ww( ww, "func", stat, abst, fina );
char * post = ( *em == '{' )? " {" : "" ;
to_( em, '\n' )
__ funcAusz( f, funcs, j, posNr, ww, fNam, co, par, nst, post ); __
boxNam[ nst ] = store.take( fNam );
boxNam[ nst+1 ] = 0 ;
boxNam[ nst+2 ] = 0 ;
B.a = em - B.z ;
// bb _1(em) _1(f)
continue_( 0 )
}
offset = 1 ;
}
__
char * se = ( correct )? "" :
" <br><b>There seem to be syntax errors "
"( at least one missing \" ).</b>" ;
fprintf( f, "\n</pre><a name=toc></a><br>"
"\n<a href=#top>top</a>, <a href=../../php.htm>ALL Code</a>"
//
, t1, c, t2 );
KVStore st ; Surr s = funcs.GetFirst( st ); char * u ;
char M = *st.c ;
while ( s )
{
__ commands++ ;
if ( *st.c != M )
then {
M = *st.c ;
}
if not_in_str( '.', st.k ) // this is a Class or not part of a Class
then {
fprintf( f, "<br>" );
}
if ( *st.c == 'c' )
then {
//
fprintf( f, "\n<a name=%s></a><a href=#%s>%s</a>"
, st.k, st.c+1, st.k );
}
else fprintf( f, "\n<br><a href=#%s>%s</a>", st.c+1, st.k );
s = funcs.Next( st );
}
fprintf( f, "\n<a name=eof></a><font size=1><br><br><br>"
"\n%i php Class, Function, Const, or Variable declarations in"
"\n<br>%s</font></font>"
, commands, gutLesbar( fn ) );
close( f );
// unlink( prphp );
anz_php_commands += commands ;
printf( "\ndone: %7i - %s", commands, php );
LE_ret( deep )
/* private: */ void Java2Htm :: create_php_ref
// -----------------------------------------------------------------------------
(
FILE * f
, char * c
, char * pre
)
LB_("Java2Htm.create_php_ref")
char * pree = is_( pre, "</pre>" )? "<pre>" : "" ;
char * x = c ; to_space( x ); skip_space( x ) x[-1] = 0 ;
int i = -1 ; lower( x );
while ( fNam[++i] ) if ( fArt[i] == co_PHP )
{ // _1(fNam[i])
if substr( x, fNam[i] ) break ;
}
printf( "\nphp_fNr %i = %s", i, x );
char1000 xf ; s_( xf, "%s/php/%s.htm", j2h, nr2(i) );
char * e = eos( c );
while ( c < e && *e != '/' ) e-- ;
if ( c < e )
then {
*e++ = 0 ;
fprintf( f, "%s%s%s<a href=%s>%s</a>%s", pre, c, e, xf, x, pree );
}
else fprintf( f, "%s%s<a href=%s>%s</a>%s", pre, c, xf, x, pree );
ret_
LE_
/* private: */ uint Java2Htm :: nestDepth ( char * c
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.nestDepth")
char * x = c ; while ( *x != '\n' ) x-- ;
char * n = x ; skip_space( n )
if ( n < c && not_iAt( n, "public" )
&& not_iAt( n, "private" )
&& not_iAt( n, "protected" )
&& not_iAt( n, "abstract" )
&& not_iAt( n, "static" )
&& not_iAt( n, "final" )
&& not_iAt( n, "global" ) && ( *c != '$' )
)
then {
traceStr( "xxx", n-1 , 20 );
traceStr( "nnn", c , 50 );
traceStr( "NNN", c-20, 130 ); fErr1(( n < c ))
}
if ( n[ - 1 ] == '\n' ) ret( 0 )
esif ( n[ - 4 ] == '\n' ) ret( 1 )
esif ( n[ - 7 ] == '\n' ) ret( 2 )
esif ( n[ -10 ] == '\n' ) ret( 3 )
esif ( n[ -13 ] == '\n' ) ret( 4 )
esif ( n[ -16 ] == '\n' ) ret( 5 )
esif ( n[ -19 ] == '\n' ) ret( 6 )
esif ( n[ -22 ] == '\n' ) ret( 7 )
esif ( n[ -25 ] == '\n' ) ret( 8 )
esif ( n[ -28 ] == '\n' ) ret( 9 )
esif ( n[ -31 ] == '\n' ) ret( 10 )
esif ( n[ -34 ] == '\n' ) ret( 11 )
else {
traceStr( "XXX", c-34, 200 ); fErr
}
LE_ret( 0 )
/* private: */ char * Java2Htm :: set_ww
// -----------------------------------------------------------------------------
(
char * ww
, char * was
, BOOL & stat
, BOOL & abst
, BOOL & fina
)
LB_("Java2Htm.set_ww")
char * s1 = ( stat || abst || fina )? "<font color=#0000FF>" : "" ;
char * s2 = ( stat || abst || fina )? "</font>" : "" ;
char * s = ( stat )? "static " : "" ;
char * a = ( abst )? "abstract " : "" ;
char * f = ( fina )? "final " : "" ;
stat = abst = fina = 0 ;
s_( ww, "%s%s%s%s%s%s", s1, s, a, f, s2, was );
LE_ret( ww )
/* private: */ void Java2Htm :: funcAusz
// -----------------------------------------------------------------------------
// schreibe den Kopf der Class or Function
// -----------------------------------------------------------------------------
(
FILE * f
, Btree & funcs
, int & fNr
, int & posNr
, char * was
, char * nam
, char * co
, char * par
, uint k
, char * post
)
LB_("Java2Htm.funcAusz")
if in_str( ' ', nam ) fErr1( nam )
char800 nn ;
{
char * z = nn ; int j = 0 ;
while ( j < k )
{
char * s = ( j == 0 )? "" : "." ;
s_( z, "%s%s", s, boxNam[j++] );
z = eos(z) ;
}
*z = 0 ;
z = in_str( '.', nam ); if ( z ) nam = z+1 ;
}
char * pre = substr( "class", was )? "" : "<pre>" ;
char10 pos ;
if ( posNrAtComment )
then {
s_( pos, "%c%i", *was, posNr++ );
posNrAtComment = false ;
}
else s_( pos, "%c%i", *was, ++posNr );
char800 NAM ; strcpy( NAM, nam );
if ( *nn && not_is_( nn, "(null)" ) ) s_( NAM, "%s. %s", nn, nam );
funcs.StrIns( 'e', NAM, pos );
if substr( "class", was )
{
fprintf( f, "<a href=#%s></a>", nam );
if ( ! phpClasses ) phpClasses = new Btree();
char100 xx ;
char100 nn ;
s_( xx, "%s#%s", co, nam );
char * cNam = nam ;
if ( phpClasses -> contains( nam ) )
{
cNam = nn ; s_( nn, "%s.%i", nam, fNr );
}
phpClasses -> StrIns( 'e', cNam, xx );
}
__
if ( *was == '$' ) ret_
if ( ! Vis ) Vis = "" ;
char100 NN ;
if is_( nn, "(null)" ) *NN = 0 ; else s_( NN, "%s ", nn );
fprintf( f, "</pre>%s<a name=%s></a>%s%s <a href=#toc>%s</a> %s%s%s"
, Vis, pos+1, NN, was, nam, par, pre, post );
Vis = 0 ;
__
LE_
/* private: */ char * Java2Htm :: htmAusz
// -----------------------------------------------------------------------------
// show in HTML a string constant
// -----------------------------------------------------------------------------
(
FILE * f
, char * c
)
LB_("Java2Htm.htmAusz")
if ( c[1] == '\n' && false ) // in PHP kann \n unescaped im String sein
{
while ( *c && *c != '\n' ) c-- ; fErr1( c+1 )
}
char quo = *c ;
char * e = c+1 ; to_( e, quo );
while escaped( e ) { e++ ; to_( e, quo ); }
char m = *e ; *e = 0 ;
Var_htm fprintf( f, "<font class=\"str\">%s%c</font>", htm, quo );
if in_str( '<', htm ) fErr1( htm )
LE_ret( e+1 )
/* private: */ uint Java2Htm :: COB_to_htm
/* -----------------------------------------------------------------------------
We analyse - and present in HTML - COBOL code:
-----------------------------------------------------------------------------
*/ (
int j // nr of page
, char * cob // path to a cob Page
)
LB_("Java2Htm.COB_to_htm")
if ( erledigt( 1, cob ) ) ret( 0 )
char800 src ; strcpy( src, cob );
char20 fnr ; s_( fnr, "%i", j );
char100 co ; s_( co, "cob/%s.htm", nr2( j ) );
char1000 xf ; s_( xf, "%s/%s", j2h, co );
unix_me( xf );
if is_file( xf ) ret( 0 ) // _1( cob )
uint deep = 0 ;
char1000 fn ; strcpy( fn, cob ); unix_me( fn );
char * c = cob + strlen( cob ) - 1 ;
while ( cob < c && not_in_str( *c, "/\\." ) ) c-- ;
char m = ( *c == '.' )? '.' : 0 ;
char * e = ( m )? c : eos( cob ); *e = 0 ;
while ( *c != '/' ) c-- ; c++ ;
char100 progr ; strcpy( progr, backtoSucc( src, "/" ) );
// char100 entry ; strcpy( entry, progr );
char100 entry ; *entry = 0 ;
char * modul = progr ;
if ( ! index.contains( progr ) ) index.StrIns( 'e', progr, co );
printf( "\ncall_nr = %i, cob = %s", call_nr, cob );
FILE * f = create_mit_meta( xf, c );
*e = m ; rBuffer B( cob, "\n" ); *e = 0 ; // muss sein
if (0)
{
char * c = B.z + B.a ;
char * e = c + 400 ;
if ( B.z + B.e < e ) e = B.z + B.e ;
while ( ++c < e )
{
if ( 128 < ( uchar )c )
{
fprintf( f, "\nIs a binary file: %s", cob );
close( f );
ret( 0 )
}
}
}
str_set such ; such.insert( "PROGRAM-ID." );
such.insert( "Program-id." );
such.insert( "program-id." );
such.insert( "ENTRY " ); // a callable entry point
such.insert( "Entry " ); // a callable entry point
such.insert( "entry " ); // a callable entry point
such.insert( "EXEC SQL" );
such.insert( "exec" ); // EXEC SQL
// such.insert( "DIVISION." );
// such.insert( "division." );
// such.insert( "section." );
// such.insert( "SECTION." );
// such.insert( "USING" );
// such.insert( "move" );
// such.insert( "Move" );
// such.insert( "MOVE" );
such.insert( "COMP" );
such.insert( "Copy" );
such.insert( "copy" );
such.insert( "COPY" );
such.insert( "CALL" );
such.insert( "Call" );
such.insert( "call" );
// forget: such.insert( "PERFORM" ); Aufruf programm-interner Teil
such.insert( "INVOKE" );
such.insert( "invoke" );
such.insert( "DISPLAY " );
such.insert( "Display " );
such.insert( "display " );
such.insert( "pic" );
such.insert( "PIC" );
such.insert( "\n" );
such.insert( "*" );
such.insert( "<" );
such.insert( "01 " );
char * posx[ mxposNr ] ; uint posNr = 0 ;
int proc = -1 ;
Btree sections ;
BOOL correct = 1 ; unsigned long ii = 0 ;
while space( B.z[ B.a ] ) B.a++ ;
while ( B.z[ B.a ] != '\n' ) B.a-- ;
int offset = 0 ;
int commands = 0 ;
while ( B.find( offset, such, f ) )
{
char * c = B.z + B.a ; offset = 0 ; B.z[ B.e+1 ] = 0 ;
if ( At( c+1, "ISPLAY " )
|| At( c+1, "isplay " )
)
{
char * e = c ; to_( e, '\n' ) skip_space( e )
offset = e-c ; continue ;
}
if ( space( c[-1] ) && At( c, "COMP" ) && space( c[4] ) )
{
char * e = c ; to_( e, '.' )
offset = e-c ; continue ;
}
if ( B.e - B.a < 3 ) break ;
if iAt( c, "EXEC " )
{
B.getmore( 12000 );
c = B.z + B.a ;
fprintf( f, "\n<a name=%i></a>", ++posNr );
strcpy( B.z + B.e + 1, "END-EXEC" );
char * e = c ; while not_At( e, "END-EXEC" ) e++ ; *e = 0 ;
if ( ! fx ) fErr
if ( B.z + B.e < e )
then {
fErr rB_( B, 1, "END-EXEC", fx ) // dann aber Lcke in f
fprintf( fx, ";\n\n" );
}
else {
*e = 0 ;
fprintf( fx, "\np .. %s [%s#%i]\n\n%s;\n\n"
, modul, co, posNr, c );
// , entry, co, posNr, c );
fprintf( f, "%s", c );
B.a = e - B.z ; fprintf( f, "%s", c );
*e = 'E' ;
}
continue_(1)
}
if ( *c == '\n' )
{
char * x = c ; skip_space( x )
offset = x-c ; continue ;
if ( proc == -1 && ( At( x, "PROCEDURE " )
|| At( x, "Procedure " )
|| At( x, "procedure " )
))
then {
proc = x-c ;
}
esif ( proc == x-c && *x != '*' )
{
offset = 1 ; continue ;
char * z = x ;
B.z[ B.e ] = 0 ;
while ( *z && *z != '.' ) z++ ;
if ( *z == '.' )
{
*z = 0 ;
char200 xx ;
if not_subSTR( "SECTION", x )
{
s_( xx, "%s SECTION", x ); x = xx ;
}
if ( subSTR( "SECTION", x ) && ! subSTR( "-Exit", x ) )
{
fprintf( f, "\n<a name=%i></a>", ++posNr );
if ( mxposNr <= posNr ) fErr1( posNr );
posx[ posNr ] = store.take( upper(x) );
}
*z = '.' ;
}
}
if ( *x == '*' )
then {
B.a = x - B.z - 1 ; x[-1] = '\n' ;
fprintf( f, "<br><font class=\"co\">" );
B.find( 1, "\n", f );
x = B.z + B.a ; skip_space( x );
while ( *x == '*' )
{
B.a = x - B.z - 1 ; x[-1] = '\n' ;
B.find( 1, "\n", f );
x = B.z + B.a ; skip_space( x );
}
char * nz = ( *x == '*' )? "" : "<br>" ;
fprintf( f, "</font>%s", nz );
}
else {
fprintf( f, "<br>" );
while ( B.z[ B.a+1 ] == '\n' ) B.a++ ; B.a++ ;
}
continue ;
}
if ( *c == '<' )
{
commands++ ; B.a += 1 ; fprintf( f, "<" );
continue ;
}
if ( *c == '*' )
{
char * e = c ; to_( e, '\n' ) offset = e - c ;
continue ;
}
offset = 1 ;
commands++ ;
if ( iAt( c, "PROGRAM-ID." )
|| iAt( c, "ENTRY '" )
|| iAt( c, "ENTRY \"" )
)
then {
char * cm = 0 ;
if in_str( *c, "eE" ) { cm = c+5 ; *cm = '.' ; }
to_( c, '.' ) c++ ; skip_space( c )
char m = '.' ;
if in_str( *c, "\'\"" ) m = *( c++ );
char * e = c ; to_( e, m ) *e = 0 ;
if not_alphanum( *c ) fErr1( c )
if ( cm ) strcpy( entry, c ); else strcpy( progr, c );
if ( *entry ) modul = entry ;
char * p = progr ;
while ( *p && not_space( *p ) ) p++ ; *p = 0 ;
char * pro = modul ;
fprintf( f, "\n<a name=%i></a>", ++posNr );
char300 xx ; s_( xx, "p .. %s", pro );
if ( mxposNr <= posNr ) fErr1( posNr );
posx[ posNr ] = store.take( xx );
s_( xx, "p %s#%i", co, posNr );
index.StrIns( 'e', pro, xx );
s_( xx, "p .. %s", pro );
zu_codef( xx, src, co, posNr );
fprintf( fx, "\n p .. %s [%s#%i]\n\n", pro, co, posNr );
*e = m ;
if ( cm ) *cm = ' ' ;
}
esif ( At( c, "01 " ) && space( c[-1] ) )
{
char * e = c-1 ;
while ( space( *e ) && *e != '\n' ) e-- ; // muss sein
if ( *e != '\n' ) continue_( 1 )
c += 2 ; skip_space( c )
e = c ; to_space( e )
if ( e[-1] != '.' )
{
offset = e - ( B.z + B.a ); continue ;
}
e[-1] = 0 ;
fprintf( f, "\n<a name=%i></a>", ++posNr );
char300 xx ; s_( xx, "s .. %s", c );
zu_codef( xx, src, co, posNr );
posx[ posNr ] = store.take( xx );
s_( xx, "s %s#%i", co, posNr );
index.StrIns( 'e', c, xx );
if not_alphanum( *c ) fErr1( c )
e[-1] = '.' ;
offset = e+1 - ( B.z + B.a );
}
esif (
in_str( *c, "Dd" ) && space( c[-1] ) ||
in_str( *c, "sS" ) && space( c[-1] ) ||
in_str( *c, "pP" ) && space( c[-1] ) && space( c[3] ) ||
in_str( *c, "mM" ) && space( c[-1] ) && space( c[4] ) ||
in_str( *c, "cC" ) && space( c[-1] ) && space( c[4] ) ||
in_str( *c, "iI" ) && space( c[-1] ) && space( c[6] )
)
{
if in_str( *c, "pPmM" ) continue ;
BOOL a_call = in_str( *c, "cC" )? 1 : 0 ;
if ( a_call )
{
if At( c+1, "all" ) memcpy( c, "CALL", 4 );
if At( c+1, "opy" ) memcpy( c, "COPY", 4 );
}
if in_str( *c, "Dd" )
{
char * s = c-1 ; while space( *s ) s-- ; s[1] = 0 ;
while not_space( *s ) s-- ;
fprintf( f, "\n<a name=%i></a>", ++posNr );
char300 xx ; s_( xx, "%s DIVISION", s+1 );
if ( mxposNr <= posNr ) fErr1( posNr );
posx[ posNr ] = store.take( xx );
continue ;
}
if in_str( *c, "sS" )
{
char * s = c-1 ; while space( *s ) s-- ; s[1] = 0 ;
while not_space( *s ) s-- ;
fprintf( f, "\n<a name=%i></a>", ++posNr );
char300 xx ; s_( xx, "PROC %s", s+1 );
posx[ posNr ] = store.take( xx );
continue ;
}
char * c1 = c ;
char * cbook = in_str( c[1], "oO" );
to_space( c ); skip_space( c );
while not_in_name ( *c ) c++ ;
char * e = c ;
__ while ( in_name( *e ) || in_str( *e, ".-" ) ) e++ ;
char m = *e ; *e = 0 ;
B.a = e+1 - B.z ;
char300 c2 ;
char * s = c1-1 ;
char * z = c2 ;
while ( *( ++s ) ) if not_in_str( *s, "'\"" ) *z++ = *s ;
*z = 0 ;
fprintf( f, "<a name=%i></a> "
"<a href=#eof><b><font size=4>%s</font></b></a> "
, ++posNr, c2 );
if ( mxposNr <= posNr ) fErr1( posNr );
posx[ posNr ] = store.take( c2 );
char300 uu ;
char300 xx ;
if ( cbook )
then {
index.StrIns( 'e', xf, "?../..~COPY" );
// s_( xx, "p .. %s~s .. %s", progr, c );
s_( xx, "p .. %s~s .. %s", modul, c );
char * s = e+1 ; to_( s, '.' )
}
else {
// s_( xx, "p .. %s~p .. %s", progr, c );
s_( xx, "p .. %s~p .. %s", modul, c );
}
if in_str( '\n', progr ) fErr1( progr )
if in_str( '\n', modul ) fErr1( modul )
if ( in_str( '\'', xx ) || in_str( '"', xx ) ) fErr1( xx )
s_( uu, "1~%s#%i", co, posNr );
cobUses.StrIns( 'e', xx, uu );
*e = m ;
}
esif ( *c == 'U' && space( c[-1] ) && space( c[5] ) )
{
// If a program p1 is calling another program p2 with parameters
// p1 is actually operating of the storage given as the actual
// parameter.
//
// If this storage is local storage - i.e. not declared in a
// copy book - the fact that p1 is using this storage is already
// recorded (because then p1 contains a corresponding COPY
// command).
}
}
fprintf( f, "\n</font><a name=eof></a><font face=\"Verdena,Arial\" size=1>" );
int i = 0 ;
while ( ++i <= posNr )
{
if ( ! posx[i] ) fErr
char * x = subSTR( " SECTION" , posx[i] );
if ( x ) *x = 0 ;
char * box = ( x || At( posx[i], "COPY " ) )? "" : ". . " ;
if At( posx[i], "STRU " ) box = "" ;
if ( x )
then fprintf( f, "\n<br><a href=#%i><b>%s%s</b></a>", i, box, posx[i] );
else fprintf( f, "\n<br><a href=#%i>%s%s</a>" , i, box, posx[i] );
}
char * se = ( correct )? "" :
" <br><b>There seem to be syntax errors "
"( at least one missing \" ).</b>" ;
fprintf( f, "\n<br><br><a href=#top>top</a>, <a href=../../cobp.htm>ALL Code</a>"
"\n<font size=4>%s%s%s<br></font>"
"\n<font size=1><br>%i cob Commands = <br>%s</font>"
, t1, c, t2, commands, gutLesbar( fn ) );
*e = m ;
fprintf( f, "</font>" );
close( f );
anz_cob_commands += commands ;
//
LE_ret( deep )
/* private: */ void Java2Htm :: zu_codef
// -----------------------------------------------------------------------------
(
char * xx // COBOL entry point or 01 storage specification
, char * cob // path to source file
, char * co
, uint posNr
)
LB_("Java2Htm.zu_codef")
if ( ! xx[5] ) ret_ // Nur "p .. " oder "s .. "
if ( mxposNr <= posNr ) fErr1( posNr );
char300 zz ;
if ( codefile -> contains( xx ) )
then {
printf( "\ndoppelt: %s", xx );
if is_( xx, "p .. main" ) fErr // file not added
s_( zz, "%s, redundant?", xx );
}
else strcpy( zz, xx );
char300 src ; s_( src, "%s#%i~%s", co, posNr, cob + LRootDir );
if ( strlen( src ) > 250 ) fErr2( strlen( src ), src )
codefile -> StrIns( 'e', zz, src );
if (1)
{
s_( zz, "%c %s#%i", *xx, co, posNr );
index.StrIns( 'e', xx+5, zz );
}
LE_
/* private: */ uint Java2Htm :: ASP_to_htm
// -----------------------------------------------------------------------------
(
int j // nr of page
, char * asp // path to a ASP Page
)
LB_("Java2Htm.ASP_to_htm")
if ( erledigt( 1, asp ) ) ret( 0 )
char1000 xx ; s_( xx, "%s/asp%i.htm", j2h, j );
if is_file( xx ) ret( 0 )
BOOL hasIncs = false ;
uint deep = 0 ;
char1000 fn ; strcpy( fn, asp ); unix_me( fn );
char * c = asp + strlen( asp ) - 1 ;
while ( asp < c && not_in_str( *c, "/\\." ) ) c-- ;
char m = ( *c == '.' )? '.' : 0 ;
char * e = ( m )? c : eos( asp ); *e = 0 ;
while ( *c != '/' ) c-- ; c++ ;
__ FILE * f = create_mit_meta( xx, c ); _1( asp )
*e = m ; rBuffer B( asp, "" ); *e = 0 ; // muss sein
str_set such ; such.insert( "<" ); int commands = 0 ;
such.insert( "\"" ); int offset = 0 ;
such.insert( "\n\n\n" );
such.insert( "#inc" );
such.insert( "#INC" );
BOOL correct = 1 ; unsigned long ii = 0 ;
while ( B.find( offset, such, f ) )
{
char * c = B.z + B.a ; offset = 0 ; B.z[ B.e+1 ] = 0 ;
// if ( B.ii > 1 ) traceStr( "ZZ", c, 100);
if ( *c == '\n' )
{
B.a++ ; continue ;
}
if ( *c == '"' )
{
// Beachte: in ASP ist \ kein escape-Zeichen.
// Der einfache ' beginnt Kommentar, kann sonst also nur in
// Strings auftreten.
char * e = c+1 ; to_( e, '"' ); B.a = e+1 - B.z ;
char m = *e ; *e = 0 ;
Var_htm // char4000 htm ; St_htm u ; u.to_htm( c, htm, 4000 );
*e = m ;
fprintf( f, "<font class=\"kw\">%s\"</font>", htm ); // kw statt str
continue ;
}
if ( noAutoComment )
{
char * cm = c ;
L1: if ( At( c, "<%-- START OF PROTECTED" )
|| At( c, "<%-- END OF PROTECTED" )
)
{
rB_( B, 1, "--%>", 0 )
c = B.z + B.a + 4 ; skip_space( c ); B.a = c - B.z ;
if At( c, "<%" ) goto L1 ;
}
if ( cm < c ) continue ;
}
if ( *c == '<' )
{
commands++ ; B.a += 1 ; fprintf( f, "<" );
continue ;
}
if At( c, "//" )
{
fprintf( f, "<font class=\"co\">" ); B.find( 1, "\n", f );
fprintf( f, "</font>" ); continue ;
}
if ( At( c, "/*" ) && c[2] != '/' )
{
fprintf( f, "<font class=\"co\">" ); B.find( 1, "*/", f ); B.a += 2 ;
fprintf( f, "*/</font>" ); continue ;
}
if ( *c == '#' ) // #inc, #INC
{
hasIncs = true ;
fprintf( f, "#INCLUDE file= " );
to_( c, '"' ) c++ ;
char * e = c ; to_( e, '"' ) *e = 0 ;
B.a = e+1 - B.z ;
KVStore st ; char1000 xx ; make_path( asp, xx, c );
char1000 inc ; *inc = 0 ; if ( *xx )
{{ if ( aspNames.Get( xx, st ) )
then {
fprintf( f, "<a href=asp%s.htm>%s\"</a>", st.c, c-1 );
s_( inc, "%s->%i", st.c, j );
uint de = ASP_to_htm( j, xx ); // muss auch hier sein
deep = max( deep, de+1 );
}
esif is_file( xx )
{
uint sNr = sourceNr( xx, co_ASP )
fprintf( f, "<a href=asp%i.htm>%s\"</a>", sNr, c-1 );
char20 nr ; s_( nr, "%i", sNr );
s_( inc, "%s->%i", nr, j );
aspNames.StrIns( 'e', xx, nr );
uint de = ASP_to_htm( sNr, xx );
deep = max( deep, de+1 );
}
else {
fprintf( f, "<font class=\"kw\">%s\"</font>", c-1 );
if in_str( '/', c ) fprintf( f, "\nno-- %s [%s]", c, asp );
// not_in_str( '*', xx )
}
}}
if ( *inc )
then {
char * x = eos( xx ) - 1 ;
while ( xx < x && x[-1] != '/' ) x-- ;
char * u = x ; while ( xx < u && *u == '/' ) u-- ;
while ( xx < u && u[-1] != '/' ) u-- ;
char800 k ; s_( k + 2, "%s~%s", u, inc );
k[0] = upper( *u ); k[1] = *u ; k[250] = 0 ;
incs_asp.StrIns( 'e', k, inc );
}
*e = '"' ;
}
}
char * se = "" ; if ( ! correct )
se = " <br><b>There seem to be syntax errors "
"( at least one missing \" ).</b>" ;
fprintf( f, "\n</font><a name=eof></a><font face=\"Verdena,Arial\" size=1>"
"\n<font size=4>%s%s%s<br></font>"
"\n<font size=1><br>%i asp Commands = <br>%s</font>"
, t1, c, t2, commands, gutLesbar( fn ) );
*e = m ;
if ( hasIncs )
{
fprintf( f, "\n<font size=2>%s<br> <br>Include Structure:<br>", se );
put_incs( f, 0, asp, aspNames, "#INC", "asp" );
fprintf( f, "</font>" );
}
fprintf( f, "</font>" );
close( f );
anz_asp_commands += commands ;
LE_ret( deep )
/* private: */ void Java2Htm :: show_the_CPP_includes (
/* -----------------------------------------------------------------------------
create a page showing all CPP includes
|----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.show_the_CPP_includes")
char * n = "C++ Includes" ;
char1000 xx ; s_( xx, "%s/inc", j2h ); create_css( xx );
s_( eos( xx ), "/incs_cpp.htm" ); FILE * f = create( xx );
fprintf( f, "\n%s<a href=../cpp.htm>C++</a>"
"\n<a name=top></a>%s%s%s<font size=2><br>"
"\nDepth of C++ include relation = %i<br>"
, kopf, t1, n, t2, deRe );
int anz = 0 ;
KVStore st ; Surr s = incs_cpp.GetFirst( st ); int preNr = -1 ;
FILE * f1 = 0 ; char800 zuVor ; *zuVor = 0 ; int anzVers = 1 ;
while ( s )
{
int i = decNr( st.c ); // _1( fNam[i] )
if ( preNr != i )
{
anz++ ;
if ( ! fNam[i] ) fErr2( i, cfNr )
preNr = i ; unix_me( fNam[i] ); // erst hier !!!
char * c = fNam[i] + 1 ;
char * e = eos( c ) - 1 ;
while ( c <= e && *e != '/' ) e-- ; e++ ;
char10 Vers ; *Vers = 0 ;
if not_is_( zuVor, e )
then {
strcpy( zuVor, e ); anzVers = 1 ;
}
else s_( Vers, ", %i", ++anzVers );
char * n = nr2(i);
fprintf( f, "\n<br>[ <a href=../%su.htm>use</a> ]"
"\n <a href=../%s.htm>%s%s</a>", n, n, e, Vers );
if ( f1 ) close( f1 );
char1000 xx ; s_( xx, "%s/%su.htm", j2h, nr2(i) );
char * x = eos( xx ); while ( *x != '/' ) x-- ; *x = 0 ;
dir_exist( xx ); *x = '/' ;
f1 = create( xx );
fprintf( f1, "\n%s<a name=top></a>%s%s%s<font size=2>"
"\n<br>is included to:<br>"
, kopf, t1, e, t2 );
}
char * c = st.k ; to_( c, '>' ) c++ ; i = decNr( c );
char * nam = semiPath( fNam[i] );
fprintf( f1, "\n<br><a href=../%s.htm>%s</a>", nr2(i), nam );
s = incs_cpp.Next( st );
}
fprintf( f, "\n<br><br></font><font face=\"Verdena,Arial\" size=1>"
"\n<font size=4>%s%s%s<br></font>"
"\n<font size=1>%i cpp include files ( used %i times )</font></font>"
, t1, n, t2, anz, anz_of( co_CPP ) );
close( f ); if ( f1 ) close( f1 );
LE_
/* private: */ BOOL Java2Htm :: schema ( char * c
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.schema")
if ( !c ) fErr
if space( *c ) fErr
// traceStr( "xxx",c,100 );
if ( *c == 'p' ) { to_space( c ); skip_space( c ); }
switch ( *c )
{
Case 'e' : if At( c, "enum " ) ret( 1 )
Case 's' : if At( c, "struct " ) ret( 1 )
Case 't' : if At( c, "typedef " ) ret( 1 )
Case 'u' : if At( c, "union " ) ret( 1 )
Case 'v' : if At( c, "virtual" )
{
while ( *c && not_in_str( *c, ";{" ) ) c++ ;
if ( *c == ';' ) ret( 1 )
}
}
LE_ret( 0 )
/* private: */ BOOL Java2Htm :: AtFunc_ALT
// -----------------------------------------------------------------------------
(
char * c
, char * eB
)
LB_("Java2Htm.AtFunc_ALT")
__ if ( At( c, "class " ) || schema( c ) || in_str( *c, "{}" ) ) ret( 0 )
while in_name( *c ) c++ ; skip_space( c )
// while ( in_name( *c ) || space( *c ) ) c++ ;
if in_str( *c, "){},;/\"" ) ret( 0 )
/* if ( *c == '(' )
{
char * x = c ; skip_nest( x, '(', ')' ); skip_space( x )
if ( *x == ';' ) ret( 0 )
}
*/
if ( *c == ':' && space( c[1] ) ) ret( 0 )
/* {
char * x = c ;
while ( c < eB && *c != '(' )
{
if in_str( *( c++ ), ";)\"" ) ret( 0 )
}
}
*/
char * z = c ; to_( z, '\n' ) while space( *z ) z-- ;
__
if ( *z == ')' )
{
*z = 0 ;
if substr( "inline ", c ) { *z = ')' ; ret( 0 ) }
*z = ')' ;
int k = 0 ; z++ ; skip_space( z )
while ( ++c < z )
{
if ( *c == '(' ) k++ ; else
if ( *c == ')' ) k-- ;
if ( k == 2 || in_str( *c, "=|-" ) ) ret( 0 )
}
ret( z < eB && *z == '{' && k == 0 )
}
LE_ret( 0 )
/* private: */ char * Java2Htm :: AtMeth
// -----------------------------------------------------------------------------
(
char * c
, char * eB
)
LB_("Java2Htm.AtMeth")
// traceStr( "AAA", c, 800 ); _
*eB = '.' ; noFunc = 1 ;
skip_space( c );
__ if ( At( c, "class " ) || schema( c ) || in_str( *c, "{}" ) ) ret( 0 )
if ( At( c, "STDMETHODIMP_(" ) || At( c, "STDMETHOD_(" ) )
{
// in MFC Code:
to_( c, '(' ) *c++ = '<' ;
int k = 1 ; while ( k )
{
c++ ; if ( *c == '(' ) k++ ;
if ( *c == ')' ) k-- ;
if ( *c == '(' ) *c = '<' ;
if ( *c == ')' ) *c = '>' ;
}
c++ ; skip_space( c )
}
__
while in_name( *c ) c++ ; skip_space( c )
char * cc = 0 ;
char * cX = 0 ;
for(;;)
{
if ( eB <= c ) break ;
__ if ( cX == c ) fErr else cX = c ;
// traceStr( "CCC", c, 200 );
while ( c < eB && not_in_str( *c, "=(:;+-/){}[.\"o<>," ) ) c++ ;
if At( c, "::" )
then {
cc = c ; c += 2 ; skip_space( c );
}
esif ( *c == '(' )
{
int k = 1 ; c++ ;
while ( k && c < eB )
{
if in_str( *c, ";.|'\"+-[" ) ret( 0 )
if ( *c == '(' ) k++ ; else
if ( *c == ')' ) k-- ;
c++ ;
}
skip_space( c )
if At( c, "const" ) { c += 5 ; skip_space( c ) }
if in_str( *c, ";.|" ) ret( 0 )
noFunc = 0 ; ret( cc )
}
esif ( *c == ':' && ( At( c-6, "public:" )
|| At( c-7, "private:" )
|| At( c-9, "protected:" )
) )
c++ ;
esif ( *c == ':' )
{
while ( c < eB && not_in_str( *c, ";{" ) ) c++ ;
if ( *c != '{' ) ret( 0 )
noFunc = 0 ; ret( cc )
}
esif At( c, "//" )
{
while ( *c != '\n' ) *c++ = ' ' ;
}
esif At( c, "/*" )
{
while ( c < eB && not_At( c, "*/" ) ) c++ ; c += 2 ;
}
esif ( *c == '<' )
{
while ( c < eB && not_in_str( *c, ";>" ) ) c++ ;
if ( *c == ';' ) ret( 0 ) else c++ ;
}
esif ( *c == 'o' )
{
if ( At( c, "operator" ) && not_in_name( c[8] ) )
then {
char * x = c + 8 ;
__ while not_in_str( *x, ";(" ) x++ ;
__
if ( *x == ';' ) goto L5 ;
skip_nest( x, '(', ')' ); skip_space( x )
if ( *x == ';' ) ret( 0 )
__
noFunc = 0 ; ret( cc )
}
L5: c++ ;
}
else ret( 0 )
}
__
LE_ret( 0 )
/* private: */ BOOL Java2Htm :: AtFunc
// -----------------------------------------------------------------------------
(
char * c
, char * eB
)
LB_("Java2Htm.AtFunc")
// traceStr( "AAA", c, 100 );
*eB = '.' ;
skip_space( c );
__ if ( At( c, "class " ) || schema( c ) || in_str( *c, "{}" ) ) ret( 0 )
while in_name( *c ) c++ ; skip_space( c )
for(;;)
{
while not_in_str( *c, "=(:;+-/){}[.\"o<>," ) c++ ;
if At( c, "::" )
then {
c += 2 ; skip_space( c );
}
esif ( *c == '(' )
{
int k = 1 ; c++ ;
while ( k )
{
if in_str( *c, ";.|'\"+-[" ) ret( 0 )
if ( *c == '(' ) k++ ; else
if ( *c == ')' ) k-- ;
c++ ;
}
skip_space( c )
if At( c, "const" ) { c += 5 ; skip_space( c ) }
if in_str( *c, ";.|" ) ret( 0 )
ret( 1 )
}
esif ( *c == ':' && ( At( c-6, "public:" )
|| At( c-7, "private:" )
|| At( c-9, "protected:" )
) )
c++ ;
esif ( *c == ':' )
{
while not_in_str( *c, ";{" ) c++ ;
ret(( *c == '{' ))
}
esif At( c, "//" )
{
while ( *c != '\n' ) *c++ = ' ' ;
}
esif At( c, "/*" )
{
while not_At( c, "*/" ) *c++ ; *c++ ; *c++ ;
}
esif ( *c == 'o' )
{
if At( c, "operator" ) ret( 1 ) else c++ ;
}
else ret( 0 )
}
LE_ret( 0 )
/* private: */ char * Java2Htm :: skip_1char_and_comment
// -----------------------------------------------------------------------------
(
char * e
, char * eB
)
LB_("Java2Htm.skip_1char_and_comment")
e++ ; skip_space( e )
while ( *e == '/' )
{
if At( e, "//" )
then {
to_( e, '\n' ) skip_space( e )
}
esif At( e, "/*" )
{
Loop {
e++ ; to_( e, '/' ); if ( e[-1] == '*' ) break ;
}
e++ ; skip_space( e )
}
else break ;
}
if ( eB <= e ) fErr1( e-eB )
LE_ret( e )
/* private: */ BOOL Java2Htm :: erledigt
// -----------------------------------------------------------------------------
(
BOOL setDone
, char * fn
)
LB_("Java2Htm.erledigt")
unix_me( fn ); lower( fn ); // muss beides sein
if ( scanned.contains( fn ) ) ret( 1 )
if ( setDone ) scanned.StrIns( fn );
LE_ret( 0 )
/* private: */ long Java2Htm :: pretty_CPP
// -----------------------------------------------------------------------------
(
char * htm
, char * cpp
)
LB_("Java2Htm.pretty_CPP")
long neLOC = 0 ;
char * spaces = " "
" "
" ";
char * esp = spaces = eos( spaces );
char * tmp = "xx_pretty" ;
FILE * f = create( tmp ); rBuffer B( htm, "\n" ); int offset = 1 ;
B.find( 0, "<pre", f );
while ( B.find( offset, suchpr, f ) )
{
char * c = B.z + B.a ; offset = 1 ;
if ( *c == '{' || *c == '}' )
then {
B.a -= 2 ; memcpy( B.z + B.a, " \n", 2 );
}
esif ( *c == '"' )
{
B.find( 1, "\"", f );
while escaped( B.z + B.a ) B.find( 1, "\"", f );
}
esif ( *c == '\n' && c[1] != '\n' )
{
neLOC++ ;
skip_space( c );
while in_str( *c, "{}" )
{
if ( *c == '{' )
then {
spaces -= 4 ;
fprintf( f, "\n%s{", spaces );
if ( spaces + 40 < esp )
{
spaces = esp - 40 ;
if ( serr ) printf( "\nBracket Error(+): %s", htm );
serr = false ;
}
c++ ; skip_space( c )
}
else {
if ( *spaces ) fprintf( f, "\n%s}", spaces );
spaces += 4 ;
if ( esp < spaces )
{
spaces = esp ; // for robustness
if ( serr ) printf( "\nBracket Error(-): %s", htm );
serr = false ;
}
c++ ; skip_space( c )
if ( *c != '}' ) fprintf( f, "\n" );
}
}
fprintf( f, "\n%s", spaces );
B.a = c - B.z ; offset = 0 ;
}
esif At( c, "//" )
{
fprintf( f, "%s", spaces ); B.find( 1, "\n", f ); offset = 0 ;
}
esif At( c, "/*" ) B.find( 1, "*/", f );
esif At( c, "</pre>" )
{
B.find( 1, "<pre", f );
if At( B.z + B.a, "<pre-" ) break ;
}
esif At( c, "<table" )
{
B.find( 1, "</table", f );
}
esif ( *c == 'a' && in_str( c[-1], "mM" ) )
{
char * a = c ; while in_name( *a ) a-- ; a++ ;
char * e = c ; while in_name( *e ) e++ ;
char * k = e ; skip_space( k );
if ( *k == '(' )
{
char m = *e ; *e = 0 ;
if is_( c, "ain" )
{
fprintf( f, "<a name=%s></a>", a );
char40 xx ; s_( xx, "%s.htm#%s", cpp, a );
ourVers( cppMains, a, xx, cpp );
}
*e = m ;
}
}
}
close( f ); f = create( htm ); B.open_rBuffer( tmp, "" );
while ( B.find( 1, "\n\n", f ) )
{
char * c = B.z + B.a + 2 ;
while in_str( *c, "\n;" )
{
B.a++ ; c++ ;
}
}
close( f ); unlink( tmp );
LE_ret( neLOC )
/* private: */ uint Java2Htm :: BAS_to_htm
// -----------------------------------------------------------------------------
(
int fNr // nr of page
, char * bas // path to a *.bas file
)
LB_("Java2Htm.BAS_to_htm")
if ( erledigt( 1, bas ) ) ret( 0 )
//
char20 basfn ; s_( basfn, "%i.htm", fNr );
char1000 xx ; s_( xx, "%s/bas%i.htm", j2h, fNr );
if is_file( xx ) ret( 0 )
Btree toc ;
BOOL hasIncs = false ;
uint spot = 0 ;
uint deep = 0 ;
char1000 fn ; strcpy( fn, bas ); unix_me( fn );
char * c = bas + strlen( bas ) - 1 ;
while ( bas < c && not_in_str( *c, "/\\." ) ) c-- ;
char m = ( *c == '.' )? '.' : 0 ;
char * e = ( m )? c : eos( bas ); *e = 0 ;
while ( *c != '/' ) c-- ; c++ ;
FILE * f = create_mit_meta_bas( xx, c );
__
*e = m ; rBuffer B( bas, "" ); *e = 0 ; // muss sein
str_set such ; such.insert( "Public " ); int commands = 0 ;
such.insert( "public " ); int offset = 0 ;
such.insert( "Function " );
such.insert( "function " );
such.insert( "Sub " );
such.insert( "sub " );
such.insert( "\nDim " );
such.insert( "\ndim " );
such.insert( "Ex" );
such.insert( "ex" );
such.insert( "nd func" );
such.insert( "nd Func" );
such.insert( "nd sub" );
such.insert( "nd Sub" );
such.insert( "nd class" );
such.insert( "nd Class" );
such.insert( "Private " );
such.insert( "private " );
such.insert( "Global " );
such.insert( "global " );
such.insert( "'" );
such.insert( "<" );
such.insert( "\"" );
such.insert( "\n\n\n" );
such.insert( "\nfile:" );
such.insert( "\nclass " );
such.insert( "\nClass " );
such.insert( "M" ); // MsgBox
such.insert( "m" ); // msgBox
such.insert( "C" ); // CreateObject
such.insert( "c" ); // CreateObject
int scope = 0 ;
BOOL correct = 1 ; unsigned long ii = 0 ;
char * A = eos( bas ) - 1 ;
while ( bas < A && not_in_str( A[-1], "/\\" ) ) A-- ;
char400 Ausfile ; *Ausfile = 0 ; strcpy( Ausfile, A );
char400 ausfile ; *ausfile = 0 ;
char100 inClass ; *inClass = 0 ;
while ( B.find( offset, such, f ) )
{
__ B.getmore( 4000 );
char * e = B.z + B.e ;
char * c = B.z + B.a ; offset = 0 ; B.z[ B.e+1 ] = 0 ;
// _1(c)
if At( c+1, "xit" )
{
char * x = c + 4 ; skip_space( x ); *x = upper( *x );
offset = x+2 - c ; continue ;
}
if in_str( *c, "mM" )
{
if not_iAt( c, "MsgBox" )
{
offset = 1 ; continue ;
}
B.z[ B.e ] = '\n' ;
char * e = c ; to_( e, '\n' ) *e = 0 ;
fprintf( f, "<a name=mB%i></a><a href=mBox.htm>MsgBox</a>", ++mBoxNr );
c += 6 ; skip_space( c )
char800 xx ; s_( xx, "%i~%s", mBoxNr, escape_to_htm( c ) );
mBoxes -> StrIns( 'i', xx, basfn );
*e = '\n' ;
B.a += 6 ; continue ;
}
if in_str( *c, "cC" )
{
if ( not_space( c[-1] ) ||
( not_iAt( c, "CreateObject" ) && not_iAt( c, "Case" ) )
)
{
offset = 1 ; continue ;
}
*c = 'C' ;
if At( c, "Case " )
{
char * x = c + 4 ; skip_space( x );
char * e = x + 1 ;
char m = ',' ;
while ( m == ',' )
{
if ( *x == '"' )
then {
while ( *e != '"' ) e++ ; e++ ;
}
else {
uint k = 0 ;
while ( k || not_space( *e ) )
{
if ( *e == '(' ) k++ ;
if ( *e == ')' ) k-- ;
e++ ;
if At( e-1, "then" ) { e-- ; k = 0 ; }
if At( e-1, "Then" ) { e-- ; k = 0 ; }
}
}
x = e ; skip_space( x )
m = *x ;
if ( m == ',' )
{
e = x+1 ; skip_space( e ); *x = *e ;
}
}
m = *e ; *e = 0 ;
// _1(bas+0)
c = escape_to_htm( c );
char300 xx ; s_( xx, "c%i", ++crObNr );
fprintf( f, "<a name=%s></a>%s", xx, c );
if ( 200 < strlen( c ) ) fErr1( c )
char300 zz ;
s_( zz, "%s~%s~%s~%i", Ausfile, basfn, c, ++execNr );
cases -> StrIns( 'i', zz, xx );
*e = m ;
B.a = e - B.z ; continue ;
}
B.z[ B.e ] = '\n' ;
to_( c, '(' );
char * e = c ; to_( e, '\n' ) *e = 0 ;
fprintf( f, "<a name=cr%i></a><a href=crOb.htm>CreateObject</a>"
, ++crObNr );
char800 xx ; s_( xx, "%i~%s", crObNr, c );
crObjs -> StrIns( 'i', xx, basfn );
*e = '\n' ;
B.a = c - B.z ; continue ;
}
if in_str( *c, "eE" )
{
if not_iAt( c, "ExecuteFile" )
{
offset = 1 ; continue ;
}
B.z[ B.e ] = '\n' ;
char * func = c ;
while in_name( *c ) c++ ;
char m = *c ; *c = 0 ;
char * e = c ; to_( e, '\n' ) *e = 0 ;
fprintf( f, "<a name=ex%i></a><a href=exec.htm>%s</a>", ++execNr, func );
*c = m ;
char800 xx ; s_( xx, "%i~%s", execNr, c );
execs -> StrIns( 'i', xx, basfn );
*e = '\n' ;
B.a = c - B.z ; continue ;
}
if At( c, "nd " )
{
if ( --scope < 0 ) scope = 0 ;
if in_str( c[3], "cC" )
{
*inClass = 0 ; strcpy( ausfile, Ausfile );
}
offset = 5 ; continue ;
}
if ( At( c, "'***" ) || At( c, "'___" ) )
{
B.z[ B.e ] = '\n' ;
to_( c, '\n' );
if ( e < c && ! B.ateof ) fErr2( c-e, B.z + B.a )
B.a = c - B.z ; continue ;
}
// traceStr( "ZZ", c, 20 );
// if At( c,"Sub" ) traceStr( "ZZ", c, 100);
// if ( B.ii > 1 ) traceStr( "ZZ", c, 100);
if ( *c == '\n' )
{
c++ ;
if At( c, "file:" )
{
c += 6 ;
char * e = c ; to_( e, '\n' ) *e = 0 ;
offset = e-c ;
strcpy( Ausfile, c );
strcpy( ausfile, c );
*e = '\n' ; continue ;
}
if ( At( c, "class " ) || At( c, "Class " ) )
{
*c = upper( *c );
s_( eos( ausfile ), ", Class " );
char * z = eos( ausfile );
char * u = z - 6 ;
c += 5 ; skip_space( c )
while not_space( *c ) *z++ = *c++ ;
*z = 0 ;
char20 nr ; s_( nr, "%i", ++spot );
toc.StrIns( 'e', u, nr );
fprintf( f, "\n<a name=%i></a><font class=\"co\">%s:</font>\n"
"\n<a name=%s></a><font size=+0><a href=\"#eof\">%s"
"</a></font>\n"
, spot, Ausfile, nr, u );
to_( c, '\n' )
B.a = c - B.z ; continue ;
}
if ( At( c, "Dim " ) || At( c, "dim " ) )
{
if ( scope )
{
offset = 1 ; continue ;
}
char * e = c ;
while not_in_str( *e, "\n'" ) e++ ;
char m = *e ; *e = 0 ;
char * x = e-1 ; while space( *x ) *x-- = 0 ;
char20 nr ; s_( nr, "%i", ++spot );
char400 zz ; char * z = zz ;
s_( z, "<font size=+0><a href=\"#eof\">" ); // +0 macht Sinn
z = eos( z );
x = c+4 ; skip_space( x );
while ( *x && x[-1] != ')' && *x != '\n' ) *z++ = *x++ ;
s_( z, "</a></font>" );
fprintf( f, "\n\nDim <a name=%s></a>%s ", nr, zz );
toc.StrIns( 'e', c, nr );
*e = m ;
B.a = e - B.z ; continue ;
}
B.a++ ; continue ;
}
if ( *c == '"' )
{
// Beachte: in bas ist \ kein escape-Zeichen.
// Der einfache ' beginnt Kommentar, kann sonst also nur in
// Strings auftreten.
char * e = c+1 ;
L4: while not_in_str( *e, "\"\n" ) e++ ;
if At( e-1, "_\n" ) { e++ ; goto L4 ; }
B.a = e+1 - B.z ;
*e = 0 ;
Var_htm // char4000 htm ; St_htm u ; u.to_htm( c, htm, 4000 );
fprintf( f, "<font class=\"kw\">%s\"</font>", htm ); // kw statt str
continue ;
}
if ( *c == '\'' )
{
char * e = c ; to_( e, '\n' ); *e = 0 ;
fprintf( f, "<font class=\"co\">%s</font>", c );
*e = '\n' ;
B.a = e - B.z ;
continue ;
}
if ( *c == '<' )
{
commands++ ; B.a += 1 ; fprintf( f, "<" );
continue ;
}
if in_str( *c, "PFSGpfsg" )
{
if not_space( c[-1] ) { offset = 1 ; continue ; }
if ( At( c+1, "unction " ) || At( c+1, "ub " ) )
{
deep++ ;
// default is public
c -= 7 ; memcpy( c, "Public ", 7 );
char * e = B.z + B.a ;
char * x = c ;
while ( x < e
&& not_At( x, "nd Sub" )
&& not_At( x, "nd Function" ) ) x++ ;
if ( x < e ) offset = x - c ;
}
*c = upper( *c );
char * e = c ;
while not_in_str( *e, "\'\n" ) e++ ;
char m = *e ; *e = 0 ;
char20 nr ; s_( nr, "%i", ++spot );
char4000 zz ;
{
char * x = c ;
char * z = zz ;
if ( At( x, "Private " ) || At( x, "Public " ) )
{
while not_space( *x ) *z++ = *x++ ;
while space( *x ) *z++ = *x++ ;
}
while ( *x && not_space( *x ) ) *z++ = *x++ ;
while ( *x && space( *x ) ) *z++ = *x++ ;
if ( *x && not_At( x, "End " ) && not_At( x, "end " ) )
{
s_( z, " <font size=+0><a href=\"#eof\">" ); // +0 macht Sinn
z = eos( z );
while ( *x && not_space( *x ) && *x != '(' ) *z++ = *x++ ;
while ( *x && space( *x ) ) *x++ ;
s_( z, "</a></font> " );
z = eos( z );
}
while ( *x ) *z++ = *x++ ;
*z = 0 ;
if ( z - zz >= 4000 ) fErr2( zz, z-zz )
}
fprintf( f, "\n<a name=%i></a>", spot );
if ( 1
// if ( *ausfile &&
// ( substr( "Sub ", zz ) || substr( "unction ", zz ) )
)
then {
fprintf( f, "\n<font class=\"co\">%s:</font>\n\n%s", ausfile, zz );
}
else fprintf( f, "%s", c );
char * x = c ;
L5: while ( *x && not_in_str( *x, "('=aAlL" ) ) x++ ;
if ( alpha( *x ) && not_At( x, "As " )
&& not_At( x, "as " )
&& not_At( x, "Lib " )
&& not_At( x, "lib " )
)
{
x++ ; goto L5 ;
}
*x-- = 0 ; while space( *x ) *x-- = 0 ;
if not_in_name( *c ) fErr1( c )
char * w = c ;
while ( At( w, "Private " )
|| At( w, "Public " )
|| At( w, "Sub " )
|| At( w, "Function " )
)
{
to_space( w ) skip_space( w )
}
*w = upper( *w );
char400 cc ;
if ( substr( " Main", c ) || substr( " main", c ) )
{
s_( cc, "%s -- %s -- %s", c, bas, ausfile );
c = cc ;
}
toc.StrIns( 'e', c, nr );
if not_substr( " const ", lower( c ) ) commands++ ;
B.a = e - B.z ; *e = m ;
while At( B.z + B.a, "\n\n" ) B.a++ ;
}
__ }
__
char * se = "" ; if ( ! correct )
se = " <br><b>There seem to be syntax errors "
"( at least one missing \" ).</b>" ;
fprintf( f, "\n</font><a name=eof></a><font face=\"Verdena,Arial\" size=1>"
"\n<font size=4>%s%s%s<br></font>"
"\n<font size=1><br>%i Methods = <br>%s</font>"
, t1, c, t2, commands, gutLesbar( fn ) );
*e = m ;
fprintf( f, "\n<font size=2>%s<br> <br>Module Contents: Goto"
" <a href=#public>exported Functions</a>,"
" <a href=#top>top</a>, or"
" <a href=subs.htm>ALL Global VB Environment</a><br>", se );
KVStore st ; Surr s = toc.GetFirst( st );
uint anzpub = 0 ;
char400 zz ;
BOOL pufunc = 0 ;
char c0 = st.k[0] ;
char c1 = st.k[1] ;
while ( s )
{
char * stk = st.k ;
if ( pufunc && not_At( st.k, "Public Func" ) )
then {
fprintf( f, "\n<br>|" );
pufunc = 0 ;
}
esif ( c0 != st.k[0] || c1 != st.k[1] )
{
__ fprintf( f, "\n<br>|" );
c0 = st.k[ 0 ] ;
c1 = st.k[ 1 ] ;
__ }
if ( *st.k == 'P' )
then {
if At( st.k, "Public" )
{
if ( ++anzpub == 1 ) fprintf( f, "\n<a name=public></a>" );
}
if At( st.k, "Public Function " )
{
pufunc = 1 ;
char * x = st.k ;
char * z = zz ;
while not_space( *x ) *z++ = *x++ ;
while space( *x ) *z++ = *x++ ;
while not_space( *x ) *z++ = *x++ ;
while space( *x ) *z++ = *x++ ;
s_( z, "<font size=\"+1\">" );
z = eos( z );
while ( *x && not_space( *x ) ) *z++ = *x++ ;
s_( z, "</font>" );
while ( *z ) *z++ ;
while ( *x ) *z++ = *x++ ;
*z = 0 ; stk = zz ;
}
}
esif At( st.k, "Sub " )
{
fprintf( f, "\n<a name=sub></a>" );
}
if not_substr( st.k, "Private" )
if not_substr( ">End<", stk )
if not_substr( ">end<", stk )
{
fprintf( f, "\n<a href=#%s>%s</a>", st.c, stk );
}
if ( in_str( *st.k, "PGSDC" ) && not_At( st.k, "Private" ) )
{
char200 xx ; s_( xx, "%i.htm#%s", fNr, st.c );
ourVers( subs, st.k, xx, bas );
}
s = toc.Next( st );
}
fprintf( f, "</font></font>" );
close( f );
anz_bas_commands += commands ;
LE_ret( deep )
/* private: */ char * Java2Htm :: to_end_of_WHERE ( char * c
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.to_end_of_WHERE")
while ( not_in_str( *c, ",;" )
&& not_At( c, "Where" )
&& not_At( c, "where" )
&& not_At( c, "WHERE" )
&& not_At( c, "ORDER BY" ) ) c++ ;
if in_str( *c, "wW" )
{
while ( *c != ';'
&& ! ( At( c, "FROM " ) && space( c[-1] ) )
&& ! ( At( c, "from " ) && space( c[-1] ) )
)
c++ ;
}
LE_ret( c )
/* private: */ char * Java2Htm :: escape_to_htm ( char * c
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.escape_to_htm")
char * c1 = c ;
char * z = escBuffer ; c-- ;
while ( *( ++c ) )
{
if ( *c == '<' )
then {
*z++ = '&' ;
*z++ = 'l' ;
*z++ = 't' ;
*z++ = ';' ;
}
else *z++ = *c ;
if ( escBufferMax <= z ) fErr1( c1 )
}
*z = 0 ;
LE_ret( escBuffer )
/* private: */ void Java2Htm :: see_EXEC_SQL_sections
/* -----------------------------------------------------------------------------
This file contains EXEC SQL sections extracted from COBOL or C files.
Postpone analysing this file after having analysed all other files so that
there is no need to analyse EXEC SQL statements in these other sorce files.
-----------------------------------------------------------------------------
*/ (
char * src // = srcRoot/tables.xxx
)
LB_("Java2Htm.see_EXEC_SQL_sections")
if ( fx ) close( fx );
rBuffer B( src, "\n" );
FILE * f = stdout ;
str_set such ; such.insert( "p .. " );
such.insert( "FETCH " );
such.insert( "fetch " );
such.insert( "COMMENT ON " );
such.insert( "comment on " );
such.insert( "CURSOR " );
such.insert( "cursor " );
such.insert( "FROM " );
such.insert( "from " );
such.insert( "VIEW " );
such.insert( "view " );
such.insert( "EXEC SQL" );
such.insert( "exec sql" );
char40 execDB ; *execDB = 0 ;
char100 progr ; s_( progr, backtoSucc( src, "/" ) );
char * view = 0 ;
char * cursor = 0 ;
char * entry = progr ;
char100 co ; *co = 0 ;
int spot = 0 ;
int offset = 0 ;
if ( B.find( 0, such, 0 ) ) ohne_tables = false ; else ret_
while ( B.find( offset, such, 0 ) )
{
ohne_tables = false ;
if ( cursor ) fErr1( cursor+0 )
B.getmore( 12000 ); B.z[ B.e+2 ] = '\n' ;
char * c = B.z + B.a ; offset = 0 ; B.z[ B.e+1 ] = 0 ;
BB {
// traceStr( "ZZ", c, 20 ); fflush( stdout );
}
if At( c, "p .. " )
{
char * e = c += 5 ; to_( e, '[' ) e[-1] = 0 ;
strcpy( progr, c );
e[-1] = ' ' ;
c = ++e ; to_( e, ']' ) *e = 0 ;
strcpy( execDB, c );
// _1(execDB)
*e = ']' ;
__ continue_( e - ( B.z + B.a ) )
}
if iAt( c, "COMMENT " )
{
to_( c, '\n' )
continue_( c - ( B.z + B.a ) )
}
if iAt( c, "FETCH " )
{
if not_space( c[-1] ) continue_( 1 )
c += 5 ; skip_space( c )
if not_alpha( *c ) continue_( 1 )
char * e = c ; while in_name( *e ) e++ ; char m = *e ; *e = 0 ;
cursor = store.take( c );
if ( ! *execDB ) fErr
if ( *progr )
then {
char300 xx ; s_( xx, "p .. %s~c .. %s", progr, cursor );
DBUse.StrIns( 'e', xx, execDB );
}
else fErr2( cursor, src )
*e = m ;
cursor = 0 ; // muss sein
continue_( e - ( B.z + B.a ) )
}
if iAt( c, "CURSOR " )
{
if not_space( c[-1] )
{
traceStr( "nnn", c-20, 80 );
continue_( 1 )
}
c-- ; while space( *c ) c-- ;
char * e = c+1 ; char m = *e ; *e = 0 ;
if not_alpha( *c ) continue_( 1 )
while in_name( *c ) c-- ; c++ ;
cursor = store.take( c );
*e = m ;
if ( ! *execDB ) fErr
cursordef -> StrIns( 'e', cursor, execDB );
while ( *c != ';'
&& ! ( At( c, "from " ) && space( c[-1] ) )
&& ! ( At( c, "FROM " ) && space( c[-1] ) ) ) c++ ;
while ( *c != ';' && not_At( c, "WHERE" )
&& not_At( c, "where" )
&& not_At( c, "Where" )
&& not_At( c, "ORDER BY" ) )
{
if ( *c == ',' ) c++ ; else to_space( c )
skip_space( c )
if ( not_in_str ( *c, ",;" ) && not_At( c, "WHERE" )
&& not_At( c, "where" )
&& not_At( c, "Where" )
&& not_At( c, "ORDER BY" ) )
{
e = c+1 ; while in_name( *e ) e++ ;
//
// Damit auch :Name noch als Name erkannt wird !!!
char m = *e ; *e = 0 ;
upper( c );
if ( *c )
{
char300 xx ;
s_( xx, "c .. %s~t .. %s", cursor, c );
if ( strlen( c ) < 2 ) fErr1( c )
}
*e = m ;
}
c = to_end_of_WHERE( c );
}
cursor = 0 ;
continue_( c - ( B.z + B.a ) )
}
if iAt( c, "VIEW " )
{
if not_space( c[-1] ) continue_( 1 )
c += 5 ; skip_space( c )
char * e = c ;
while ( in_name( *e ) || *e == '.' )
{
if ( *e == '.' ) c = e+1 ;
e++ ;
}
char m = *e ; *e = 0 ;
view = store.take( c ); // is here a VIEW
*e = m ;
fprintf( f, "\n<a name=%i></a>\n", ++spot );
while ( *c != ';'
&& ! ( At( c, "from " ) && space( c[-1] ) )
&& ! ( At( c, "FROM " ) && space( c[-1] ) ) ) c++ ;
while ( *c != ';' && not_At( c, "WHERE" )
&& not_At( c, "where" )
&& not_At( c, "Where" )
&& not_At( c, "ORDER BY" ) )
{
if ( *c == ',' ) c++ ; else to_space( c )
skip_space( c )
if ( not_in_str ( *c, ",;" ) && not_At( c, "WHERE" )
&& not_At( c, "where" )
&& not_At( c, "Where" )
&& not_At( c, "ORDER BY" ) )
{
e = c ; while in_name( *e ) e++ ;
char m = *e ; *e = 0 ;
upper( c );
char300 xx ; s_( xx, "v .. %s~t .. %s", view, c );
if ( strlen( c ) < 3 ) fErr
*e = m ;
}
c = to_end_of_WHERE( c );
}
view = 0 ;
continue_( c - ( B.z + B.a ) )
}
if iAt( c, "FROM " )
{
if not_space( c[-1] ) continue_( 1 )
if ( cursor ) fErr
char * x = c + 4 ; skip_space( x );
if not_alpha( *x ) continue_( 1 )
if ( ! *execDB ) fErr
while ( *c != ';' && not_At( c, "WHERE" )
&& not_At( c, "where" )
&& not_At( c, "Where" )
&& not_At( c, "ORDER BY" ) )
{
if ( *c == ',' ) c++ ; else to_space( c )
skip_space( c )
if ( *c == '(' ) continue_( 1 )
if ( not_in_str ( *c, ",;" ) && not_At( c, "WHERE" )
&& not_At( c, "where" )
&& not_At( c, "Where" )
&& not_At( c, "ORDER BY" ) )
{
char * e = c+1 ; while in_name( *e ) e++ ;
char m = *e ; *e = 0 ;
upper( c );
if ( ! progr ) fErr2( c, src )
char300 xx ; s_( xx, "p .. %s~t .. %s", entry, c );
if ( *c == ':' )
{
traceStr( "WARN: dynamic cursor def", c, 200 );
}
DBUse.StrIns( 'e', xx, execDB );
c = e ; *e = m ;
}
c = to_end_of_WHERE( c );
}
continue_( c - ( B.z + B.a ) )
}
if iAt( c, "EXEC SQL" )
{
if ( cursor ) fErr
fprintf( f, "\n<a name=%i></a>\n", ++spot );
continue_( 1 )
}
}
LE_
/* private: */ uint Java2Htm :: CSharp_to_htm
// -----------------------------------------------------------------------------
(
int fNr // nr of htm file to create
, char * cs // ein *.cs
)
LB_("Java2Htm.CSharp_to_htm")
if not_is_file( cs ) fErr1( cs ) _1( cs ) fflush( stdout );
if ( erledigt( 1, cs ) ) ret( 0 )
char800 src ; strcpy( src, cs );
S_ "type \"%s\" >> %s", cs, ALL_cscode _Do
if ( ! statics ) statics = new Btree ;
uint spot = 0 ;
uint deep = 0 ;
char300 ausMe ; *ausMe = 0 ;
char1000 fn ; strcpy( fn, cs ); unix_me( fn ); int ik = fNr/100 ;
char1000 xx ; s_( xx, "=%i=%s", fNr, fn ); incsMe.StrIns( 'e', xx );
char20 hh ; s_( hh, "%s.htm", nr2( fNr ) );
s_( xx, "%s/%i", j2h, ik ); create_css( xx );
s_( xx, "%s/%s", j2h, hh );
char * c = eos( cs ) - 1 ;
BOOL GLOBAL = 0 ;
while ( cs <= c && *c != '/' ) c-- ; c++ ;
if ( ! *c ) fErr1( cs );
char * csfNam = c ;
char1000 ix ; s_( ix, "=%i=%s", fNr, csfNam ); INCs.StrIns( 'e', ix );
if ( xx_dvc ) fprintf( fsrc, "\n%s", c );
FILE * f = create_mit_meta_cpp( xx, c, cs ); // xx nun so bewahren !!!
if ( ! nspaces ) nspaces = new Btree() ;
rBuffer B( cs, "" );
c = substr( "using", B.z + B.a ); if ( c ) B.a = c - B.z ;
int offset = 0 ;
str_set such ; such.insert( "<" );
such.insert( "\"" );
such.insert( "\n\n\n" );
// such.insert( "{" );
such.insert( "#" ); // region, endregion
such.insert( "/" ); // comment // or /*
such.insert( "interface " );
such.insert( "class " ); // kein Blank dahinter
such.insert( "static" );
such.insert( "return" );
such.insert( "namespace" );
such.insert( "using " );
such.insert( "p" );
such.insert( "main(" );
such.insert( "Main(" );
Btree * oben = new Btree();
char * progr = store.take( backtoSucc( src, "/" ) );
char * entry = progr ;
char300 nspace ; *nspace = 0 ; char * ensp = nspace ;
char40 nr ;
char80 cNam ; s_( cNam, "??" );
char300 xz ;
s_( xz, "%s.htm~%s", nr2( fNr ), src + LRootDir );
codefile -> StrIns( 'e', progr, xz );
s_( xz, "p %s.htm", nr2( fNr ) );
index.StrIns( 'e', progr, xz );
BOOL correct = 1 ; unsigned long ii = 0 ;
while ( B.find( offset, such, f ) )
{
B.getmore( 12000 ); B.z[ B.e+2 ] = '\n' ;
char * c = B.z + B.a ; offset = 0 ; B.z[ B.e+1 ] = 0 ;
if ( *c == '\n' )
{
while At( B.z + B.a, "\n\n\n" ) B.a++ ;
continue ;
}
bb {
}
// traceStr( "XXX",c,200);
if ( *c == 'p' )
{
if in_str( c[1], "ru" )
then {
char * was = "" ;
if At( c, "public " ) { c += 6 ; was = "." ; }
esif At( c, "private " ) { c += 7 ; was = "3" ; }
esif At( c, "protected " ) { c += 9 ; was = "2" ; }
if ( *was )
then {
char * x = c ; skip_space( c );
if At( c, "internal " ) { c += 9 ; skip_space( c ) }
if At( c, "abstract " ) { c += 9 ; skip_space( c ) }
if At( c, "static " ) { c += 7 ; skip_space( c ) }
if At( c, "virtual " ) { c += 8 ; skip_space( c ) }
if ( At( c, "class " ) || At( c, "interface" ) )
{
fprintf( f, "<font class=kw>%s</font> ", was );
B.a = c - B.z ;
continue ;
}
char * c1 = c-1 ;
while ( *c != ' ' && *c != '(' ) c++ ;
if ( *c == '(' ) c = c1 ;
if ( *c == ' ' ) *c = 0 ; else fErr1( c )
fprintf( f, "<font class=kw>%s%s</font> ", was, x );
*c = ' ' ;
B.a = ++c - B.z ;
char * e = c ; to_( e, '\n' ) *e = 0 ;
if not_in_str('<',c) if ( in_str( '(', c ) || At( " class " , c )
|| At( " interface ", c )
)
{
char * x = c+1 ;
while ( in_name( *x ) || in_str( *x, " <>" ) )
{
if ( *x == '<' ) to_( x, '>' )
x++ ;
}
x-- ;
while space( *x ) x-- ;
while in_name( *x ) x-- ;
if ( *x == ' ' ) *x++ = 0 ; else fErr3( c, *x, x )
char * n = ++x ;
while in_name( *x ) x++ ;
char m = *x ; *x = 0 ;
s_( nr, "c%s.htm#%i", nr2( fNr ), ++spot );
fprintf( f, "<a id=%i></a>"
"<a href=#eof>%s</a>", spot, c );
char300 z1 ;
char300 z2 ;
*ensp = 0 ;
s_( z1, "%s . %s~%s" , nspace, cNam, c+0 );
s_( z2, "<a href=#%i>%s</a>", spot , c+0 );
oben -> StrIns( 'e', z1, z2 );
s_( z1, "%s . %s~%s", nspace, cNam, hh );
nspaces -> StrIns( 'e', z1 );
B.a = x - B.z ; *x = m ;
}
*e = '\n' ;
}
else offset = 1 ;
}
else offset = 1 ;
continue ;
}
if ( *c == '/' )
{
if At( c, "/*" )
then {
fprintf( f, "<font class=\"co\">" );
B.find( 2, "*/", f ); B.a += 2 ;
fprintf( f, "*/</font>" );
continue ;
}
esif At( c, "//" )
{
char * x = c+2 ; if ( *x == '/' ) x++ ;
while ( *x == ' ' ) x++ ;
if At( x, "<summary>" ) x += 9 ;
while ( *x == ' ' ) x++ ;
if ( *x == '\n' )
{
B.a = x - B.z ; continue ;
}
fprintf( f, "<font class=\"co\">" );
char s = ( c[-1] == '\n' )? '|' : ' ' ;
while At( c, "//" )
{
if At( c, "/// <par" )
then {
B.find( 0, "//", f );
fprintf( f, "/// par: " );
to_( c, '>' ) B.a = c+1 - B.z ;
}
esif At( c, "/// <ret" )
{
B.find( 0, "//", f );
fprintf( f, "/// res: " );
to_( c, '>' ) B.a = c+1 - B.z ;
}
B.find( 1, "\n", ( c[3] == '\n' )? 0 : f );
c = B.z + B.a + 1 ; skip_space( c );
}
fprintf( f, "\n%c</font>", s );
continue ;
}
else continue_( 1 )
}
if ( *c == '"' )
{
if ( c[+1] == '\'' && in_str( c[-1], "'\\" ) ) continue_(1)
__ char * e = c ; skip_str( e, B.z + B.e );
B.a = e - B.z ;
char m = *e ; *e = 0 ;
if ( m == '\n' ) correct = quote_not_found( c, cs );
Var_htm // char4000 htm ; St_htm u ; u.to_htm( c, htm, 4000 );
*e = m ;
fprintf( f, "<font class=\"kw\">%s</font>", htm ); // kw statt str
continue ;
}
if ( *c == 'c' || *c == 'i' ) // class or interface
{
char40 nr ; s_( nr, "c%s.htm#%i", nr2( fNr ), ++spot );
char was = *c ;
char * n = c ; to_space( n ); *n++ = 0 ; skip_space( n );
char * e = n ; to_space( e ); char m = *e ; *e = 0 ;
s_( cNam, n );
fprintf( f, "%s <b><font size=+1><a href=#eof>%s</a></font></b>", c, n );
B.a = e - B.z ; *e = m ;
continue ;
}
if ( *c == '#' )
{
if ( At( c, "#region" ) || At( c, "#end" ) )
then {
char * e = in_str( '\n', c ); *e = 0 ;
char * z = ( c[1] == '\n' )? "" : "\n" ;
fprintf( f, "<b><font class=kw size=+1>%s</font></b>%s", c, z );
B.a = e - B.z ; *e = '\n' ;
continue ;
}
else continue_( 1 )
}
if ( *c == 'n' ) // namespace
{
if ( c[-1] != '\n' ) continue_( 1 )
fprintf( f, "<font class=kw>./2/3 = public/protected/private "
"(default = 3, resp . for enums and interface members)"
"</font>\n\n"
"<font class=kw>namespace</font> " );
B.a = c+10 - B.z ;
c = B.z + B.a ; skip_space( c );
char * z = nspace ;
while ( alphanum( *c ) || *c == '.' ) *z++ = *c++ ;
ensp = z ;
continue ;
}
if ( *c == 'r' ) // return
{
B.a += 6 ;
fprintf( f, "<font class=kw>return</font>" );
continue ;
}
if ( *c == 's' ) // static
{
if ( not_space( c[6] ) || not_space( c[-1] ) ) continue_( 1 )
char * e = c ; while not_in_str( *( ++e ), "(;=#{" );
if ( *e == '#' )
{
offset = 1 ; continue ;
}
char m = *e ; *e = 0 ;
if ( not_At( c, "THIS_FILE" ) && not_in_str( '/', c ) )
{
char400 nr ;
s_( nr, "%s~%s.htm#%i", c, nr2( fNr ), ++spot );
fprintf( f, "<a name=%i></a><font class=kw>static </font>", spot );
statics -> StrIns( 'e', nr );
B.a += 6 ;
}
*e = m ;
if ( m == ';' ) continue_( e - ( B.z + B.a ) )
continue_( 1 )
}
if ( *c == '<' )
{
B.a += 1 ; fprintf( f, "<" );
continue ;
}
if At( c+1, "ain(" ) // main or Main
{
if not_space( c[-1] ) continue_(1)
char100 xx ; s_( xx, "main %s", progr );
strcpy( progr, xx );
s_( xx, "p .. %s", progr );
fprintf( f, "\n<a name=%i></a>\n<hr>", ++spot );
char100 co ; s_( co, "%s.htm", nr2( fNr ) );
zu_codef( xx, src, co, spot );
continue_( 1 )
}
if ( *c == 'u' )
{
to_( c, ';' ) *c = ' ' ;
continue_( 1 )
}
fErr1( c )
}
c = "" ;
char * se = "" ; if ( ! correct )
se = " <br><b>There seem to be syntax errors "
"( at least one missing \" ).</b>" ;
if ( winc[ fNr ] )
then {
s_( ix, "<a href=../bf/%i.htm>is_inc_for</a> . ", fNr );
}
else *ix = 0 ;
fprintf( f, "\n</pre></font><a name=eof></a><font face=\"Verdena,Arial\">"
"\n<font size=2><a href=#top>top</a> . %s<a href=../cpp.htm>C++</a>"
"\n<font size=4>%s%s%s<br></font>"
"\n%sInclude-structure of<br>%s<br><br>"
, ix, t1, c, t2, se, gutLesbar( fn ) );
char100 namesp ; *namesp = 0 ;
KVStore st ; Surr s = oben -> GetFirst( st );
while ( s )
{
char * x = in_str( '~', st.k );
if ( x ) *x = 0 ; else fErr1( st.k )
if not_is_( namesp, st.k )
{
if ( *namesp ) fprintf( f, "\n<a id='%s'></a>|<br>", st.k );
else fprintf( f, "\n<a id='%s'></a>" , st.k );
strcpy( namesp, st.k );
}
fprintf( f, "\n%s . %s<br>", st.k, st.c );
*x = '~' ;
s = oben -> Next( st );
}
close( f );
delete( oben );
LE_ret( deep )
/* private: */ uint Java2Htm :: CPP_to_htm
// -----------------------------------------------------------------------------
(
int fNr // nr of htm file to create
, char * cpp
)
LB_("Java2Htm.CPP_to_htm")
char * cs = substr( ".cs", cpp );
if ( cs && is_( cs, ".cs" ) )
{
CSharp_to_htm( fNr, cpp );
ret( 0 )
}
if ( erledigt( 1, cpp ) ) ret( 0 )
char800 src ; strcpy( src, cpp );
S_ "type \"%s\" >> %s", cpp, ALL_ccode _Do
if ( ! statics ) statics = new Btree ;
long LOCA = LOC_cpp ;
BOOL GRT_src = false ;
BOOL ui = false ;
SCTr { printf( "\ncp \"%s\" x8", cpp ); fflush( stdout ); }
if ( *selector && substr( selector, cpp ) ) codese += file_len( cpp );
codesz += file_len( cpp );
if ( ++codenr % 100 == 1 )
{
printf( "\ncode: %5u, %12u", codenr, codesz );
fflush( stdout );
}
if not_is_file( cpp ) fErr1( cpp ) _1( cpp ) fflush( stdout );
if ( compare_code_rose )
{
fprintf( fcode, "\n\nfile: %s\n", cpp );
rBuffer X( cpp, "\n" ); X.copy_to( fcode );
}
uint spot = 0 ;
uint deep = 0 ;
char300 ausMe ; *ausMe = 0 ;
char1000 fn ; strcpy( fn, cpp ); unix_me( fn ); int ik = fNr/100 ;
char1000 xx ; s_( xx, "=%i=%s", fNr, fn ); incsMe.StrIns( 'e', xx );
s_( xx, "%s/%i", j2h, ik ); create_css( xx );
s_( xx, "%s/%s.htm", j2h, nr2( fNr ) );
char * c = eos( cpp ) - 1 ;
BOOL GLOBAL = 0 ;
BOOL isCpp = ( c[-2] == 'c' );
BOOL isRes = At( c-2, ".rc" );
while ( cpp <= c && *c != '/' ) c-- ; c++ ;
char * cppfNam = c ;
char1000 ix ; s_( ix, "=%i=%s", fNr, cppfNam ); INCs.StrIns( 'e', ix );
if ( xx_dvc ) fprintf( fsrc, "\n%s", c );
if ( ! *c ) fErr1( cpp );
FILE * f = create_mit_meta_cpp( xx, c, cpp ); // xx nun so bewahren !!!
path esc = "tmp.esc.tmp" ; escto( cpp, esc ); // das '<' zu <
rBuffer B( esc, "" );
{
char * c = B.z + B.a ; skip_space( c )
if At( c, "/*" ) { rB_( B, 1, "*/", 0 ) B.a += 2 ; }
}
if substr( "/ui_", cpp )
{
//
if ( ! DDX.contains( cpp ) ) DDX.StrIns( 'e', cpp, nr2( fNr ) );
}
BOOL LB = 0 ;
int offset = 0 ;
str_set such ; such.insert( "<" );
such.insert( "\"" );
such.insert( "\n" );
such.insert( "#" );
such.insert( "/" ); // comment // or /*
such.insert( "class" ); // kein Blank dahinter
such.insert( "static" );
such.insert( "typedef" );
such.insert( "DDX_" );
such.insert( "MESSAGE_MAP" );
such.insert( "ASSERT(" );
such.insert( "Exception(" ); zuCob = 1 ;
if ( isCpp ) such.insert( "(" );
such.insert( "main(" );
if ( zuCob ) such.insert( "COMMENT ON " );
if ( zuCob ) such.insert( "comment on " );
if ( zuCob ) such.insert( "int " );
if ( zuCob ) such.insert( "void " );
/*
if ( zuCob ) such.insert( "FETCH " );
if ( zuCob ) such.insert( "fetch " );
if ( zuCob ) such.insert( "CURSOR " );
if ( zuCob ) such.insert( "cursor " );
if ( zuCob ) such.insert( "FROM " );
if ( zuCob ) such.insert( "from " );
if ( zuCob ) such.insert( "VIEW " );
if ( zuCob ) such.insert( "view " );
*/
if ( zuCob ) such.insert( "EXEC SQL" );
if ( zuCob ) such.insert( "exec sql" );
if ( noAutoComment )
{
such.insert( "TRACE0(" );
}
char40 execDB ; *execDB = 0 ;
char * u = eos( src );
char * view = 0 ;
char * cursor = 0 ;
char * progr = store.take( backtoSucc( src, "/" ) );
char * entry = progr ;
char300 xz ;
s_( xz, "%s.htm~%s", nr2( fNr ), src + LRootDir );
codefile -> StrIns( 'e', progr, xz );
s_( xz, "p %s.htm", nr2( fNr ) );
index.StrIns( 'e', progr, xz );
BOOL correct = 1 ; unsigned long ii = 0 ;
uint MeNr = 0 ; Btree * MeSet = new Btree ;
while ( B.find( offset, such, f ) )
{
__ if ( cursor ) fErr1( cursor+0 )
B.getmore( 20000 ); B.z[ B.e+2 ] = '\n' ;
char * c = B.z + B.a ; offset = 0 ; B.z[ B.e+1 ] = 0 ;
bb {
// traceStr( "ZZ", c, 200 ); fflush( stdout );
}
// traceStr( "XXX",c,200);
if ( *c == '\n' ) // stets als erste Alternative
{
if ( B.e <= B.a + 2 ) break ; // muss sein
if At( c, "\n\n\n" )
{
__ B.a = nz( c ) - B.z ; __ continue ;
}
if ( At( c, "\n/* p" ) && substr( "LB_(", c ) )
{
LB = true ;
__
// Methode feststellen:
{
MeNr++ ;
char * e = in_str( '\n', c+1 ); *e = 0 ;
char M = 0 ;
char * m = in_str( '(', c+1 );
if ( m )
{
while ( m[-1] == ' ' ) m-- ;
M = *m ;
*m = 0 ;
}
__
s_( xz, "%s#%i", c+1, ++MeNr );
*e = '\n' ;
if ( m ) *m = M ;
MeSet -> StrIns( 'i', xz, "" );
}
__
fprintf( f, "\n\n<a id=%i></a>\n", MeNr );
printf( "\n\n<a id=%i></a>\n", MeNr );
B.find( 1, "\n LE_", f );
B.find( 1, "\n" , f );
continue ;
}
if At( c, "\n//" )
{
if At( c+1, "// end >>" ) break ;
FILE * f1 = f ; if At( c, "// #" ) then f = 0 ;
B.find( 1, "\n", f1 );
continue ;
}
if ( isRes || At( c, "\n LE_" ) ) continue_( 1 )
if At( c, "LB_" )
{
fprintf( f, " LB_" ); B.find( 1, "\n", 0 ); continue_( 0 )
}
GLOBAL-- ;
if ( c[1] == '\n' ) continue_( 1 )
if ( c[-1] == ',' ) continue_( 1 )
char * z = c ; skip_space( z );
if ( B.z + B.e <= z ) break ;
if ( At( z, "int " )
|| At( z, "void " )
|| At( z, "FROM " )
|| At( z, "FETCH " )
|| At( z, "CURSOR " ) ) continue_( z - ( B.z + B.a ) )
if ( *z != '/' && not_alpha( *z ) ) continue_( 1 )
if At( z, "EJECT" )
then {
to_( z, '\n' ); B.a = z - B.z ; continue_( 0 )
}
while ( At( z, "__" ) && space( z[2] )
|| At( z, "___" ) && space( z[3] )
)
{
// GRT trace command ausblenden:
while ( *z == '_' ) *z++ = ' ' ; skip_space( z );
}
if ( *z == '(' ) fprintf( f, " " );
if in_str( *z, "{};(),#<>|&*+-" ) continue_( z-c )
if At( z, "extern \"C\"" )
{
z[10] = '\n' ; B.a = z + 10 - B.z ; continue_( 0 )
}
if ( *z == 'p' )
{
if ( At( z, "protected:" )
|| At( z, "public:" )
|| At( z, "private:" )
)
{
continue_( 1 )
}
}
if ( *z == '/' )
{
if ( At( z, "// Additional P" )
|| At( z, "// Additional I" )
|| At( z, "// Data Members" )
)
{
to_( z, '\n' ); B.a = z - B.z ; continue_( 0 )
}
B.a = --z - B.z ; *z = '\n' ; continue_( 1 )
}
if ( At( z, "union " )
|| At( z, "enum " )
|| At( z, "struct " )
)
{
char * x = z ; while in_name( *x ) x++ ; skip_space( x )
while in_name( *x ) x++ ; skip_space( x )
if ( *x == '*' ) continue_( 1 )
while not_in_str( *x, ";{" ) x++ ;
if ( *x == ';' )
{
// skip this predeclaration:
to_( x, '\n' ) B.a = x - B.z ; continue_( 0 )
}
}
if At( z, "template " )
{
char * x = z ; while not_in_str( *x, ";{" ) x++ ;
if ( *x == ';' )
{
// skip this predeclaration:
to_( x, '\n' ) B.a = x - B.z ; continue_( 0 )
}
}
if in_str( *z, "ifcdersptw:LCSTEAo" )
if ( At( z, "if " ) || not_in_name( *z )
|| At( z, "if(" ) || in_str( *z, "{}." )
|| At( z, "fErr" )
|| At( z, "LB_" )
|| At( z, "LE_" )
||( At( z, "template" ) && in_str( z[8], "< " ) )
||( At( z, "for(" ) && in_str( z[3], "( " ) )
||( At( z, "then" ) && space( z[4] ) )
||( At( z, "else" ) && space( z[4] ) )
||( At( z, "esif" ) && space( z[4] ) )
||( At( z, "while" ) && space( z[5] ) )
||( At( z, "class" ) && space( z[5] ) )
||( At( z, "do" ) && space( z[2] ) )
||( At( z, "ok" ) && space( z[2] ) )
||( At( z, "TRY" ) && space( z[3] ) )
||( At( z, "return" ) && not_in_name( z[6] ) )
||( At( z, "switch" ) && not_in_name( z[6] ) )
||( At( z, "case" ) && not_in_name( z[4] ) )
||( At( z, "default" ) && not_in_name( z[7] ) )
||( At( z, "delete" ) && not_in_name( z[6] ) )
|| At( z, "TRACE" )
|| At( z, ": " )
|| At( z, "printf" ) || At( z+1, "printf" )
|| At( z, "interface" )
|| At( z, "CATCH_" )
|| At( z, "END_" )
|| At( z, "ASSERT" )
|| At( z, "STDMETHOD" ) ) continue_( z-c )
BOOL seeMe = ( ! GRT_src && ( isCpp || At( z, "inline" ) ) );
char * k = AtMeth( z, B.z + B.e ); // _1((k==0))
if ( k )
{
if ( *k == '.' ) continue_( 1 )
if ( ! k[3] ) k[3] = ' ' ;
if not_At( k, "::" )
{
char * x = k ; while not_in_str( *x, "(:\n" ) x++ ;
if At( x, "::" ) k = x ;
}
}
LOC_cpp++ ;
char * M = 0 ;
if ( seeMe && k && At( k, "::" ) )
{
char * c0 = c ; skip_space( c0 )
// -----------------------------------------------------------------
*k = 0 ; char * u = k + 2 ; skip_space( u )
char * e = u ; while not_in_str( *e, "({;}" ) e++ ;
if ( *e == '(' ) *e = 0 ; else continue_( 1 )
*e = 0 ;
{
M = substr( "\n/*", u ); if ( M ) *M = 0 ;
M = substr( "\n//", u ); if ( M ) *M = 0 ;
}
char100 meth ; strcpy( meth, escape( u, B.z + B.e ) );
*e = '(' ;
if (0)
{
char * x = eos( meth ) - 1 ;
while ( space( *x ) && meth <= x ) *x-- = 0 ;
if ( ! *meth ) fErr
}
// -----------------------------------------------------------------
char40 nr ; s_( nr, "m%s.htm#%i", nr2( fNr ), ++spot );
char800 dopp ; int Vers = 1 ; char * c1 = k-1 ;
while space( *c1 ) c1-- ;
if ( *c1 == '>' )
{
while ( *c1 != '<' ) c1-- ; c1-- ;
while space( *c1 ) c1-- ;
}
while not_space( *c1 ) c1-- ; c1++ ;
while not_in_name( *c1 ) c1++ ;
c = c1 ; *k = ':' ;
char * x = eos( c1 ); while ( ! *x ) *x++ = ' ' ;
x = k+2 ; skip_space( x ); if ( *x == '~' ) x++ ;
if At( c, "operator" )
{
x = c + 8 ; skip_space( x ) x++ ;
}
while ( *x != '(' ) x++ ; while space( x[-1] ) x-- ;
char m = *x ; *x = 0 ; ourVers( cppsecs, c, nr, cpp );
char * xm = x ; *k = 0 ; x = in_str( '/', u );
if ( x ) *x = 0 ;
KVStore st ; char * o = eos( c0 ) - 1 ;
while ( c0 <= o && ( in_name( *o ) || *o == '>' ) )
{
if ( *o == '>' )
then {
while ( *( --o ) != '<' ){} o-- ;
while space( *o ) o-- ;
}
else o-- ;
}
o++ ; if ( ! *o ) o = "::" ;
if ( ! nameNr.Get( o, st ) )
{
s_( st.c, "%i", ++nam_Nr ); nameNr.StrIns( 'e', o, st.c );
}
char * sk = "" ; char * zk = in_str( '\n', c0 );
if ( zk )
then {
sk = c0 ; *zk++ = 0 ;
}
else zk = c0 ;
char * c2 = ( GLOBAL > 0 )? "" : " ::" ;
char20 toc ; s_( toc, "m/%s.htm", st.c );
if ( ! *c2 ) s_( toc, "funcs.htm" );
fprintf( f, "\n</pre><a name=%i></a>%s%s %s%s"
"\n<font size=4><a href=../%s>%s</a></font><hr>"
"\n<pre class=c><font size=2>"
, spot, to_2B, sk, escstr( zk ), c2, toc, meth );
if ( M ) *M = '\n' ;
{
char200 func ; strcpy( func, escstr( zk ) );
char * x = eos( func ) - 1 ;
while ( func < x && in_name( *x ) ) x-- ;
if ( func < x ) *x-- = 0 ;
s_( ausMe, "%s :: %s : %s", x+1, u, func );
char300 nr ; nr[252] = 0 ;
s_( nr, "%s~%s.htm#%i", ausMe, nr2( fNr ), spot );
if ( nr[252] ) fErr1( nr )
if ( GLOBAL == 1 )
{
char * x = nr ; to_( x, '~' )
CFunc.StrIns( x+1 );
GLOBAL = 0 ;
}
Methods.StrIns( 'i', nr );
GLOBAL = 0 ;
}
__ *xm = m ;
if ( x && x[1] != '/' ) // to skip lines // ------....
{
*x = '/' ;
}
c = e ; *e = '(' ;
if At( c, "( void )" ) { c += 6 ; *c = '(' ; }
char * nL = "" ;
while in_str( *c, "(," )
{
char k = *c++ ; skip_space( c ); e = c ;
if in_name( *c ) nL = "" ;
// if in_name( *c ) nL = "<br>" ;
while not_in_str( *e, ",)" ) e++ ;
char m = *e ; *e = 0 ; if ( *c ) fprintf( f, "%s", c );
// char m = *e ; *e = 0 ; if ( *c )
c = e ; *e = m ;
}
if ( *e != ')' ) fErr
e++ ; skip_space( e )
while ( not_in_str( *e, "{" ) && e < B.z + B.e )
{
if ( *e == '{' )
{
char * e1 = e ; skip_nest( e, '{', '}' );
if ( B.z + B.e <= e ) fErr
e[-1] = 0 ; fprintf( f, "%s}", e1 );
B.a = e - B.z ; continue_( 0 )
}
if At( e, "//" ) to_( e, '\n' )
if At( e, "LB_" ) break ; else e++ ;
}
fprintf( f, "%s", nL );
B.a = e - B.z ; continue ;
}
if ( seeMe && ( ! noFunc ) && AtFunc( z, B.z + B.e ) )
{
if ( GLOBAL == 1 )
then {
if At( z, "::" ) z += 3 ; else z -= 1 ;
*z = '\n' ;
B.a = z - B.z ; continue_( 1 )
}
char * x = z ; to_( x, '(' ) x-- ;
while space( *x ) x-- ;
if in_name( *x )
then {
while ( in_name( *x ) || *x == '~' ) x-- ;
if space( *x )
then while not_space( *x ) x-- ;
else x++ ;
}
else while not_space( *x ) x-- ;
if ( z <= x )
then {
char m = *x ; *x = 0 ;
char * e = eos( z ) - 2 ;
if At( e, "::" ) *e = 0 ;
uint L = strlen( z ); char800 ss ;
if ( 800 <= L ) fErr1( z )
char * s = ( x - L - 4 ); s_( ss, "\n%s ::", z );
memcpy( s, ss, strlen( ss ) );
e = s+1 ;
while ( *( ++e ) != '\n' ) if is_( e, "operator ::" )
{
memcpy( e, ":: operator", 11 );
break ;
}
*x = m ; x = s ;
}
else {
x = z - 5 ; memcpy( x, "\n :: ", 5 );
}
if ( GLOBAL == 1 )
then {
traceStr( "xxx", x, 100 ); fErr
}
GLOBAL = 2 ;
__ B.a = x - B.z ; offset = 0 ; continue ;
}
__ char * p = c ; while space( *p ) p-- ;
skip_space( c );
if ( B.z + B.e <= c ) break ;
if ( At( c, "enum " ) || At( c, "struct " ) || At( c, "union " ) )
{
char * Art = c ; to_space( c );
char * x = c ; while not_in_str( *x, ";{" ) x++ ;
if ( *x == ';' )
{
B.a = c - B.z ; continue ;
}
*c++ = 0 ; skip_space( c );
if in_name( *c )
{
char * e = c ; while in_name( *e ) e++ ;
if ( B.z + B.e <= e ) fErr
char m = *e ; *e = 0 ;
char40 nr ; s_( nr, "%s.htm#%i", nr2( fNr ), ++spot );
fprintf( f, "\n</pre><a name=%i></a><p class=c>%s "
"\n<a href=../types.htm>"
"\n<font size=4>%s</font></a>"
"\n<pre class=c><font size=2><hr>"
, spot, Art, c );
ourVers( typedefs, c, nr, cpp );
if ( strlen( c ) < 180 )
{
char200 cc ; s_( cc, "%s %s", Art, c );
ourVers( typedefs, cc, nr, cpp );
}
*e = m ;
rB_( B, 1, "{", 0 )
rB_( B, 1, "}", f )
rB_( B, 1, ";", f )
continue ;
B.a = e - B.z ; continue ;
}
}
offset = ( c < z )? z-c : 1 ; continue ;
}
if At( c, "/*" )
{
fprintf( f, "<font class=\"co\">" );
B.find( 2, "*/", f ); B.a += 2 ;
fprintf( f, "*/</font>" );
continue ;
}
if ( At( c, "int " ) || At( c, "void " ) )
{
to_space( c ); skip_space( c )
if not_alpha( *c ) continue_( 1 )
char * e = c ; while in_name( *e ) e++ ; char * ce = e ;
skip_space( e )
if ( *e == '(' ) // zu_codef
{
char * k = e ; to_( k, ')' )
while not_in_str( *k, ";{" ) k++ ;
if ( *k == ';' ) continue_( 1 ) // pre-declaration found
char m = *ce ; *ce = 0 ;
entry = store.take( c );
if is_( entry, "main" )
{
char200 xx ;
s_( xx, "main %s", backtoSucc( src, "/" ) );
entry = store.take( xx );
}
char300 xx ; s_( xx, "C PROGRAM %s", entry );
fprintf( f, "\n<a name=%i></a>\n<hr>", ++spot );
char100 co ; s_( co, "%s.htm", nr2( fNr ) );
s_( xx, "p cob/../%s#%i", co, spot );
index.StrIns( 'e', entry, xx );
s_( xx, "p .. %s", entry );
zu_codef( xx, src, co, spot );
*ce = m ;
}
continue_( 1 )
}
if iAt( c, "COMMENT " )
{
to_( c, '\n' )
continue_( c - ( B.z + B.a ) )
}
if At( c, "main(" )
{
if not_space( c[-1] ) continue_(1)
char100 xx ; s_( xx, "main %s", progr );
strcpy( progr, xx );
s_( xx, "p .. %s", progr );
fprintf( f, "\n<a name=%i></a>\n<hr>", ++spot );
char100 co ; s_( co, "%s.htm", nr2( fNr ) );
zu_codef( xx, src, co, spot );
continue_( 1 )
}
if iAt( c, "EXEC SQL" )
{
if ( cursor ) fErr
fprintf( f, "\n<a name=%i></a>\n", ++spot );
s_( execDB, "%s.htm#%i", nr2( fNr ), spot );
fprintf( fx, "\n p .. %s [%s]\n\n", entry, execDB );
B.z[ B.e ] = 0 ;
char * e = in_str( ';', c );
if ( ! e ) fErr
if ( ! fx ) fErr
fprintf( fx, "%s;\n\n", c );
fprintf( f, "%s", c );
B.a = e - B.z ;
continue_( 1 )
}
if ( *c == '(' )
{
*c = 0 ;
char * x = c-1 ; while in_name( *x ) x-- ; *x = '+' ;
if ( x[1] && Aufrufe -> contains( x ) )
then {
char80 nr ;
s_( nr, "%s~%s.htm#%i", x+1, nr2( fNr ), ++spot );
fprintf( f, "<a name=%i></a>"
"<font color=#FF00FF><b>[]</b></font>", spot );
Aufrufe -> StrIns( 'i', nr, ausMe );
}
esif ( x[1] )
{
*x = ' ' ;
noAufrufe -> StrIns( 'e', x );
}
offset = 1 ; *c = '(' ; continue ;
}
if ( *c == '"' )
{
if ( c[+1] == '\'' && in_str( c[-1], "'\\" ) ) continue_(1)
if ( B.z + B.e < c ) fErr1( c )
__ char * e = c ; skip_str( e, B.z + B.e );
B.a = e - B.z ;
char m = *e ; *e = 0 ;
Var_htm // char4000 htm ; St_htm u ; u.to_htm( c, htm, 4000 );
*e = m ;
fprintf( f, "<font class=\"kw\">%s</font>", htm ); // kw statt str
char * DLL = eos( htm ) - 4 ;
if ( htm < DLL && ( is_( DLL, ".dll" ) || is_( DLL, ".DLL" ) ) )
{
char80 nr ; strcpy( DLL, ".DLL" );
s_( nr, "%s~%s.htm#%i", htm + 1, nr2( fNr ), ++spot );
fprintf( f, "<a name=%i></a>"
"<font color=#FF00FF><b>[ DLL ]</b></font>", spot );
if ( ! DLLs ) DLLs = new Btree() ;
DLLs -> StrIns( 'i', nr );
}
continue ;
}
if ( *c == '#' )
{
if At( c, "#pragma" ) continue_( 1 )
while space( c[1] ) { B.z[ ++B.a ] = '#' ; c++ ; } // _1(c+1-1)
}
if ( *c == 's' ) // static
{
if ( not_space( c[6] ) || not_space( c[-1] ) ) continue_( 1 )
char * e = c ; while not_in_str( *( ++e ), "(;=#{" );
if ( *e == '#' )
{
offset = 1 ; continue ;
}
char m = *e ; *e = 0 ;
if ( not_At( c, "THIS_FILE" ) && not_in_str( '/', c ) )
{
char400 nr ;
s_( nr, "%s~%s.htm#%i", c, nr2( fNr ), ++spot );
fprintf( f, "<a name=%i></a><font class=kw>static </font>", spot );
statics -> StrIns( 'e', nr );
B.a += 6 ;
}
*e = m ;
if ( m == ';' ) continue_( e - ( B.z + B.a ) )
continue_( 1 )
}
if ( *c == 'A' && At( c, "ASSERT(" ) )
{
anz_assert++ ;
to_( c, ';' ) c++ ;
while At( c, "\n\n\n" ) c++ ;
B.a = c - B.z ; continue ;
}
if ( *c == 'E' && At( c, "Exception(" ) )
{
char * x = c + 10 ; skip_space( x )
if ( *x == '"' )
{
x++ ; to_( x, '"' )
}
char m = *x ; *x = 0 ; while in_name( c[-1] ) c-- ;
char400 nr ;
s_( nr, "%s~%s.htm#%i", c, nr2( fNr ), ++spot );
*x = m ;
fprintf( f, "<a name=%i></a>"
"<font color=#FF00FF><b>[ Exc ]</b></font>", spot );
if ( ! Exceptions ) Exceptions = new Btree ;
Exceptions -> StrIns( 'i', nr );
offset = 1 ; continue ;
}
if ( *c == 'D' || *c == 'M' ) // DDX_...
{
ui = true ;
if ( *c == 'M' )
{
if ( ! messMap )
{
messMap = new Btree ;
server = new Btree ;
}
messMap -> StrIns( 'e', cpp, nr2( fNr ) );
}
DDX.StrIns( 'e', cpp, nr2( fNr ) );
offset = 1 ; continue ;
}
if ( noAutoComment )
{
if At( c, "#ifdef _DEBUG" )
{
Scanner1 u ;
B.a = u.skip_DEBUG( c ) - B.z ; continue ;
}
if At( c, "#ifdef AFX_DATA\n#undef AFX_DATA" )
{
B.a += 16 ; continue ;
}
if At( c, "#if _MSC_VER >=" )
{
to_( c, '\n' ) c++ ;
to_( c, '\n' ) c++ ;
to_( c, '\n' ) ; while At( ++c, "\n\n" ) c++ ;
B.a = c - B.z ; continue ;
}
char * cm = c ;
if ( *c == '/' )
{
if not_in_str( c[1], "/*" ) continue_( 1 )
if ( At( c, "// #" )
|| At( c, "//#" )
|| At( c, "/// " )
|| At( c, "// Microsoft" )
)
{
to_( c, '\n' ); B.a = c+1 - B.z ; continue ;
}
}
L1: if ( *c == '/' || *c == 'T' )
if ( At( c, "//##" )
|| At( c, "//@@" )
|| At( c, "// classes" )
|| At( c, "// interfaces" )
|| At( c, "// includes" )
|| At( c, "// public" )
|| At( c, "// private" )
|| At( c, "// protected" )
|| At( c, "// Constructor" )
|| At( c, "// Destructor" )
|| At( c, "// Query" )
|| At( c, "// precompiled" )
|| At( c, "// implementation" )
|| At( c, "// ----- " )
|| At( c, "// ===" )
|| At( c, "//====" )
|| At( c, "TRACE0(" )
)
{
LoAutoCo++ ;
rB_( B, 1, "\n", 0 )
c = B.z + B.a + 1 ; B.a = c - B.z ;
if At( c, "//" ) goto L1 ;
B.a-- ; continue_( 0 )
}
L2: if ( At( c, "/* START OF PROTECTED" )
|| At( c, "/* END OF PROTECTED" )
|| At( c, "/*@FILE_DOC" )
|| At( c, "/*........." )
||( At( c, "/**" ) && GRT_src )
)
{
fprintf( f, "\n</pre></font><pre class=c><font size=2>" );
LoAutoCo++ ;
rB_( B, 1, "*/", 0 )
memcpy( B.z + B.a, " \n", 2 );
c = B.z + B.a ; skip_space( c )
if At( c, "<%" ) goto L1 ;
if At( c, "/*" ) goto L2 ;
B.a += 1 ;
}
if At( c, "/*\n * The Apache Software" )
{
fprintf( f, "<font class=co>/* Apache Software: */</font>" );
rB_( B, 10, "*/", 0 ); B.a += 2 ; continue ;
}
if At( c, "/**\n * $Log:" )
{
rB_( B, 10, "*/", 0 ); B.a += 2 ; continue ;
}
if ( cm < c ) continue ;
}
if ( *c == '<' )
{
B.a += 1 ; fprintf( f, "<" );
c-- ; while space( *c ) c-- ;
if At( c-7, "template" ) rB_( B, 0, ">", f )
continue ;
}
if At( c, "//" )
{
if At( c , "// All rights reserved" )
if At( c + 259, "Microsoft Foundation Classes" )
{
c += 280 ; to_( c, '\n' )
while ( c[1] == '\n' ) c++ ;
B.a = c - B.z ; continue_( 0 )
}
char * e = c ; to_( e, '\n' ); skip_space( e )
if ( *e == '#' )
{
*(--e) = '\n' ;
B.a = e - B.z ; continue ;
}
char * u = c-1 ; while ( space(*u) && *u != '\n' ) u-- ;
u = ( *u == '\n' )? "" : "" ;
fprintf( f, "%s<font class=\"co\">", u );
B.find( 1, "\n", f );
c = B.z + B.a + 1 ;
if ( *c == '\n' || At( c, "//" ) )
then {
c = "" ;
}
else {
skip_space( c );
if At( c, "//" ) c = "" ; else c = "" ;
}
B.a++ ; fprintf( f, "</font>%s", c );
continue_( 0 )
}
if At( c, "/*" )
{
if ( At( c-1, "\n/* ------" ) || At( c-1, "\n/*\n" ) )
{
fprintf( f, "<font class=co>" );
B.z[ B.a ] = B.z[ B.a+1 ] = '/' ; B.find( 1, "*/", f );
B.z[ B.a ] = B.z[ B.a+1 ] = ' ' ;
fprintf( f, "</font>" );
continue_( 1 )
}
if ( At( c+3, "public:" )
|| At( c+3, "protected:" )
|| At( c+3, "private:" )
)
{
// This is GRT format generated by ic.exe, hence:
char * cA = c ;
GRT_src = 1 ;
char * x = c + 10 ; to_( x, '*' )
memcpy( x, " ", 2 );
memcpy( c, " ", 3 );
while not_in_str( *x, "(/\n" ) x++ ; x-- ;
if At( x, "//" ) to_( x, '\n' )
char * ec = x ;
B.a = x+1 - B.z ;
while space( *x ) x-- ; x++ ; *x-- = 0 ;
while in_name( *x ) x-- ;
if ( *x == '~' ) x-- ;
char100 meth ; strcpy( meth, x+1 );
char * c0 = c + 3 ;
char40 nr ; s_( nr, "m%s.htm#%i", nr2( fNr ), ++spot );
c = x-1 ;
while not_in_name( *c ) c-- ;
while in_name( *c ) c-- ;
ourVers( cppsecs, c+1, nr, cpp ); __
KVStore st ; char * o = eos( c0 ) - 1 ;
while ( c0 <= o && ( in_name( *o ) || *o == '>' ) )
{
if ( *o == '>' )
then {
while ( *( --o ) != '<' ){} o-- ;
while space( *o ) o-- ;
}
else o-- ;
}
__
o++ ; if ( ! *o ) o = "::" ;
if ( ! nameNr.Get( o, st ) )
{
s_( st.c, "%i", ++nam_Nr ); nameNr.StrIns( 'e', o, st.c );
}
char * c2 = ( GLOBAL > 0 )? "" : " ::" ;
char20 toc ; s_( toc, "m/%s.htm", st.c );
if ( ! *c2 ) s_( toc, "funcs.htm" );
__
fprintf( f, "\n</pre><a name=%i></a>%s%s%s"
"\n<font size=4><a href=../%s>%s</a></font><hr>"
"\n<pre class=c><font size=2>"
, spot, to_2B, escstr( c0 ), c2, toc, meth );
*ec = '\n' ;
char * p1 = in_str( '(', o );
if ( !p1 ) p1 = eos( o );
char * mc = ec ; // mc = method comment
while ( *mc != '/' || mc[3] != '-' || At( mc, "//\n" ) )
{
if ( ! *mc || At( mc, "LB_(" ) ) break ;
mc++ ;
}
if At( mc, "/*" )
then {
to_( mc, '\n' )
char * x = mc ; while not_At( x, "*/" ) x++ ;
ec = x + 2 ;
while in_str( *x, "\n -" ) x-- ; x[1] = 0 ;
}
esif At( mc, "//" )
{
ec = mc ; to_( ec, '\n' ) skip_space( ec )
}
else {
*mc = 0 ;
ec = mc ; to_( ec, '\n' )
while ( not_At( ec, "\n (" )
&& not_At( ec, "\n )" )// ) ec++ ; ec += 4 ;
)
{
if ( *ec ) ec++ ; else break ;
}
if ( *ec ) ec += 4 ;
}
__ skip_space( ec )
if ( mc < p1 && p1 < ec )
then {
p1 = ec ; to_( p1, '(' )
}
if ( *ec == ')' )
then {
p1 = ec+1 ; skip_space( p1 ) p1-- ;
}
// esif ( mc < p1 )
esif ( 1 )
{
p1 = ec ; to_( p1, '(' )
}
char m = ( *ec == ')' )? ')' : ',' ;
int mx1, mx2 ; mx1 = mx2 = 0 ;
Parameter par[ 40 ] ; uint p = 0 ;
p1++ ; skip_space( p1 )
while ( m == ',' )
{
char * x = p1 ;
while ( *x && not_in_str( *x, ",/)" ) ) x++ ;
if ( ! *x && At( x+1, "/ ---" ) ) *x = '/' ;
while ( *x == '/' )
{
if At( x, "/*" )
then {
while not_At( x, "*/" ) x++ ; x += 2 ;
}
esif At( x, "//" ) to_( x, '\n' )
if ( *x == '/' ) fErr
while not_in_str( *x, ",/)" ) x++ ;
}
char * z = x-1 ;
m = *x ;
while space( *z ) z-- ; z[1] = 0 ;
while in_name( *z ) z-- ;
par[ p ].p1 = p1 ; setMx( mx1, strlen( p1 ) );
par[ p ].p2 = z+1 ; setMx( mx2, strlen( z+1 ) );
par[ p ].p3 = x ;
while space( *z ) z-- ; z[1] = 0 ;
if At( x, "/*" ) fErr
if At( x, "//" )
then {
to_( x, '\n' ) skip_space( x )
m = *x ;
}
else x++ ;
x[-1] = 0 ; p1 = x ; skip_space( p1 )
if ( *par[ p ].p3 == '/' )
{
x = par[ p ].p3 ; to_( x, '\n' ) skip_space( x )
while At( x, "//" )
{
par[ ++p ].p1 = "" ;
par[ p ].p2 = "" ;
par[ p ].p3 = x ;
to_( x, '\n' ) *x++ = 0 ; skip_space( x )
m = *x ; p1 = x ;
}
}
p++ ;
}
par[ p ].p1 = 0 ;
int i = -1 ;
while ( par[ ++i ].p1 )
{
Parameter & p = par[i] ;
fprintf( f, "\n%*s %*s %s", -mx1, p.p1, -mx2, p.p2, p.p3 );
}
fprintf( f, "\n)\n%s LB_", mc );
if ( *p1 == ')' )
{
p1++ ; skip_space( p1 )
}
if (0) if ( *p1 != '{' && not_At( p1, "LB_" ) )
{
traceStr( "ppp", p1, 20 ); fErr1( p1-4 )
}
to_( p1, '\n' )
B.a = p1 - B.z ; continue_( 0 )
}
if At( c, "/* Module" ) // GRT formatted text
{
B.find( 2, "*/", 0 );
B.find( 2, "\n", 0 );
continue ;
}
c[0] = c[1] = ' ' ;
fprintf( f, "<font class=\"co\">" );
B.find( 2, "*/", f ); B.a += 2 ;
fprintf( f, "</font>\n " );
continue ;
}
if ( *c == 't' )
{
if ( not_space( c[-1] ) || not_space( c[7] ) ) continue_( 1 )
if At( c, "typedef" )
{
char * e22 = 0 ;
c += 8 ; skip_space_and_comment( c );
offset = c - ( B.z + B.a );
char8000 cc ; char * e = c ;
while not_in_str( *e, ";{" ) e++ ;
if ( At( c, "struct" ) && ( space( c[6] ) || c[6] == '{' )
|| At( c, "union" ) && ( space( c[5] ) || c[5] == '{' )
|| At( c, "enum" ) && ( space( c[4] ) || c[4] == '{' )
)
then {
char * Art = "struct" ;
if ( *c == 'u' ) Art = "union" ;
if ( *c == 'e' ) Art = "enum" ;
while in_name( *c ) c++ ;
skip_space_and_comment( c );
char * x = c ; to_( x, ';' )
if in_name( *c )
then {
*x = 0 ;
if in_str( '{', c )
then {
*x = ';' ;
to_( e, '{' ) *e = 0 ; e22 = e ;
c = e-1 ;
while space( *c ) c-- ;
while in_name( *c ) c-- ; c++ ;
s_( cc, "%s %s", Art, c ); c = cc ;
}
else {
// struct A B ;
// enum A B ;
// union A B ;
}
e = x ; *x = ';' ;
}
else {
if ( *c != '{' ) fErr1( *c )
e22 = e = c ;
skip_nest( e, '{', '}' );
*e22 = 0 ;
to_( e, ';' ) c = e-1 ; *e = 0 ;
while space( *c ) c-- ;
while in_name( *c ) c-- ; c++ ;
s_( cc, "%s %s", Art, c ); c = cc ;
*e = ';' ;
}
}
esif At( c, "map<" )
{
to_( e, ';' )
}
if ( *e && *e != ';' )
then {
B.z[ B.e ] = 0 ; fErr2( e-c, B.z + B.a )
}
*e = 0 ; // muss sein
char400 zz ; char * ek = in_str( '(', c );
if ( ek )
then {
while space( ek[-1] ) ek-- ;
char m = *ek ; *ek = 0 ;
strcpy( zz, c ); *ek = m ;
c = zz ;
}
if ( 250 < strlen( c ) ) fErr1( c )
char40 nr ; s_( nr, "%s.htm#%i", nr2( fNr ), ++spot );
char * u = escstr( c ); char * x = eos( u ) - 1 ;
while space( *x ) *x-- = 0 ;
while ( u <= x && in_name( *x ) ) x-- ;
if ( x[1] )
then {
if ( u < x ) *x = 0 ;
}
else x = u-1 ;
typedefs.StrIns( 'e', x+1, nr );
char * nn = escstr( B.z + B.a );
char * e2 = eos( nn );
while space( e2[-1] ) e2-- ; *e2-- = 0 ;
if ( *e2 == ']' )
{
while ( *e2 != '[' ) e2-- ;
while space( e2[-1] ) e2-- ; e2-- ;
}
while in_name( *e2 ) e2-- ;
char * M = " " ; *M = ' ' ; // muss sein
if in_name( e2[1] )
then {
*M = *e2 ; *e2++ = 0 ;
}
else M = e2 = "" ;
fprintf( f, "\n<a name=%i></a> </pre>%s"
"\n<font size=2>%s%s</font> "
"\n<a href=../types.htm><font size=4>%s</font></a>"
"\n<pre class=c><font size=2><hr>"
, spot, to_2B, nn, M, e2 );
*e = ';' ;
if ( e22 ) { *e22 = '{' ; e = e22 ; }
B.a = e - B.z ; offset = 0 ; continue ;
}
}
if ( *c == 'c' )
{
if not_space( c[5] ) continue_( 1 )
if ( ! ( space( c[-1] ) || c[-1] == '<' ) ) continue_( 1 )
char * c1 = c ; // _1(c1)
char * x = c ;
while ( *x && not_in_str( *x , ";{" ) )
{
if At( x, "//" )
then {
to_( x, '\n' )
}
esif At( x, "/*" )
{
while not_At( x, "*/" ) x++ ; x += 2 ;
}
else x++ ;
}
// _1(x)
if ( *x == ';' ) continue_( x-c )
c-- ; while space( *c ) c-- ;
// _1(c)
if At( c-5, "friend" )
{
to_( c, ';' ); continue_( c-c1 )
}
// _1(c1+0)
c = to_className( c1 );
// _1(c)
if ( ! c )
then {
// pre-declaration - need not be shown:
c = c1 ;
to_( c, '\n' ) B.a = c - B.z ; continue_( 0 );
fprintf( f, "predeclare " ); continue_( 1 );
}
esif ( *c == '*' ) continue_( 1 );
if ( *c == '<' ) { to_( c, '>' ) c++ ; skip_space( c ) }
char * e = c ; while in_name( *e ) e++ ; skip_space( e )
while not_in_str( *e, ";\n" ) e++ ;
c[-1] = 0 ;
char me = '\n' ;
to_( e, '\n' ) *e = 0 ;
char40 nr ; s_( nr, "c%s.htm#%i", nr2( fNr ), ++spot );
x = in_str( '/', c );
if ( x )
{
*e = '\n' ;
x-- ; while space( *x ) x-- ;
me = *x ; e = x ; *x = 0 ;
}
__
*e = me ;
e = c ; while in_name( *e ) e++ ;
if ( *e == '<' ) skip_nest( e, '<', '>' );
char m = *e ; *e = 0 ;
KVStore st ; char20 xx ;
if ( ! nameNr.Get( c, st ) )
then {
s_( xx, "%i", ++nam_Nr ); nameNr.StrIns( 'e', c, xx );
if ( ! *c ) fErr
}
else strcpy( xx, st.c );
fprintf( f, "\n</pre><a name=%i></a>%s%s"
"\n<font size=4><a href=../m/%s.htm>%s</a></font>"
"\n<pre class=c><font size=2><hr>"
, spot, to_2B, escstr( c1 ), xx, c );
if ( *c == '<' ) fErr1( c )
__
defNameNr( ourVers( cppsecs, c, nr, cpp ) );
char100 cName ; strcpy( cName, c );
*e = m ; skip_space( e )
if ( *e == ':' )
{
char * s = e+1 ; skip_space( s );
while ( *s != '{' )
{
char * s1 = s ;
char * x = s ; while in_name( *x ) x++ ;
while ( At( x, "::" ) || At( c, " ::" ) )
{
x += 3 ; skip_space( x );
while in_name( *x ) x++ ;
}
if ( *x == '<' ) skip_nest( x, '<', '>' );
char m = *x ; *x = 0 ;
if ( not_is_( s, "public" )
&& not_is_( s, "protected" )
&& not_is_( s, "private" )
&& not_is_( s, "virtual" )
&& not_is_( s, "isA" )
&& not_is_( s, "isA_" )
)
then {
char200 cs ; s_( cs, "%s~%s", cName, s );
supNames.StrIns( 'e', cs );
}
*x = m ; skip_space( x )
while At( x, "//" )
{
to_( x, '\n' ) skip_space( x )
}
if ( *x == ',' ) { x++ ; skip_space( x ) }
while ( *x == '/' )
{
if At( x, "//" ) to_( x, '\n' )
if At( x, "/*" )
{
while not_At( x, "*/" ) x++ ; x += 2 ;
}
skip_space( x );
}
if At( x, "#else" )
then {
x++ ; to_( x, '#' ); to_( x, '\n' );
skip_space( x );
}
while At( x, "#endif" )
{
to_( x, '\n' ); skip_space( x );
}
s = x ;
if ( s <= s1 )
{
traceStr( "s1", s1, 80 );
traceStr( "sss", s, 20 ); fErr2( cpp, s1-s )
}
offset = s - e ; // muss sein
}
}
B.a = e - B.z ; continue ;
}
if At( c, "#def" ) // #define
{
fprintf( f, "\n" );
c += 7 ; skip_space( c )
if At( c, "AFX_" ) continue_( 1 )
if At( c, "MSG_" ) continue_( 1 )
char * e = c+1 ;
while in_name( *e ) e++ ;
if At( e-2, "_H" ) continue_( 1 )
if At( e-2, "_h" ) continue_( 1 )
char m = *e ; *e = 0 ;
char40 nr ; s_( nr, "%s.htm#%i", nr2( fNr ), ++spot );
fprintf( f, "#define <a name=%i></a><u>%s</u>", spot, c );
ourVers( defines, c, nr, cpp );
*e = m ;
c = e ; to_( e, '\n' )
while ( e[-1] == '\\' ) { e++ ; to_( e, '\n' ) }
*e = 0 ; fprintf( f, "%s", c );
B.a = e - B.z ; *e = '\n' ; continue ;
}
if At( c, "#inc" ) // #include
{
char * e = c+1 ;
if not_At( e, "include " ) continue_( 1 )
char * x = e+7 ; skip_space( x )
if not_in_str( *x, "<\"" ) // kann so auftreten !!!!
{
to_( x, '\n' ) *x = 0 ;
fprintf( f, "\n%s", c );
B.a = x - B.z ; *x = '\n' ; offset = 0 ; continue ;
}
fprintf( f, "#include " );
Loop { ++c ; if in_str( *c, "\"<" ) break ; } *c++ = '"' ;
e = c ; while not_in_str( *e, "\">" ) e++ ; *e = 0 ;
KVStore st ; char1000 xx ; make_path( cpp, xx, lower( c ) );
char1000 inc ; *inc = 0 ; if ( *xx )
{{ if ( cppNames.Get( xx, st ) )
then {
__ if not_digit( *st.c ) fErr2( st.k, st.c )
int i = decNr( st.c ); int x = i/100 ;
to_INCs( i, fNr );
if ( x == ik )
then {
fprintf( f, "<a href=%i.htm>%s</a>", i - x * 100, c );
}
else fprintf( f, "<a href=../%s.htm>%s</a>", nr2(i), c );
add_refcpp( f, xx, c );
s_( inc, "%s->%i", st.c, fNr );
}
esif is_file( xx )
{
__ unix_me( xx ); lower( xx );
uint sNr = sourceNr( xx, co_CPP )
to_INCs( sNr, fNr );
char20 nr ; s_( nr, "%i->%i", sNr, fNr );
cppNames.StrIns( 'e', xx, nr );
s_( inc, "%i->%i", sNr, fNr );
int i = sNr/100 ;
if ( i != ik )
then {
fprintf( f, "<a href=../%s.htm>%s</a>", nr2( cfNr ), c );
}
else fprintf( f, "<a href=%i.htm>%s</a>", i, c );
add_refcpp( f, xx, c );
}
else {
fprintf( f, "<font class=\"kw\">%s\"</font>", c-1 );
}
}}
if ( *inc )
then {
char * x = eos( xx ) - 1 ;
while ( xx < x && x[-1] != '/' ) x-- ;
char * u = x ; while ( xx < u && *u == '/' ) u-- ;
while ( xx < u && u[-1] != '/' ) u-- ;
char800 k ; s_( k + 2, "%s~%s", u, inc );
k[0] = upper( *u ); k[1] = *u ; k[250] = 0 ;
incs_cpp.StrIns( 'e', k, inc );
}
e++ ; to_( e, '\n' ); B.a = e - B.z ; // _1(B.z+B.a)
continue ;
}
if ( *c == '#' )
{
if At( c, "#ifndef" )
{
char * e = c ; to_( e, '\n' ) *e = 0 ;
if ( substr( "_h__", c ) || substr( "_cxx__", c ) )
then {
// durch ic.exe formatted
to_( e, '\n' ) skip_space( e )
while ( *e != '\n' ) e-- ;
B.a = e - B.z ;
}
else *e = '\n' ;
}
offset = 1 ;
}
}
Unlink( esc )
char * se = "" ; if ( ! correct )
se = " <br><b>There seem to be syntax errors "
"( at least one missing \" ).</b>" ;
if ( winc[ fNr ] )
then {
s_( ix, "<a href=../bf/%i.htm>is_inc_for</a> . ", fNr );
}
else *ix = 0 ;
fprintf( f, "\n</pre></font><a name=eof></a><font face=\"Verdena,Arial\">"
"\n<font size=2><a href=#top>top</a> . %s<a href=../cpp.htm>C++</a>"
"\n<font size=4>%s%s%s<br></font>"
"\n%sInclude-structure of<br>%s<br><br>"
, ix, t1, c, t2, se, gutLesbar( fn ) );
fprintf( f, "\n<pre-" ); // muss sein, see pretty_CPP
close( f );
if ( MeNr )
{
// Nun erzeuge zu Anfang der Seite ein Methodenverzeichnis:
char * tm1 = "tmp.MeNr" ; f = create( tm1 );
B.open_rBuffer( xx, "" );
B.find( 1, "\n#def", f );
char * vis = "private" ;
fprintf( f, "\n%i Methoden:", MeNr );
KVStore st ; Surr s = MeSet -> GetFirst( st );
while ( s )
{
char * x = st.k ; to_( x, '#' ) *x = 0 ;
char * z = substr( ":: ", st.k );
if ( z ) z[2] = 0 ;
uint n = substr( "public", st.k )? 2 : 1 ;
if not_substr( vis, st.k )
{
fprintf( f, "\n<BR>|" );
if substr( "protected", st.k ) vis = "protected" ;
esif substr( "private" , st.k ) vis = "private" ;
esif substr( "pure" , st.k ) vis = "pure" ;
esif substr( "public" , st.k ) vis = "public" ;
}
char200 zz ;
{
char * x = st.k - 1 ;
char * z = zz ;
while ( *(++x) )
{
while ( *x == ' ' && x[1] == ' ' ) x++ ;
*z++ = *x ;
}
*z = 0 ;
}
fprintf( f, "\n<BR>%s<font size=+%u> <a href='#%s'>%s</a></font>"
, zz, n, x+1, ( z )? z+3 : "" );
*x = '#' ;
if ( z ) z[2] = ' ' ;
s = MeSet -> Next( st );
}
fprintf( f, "\n<br><br><br><br>" );
B.copy_to( f );
close( f );
cp_file( xx, tm1 );
}
delete( MeSet );
if ( ! LB ) // grt sources
{
pretty_CPP( xx, nr2( fNr ) );
better_cpp( xx );
}
if ( ui ) LOC_UI += ( LOC_cpp - LOCA );
LE_ret( deep )
/* private: */ char * Java2Htm :: nz ( char * e
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.nz")
if ( e ) *e = '\n' ; else fErr // traceStr( "ZZZ",e-1,30 )
skip_space( e ); int n = 1 ; *( eos(e) ) = ' ' ;
while space( *( --e ) )
{
if ( *e == '\n' ) if ( --n == 0 ) ret( e )
}
LE_ret( e )
/* private: */ void Java2Htm :: better_cpp ( char * htm
// -----------------------------------------------------------------------------
// Verbesserung des Layouts
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.better_cpp")
#define weiter { __ B.a = nz( e ) - B.z ; __ continue ; }
char * sp = " "
" " ;
" " ;
char * esp = eos( sp );
char * osp = esp ;
uint spAnz = 0 ;
rBuffer B( htm, "\n" ); if ( ! B.ateof ) ret_
FILE * f = create( htm );
while ( B.find( 0, "\n", f ) )
{
char * c = B.z + B.a ;
while At( c, "\n\n\n" ) c++ ;
while At( c, "\n\n," ) c++ ;
char * x = c ; skip_space( x );
while At( c, "__ " ) { c += 3 ; skip_space( c ); }
char * e = in_str( '\n', x );
if ( *x == '/' )
{
char * z = ( c[1] == '\n' )? "\n" : "" ;
*e = 0 ;
fprintf( f, "\n%s%s%s", osp, z, x );
weiter
}
osp = esp ;
if(0) if ( *x == '#' )
{
char * e = in_str( '\n', x );
while At( x, "# " ) *( ++x ) = '#' ;
if At( x, "#define" )
then {
*e = 0 ;
x += 8 ; skip_space( x )
fprintf( f, "\n #define %s", x );
weiter
}
BOOL inc = At( x, "#inc" );
char400 zz ; char * z = zz ;
while ( *x != '\n' )
{
*z++ = *x++ ;
if ( inc && z[-1] == '"' ) z -= 1 ;
{
if ( z[-1] == '"' ) z -= 1 ;
if ( z[-1] == ':' )
{
*( --z ) = 0 ;
if substr( ".cpp", zz ) x = e ; else *z++ = ':' ;
}
}
}
*z = 0 ;
fprintf( f, "\n %s", zz );
weiter
}
char m = *e ; *e = 0 ;
char * e1 = substr( "//", c ); if ( e1 ) osp = esp - ( e1-c-1 );
fprintf( f, "\n%s", c );
*e = m ;
weiter
}
close( f );
#undef continue_e
LE_
/* private: */ void Java2Htm :: ADD_inc_structure (
// -----------------------------------------------------------------------------
)
LB_("Java2Htm.ADD_inc_structure")
char10 pre ;
char100 fNam ;
char800 fAt ;
char800 bf ;
KVStore st ; Surr s = INCs.GetFirst( st );
while ( s )
{
if ( *st.k == '=' )
{
int fNr = decNr( st.k+1 );
if ( max_fNr <= fNr ) fErr2( st.k, st.c )
s_( bf, "%s/bf/%i.htm", j2h, fNr );
s_( fAt, "%s/%s.htm", j2h, nr2( fNr ) );
FILE * f = fopen( fAt, "a" );
if ( ! f ) fErr1( fAt )
char * x = st.k + 1 ; to_( x, '=' ) *x = 0 ;
strcpy( fNam, x+1 );
s_( pre, ">%s=", st.k+1 ); *x = '=' ;
Btree done ;
char10 sNr ; s_( sNr, "%i", fNr );
uint anz = show_INCs( f, pre, 1, sNr, done );
if ( winc[ fNr ] )
then {
s_( bf, "<a href=../bf/%i.htm>is_inc_for</a> . ", fNr );
}
else *bf = 0 ;
x = eos( fNam ) - 4 ;
char * see = "cpp.htm>C++" ;
if is_( x, ".jsp" ) see = "jsp.htm>JSP" ;
fprintf( f, "\n<font size=1><br>%i include files<font size=2><br>"
"\n<a href=#top>top</a> . %s<a href=../%s</a>"
, anz, bf, see );
close( f );
}
s = INCs.GetNext( st );
}
LE_
/* private: */ uint Java2Htm :: show_INCs
// -----------------------------------------------------------------------------
(
FILE * f
, char * pre
, uint deep
, char * sNr
, Btree & done
)
LB_("Java2Htm.show_INCs")
KVStore st ; Surr s = INCs.Getmin_GE( st, pre ); uint anz = 0 ;
while ( s )
{
if not_At( st.k, pre ) break ;
char * x = st.k + 1 ; to_( x, '=' )
if ( ! done.contains( x+1 ) )
{
done.StrIns( 'e', x+1 );
char20 pre1 ; s_( pre1, "=%s=", x+1 );
KVStore nn ; if ( ! INCs.Getmin_GE( nn, pre1 ) ) fErr
char * n = nn.k+1 ; to_( n, '=' ) *n = 0 ;
if ( ! done.contains( n+1 ) )
{
anz++ ;
/*
Semantics of INCs:
>fNr1=fNr2 means: f1 has direct include f2
=fNr=fNam means: fNam is the name of f
---------------------------------------------------------------
Semantics of incsMe:
/fNr2=fNr1 means: f2 is based on f1
>fNr1=fNr2 means: f1 is basis for f2
=fNr1=fpath means: fpath is the path to file f1
*/
char20 xx ;
s_( xx, "/%s=%s", sNr, nn.k+1 ); incsMe.StrIns( 'e', xx );
s_( xx, ">%s=%s", nn.k+1, sNr ); incsMe.StrIns( 'e', xx );
// ---------------------------------------------------------------
uint i = 0 ;
while ( ++i <= deep ) fprintf( f, "%s", ". " );
fprintf( f, "<a href=../%s.htm>%s<br></a>"
, nr2( decNr( nn.k+1 ) ), n+1 );
done.StrIns( 'e', n+1 );
}
*n = '=' ;
*pre1 = '>' ;
anz += show_INCs( f, pre1, deep + 1, sNr, done );
}
s = INCs.GetNext( st );
}
LE_ret( anz )
/* private: */ void Java2Htm :: add_refcpp
/* -----------------------------------------------------------------------------
Schreibe neben *.h include commands eine Referenz nach *.cpp
-----------------------------------------------------------------------------
*/ (
FILE * f
, char * h // path to some include file
, char * c // name of this include file
)
LB_("Java2Htm.add_refcpp")
if substr( ".cpp", c ) ret_
char * x = eos( h ) - 1 ; while ( *x != '.' ) x-- ; *x = 0 ;
char800 xx ; s_( xx, "%s.cpp", h ); *x = '.' ;
uint m = cfNr ;
if is_file( xx )
{
uint sNr = sourceNr( xx, co_CPP ) // k”nnte cfNr um 1 erh”ht haben:
if ( m != cfNr ) fErr3( m, cfNr, sNr )
if ( m == cfNr )
then {
fprintf( f, " : <a href=../%s.htm>cpp</a>", nr2( sNr ) );
}
else cfNr-- ;
}
LE_
/* private: */ char * Java2Htm :: to_className ( char * c
/* -----------------------------------------------------------------------------
example: class AFX_macro className
-----------------------------------------------------------------------------
*/ )
LB_("Java2Htm.to_className")
char * c1 = c ;
if ( not_At( c, "class" ) || not_space( c[5] ) ) fErr
c += 5 ; skip_space( c );
char * x = c ; while in_name( *x ) x++ ; skip_space( x );
// if alpha( *c ) traceStr( "SSS", c1, 100 );
while alpha( *x )
{
c = x ; while in_name( *x ) x++ ; skip_space( x );
}
if ( *x == '<' ) { skip_nest( x, '<', '>' ); skip_space( x ) }
while ( *x == '/' )
{
if At( x, "/*" )
then {
while not_At( x, "*/" ) x++ ; x += 2 ;
}
esif At( x, "//" ) to_( x, '\n' );
skip_space( x );
}
if At( x, "#else" )
then {
x++ ; to_( x, '#' ); to_( x, '\n' ); skip_space( x );
}
while ( *x == '#' ) { to_space( x ); skip_space( x ) }
if ( *x == '*' ) ret( x )
if ( ! *x ) ret( c ) // muss ein wegen Gebhard's C++ Code
LE_ret( in_str( *x, ":{" )? c : 0 )
/* private: */ char * Java2Htm :: ourVers
// -----------------------------------------------------------------------------
(
Btree & tree // defines
, char * c
, char * nr
, char * fNam
)
LB_("Java2Htm.ourVers")
if ( ! *c ) fErr
if ( not_in_name( *c ) && *c != '~' ) fErr1( c )
// if ( not_in_name( *c ) && *c != '~' ) _1(c)
char * e = eos( fNam ) - 1 ;
while ( *(--e) != '/' ); fNam = e+1 ;
char * x = substr( "::", c );
char400 xx ;
if ( x )
then {
char * a = x-1 ; while ( c < a && space( *a ) ) *a-- = 0 ;
*x = 0 ; x += 2 ; skip_space( x );
s_( xx, "%s :: %s", c, x );
if ( ! *c ) fErr1( x )
c = xx ;
}
char * c1 = c ; int Vers = 1 ;
while ( tree.contains( c ) )
{
c = dopp ; s_( c, "%s . %i", c1, ++Vers );
}
char200 zz ; s_( zz, "%s</a> : %s", c, fNam );
tree.StrIns( 'e', zz, nr );
LE_ret( c )
/* private: */ FILE * Java2Htm :: create_mit_meta
// -----------------------------------------------------------------------------
(
char * fn
, char * c // the title in blue
)
LB_("Java2Htm.create_mit_meta")
char * x = eos( fn ) - 6 ;
while ( fn < x && not_in_str( *x, "\\/" ) ) x-- ;
if ( x <= fn ) fErr1( fn )
*x = 0 ; create_css( fn ); *x = '/' ;
FILE * f = create( fn );
fprintf( f, "\n%s<a name=top></a><a href=#eof>meta</a>"
"\n%s%s%s<pre class=\"Classes\"><font size=2>", kopf, t1, c, t2 );
LE_ret( f )
/* private: */ FILE * Java2Htm :: create_mit_meta_php
// -----------------------------------------------------------------------------
(
char * fn
, char * c // the title in blue
)
LB_("Java2Htm.create_mit_meta_php")
char * x = eos( fn ) - 6 ;
while ( fn < x && not_in_str( *x, "\\/" ) ) x-- ;
if ( x <= fn ) fErr1( fn )
*x = 0 ; create_css( fn ); *x = '/' ;
FILE * f = create( fn );
fprintf( f, "\n%s<a name=top></a><a href=#eof>meta</a>,"
"\n<a href=../../php.htm>files</a>,"
"\n<a href=../../phc.htm>classes</a>"
"\n%s%s%s<pre class=\"Classes\"><font size=2>", kopf, t1, c, t2 );
LE_ret( f )
/* private: */ FILE * Java2Htm :: create_mit_meta_cpp
// -----------------------------------------------------------------------------
(
char * fn
, char * c // the title in blue
, char * h // the path
)
LB_("Java2Htm.create_mit_meta_cpp")
char800 xx ; *xx = 0 ;
char * x = eos( h ) - 1 ; while ( *x != '.' ) x-- ;
if not_is_( x, ".cpp" )
{
*x = 0 ; s_( xx, "%s.cpp", h ); *x = '.' ;
uint m = cfNr ;
uint s = sourceNr( xx, co_CPP );
if ( m == cfNr )
then {
s_( xx, "<a href=../%s.htm>cpp</a>, ", nr2(s) );
}
else {
cfNr = m ; *xx = 0 ;
}
}
FILE * f = create( fn );
fprintf( f, "\n%s<a name=top></a>%s<a href=#eof>meta</a>,"
"\n<a href=../cpp.htm>C++</a>"
"\n%s%s%s<pre class=\"Classes\"><font size=2>", kopf, xx, t1, c, t2 );
LE_ret( f )
/* private: */ FILE * Java2Htm :: create_mit_meta_bas
// -----------------------------------------------------------------------------
(
char * fn
, char * c // the title in blue
)
LB_("Java2Htm.create_mit_meta_bas")
FILE * f = create( fn );
fprintf( f, "\n%s<a name=top></a><br>[ <a href=bas.htm>ALL Code Files</a> ]"
"\n<a href=#eof>Sections</a>,"
"\n<a href=#public>Exports</a>,"
"\n<a href=subs.htm>and the Complete Global VB Environment of</a><br>"
"\n "
"\n%s%s%s<pre class=\"Classes\"><font size=2>", kopf, t1, c, t2 );
LE_ret( f )
/* pure: */ uint create_our_tree
/* -----------------------------------------------------------------------------
rootneu/... wird der Baum aller Dateien, die eine der in 'dirAbbr
enthaltenen extensions haben. Dieser Baum hat die Tiefe 2, und alle
Pfade haben die Form 'rootneu/n/fileName, 1 <= n <= mxdirAbbr.
-----------------------------------------------------------------------------
*/ (
FILE * f
, char * root
, char * rootneu
, Btree & dirAbbr // already containing all our extensions
, char ** dirName
, uint mxdirAbbr
, str_set & store
)
LB_("uint create_our_tree")
BOOL fetchCode = false ; uint mehrfach = 0 ;
if ( *root == '=' ) { root++ ; fetchCode = true ; }
char * tmp = "x_dirAbbr" ; if not_is_dir( root ) fErr1( root )
S_ "wfind %s > %s", root, tmp _Do
if ( ! rootneu || ! *rootneu ) fErr
dir_exist( rootneu );
Btree files ;
Btree ignored ; int anz = 0 ;
rBuffer B( tmp, "" ); int i = 0 ; dirName[0] = "" ;
char400 xx ; strcpy( xx, "." ); char * dir = eos( xx );
while ( B.find( 0, "\n", 0 ) )
{
B.getmore( 1000 );
char * c = B.z + B.a + 1 ; B.z[ B.e ] = '\n' ;
char * e = c ; to_( e, '\n' ) ;
while in_str( e[-1], "/\\" ) e-- ; char m = *e ; *e = 0 ;
char * ea = e ;
if is_dir( c )
then {
if ( mxdirAbbr <= i ) fErr2( i, mxdirAbbr )
if not_is_( c, dirName[i] ) dirName[ ++i ] = store.take( c );
s_( xx, "%s/%i", rootneu, i ); dir_exist( xx );
dir = eos( xx );
}
else {
Loop if ( c < --e ) if in_str( *e, "./\\" ) break ;
char * e1 = e ;
if ( dirAbbr.contains( lower( e1 ) ) )
then {
Loop if ( c == --e || in_str( e[-1], "/\\" ) ) break ;
fprintf( f, "\n-%i/%s", i, e );
anz++ ; s_( dir, "/%s", e );
if ( files.contains( e ) )
then {
mehrfach++ ; printf( "\nmehrfach: %s", e );
}
else files.StrIns( 'i', e );
if ( fetchCode ) cp_file( xx, c );
}
else ignored.StrIns( 'e', e1 );
}
B.a = ea - B.z ; *ea = m ;
}
Unlink( tmp )
KVStore st ; Surr s = ignored.GetFirst( st );
while ( s )
{
printf( "\nignored: ... %s", st.k ); s = ignored.Next( st );
}
printf( "\n\n%i files are selected ( mehrfach = %i ).\n\n", anz, mehrfach );
LE_ret( i )
#undef static
#endif