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

📄 main.cpp

📁 计算机科学与技术专业课程编译原理的课程实验代码
💻 CPP
字号:
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <process.h>
#include <fstream.h>
#include <iostream.h>


#include "Define.h"
#include "System.h"
#include "Morphology.h"
#include "Error.h"

void Morphology(ofstream File)
{
	cout<<"词法分析开始!!"<<endl;
	if((FIN=fopen("input.txt","r"))==NULL)
	{
		cout<<"不能打开输入文件!"<<endl;
	    exit(0);
	}
	cout<<"输入文件为"<<"input.txt"<<endl;
	if((FOUT=fopen("output.txt","w"))==NULL)
	{
		cout<<"不能打开输出文件!"<<endl;
	    exit(0);
	}
    cout<<"输出文件为"<<"output.txt"<<endl;
    File.open("output.txt");
    while(fgets(buff,80,FIN)!=NULL)
    {
      I=0;
      while(I<=strlen(buff)-2)
	  {
        Get_A_Word(File);
	  }
	}
    fclose(FIN); 
	fclose(FOUT);
    File.close();
    cout<<"词法分析完毕!!"<<endl;
}

void main()
{
	ofstream File;
	Morphology(File);
}




⌨️ 快捷键说明

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