📄 test.tcl
字号:
proc ShowTfProp {id} { global fp puts $fp " <---- properties ----" puts $fp " npiName=[npi_get $id -npiName]" puts $fp " npiFullName=[npi_get $id -npiFullName]" puts $fp " npiType=[npi_get $id -npiType]" puts $fp " npiFile=[npi_get $id -npiFile]" puts $fp " npiLineNo=[npi_get $id -npiLineNo]" if {[npi_get $id -npiType] == "npiFunction"} { puts $fp " npiFuncType=[npi_get $id -npiFuncType]" puts $fp " npiSize=[npi_get $id -npiSize]" } puts $fp " >---- properties ----"}proc foreach_IterateHandle {iter_handle iter_type} { global fp set Object_Handle [npi_scan $iter_handle] puts $fp " <---$iter_type--->" while {$Object_Handle != "NULL"} { puts $fp " <---begin npi_scan \$iter_handle--->" puts $fp " npiType = [npi_get $Object_Handle -npiType]" puts $fp " npiName = [npi_get $Object_Handle -npiName]" puts $fp " npiLineNo = [npi_get $Object_Handle -npiLineNo]" puts $fp " <---end of npi_scan \$iter_handle--->" set Object_Handle [npi_scan $iter_handle] } puts $fp " <---end of $iter_type--->"}proc ShowHandleProp {Handle type} { global fp puts $fp " <---$type --->" if {$Handle != "NULL"} { puts $fp " npiType = [npi_get $Handle -npiType]" puts $fp " npiName = [npi_get $Handle -npiName]" puts $fp " npiLineNo = [npi_get $Handle -npiLineNo]" } puts $fp " <---end of $type --->"}proc ShowTfRelationship {id} { global fp puts $fp " <---relationship --->" set IO_iter [npi_iterate $id -npiType npiIODecl] foreach_IterateHandle $IO_iter "npi_iterate \$id -npiType npiIODecl" set param_iter [npi_iterate $id -npiType npiParameter] foreach_IterateHandle $param_iter "npi_iterate \$id -npiType npiParameter" set Scope [npi_handle $id -npiType npiScope] ShowHandleProp $Scope "npi_handle \$id -npiType npiScope" if {[npi_get $id -npiType] == "npiFunction"} { set Left [npi_handle $id -npiType npiLeftRange] ShowHandleProp $Left "npi_handle \$id -npiType npiLeftRange" set Right [npi_handle $id -npiType npiRightRange] ShowHandleProp $Right "npi_handle \$id -npiType npiRightRange" puts $fp " <---end of relationship --->" }}proc ShowTfPropAndRelationship {var} { global fp puts $fp "<---begin showing var information--->" ShowTfProp $var ShowTfRelationship $var puts $fp "<---end of showing var information--->"}proc ShowTaskPropAndRelationship {} { global g_Task ShowTfPropAndRelationship $g_Task}proc ShowFuncPropAndRelationship {} { global g_Function ShowTfPropAndRelationship $g_Function}set log_file [file join [file dirname [info script]] [file tail [info script]].out]set fp [open $log_file w]fconfigure $fp -buffering nonenpi_register_cb -npiModuleBased Task ShowTaskPropAndRelationshipnpi_register_cb -npiModuleBased Function ShowFuncPropAndRelationshipnpi_traverse_model -npiModuleBasedclose $fp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -