One-Pass and Two-Pass Checking
By default, TclPro Checker performs a two-pass scan of your scripts. The first pass accumulates information about user-defined procedures and user-defined [incr Tcl] classes. This information includes:
- the number of arguments for procedure definitions and [incr Tcl] constructor definitions
- the scope of procedures (namespace, protection level)
- redefinition of procedures using the Tcl rename command
- imports and exports of namespace procedures
- class structures of inherited [incr Tcl] classes
The second pass uses this information to provide warnings and error messages concerning the usage of the user-defined procedures, including:
- calling a procedure with the wrong number of arguments
- calling an [incr Tcl] class constructor with the wrong number of arguments
- redefining existing procedures, by either the rename command or by defining a procedure or class with and identical name
- calling [incr Tcl] class procedures out of scope
- calling class procedures with invalid permissions (private or protected)
TclPro Checker properly handles all variations of user-defined procedures in namespaces.
Note: TclPro Checker does not currently check the following:
- variable usage (for example, attempting to use the value of an undefined variable or attempting to perform math operations on a list variable)
- [incr Tcl] class methods
- argument types passed to user-defined procedures
- redefinition of built-in Tcl, Tk, or [incr Tcl] commands
Also, if you define a procedure multiple times, TclPro Checker generates a usage error when calling that procedure only if the call fails to match any of procedure definitions. Because of the dynamic nature of procedure definition and redefinition, TclPro Checker can't determine which argument list is currently valid for the given procedure call.
TclPro Checker does not automatically scan scripts that are sourced by your script. Therefore, you must include on the procheck command line all files that define user procedures and classes used by your script.
For a quicker but less comprehensive check of your scripts, you can use the procheck onepass option to force TclPro Checker to perform a one-pass scan of your scripts. A one-pass scan does not check for any of the potential errors or misuses of user-defined procedures and [incr Tcl] classes described above.
You can also use the procheck verbose option to get a list of all commands used by the scripts you specify that are not defined in that collection of scripts. If you don't include the verbose option, TclPro Checker doesn't warn you about undefined procedures.
http://www.ajubasolutions.com Voice: (650) 210-0100 Fax: (650) 210-0101 support@ajubasolutions.com |