📄 myscannerdlg.h
字号:
// MyScannerDlg.h : header file
//
#if !defined(AFX_MyScannerDLG_H__7B6895CE_D465_4211_B354_F17F381E0497__INCLUDED_)
#define AFX_MyScannerDLG_H__7B6895CE_D465_4211_B354_F17F381E0497__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CMyScannerDlg dialog
#define MAX_LEN 65536
class CMyScannerDlg : public CDialog
{
// Construction
public:
char buf[MAX_LEN];//文件读入缓冲区
char keyword[33][15];//关键字表
unsigned int m_charstrtab_length;//字符串表长度标记
unsigned int m_pos_chartab;//符号表位置标记
unsigned int m_pos_token;//token串位置标记
unsigned int m_pos_error;//错误标记
unsigned int m_pos;//位置标记
unsigned int m_pos_charstrtab;//字符串表位置标记
unsigned int line;//行计数
unsigned int col;//列计数
int isincharstrtab(char *tmp,int i);//当前字符是否在字符串表中
int isinchartab(char *tmp);//当前字符是否在符号表中
int iskeyword(char *tmp);//是否为关键字
char getcur(unsigned int a);//当前位置的字符,位置标记不变
char getnext(unsigned int a);//下一个位置的字符,位置标记不变
char get(unsigned int a);//当前字符并且位置标记+1
void addpos();//位置标记+1
bool isnumber(char char_tmp);//当前字符是否为数字
bool ischar(char char_tmp);//当前字符是否为字母
bool ischarornumber(char char_tmp);//当前字符是否为数字或字母
void operchar();//标识符
void opernumber();//数字常数
void opercharconst();//字符常量
void operhit();//注释或者界符
void operother();//其他界符
void output();//输出
struct stringtab
{
char string[50];//内容
int pos;//在符号表中的位置
bool flag;//true表示是标识符,false表示是字符常量
}string[200];//字符串表
struct chartabstr
{
unsigned int startpos;//在字符串表中的开始位置
unsigned int length;//长度
char type[100];//类型
char kind[100];//种属
char val[100];//值
}chartab[500];//符号表
struct tokenstr
{
char word[100];//字符串
unsigned int type;//种别码
char val[100];//值
}token[3000];
struct wrongtab
{
unsigned int ln;//行计数
unsigned int col;//列计数
char wrongmsg[50];//错误原因
}wrong[1000];
CMyScannerDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CMyScannerDlg)
enum { IDD = IDD_MyScanner_DIALOG };
CListBox m_tokentab;
CListBox m_errortab;
CListBox m_chartable;
CEdit m_input;
CEdit m_charstrtab;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyScannerDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CMyScannerDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnButtonExit();
afx_msg void OnButtonOpen();
afx_msg void OnButtonSave();
afx_msg void OnButtonScanning();
afx_msg void OnButtonAbout();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnEnChangeEditInput();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MyScannerDLG_H__7B6895CE_D465_4211_B354_F17F381E0497__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -