Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!usc!zaphod.mps.ohio-state.edu!wuarchive!udel!princeton!phoenix!egnilges From: egnilges@phoenix.Princeton.EDU (Ed Nilges) Newsgroups: comp.software-eng Subject: Re: Counting semicolons (was: Re: WANTED: "C" code line counter program) Message-ID: <7547@idunno.Princeton.EDU> Date: 26 Mar 91 18:52:23 GMT References: <1991Mar15.132757.6883@comm.wang.com> <4196@zaphod.UUCP> Sender: news@idunno.Princeton.EDU Organization: Princeton University Lines: 59 In article <4196@zaphod.UUCP> bobd@zaphod.UUCP (Bob Dalgleish) writes: >Define your accuracy requirements! > >Some C statements don't show up as such because they are primarily >expressions and show up in expression lists: Good point, Bob. A strict metric using "statement" as defined in the Backus-Naur Form definition of C would measure the following code fragment index = 0; count = 0; for ( ; indexPrescription: choose something that is easy to count with a standard >Unix tool: i.e., wc, grep, sed, etc. Then, determine how accurate it is >for the sample code that you are using - within 5%, within 2.5%, >whatever. Is this good enough for your usage? Within 5 percent of what? What's your independent measure of complexity? And note that yacc and lexx are also standard unix tools. >Don't get bogged down in what is a statement, or other metaphysical >things. Just find something that is well correlated with your needs, >and measure it cheaply. Anything else misses the point. There is nothing "metaphysical" about using the right tool for the job. Unless "metaphysical"=="I don't understand it".