📄 word.h
字号:
#pragma once
//#include<iostream>
#include"Mystring.h"
#include<fstream>
#include<cstring>
using namespace std;
class Mystring;
class Word
{
public:
Word(void); //构造
~Word(void){} //析构
bool forMain(); //界面函数
protected:
bool infIn(); //读源文件
bool wordAnalyze(char *line); //做词法分析
bool isInWord(char *arry); //判断是否是保留字
bool isSign(char frist,char second='\0'); //判断是否是运算符
bool isMarco(char *arry); //判断是否是编译宏
bool isBound(char data); //判断是否是分界符
bool isWord(char data); //判断字母
bool isNum(char data); //判断数字字符
bool outPut(char *word,char *strings=NULL); //将strings的内容写进文件outputfilename中
bool outPut(char data,char *strings=NULL); //将一个字符写进文件中
bool outPut(char data1,char data2,char *strings=NULL);//将两个字符写进文件中
bool setFlag(); //改变flag的值
private:
Mystring inword; //保留字
Mystring marco; //编译宏
Mystring sign; //运算符集
Mystring bound; //分界符集
ofstream outfile; //保存分析结果的文件对象
char word[64]; //字符缓冲区
char outputfilename[32]; //输出文件名
bool flag; //是否向输出文件写入源码注释
bool flagto_txt; //注释开关
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -