/* Public domain C comment stripper created by Lawrence Foard */
/* version 2 */
#include <stdio.h>
char *a="/* this is a test 'of the emergency \" comment stripper \\ \'*/";
/* this is a'nasty\' "comment" meant / * to really confuse it"*//*\*/

/* jar -- second try got it right!! */

int no_com()
 {
  int c; 
  static int quote=0,squote=0,slash=0;
  c=getc(stdin);
  if (slash || (c=='\\'))
   {
    slash=!slash;
    return(c);
   }
  if ((quote^=((c=='"') && !squote)) ||
      (squote^=((c=='\''/*\ and right here two \*/) && !quote)))
   return(c);
  if (c=='/') 
   if ((c=getc(stdin))!='*')
    {
     ungetc(c,stdin);
     return('/');
    }
   else
    {
     c=0;
     do
      {
       ungetc(c,stdin);
       while(getc(stdin)!='*');
      }
     while((c=getc(stdin))!='/');
     return(no_com());
    }
   return(c);
  }  
   
main()
 {
  int c;
  while((c=no_com())!=EOF)
   fputc(c,stdout);
 }  
