Index: TODO =================================================================== diff -u -r712f75125ed88102fe7b1e9751ba07c4b69d280a -r95c4d29515cfda9283b406ba7a7ac1dd029de8c9 --- TODO (.../TODO) (revision 712f75125ed88102fe7b1e9751ba07c4b69d280a) +++ TODO (.../TODO) (revision 95c4d29515cfda9283b406ba7a7ac1dd029de8c9) @@ -3464,7 +3464,20 @@ * make use of Tcl_Obj type in ResolveMethodName() to reduce number of string operations +- gentclAPI.tcl: + * added option handling for every cmd/method/... + * added option "-nxdoc" for outputting an index + to ease maintenance in nxdoc +- nsf.nxd: + * adapted to new namings + * tend to use fully qualified names (make maintenance easier) + * bring cmds to an alphabetical order (make maintenance easier) + * add optical separators between doc items to ease reading + + + + TODO: - private: * document private in tutorial Index: generic/gentclAPI.tcl =================================================================== diff -u -r143ac569e197689119f0e355bfa4a7fd7e4ee8fb -r95c4d29515cfda9283b406ba7a7ac1dd029de8c9 --- generic/gentclAPI.tcl (.../gentclAPI.tcl) (revision 143ac569e197689119f0e355bfa4a7fd7e4ee8fb) +++ generic/gentclAPI.tcl (.../gentclAPI.tcl) (revision 95c4d29515cfda9283b406ba7a7ac1dd029de8c9) @@ -398,14 +398,15 @@ puts "static Nsf_methodDefinition method_definitions\[\] = \{\n$definitionString,\{NULL\}\n\};\n" } -proc methodDefinition {methodName methodType implementation parameterDefinitions {ns ""}} { +proc methodDefinition {methodName methodType implementation parameterDefinitions options} { + array set opts [list -ns $::ns($methodType)] + array set opts $options set d(methodName) $methodName set d(implementation) $implementation set d(stub) ${implementation}Stub set d(idx) ${implementation}Idx set d(methodType) $methodType - if {$ns eq ""} {set ns $::ns($methodType)} - set d(ns) $ns + set d(ns) $opts(-ns) switch $methodType { classMethod {set d(clientData) class} objectMethod {set d(clientData) object} @@ -419,30 +420,34 @@ } set d(parameterDefinitions) $completed set ::definitions($d(methodType)-$d(implementation)-$d(methodName)) [array get d] + puts $::nxdocIndex [list set ::nxdoc::include($d(ns)::$d(methodName)) $opts(-nxdoc)] } -proc checkMethod {methodName implementation parameterDefinitions} { - methodDefinition type=$methodName checkMethod $implementation $parameterDefinitions +proc checkMethod {methodName implementation parameterDefinitions {options "-nxdoc 0"}} { + methodDefinition type=$methodName checkMethod $implementation $parameterDefinitions $options } -proc classMethod {methodName implementation parameterDefinitions} { - methodDefinition $methodName classMethod $implementation $parameterDefinitions +proc classMethod {methodName implementation parameterDefinitions {options "-nxdoc 0"}} { + methodDefinition $methodName classMethod $implementation $parameterDefinitions $options } -proc objectMethod {methodName implementation parameterDefinitions} { - methodDefinition $methodName objectMethod $implementation $parameterDefinitions +proc objectMethod {methodName implementation parameterDefinitions {options "-nxdoc 0"}} { + methodDefinition $methodName objectMethod $implementation $parameterDefinitions $options } -proc objectInfoMethod {methodName implementation parameterDefinitions} { - methodDefinition $methodName objectMethod $implementation $parameterDefinitions $::ns(objectInfoMethod) +proc objectInfoMethod {methodName implementation parameterDefinitions {options "-nxdoc 0"}} { + lappend options -ns $::ns(objectInfoMethod) + methodDefinition $methodName objectMethod $implementation $parameterDefinitions $options } -proc classInfoMethod {methodName implementation parameterDefinitions} { - methodDefinition $methodName classMethod $implementation $parameterDefinitions $::ns(classInfoMethod) +proc classInfoMethod {methodName implementation parameterDefinitions {options "-nxdoc 0"}} { + lappend options -ns $::ns(classInfoMethod) + methodDefinition $methodName classMethod $implementation $parameterDefinitions $options } -proc cmd {methodName implementation parameterDefinitions} { - methodDefinition $methodName cmd $implementation $parameterDefinitions +proc cmd {methodName implementation parameterDefinitions {options "-nxdoc 0"}} { + methodDefinition $methodName cmd $implementation $parameterDefinitions $options } if {[llength $argv] == 1} {set decls $argv} {set decls generic/gentclAPI.decls} -puts stderr "source $decls" +set ::nxdocIndex [open [file root $decls].nxdocindex w] source $decls +close $::nxdocIndex genstubs puts stderr "[array size ::definitions] parsing stubs generated" Index: generic/nsf.h =================================================================== diff -u -r5436dfb5604b3e72e758eda0ae8ba2561527f04d -r95c4d29515cfda9283b406ba7a7ac1dd029de8c9 --- generic/nsf.h (.../nsf.h) (revision 5436dfb5604b3e72e758eda0ae8ba2561527f04d) +++ generic/nsf.h (.../nsf.h) (revision 95c4d29515cfda9283b406ba7a7ac1dd029de8c9) @@ -78,7 +78,7 @@ /* are we developing? #define NSF_DEVELOPMENT 1 */ -//#define NSF_DEVELOPMENT 1 +#define NSF_DEVELOPMENT 1 /* activate/deacticate assert #define NDEBUG 1 Index: generic/nsfAPI.decls =================================================================== diff -u -rac96e6ce975fe5864b64dee9d66bc701a31e113b -r95c4d29515cfda9283b406ba7a7ac1dd029de8c9 --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision ac96e6ce975fe5864b64dee9d66bc701a31e113b) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision 95c4d29515cfda9283b406ba7a7ac1dd029de8c9) @@ -19,14 +19,14 @@ cmd __db_compile_epoch NsfDebugCompileEpoch {} cmd __db_run_assertions NsfDebugRunAssertionsCmd {} cmd __db_show_stack NsfShowStackCmd {} -cmd __profile_clear NsfProfileClearDataStub {} +cmd __profile_clear NsfProfileClearDataStub {} cmd __profile_get NsfProfileGetDataStub {} cmd __unset_unknown_args NsfUnsetUnknownArgsCmd {} cmd configure NsfConfigureCmd { {-argName "configureoption" -required 1 -type "debug|dtrace|filter|profile|softrecreate|objectsystems|keepinitcmd|checkresults|checkarguments"} {-argName "value" -required 0 -type tclobj} -} +} {-nxdoc 1} cmd colon NsfColonCmd { {-argName "args" -type allargs} } @@ -42,22 +42,22 @@ {-argName "-system" -required 0 -nrargs 0} {-argName "command" -required 1 -type tclobj} {-argName "args" -type args} -} +} {-nxdoc 1} cmd finalize NsfFinalizeCmd { {-argName "-keepvars" -required 0 -nrargs 0} -} +} {-nxdoc 1} cmd interp NsfInterpObjCmd { {-argName "name" -required 1} {-argName "args" -type allargs} -} +} {-nxdoc 1} cmd invalidateobjectparameter NsfInvalidateObjectParameterCmd { {-argName "class" -required 1 -type class} } cmd is NsfIsCmd { {-argName "-complain" -nrargs 0} {-argName "constraint" -required 1 -type tclobj} {-argName "value" -required 1 -type tclobj} -} +} {-nxdoc 1} # # method cmds @@ -68,12 +68,12 @@ {-argName "methodName" -required 1} {-argName "-frame" -required 0 -type "method|object|default" -default "default"} {-argName "cmdName" -required 1 -type tclobj} -} +} {-nxdoc 1} cmd "method::assertion" NsfMethodAssertionCmd { {-argName "object" -required 1 -type object} {-argName "assertionsubcmd" -required 1 -type "check|object-invar|class-invar"} {-argName "arg" -required 0 -type tclobj} -} +} {-nxdoc 1} cmd "method::create" NsfMethodCreateCmd { {-argName "object" -required 1 -type object} {-argName "-inner-namespace" -nrargs 0} @@ -84,12 +84,12 @@ {-argName "body" -required 1 -type tclobj} {-argName "-precondition" -type tclobj} {-argName "-postcondition" -type tclobj} -} +} {-nxdoc 1} cmd "method::delete" NsfMethodDeleteCmd { {-argName "object" -required 1 -type object} {-argName "-per-object" -nrargs 0} {-argName "methodName" -required 1 -type tclobj} -} +} {-nxdoc 1} cmd "method::forward" NsfMethodForwardCmd { {-argName "object" -required 1 -type object} {-argName "-per-object" -nrargs 0} @@ -102,36 +102,36 @@ {-argName "-verbose" -nrargs 0} {-argName "target" -type tclobj} {-argName "args" -type args} -} +} {-nxdoc 1} cmd "method::property" NsfMethodPropertyCmd { {-argName "object" -required 1 -type object} {-argName "-per-object" -nrargs 0} {-argName "methodName" -required 1 -type tclobj} {-argName "methodproperty" -required 1 -type "class-only|call-private|call-protected|redefine-protected|returns|slotcontainer|slotobj"} {-argName "value" -type tclobj} -} +} {-nxdoc 1} cmd "method::registered" NsfMethodRegisteredCmd { {-argName "handle" -required 1 -type tclobj} -} +} {-nxdoc 1} cmd "method::setter" NsfMethodSetterCmd { {-argName "object" -required 1 -type object} {-argName "-per-object" -nrargs 0} {-argName "parameter" -required 1 -type tclobj} -} +} {-nxdoc 1} # # object cmds # cmd "object::exists" NsfObjectExistsCmd { {-argName "value" -required 1 -type tclobj} -} +} {-nxdoc 1} cmd "object::property" NsfObjectPropertyCmd { {-argName "objectName" -required 1 -type object} {-argName "objectproperty" -type "initialized|class|rootmetaclass|rootclass|slotcontainer" -required 1} -} +} {-nxdoc 1} cmd "object::qualify" NsfObjectQualifyCmd { {-argName "objectName" -required 1 -type tclobj} -} +} {-nxdoc 1} # # objectsystem cmds @@ -140,18 +140,18 @@ {-argName "rootClass" -required 1 -type tclobj} {-argName "rootMetaClass" -required 1 -type tclobj} {-argName "systemMethods" -required 0 -type tclobj} -} +} {-nxdoc 1} cmd my NsfMyCmd { {-argName "-intrinsic" -nrargs 0} {-argName "-local" -nrargs 0} {-argName "-system" -nrargs 0} {-argName "methodName" -required 1 -type tclobj} {-argName "args" -type args} -} +} {-nxdoc 1} cmd next NsfNextCmd { {-argName "arguments" -required 0 -type tclobj} -} +} {-nxdoc 1} cmd nscopycmds NsfNSCopyCmdsCmd { {-argName "fromNs" -required 1 -type tclobj} {-argName "toNs" -required 1 -type tclobj} @@ -166,18 +166,18 @@ {-argName "procName" -required 1 -type tclobj} {-argName "arguments" -required 1 -type tclobj} {-argName "body" -required 1 -type tclobj} -} +} {-nxdoc 1} cmd relation NsfRelationCmd { {-argName "object" -required 1 -type object} {-argName "relationtype" -required 1 -type "object-mixin|class-mixin|object-filter|class-filter|class|superclass|rootclass"} {-argName "value" -required 0 -type tclobj} -} +} {-nxdoc 1} cmd current NsfCurrentCmd { {-argName "currentoption" -required 0 -type "proc|method|methodpath|object|class|activelevel|args|activemixin|calledproc|calledmethod|calledclass|callingproc|callingmethod|callingclass|callinglevel|callingobject|filterreg|isnextcall|nextmethod"} -} +} {-nxdoc 1} cmd self NsfSelfCmd { -} +} {-nxdoc 1} # # var cmds @@ -186,22 +186,22 @@ {-argName "-array" -required 0 -nrargs 0} {-argName "object" -required 1 -type object} {-argName "varName" -required 1} -} +} {-nxdoc 1} cmd "var::import" NsfVarImportCmd { {-argName "object" -required 1 -type object} {-argName "args" -type args} -} +} {-nxdoc 1} cmd "var::set" NsfVarSetCmd { {-argName "-array" -required 0 -nrargs 0} {-argName "object" -required 1 -type object} {-argName "varName" -required 1 -type tclobj} {-argName "value" -required 0 -type tclobj} -} +} {-nxdoc 1} cmd "var::unset" NsfVarUnsetCmd { {-argName "-nocomplain" -required 0 -nrargs 0} {-argName "object" -required 1 -type object} {-argName "varName" -required 1 -type tclobj} -} +} {-nxdoc 1} # # object methods