fprintf(outfp, "/*\t$NetBSD: ncr53cxxx.c,v 1.5 2000/10/23 14:51:51 bouyer Exp $\t*/\n");
fprintf(outfp, "/*\t$NetBSD: ncr53cxxx.c,v 1.10 2002/04/21 22:40:10 bouyer Exp $\t*/\n");
main (int argc, char *argv[]){	int	i;	if (argc < 2 || argv[1][0] == '-')		usage();	sourcefile = argv[1];	infp = fopen (sourcefile, "r");	if (infp == NULL) {		perror ("open source");		fprintf (stderr, "scc: error opening source file %s\n", argv[1]);		exit (1);	}	/*	 * process options	 * -l [listfile]	 * -o [outputfile]	 * -p [outputfile]	 * -z [debugfile]	 * -e [errorfile]	 * -a arch	 * -v	 * -u	 */	for (i = 2; i < argc; ++i) {		if (argv[i][0] != '-')			usage();		switch (argv[i][1]) {		case 'o':		case 'p':			partial_flag = argv[i][1] == 'p';			if (i + 1 >= argc || argv[i + 1][0] == '-')				outputfile = makefn (sourcefile, "out");			else {				outputfile = argv[i + 1];				++i;			}			break;		case 'l':			if (i + 1 >= argc || argv[i + 1][0] == '-')				listfile = makefn (sourcefile, "lis");			else {				listfile = argv[i + 1];				++i;			}			break;		case 'e':			if (i + 1 >= argc || argv[i + 1][0] == '-')				errorfile = makefn (sourcefile, "err");			else {				errorfile = argv[i + 1];				++i;			}			break;		case 'a':			if (i + 1 == argc)				usage();			setarch(argv[i +1]);			if (arch == 0) {				fprintf(stderr,"%s: bad arch '%s'\n",					argv[0], argv[i +1]);				exit(1);			}			++i;			break;		default:			fprintf (stderr, "scc: unrecognized option '%c'\n",			    argv[i][1]);			usage();		}	}	if (outputfile)		outfp = fopen (outputfile, "w");	if (listfile)		listfp = fopen (listfile, "w");	if (errorfile)		errfp = fopen (errorfile, "w");	else		errfp = stderr;	if (outfp) {		time_t cur_time;		fprintf(outfp, "/*\t$NetBSD: ncr53cxxx.c,v 1.5 2000/10/23 14:51:51 bouyer Exp $\t*/\n");		fprintf(outfp, "/*\n");		fprintf(outfp, " *\tDO NOT EDIT - this file is automatically generated.\n");		time(&cur_time);		fprintf(outfp, " *\tcreated from %s on %s", sourcefile, ctime(&cur_time));		fprintf(outfp, " */\n");	}	while (fgets (inbuf, sizeof (inbuf), infp)) {		++lineno;		if (listfp)			fprintf (listfp, "%3d:  %s", lineno, inbuf);		err_listed = 0;		parse ();		if (ntokens) {#ifdef DUMP_TOKENS			int	i;			fprintf (listfp, "      %d tokens\n", ntokens);			for (i = 0; i < ntokens; ++i) {				fprintf (listfp, "      %d: ", i);				if (tokens[i].type)					fprintf (listfp,"'%c'\n", tokens[i].type);				else					fprintf (listfp, "%s\n", tokens[i].name);			}#endif			if (ntokens >= 2 && tokens[0].type == 0 &&			    tokens[1].type == ':') {			    	define_symbol (tokens[0].name, dsps, S_LABEL, F_DEFINED);				tokenix += 2;			}			if (tokenix < ntokens)				process ();		}	}	close_script ();	emit_symbols ();	if (outfp && !partial_flag) {		fprintf (outfp, "\nu_int32_t INSTRUCTIONS = 0x%08x;\n", ninsts);		fprintf (outfp, "u_int32_t PATCHES = 0x%08x;\n", npatches);	}	list_symbols ();	exit(0);}