CLIST ($69us)

CDOC or CLIST process user 'C' and 'C++' programs, and produce either reformated source code or action-diagram highlighted listings. For our simple example program "EXAMPLE.C":

[return to HomePage Contents] [backup to CLIST]

Original Input program

 void main ()
		  {
     signed int count,                         /* loop counter        */
       f_temp,          /* temp in Fahrenheit*/
       c_temp;// temp in centigrade

     printf(  "Centigrade to Fahrenheit table"  )   ;

     for     (count=-6;     count <=20 ;count  ++)            {

	 c_temp= 10*  count;
	 f_temp=fahren(   c_temp)  ;
	 if     (c_temp >= 150) {
		prt_line (c_temp, f_temp)  ;          break;
		}
	 prt_line (   c_temp,    f_temp   )   ;
     }
     exit(0);
     }

[return to HomePage Contents] [backup to CLIST]

Annotated Action-Diagram Listing

 14 void main ()
 15 {
 16      signed int count,               /* loop counter             */
 17                 f_temp,              /* temp in Fahrenheit       */
 18                 c_temp;              // temp in centigrade
 19
 20      printf("Centigrade to Fahrenheit table");
 21
 22      for (count = -6; count <= 20; count++) {
 23      #
 24      #    c_temp = 10 * count;
 25      #    f_temp = fahren(c_temp);
 26      #    if (c_temp >= 150)
 26      #    {
 27      #    |    prt_line(c_temp, f_temp);
 27      #=========break;
 28      #    }
 29      #    prt_line(c_temp, f_temp);
 30      }
 31      exit (0);
 32 }

The "#" can be replaced with a double-vertical-bar character if your printer supports line-drawing characters ("IBM extended characters"), and the "=" can be replaced with a double-horizontal-line character.

[return to HomePage Contents] [backup to CLIST]

Additional Reformat Options

Braces Adjustments

In-line Spacing Adjustments

Comment positions

Other Options

[return to HomePage Contents] [backup to CLIST]

Reformated Source

 void main ()
 {
      signed int count,               /* loop counter             */
		 f_temp,              /* temp in Fahrenheit       */
		 c_temp;              // temp in centigrade

      printf("Centigrade to Fahrenheit table");

      for (count = -6; count <= 20; count++) {

	   c_temp = 10 * count;
	   f_temp = fahren(c_temp);
	   if (c_temp >= 150)
	   {
		prt_line(c_temp, f_temp);
		break;
	   }
	   prt_line(c_temp, f_temp);
      }
      exit (0);
 }

[return to HomePage Contents] [backup to CLIST]
[next document CCALL]

Author:

SoftWare BlackSmiths Inc, 6064 St Ives Way, Mississauga ON, Canada L5N-4M1 WWW = http://www.swbs.com eMail = email@swbs.com Voice/Fax = (905)-858-4466

You are the visitor to this page. We just reset our hit-counter aug2001

MAIN WEBPAGE INDEX: (back to the main index).