home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_02 / v7n2081b.txt < prev    next >
Text File  |  1988-12-19  |  1KB  |  35 lines

  1. /[()\[\]{}]/
  2.                 {
  3.                 braces = braces + match( $0, @\{@ );
  4.                 braces = braces - match( $0, @'\{'@ );
  5.                 braces = braces - match( $0, @\}@ );
  6.                 braces = braces + match( $0, @'\}'@ );
  7.                 }
  8. /[A-Za-z][A-Za-Z0-9_]*: *(/
  9.                 {
  10.                 if ( braces == 0 )
  11.                     {
  12.                     i = 1;
  13.                     while ( i < NF )
  14.                         {
  15.                         if ( match( $i, @[A-Za-z][A-Za-z0-9_]*(@ ) != 0 )
  16.                             {
  17.                             j = strlen( $i );
  18.                             while ( j )
  19.                                 {
  20.                                 if ( ($i)[j] == 40 )
  21.                                     {
  22.                                     ($i)[j] = 0;
  23.                                     j = 1;
  24.                                     }
  25.                                 j--;
  26.                                 }
  27. #                            ($i)[ strlen( $i ) - 1] = '\0';
  28.                             printf( "    MON_NAME( %s ),\n", $i );
  29.                             }
  30.                         i++;
  31.                         }
  32.                     }
  33.                 }
  34. # END  {  printf( "    };\n" ); }
  35.