Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!bu.edu!wang!comm.wang.com!lws From: lws@comm.wang.com (Lyle Seaman) Newsgroups: comp.software-eng Subject: Re: Counting semicolons (was: Re: WANTED: "C" code line counter program) Message-ID: <1991Mar15.132757.6883@comm.wang.com> Date: 15 Mar 91 13:27:57 GMT References: <1991Mar6.214157.18633@ntpal.uucp> <9082@suns6.crosfield.co.uk> Organization: Wang Labs, Platform Comms. Lines: 21 richard@iesd.auc.dk (Richard Flamsholt S0rensen) writes: > In a line counting program, however, you probably wouldn't want the >{}'s themselfes to count as a statement, would you? Furthermore, if we >count }'s as statements this also makes function definitions, structs, >unions, enums and initializers - who all ends with a } - look like >statements. > Therefore, I think the idea of dismissing the compound statements >and only counting semicolons is allright (as long as you stay out of >comments, character constants and strings, of course ...) - and if I'm >wrong, somebody'll probably tell me so ;-) Well, that's a matter of interpretation. I think compund statements are a useful complexity indicator, and reasonably simple to count. I guess it depends on *why* you're counting things in your code-- what your goals are, what you hope to be able to use such data for. -- Lyle 508 967 2322 "We have had television problems directly lws@capybara.comm.wang.com attributable to something not understandable" Wang Labs, Lowell, MA, USA - unnamed believer in poltergeists