Style analysis of C program (CACM Jan. '85.)
Hur, Jinho
jhhur at kaist.UUCP
Thu Jan 17 04:27:08 AEST 1985
I tested the source given in the appendix of the corr article, and found
some mistakes in a few files.
First, the words in 'style.dict' should be sorted and listed as one word
in a line. The file 'style' and 'style.com.sed' is to be modified as follows.
A diff output is given.
==========================================================================
*** style Wed Jan 16 00:16:35 1985
--- style.old Wed Jan 16 00:05:25 1985
***************
*** 24,30
:
: --- sort program words
:
! tr -cs "a-z0-9_" "\012" < $TMP1 |\
sed -n '/^[a-z]/p' |\
sort -u > $TMP2
:
--- 24,30 -----
:
: --- sort program words
:
! tr -cs "[a-z][0-9]_" "[\012*]" < $TMP1 |\
sed -n '/^[a-z]/p' |\
sort -u > $TMP2
:
==============================================================================
*** style.com.sed Wed Jan 16 00:24:07 1985
--- style.com.sed.old Wed Jan 16 00:23:17 1985
***************
*** 16,22
s/ Strip multiple comments /&/
! /^[ ]*@.*$/ b loop
/@.*$/ { s/[ ]*@.*$//p
:loop
n
--- 16,22 -----
s/ Strip multiple comments /&/
! /^[ ]*@.*$/ bloop
/@.*$/ { s/[ ]*@.*$//p
:loop
n
***************
*** 21,27
:loop
n
s/ Ensure flag is reset /&/
! t dummy
:dummy
s/ Go on until delimiter /&/
s/^[^@]*`//
--- 21,27 -----
:loop
n
s/ Ensure flag is reset /&/
! tdummy
:dummy
s/ Go on until delimiter /&/
s/^[^@]*`//
***************
*** 25,33
:dummy
s/ Go on until delimiter /&/
s/^[^@]*`//
! /^[ ]*$/ d
! t start
! b loop
}
s/ Print whatever's left /&/
p
--- 25,34 -----
:dummy
s/ Go on until delimiter /&/
s/^[^@]*`//
! /^[ ]*$/
! d
! tstart
! bloop
}
s/ Print whatever's left /&/
p
--
real: Hur, Jinho Dept of Computer Science, KAIST
uucp: ..!hplabs!kaist!jhhur
csnet: jhhur%kaist at csnet-relay.csnet
More information about the Comp.sources.unix
mailing list