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

📄 dialog3.cpp

📁 实现了简单的Simple语言的编辑器,包括词法分析,语法分析,生成四元式,以及生成符号表功能,在符号表中还可以进行查询与删除.
💻 CPP
字号:
// Dialog3.cpp : implementation file
//

#include "stdafx.h"
#include "caoyuting.h"
#include "Dialog3.h"
#include "Dialog1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CCaoyutingApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CDialog3 dialog


CDialog3::CDialog3(CWnd* pParent /*=NULL*/)
	: CDialog(CDialog3::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDialog3)
	m_str = _T("");
	//}}AFX_DATA_INIT
}


void CDialog3::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDialog3)
	DDX_Control(pDX, IDC_LIST, m_cOut);
	DDX_LBString(pDX, IDC_LIST, m_str);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDialog3, CDialog)
	//{{AFX_MSG_MAP(CDialog3)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDialog3 message handlers

void CDialog3::OnCancel() 
{
	// TODO: Add extra cleanup here
	CDialog1 dialog;
	int nIndex;
	UpdateData(true);
	for(int i=0;i<theApp.n;i++)
    if(m_str==theApp.nam[i])
     nIndex=dialog.m_cOut.GetCurSel();
    delete dialog.m_cOut.GetItemDataPtr(nIndex);
	CDialog::OnCancel();

}

BOOL CDialog3::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CString str1;
	str1.Format("type          val       name ");
    m_cOut.AddString(str1);
    m_cOut.AddString(theApp.str1);
    m_str=str1+theApp.str1;
	UpdateData(false);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDialog3::OnButton1() 
{
	// TODO: Add your control notification handler code here
	CDialog3::OnOK();
}

⌨️ 快捷键说明

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