亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cmain.c

?? C編譯器源碼是我到處找來的,看了之后很有收獲
?? C
字號:
/*
 * 68K/386 32-bit C compiler.
 *
 * copyright (c) 1997, David Lindauer
 * 
 * This compiler is intended for educational use.  It may not be used
 * for profit without the express written consent of the author.
 *
 * It may be freely redistributed, as long as this notice remains intact
 * and either the original sources or derived sources 
 * are distributed along with any executables derived from the originals.
 *
 * The author is not responsible for any damages that may arise from use
 * of this software, either idirect or consequential.
 *
 * v1.35 March 1997
 * David Lindauer, gclind01@starbase.spd.louisville.edu
 *
 * Credits to Mathew Brandt for original K&R C compiler
 *
 */
/*
 * The following symbols must be defined on the compile command line:
 *    PROGNAME
 *    ENVNAME
 *    GLBDEFINE
 *	  SOURCEXT
 */
#include        <stdio.h>
#include				<malloc.h>
#include 				<string.h>
#include 				<setjmp.h>
#include				<signal.h>
#include				<stdlib.h>
#include				"utype.h"	
#include				"cmdline.h"	
#include        "expr.h"
#include				"errors.h"
#include        "c.h"
#include 				"diag.h"

#define VERSION 151

typedef struct list {
		struct list *link;
		void *data;
} LIST;

extern char GLBDEFINE[],SOURCEXT[],ENVNAME[],PROGNAME[];

extern ERRORS *errlist;
extern TABLE    tagtable;
extern int      total_errors;
extern int diagcount;
extern char *errfile;
extern TABLE gsyms;

FILE            *inputFile = 0, *listFile = 0, *outputFile = 0, *cppFile = 0, *errFile = 0;
int stoponerr = 0;
LIST *clist = 0;
LIST *deflist = 0;
int prm_linkreg = TRUE;
int prm_stackcheck = FALSE;
int prm_warning = TRUE;
#ifdef OBJEXT
int prm_asmfile = FALSE;
#else
int prm_asmfile = TRUE;
#endif
int prm_ansi = FALSE;
int prm_listfile = FALSE;
int prm_maxerr = 25;
int prm_diag = FALSE;
int prm_bss = TRUE;
int prm_cppfile = FALSE;
int prm_packing = FALSE;
int prm_revbits = FALSE;
int prm_lines = TRUE;
int prm_cplusplus = FALSE;
int prm_cmangle = TRUE;
int basear = 1, basedr = 1, basefr = 1;
int prm_debug = FALSE;
int version = VERSION;
int prm_errfile = FALSE;

char *prm_searchpath = 0;
jmp_buf ctrlcreturn;
int file_count = 0;

char     *infile, listfile[40],outfile[40],cppfile[40],errorfile[40];
void bool_setup(char select, char *string);
void err_setup(char select, char *string);
void incl_setup(char select, char *string);
void def_setup(char select, char *string);
void codegen_setup(char select, char *string);
void optimize_setup(char select, char *string);
void warning_setup(char select, char *string);
void parsefile(char select, char *string);

/* setup for ARGS.C */
ARGLIST ArgList[] = {
  { 'i', ARG_BOOL, bool_setup },
  { 'e', ARG_BOOL, bool_setup },
  { 'f', ARG_CONCATSTRING, parsefile },
  { 'l', ARG_BOOL, bool_setup },
#ifdef OBJEXT
  { 'v', ARG_BOOL, bool_setup },
#endif
  { 'w', ARG_CONCATSTRING, warning_setup },
  { 'A', ARG_BOOL, bool_setup },
  { 'C', ARG_CONCATSTRING, codegen_setup },
  { 'O', ARG_CONCATSTRING, optimize_setup },
  { 'E', ARG_CONCATSTRING, err_setup },
  { 'I', ARG_CONCATSTRING, incl_setup },
	{ 'D', ARG_CONCATSTRING, def_setup },
#ifdef OBJEXT
  { 'S', ARG_BOOL, bool_setup },
#endif
  { 0, 0, 0 }
};



void bool_setup(char select, char *string)
/*
 * activation routine (callback) for boolean command line arguments
 */
{
	int bool = (int)string;
	if (select == 'S')
		prm_asmfile = bool;
  if (select == 'l')
		prm_listfile = bool;
	if (select == 'i')
		prm_cppfile = bool;
	if (select == 'e')
		prm_errfile = bool;
	if (select == 'v')
		prm_debug = bool;
	if (select == 'A')
		prm_ansi = bool;
}
void codegen_setup(char select, char *string)
/*
 * activation for code-gen type command line arguments
 */
{
		int bool = TRUE;
		while (*string) {
				switch (*string) {
					case 'd':
						prm_diag = bool;
						break;
					case 'p':
						prm_packing = bool;
						break;
					case 'r':
						prm_revbits = bool;
						break;
					case 'b':
						prm_bss=bool;
						break;
					case 'l':
						prm_lines = bool;
						break;
					case 'm':
						prm_cmangle = bool;
						break;
					case 'S':
						prm_stackcheck = bool;
						break;
					case 'R':
						prm_linkreg = bool;
						break;
					case '-':
						bool = FALSE;
						break;
					case '+':
						bool = TRUE;
						break;
					default:
						if (!confcodegen(*string,bool)) 
							fatal("Illegal codegen parameter ");
				}
			string++;
		}
}
void optimize_setup(char select, char *string)
/*
 * activation for optimizer command line arguments
 */
{
		int bool = TRUE;
		while (*string) {
			switch (*string) {
				case 'R':
					string++;
					while (*string && *string != '+' && *string != '-') {
						switch (*string++) {
							case 'a':
								basear = bool;
								break;
							case 'd':
								basedr = bool;
								break;
							case 'f':
								basefr = bool;
								break;
							default:
								goto errorx;
						}
						if (!*string)
							return;
					}
					break;
				case '-':
					bool = FALSE;
					break;
				case '+':
					bool = TRUE;
					break;
				default:
errorx:
					fatal("Illegal optimizer parameter");
			}
			string++;
		}
}
void err_setup(char select, char *string)
/*
 * activation for the max errs argument
 */
{
	prm_maxerr = atoi(string);
}
void incl_setup(char select, char * string)
/*
 * activation for include paths
 */
{
	if (prm_searchpath)
		prm_searchpath = realloc(prm_searchpath,strlen(string)+strlen(prm_searchpath)+1);
	else {
		prm_searchpath = malloc(strlen(string)+1);
		prm_searchpath[0] = 0;
	}
	strcat(prm_searchpath,string);
}
void def_setup(char select, char *string)
/*
 * activation for command line #defines
 */
{
	char *s = malloc(strlen(string)+1);
	LIST *l = malloc(sizeof(LIST));
	strcpy(s,string);
	l->link = deflist;
	deflist = l;
	l->data = s;
}
void setglbdefs(void)
/*
 * function declares any global defines from the command line and also
 * declares a couple of other macros so we can tell what the compiler is
 * doing
 */
{
	LIST *l = deflist;
	while (l) {
		char *s = l->data;
		char *n = s;
		while (*s && *s != '=')
			s++;
		if (*s == '=')
			*s++=0;
		glbdefine(n,s);
		l = l->link;
	}
#ifdef CPLUSPLUS
	if (prm_cplusplus) {
		glbdefine("__cplusplus","");
	}
#endif
	glbdefine(GLBDEFINE,"");
}
void InsertAnyFile(FILE *inf, FILE *outf, char *filename, char *path, int drive)
/*
 * Insert a file name onto the list of files to process
 */

{
  char *newbuffer, buffer[100],*p = buffer;
	LIST *r = &clist;

	file_count++;

	if (drive != -1) {
		*p++ = (char)(drive + 'A');
		*p++ = ':';
	}
	if (path) {
		strcpy(p,path);
		strcat(p,"\\");
	}
	else
		*p = 0;
  /* Allocate buffer and make .C if no extension */
	strcat(buffer,filename);
  AddExt(buffer,".C");
  newbuffer = (char *) malloc(strlen(buffer) + 1);
  strcpy(newbuffer,buffer);

  /* Insert file */
	while (r->link)
		r = r->link;
	r->link = malloc(sizeof(LIST));
	r = r->link;
	r->link = 0;
	r->data = newbuffer;
}
void dumperrs(FILE *file);
void setfile(char *buf,char *orgbuf,char *ext)
/*
 * Get rid of a file path an add an extension to the file name
 */
{
	char *p = strrchr(orgbuf,'\\');
	if (!p) p = orgbuf;
	else p++;
	strcpy(buf,p);
	StripExt(buf);
	AddExt(buf,ext);
}
int parse_arbitrary(char *string)
/*
 * take a C string and and convert it to ARGC, ARGV format and then run
 * it through the argument parser
 */
{
	char *argv[40];
	int rv,i;
	int argc = 1;
	if (!string || !*string)
		return 1;
	while (1) {
		while (*string == ' ') 
			string++;
		if (!*string)
			break;
		argv[argc++] = string;
		while (*string && *string != ' ') string++;
		if (!*string)
			break;
		*string = 0;
		string++;
	}
  rv = parse_args(&argc,argv,TRUE);
  for (i= 1; i < argc; i++)
		InsertAnyFile(0,0,argv[i],0,-1);
	return rv;
}
void parsefile(char select, char *string)
/*
 * parse arguments from an input file
 */
{
	FILE *temp;
	if (!(temp = fopen(string,"r")))
		fatal("Argument file not found");
	while (!feof(temp)) {
		char buf[256];
		buf[0] = 0;
		fgets(buf,256,temp);
		if (buf[strlen(buf)-1] == '\n')
			buf[strlen(buf)-1] = 0;
		if (!parse_arbitrary(buf))
			break;
	}
	fclose(temp);
}
void addinclude(void)
/*
 * Look up the INCLUDE environment variable and append it to the
 * search path
 */
{
	char *string = getenv("CCINCL");
	if (string && string[0]) {
		char temp[500];
		strcpy(temp,string);
		if (prm_searchpath) {
			strcat(temp,";");
			strcat(temp,prm_searchpath);
			free(prm_searchpath);
		}
		prm_searchpath = malloc(strlen(temp)+1);
		strcpy(prm_searchpath,temp);
	}
}
int parseenv(char *name)
/*
 * Parse the environment argument string
 */
{
	char *string = getenv(name);
	return parse_arbitrary(string);
}
void dumperrs(FILE *file)
{
#ifdef DIAGNOSTICS
	if (diagcount)
		fprintf(file,"%d Diagnostics detected\n",diagcount);
#endif
	if (total_errors)
		fprintf(file,"%d Total errors\n",total_errors);
	if (prm_diag)
		mem_summary();
}
void summary(void)
{       
	if (prm_listfile) {
    fprintf(listFile,"\f\n *** global scope symbol table ***\n\n");
    list_table(&gsyms,0);
		if (tagtable.head) {
    	fprintf(listFile,"\n *** structures and unions ***\n\n");
    	list_table(&tagtable,0);
		}
		dumperrs(listFile);
  }
}
void ctrlchandler(int aa)
{
	longjmp(ctrlcreturn,1);
}
int main(int argc,char *argv[])
{
	char buffer[40];
	char *p;
  banner("%s Version %d.%02d Copyright (c) 1994-1997, LADsoft",PROGNAME,VERSION/100,VERSION %100);
  outfile[0] = 0;

	/* parse the environment and command line */
	/* inpout cfg file has already been parsed */
  if (!parseenv(ENVNAME))
    usage(argv[0]);
  if (!parse_args(&argc, argv, TRUE) || (!file_count && argc == 1))
    usage(argv[0]);


	/* tack the environment includes in */
	addinclude();

	/* processor-dependent initialization */
	confsetup();

  /* Scan the command line for file names or response files */
	{ int i;
		for (i=1; i <argc; i++) 
			InsertAnyFile(0,0,argv[i],0,-1);
	}


  /* Set up a ctrl-C handler so we can exit the prog */
	signal(SIGINT,ctrlchandler);
	if (setjmp(ctrlcreturn))
		exit(1);
	/* loop through and compile all the files on the file list */
	while (clist) {
		inasmini();
		memini();
	  symini();
		stmtini();
		kwini();
		initini();
		preprocini();
		exprini();
		declini();
		funcini();
		peepini();
		outcodeini();
		regini();
		printf("file: %s\n",clist->data);
	  strcpy(buffer,clist->data);
#ifdef OBJEXT
		if (prm_asmfile)
#endif
			setfile(outfile,buffer,SOURCEXT);
#ifdef OBJEXT
		else
			setfile(outfile,buffer,OBJEXT);
#endif
		setfile(cppfile,buffer,".I");
		setfile(listfile,buffer,".LST");
		setfile(errorfile,buffer,".ERR");
		prm_cplusplus = FALSE;
	  AddExt(buffer,".C");
#ifdef CPLUSPLUS
		p = strrchr(buffer,'.');
		if (*(p-1) != '.') {
			if (p[1] == 'c' || p[1] == 'C')
				if (p[2] == 'p' || p[2] == 'P')
					if (p[3] == 'p' || p[3] == 'P')
						prm_cplusplus = TRUE;
		}
#endif
		infile = errfile = litlate(buffer);

		if (prm_cppfile) {
			if (!(cppFile = fopen(cppfile,"w")))
				fatal("Can't open cpp file %s",cppfile);
		}
  	if (!(inputFile = fopen(infile,"r")))
    	fatal("Can't open input file %s",infile);
  	if (!(outputFile = fopen(outfile,"w"))) {
    	fclose(inputFile);
    	fatal("Can't open output file %s",outfile);
	  }
		if (prm_asmfile)
			asm_header();
	  if (prm_listfile)
  		if (!(listFile = fopen(listfile,"w"))) {
    		fclose(inputFile);
		    fclose(outputFile);
    		fatal("Can't open list file %s",listfile);
  		}
	  if (prm_errfile)
  		if (!(errFile = fopen(errorfile,"w"))) {
				fclose(listFile);
    		fclose(inputFile);
		    fclose(outputFile);
    		fatal("Can't open error file %s",errorfile);
  		}
		initerr();
	  initsym();
		setglbdefs();
  	getch();
  	getsym();
	  compile();
		summary();
  	release_global();
		dumperrs(stdout);
	  fclose(inputFile);
		if (prm_asmfile) {
  		fclose(outputFile);
		}
  	if (prm_listfile)
    	fclose(listFile);
  	if (prm_errfile)
    	fclose(errFile);
  	if (prm_cppfile)
    	fclose(cppFile);
		clist = clist->link;

		/* Remove the ASM file if there are errors */
	if (total_errors)
			remove(outfile);

		/* Remove the ERR file if no warnings / errors */
		if (!errlist && prm_errfile)
			remove(errorfile);

		/* Flag to stop if there are any errors */
		stoponerr |= total_errors;
	}
  if (stoponerr)
   	return(1);
  else
    return(0);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品高清视频在线观看| 精品日韩欧美一区二区| 亚洲欧洲精品一区二区精品久久久 | 欧美国产禁国产网站cc| 国产精品18久久久久久vr| 久久精品男人天堂av| 成人黄色在线看| 一区二区在线观看视频| 欧美日韩一本到| 精品一区二区在线播放| 久久看人人爽人人| 99re8在线精品视频免费播放| 亚洲激情校园春色| 日韩一区二区中文字幕| 国产精品一区二区无线| 一区二区在线观看免费视频播放| 欧美三级乱人伦电影| 欧美日韩一区 二区 三区 久久精品| 亚洲男人天堂一区| av在线一区二区| 欧美一区三区四区| 26uuu精品一区二区| 色噜噜夜夜夜综合网| 国产电影一区在线| 美女mm1313爽爽久久久蜜臀| 天堂资源在线中文精品| 久久激五月天综合精品| 国产一区二区三区免费看 | 亚洲国产精品传媒在线观看| 精品一区二区在线看| 国产成人免费网站| 亚洲激情在线播放| 欧美视频在线观看一区| 国产91丝袜在线观看| 综合久久久久久| 欧美精品久久天天躁| 日韩综合在线视频| 欧美二区乱c少妇| 国产精品嫩草99a| 日韩一区二区三区观看| 国产肉丝袜一区二区| 天使萌一区二区三区免费观看| 99re这里只有精品首页| 欧美精品精品一区| av男人天堂一区| 91视频国产资源| 国产999精品久久| 欧美日韩一区二区三区不卡| 99久久精品国产精品久久| 国产乱一区二区| 7799精品视频| 午夜精品免费在线观看| 欧美日韩精品系列| 亚洲一区在线观看免费| 91国产免费观看| 亚洲一级不卡视频| 久久久久综合网| 日韩国产一区二| 国产精品麻豆欧美日韩ww| 强制捆绑调教一区二区| 久久久久久免费网| 99精品久久只有精品| 午夜欧美电影在线观看| 亚洲一区二区三区四区在线观看| 欧美日本一区二区三区四区| 久久99精品国产麻豆不卡| 欧美一区二区精品在线| 国产精品一区二区三区四区| 国产精品电影一区二区三区| 在线这里只有精品| 亚洲一区二区三区四区五区黄| 国产亚洲欧美日韩在线一区| 青青国产91久久久久久| 亚洲女爱视频在线| 国产精品高潮呻吟| 国产精品久久久久9999吃药| 久久久亚洲欧洲日产国码αv| 欧美成人一区二区三区片免费| 6080国产精品一区二区| 69精品人人人人| 欧美一级高清大全免费观看| 欧美专区日韩专区| 欧美日韩一区二区三区在线| 欧洲一区在线电影| 精品视频在线视频| 欧美精品乱码久久久久久| 91精品国产一区二区三区| 日韩女优制服丝袜电影| 久久久亚洲午夜电影| 国产精品久久久久一区二区三区| 中文字幕av资源一区| 亚洲精品免费播放| 午夜精品久久久久久久蜜桃app| 亚洲国产美女搞黄色| 婷婷久久综合九色综合绿巨人 | 亚洲品质自拍视频网站| 亚洲欧美日韩国产一区二区三区| 亚洲精品老司机| 日韩国产欧美三级| 丰满亚洲少妇av| 在线观看日产精品| 日韩久久久精品| 国产精品欧美一级免费| 亚洲国产精品视频| 国产综合色产在线精品| 92精品国产成人观看免费| 欧美丰满高潮xxxx喷水动漫| 欧美一级欧美三级在线观看 | 亚洲精品国久久99热| 久久久久久毛片| 中文字幕欧美激情| 日本一区二区三区国色天香| 国产精品福利电影一区二区三区四区| 国产日韩av一区二区| 国产精品丝袜91| 亚洲地区一二三色| 9l国产精品久久久久麻豆| 国产一区免费电影| 亚洲国产精品一区二区尤物区| 麻豆国产精品视频| 日本乱人伦一区| 久久久精品中文字幕麻豆发布| 亚洲一区中文日韩| 国产成人福利片| 欧美特级限制片免费在线观看| 欧美精品一区二区高清在线观看 | 狠狠狠色丁香婷婷综合激情| 国产麻豆午夜三级精品| 成人免费va视频| 欧美精品一区视频| 亚洲h动漫在线| 成人精品国产一区二区4080 | 日本韩国精品在线| 亚洲精品在线观看网站| 成人自拍视频在线观看| 麻豆精品国产91久久久久久| 国产蜜臀97一区二区三区| 亚洲美女免费视频| 欧美激情综合在线| 国产在线看一区| 欧美一区永久视频免费观看| 亚洲日本护士毛茸茸| 韩国av一区二区三区| 欧美综合欧美视频| 亚洲成人你懂的| 亚洲国产经典视频| 美女在线观看视频一区二区| 人妖欧美一区二区| 久久97超碰国产精品超碰| 91在线视频免费观看| 国产精品久久久久久久岛一牛影视| 99视频热这里只有精品免费| 成人av网在线| 一本久久综合亚洲鲁鲁五月天| 精品一区在线看| 91国产视频在线观看| 综合中文字幕亚洲| 成人国产精品免费观看动漫| 久久久亚洲高清| 国产精品自拍av| 精品久久久影院| 麻豆成人久久精品二区三区红| 91精品国产综合久久久蜜臀图片 | 色呦呦网站一区| 亚洲私人黄色宅男| 99re亚洲国产精品| 日韩一区日韩二区| 97久久久精品综合88久久| 中文字幕日韩一区二区| 99re这里只有精品视频首页| 中文字幕在线不卡视频| 91丨porny丨首页| 一区二区三区成人| 欧美日韩国产另类一区| 首页国产丝袜综合| 日韩午夜中文字幕| 国产一区二区三区国产| 国产校园另类小说区| 成人精品鲁一区一区二区| 亚洲日本乱码在线观看| 91色婷婷久久久久合中文| 亚洲免费观看高清在线观看| 色婷婷久久久亚洲一区二区三区| 亚洲综合视频在线观看| 欧美日本乱大交xxxxx| 久久av老司机精品网站导航| 久久一留热品黄| 99视频一区二区三区| 亚洲国产精品欧美一二99| 日韩欧美一级片| 国产成人亚洲综合色影视| 国产精品电影院| 欧美日韩国产影片| 久久精品国产77777蜜臀| 亚洲国产精品精华液ab| 一本久久a久久免费精品不卡| 午夜精品久久久久久| 久久品道一品道久久精品| 色悠久久久久综合欧美99| 日韩 欧美一区二区三区|