nocom.c revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1987-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* nocom [file ...]
*
* nocom -- strip comments from C source files
*/
static const char usage[] =
"[-?\n@(#)$Id: nocom (AT&T Research) 1994-01-11 $\n]"
"[+NAME?nocom - strip comments from C source files]"
"[+DESCRIPTION?\bnocom\b strips \b// ...\b and \b/* ... */\b comments from"
" each C source \afile\a and writes the result on the standard output."
" Comments that span multiple lines are replaced by \bnewline\b"
" characters to retain the original source line numbering. If \afile\a"
" is omitted then the standard input is read.]"
"\n"
"\n[ file ... ]\n"
"\n"
"[+SEE ALSO?\bcc\b(1), \bwc\b(1)]"
;
#include <ast.h>
#include <error.h>
#include "nocomment.c"
int
{
register char* s;
for (;;)
{
{
case '?':
break;
case ':':
break;
}
break;
}
if (error_info.errors)
if (!*argv)
{
}
else while (s = *argv++)
{
else
{
}
}
return error_info.errors != 0;
}