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

📄 scannerdlg.h

📁 编译原理课程设计
💻 H
字号:
// ScannerDlg.h : header file
//

#if !defined(AFX_SCANNERDLG_H__582AA5D9_D4F2_49A7_9BD2_2370B0F7C6DF__INCLUDED_)
#define AFX_SCANNERDLG_H__582AA5D9_D4F2_49A7_9BD2_2370B0F7C6DF__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CScannerDlg dialog

class CScannerDlg : public CDialog
{
// Construction
public:
	CScannerDlg(CWnd* pParent = NULL);	// standard constructor
public:
	int value;    // value=InsertId()||InsertConst(); 
	int length;   //源程序的长度
	BOOL ends;
	char ch;	   //每次读入的字符
	BOOL digit;   //标识到底是小数还是整数
	int point;    //位置指针
	int code;      //code=Reserve();

	CString strToken;			//查找到的一串数据
    int PrimaryKey[50];			//关键字在vocabulary表当中的位置
	CString Identifier[50];    //标识符
	CString Floatt[50];         //浮点数
	CString Intt[50];			//整数
	//CString Const[50];			//常数,先把整数小数等统一转换为字符
	CString Symbol[50];		//符号

public:
	char GetChar();     //最新的一个字符串给ch
	void GetBC();       //去掉空格
	void Concat();       //将ch中的字符连接到strToken之后
	BOOL IsLetter();     //读出的字符ch是否是字母
	BOOL IsDigit();      //读出的字符ch是否是数字
	int Reserve();       //
	void Retract();      //point指针回调一个字符
	int InsertId();      //将strToken中的标识符插入到符号表Identifier数组中,返回符号表指针
//	int InsertConst();   //将strToken中的常数插入到常数表,返回符号表指针
	int InsertSymbol(CString s);   //将符号s插入到符号表中,返回符号表指针
	int InsertInt();   //插入整数
	int InsertFloat();
	void ShowOut();     //按照顺序输出分析结果
// Dialog Data
	//{{AFX_DATA(CScannerDlg)
	enum { IDD = IDD_SCANNER_DIALOG };
	CEdit	m_edit_source;
	CEdit	m_edit_result;
	CString	m_result;
	CString	m_source;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CScannerDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CScannerDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnScan();
	afx_msg void OnClose();
	afx_msg void OnOpen();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SCANNERDLG_H__582AA5D9_D4F2_49A7_9BD2_2370B0F7C6DF__INCLUDED_)

⌨️ 快捷键说明

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