//
define array cnt 20;
proc main;
	putline('No.,name,t.m.step,module number,comment,blank,#xxxxx,skip,total');
	try ;
		c_file = 0;
		i=0;
		loop 20; cnt[i++] = 0; endloop;
		fp = fopen(%1);
		line = fgetline(fp);
		for (;;);
//putline(line);
			if line==''; continue; endif;
			if (left(line,3) == '---');
				n=getargs(line,1);
				name = $2;
				c_file++;
				for (;;);
					line = fgetline(fp);
					if line==''; continue; endif;
					if (left(line,3) == '---'); break; endif;
					switch (left(line,7));
						case 'total m'; cnt[0] = substr(line,20,5);
						case 'module '; cnt[1] = substr(line,16,5);
						case 'comment'; cnt[2] = substr(line,16,5);
						case 'blank  '; cnt[3] = substr(line,16,5);
						case '#xxxxxx'; cnt[4] = substr(line,16,5);
						case 'skip   '; cnt[5] = substr(line,16,5);
						case 'total  '; cnt[6] = substr(line,16,5);
					end switch;
				next;
				putline(c_file,',',name,',',cnt[0],',',cnt[1],',',cnt[2],',',cnt[3],',',cnt[4],',',cnt[5],',',cnt[6]);
				i = 0;
				j = 10;
				loop 7; cnt[j++] += cnt[i++]; endloop;
			else;
				line = fgetline(fp);
			end if;
		next;
	catch;
	finally;
		if (fp); fclose(fp); endif;
	end try;
	putline(',TOTAL,',cnt[10],',',cnt[11],',',cnt[12],',',cnt[13],',',cnt[14],',',cnt[15],',',cnt[16]);
	return $ERROR;
end proc;
