Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!njin!princeton!phoenix!pucc!EGNILGES From: EGNILGES@pucc.Princeton.EDU (Ed Nilges) Newsgroups: comp.software-eng Subject: Re: C source lines in file Message-ID: <9363@pucc.Princeton.EDU> Date: 18 Aug 89 20:57:22 GMT References: <35120@ccicpg.UUCP> <16018@vail.ICO.ISC.COM> <895@mrsvr.UUCP> Reply-To: EGNILGES@pucc.Princeton.EDU Organization: Princeton University, NJ Lines: 27 Disclaimer: Author bears full responsibility for contents of this article In article <895@mrsvr.UUCP>, hallett@shoreland.uucp (Jeff Hallett x4-6328) writes: >In article <16018@vail.ICO.ISC.COM> rcd@ico.ISC.COM (Dick Dunn) writes: >>swonk@ccicpg.UUCP (Glen Swonk) writes: >>> Does anyone have a program or a method of determing >>> the number of C source lines in a source file? Turns out this unambiguous measure is ambiguous. I modified a compiler a while back to take comments out of its count of source lines. I ended up counting, not "lines" (which is an incoherent concept in any language which allows multiple statements per line or multiple lines per statement) but syntactical "statements". That meant that in the following code DO while foo foo := bar+1 END there are three lines but two statements, one of which is contained in the other! I believe that this is the best of a not too good collection of complexity measures. ************************************************************************ Edward Nilges "If the universe were perfect, it wouldn't exist" - Yogi Berra