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

📄 wordanalyse.cpp

📁 PL/0语言的词法分析
💻 CPP
字号:
// WordAnalyse.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int main(int argc, char* argv[])
{
	CmdLine cl;

	if(!parseCmdLine(argc,argv,cl)){
		showHelp();
		return 0;
	}

	if ((infile = fopen((char*)cl.inFileName, "r")) == NULL)
	{
		printf("File %s can't be opened.\n", cl.inFileName);
		exit(1);
	}
	if ((outfile = fopen((char*)cl.outFileName, "w")) == NULL)
	{
		printf("File %s can't be opened.\n", cl.outFileName);
		exit(1);
	}

	if(feof(infile)){
		cout<<"The input file is empty!"<<endl;
		fprintf(outfile, "The input file is empty!");
		return 0;
	}	

	getch();
	do{
		getsym();
		fprintf(outfile, "%3d: %-15s ", sym, id);
		if(cl.showLineNum) fprintf(outfile,"Ln %3d ",ln);
		if(cl.showColNum) fprintf(outfile,"Col %3d ",cch);
		fprintf(outfile,"\n");
	}while( SYM_PERIOD != sym);

	return 0;
}

⌨️ 快捷键说明

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