Tcl Syntax checking.
Posted by Graham_Tasker (Graham_Tasker), 15 February 2005We (Herschel project, Dutch Space) are using 'procheck' to syntax check a TCL scripts. However it does not pick up syntax errors inside procedure bodies. It also does not work with namespaces or packages. Does any one know of a checker with can be run on a unix system which will find these syntax (and other) errors.
Thanks (on behalf of the team) Graham
Posted by admin (Graham Ellis), 16 February 2005Tcl syntax checking is inerrently difficult except as it runs ... Deferred block may contain anything, variables may contain code, etc, and nothing's going to get that 100%. Please don't shoot the messenger
I'm on the road this week (see http://www.wellho.net/horse/ - let me know if you would like a fuller reply when I'm back at my desk
Posted by Graham_Tasker (Graham_Tasker), 16 February 2005I realize that Tcl syntax checking will not be simple and anywere neer 100% checking will be impossible.
But : the present syntax checker we have (procheck) is leading us into a force sense of security and leading to bad practises. (i.e poor or no use of namespaces and packages.), in some ways we may be better of with out it, but that is not my decision.
I there fore would expect that almost any syntax checker would be an improvement on what we have. A fuller reply would be appreciated.
Posted by admin (Graham Ellis), 21 February 2005Graham, I came across tcLex that claims working with namespaces as one of its features ... see
I was also thinking during the night (I'm sad!) that you could use Tcl's feature that it analyses both blocks of code and data with the same list engine to write a script that tuns on itself and at least presents the main blocks to you. The biggest early issue would be the need to tell the new line (end of command) and white space (parameter seperators) apart when looking to identify the command keywords.
Recursion where appropriate would allow you to go on and handle blocks such as proc definitions, conditional and loop blocks and namespaces.
Perhaps it's my training as a compiler writer that makes this look straightforward to me, but I'll probably have to add it to the list of "things I would like to do but don't have enough hours for" I'm afraid. Would love to see something simple along these lines if you were to find a few hours to experiment!
Posted by patthoyts (patthoyts), 18 April 2005Another Tcl syntax checking program you might try is Frink. See http://wiki.tcl.tk/2611 for a link and some more information.
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho