⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pascal.cpp

📁 近日学习编译原理课程
💻 CPP
字号:
#include <stdio.h>
#include <stdlib.h>#include "parser.h"#include "string.h"

#ifndef _DEBUG
#define _DEBUG
#endif

int main(int argc, char* argv[])
{	if(argc>1)
	{		strcpy(sourcefile,argv[1]);		register char* cp;		cp=&sourcefile[strlen(sourcefile)]-1;		in=fopen(sourcefile,"r");		while((cp>=sourcefile)&&(*cp!='.')&&(*cp!='\\'))cp--;		if(*cp=='.')*cp=0;	}
#ifdef _DEBUG	else{		strcpy(sourcefile,"example");		in=fopen("example.pas","r");	}#endif	if(in==NULL){		printf("请在屏幕输入源文件,按ctrl+z结束输入\n");		in=0;	}	out=fopen("out.txt","w");
	fprintf(out, "%-8s%-8s%s\n-----------------------------------\n", "LineNO", "Type", "Value");	while(lex()!=0);//print_result(out);	fclose(out);	if(in!=NULL)fclose(in);

	system("edit out.txt");	return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -