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

📄 automakeview3.cpp

📁 一个大学时候做的编译原理的实验.实验内容是正则表达式到NFA到DFA到最小化DFA最终生成词法分析代码的整个过程的演示.那时由于时间关系,词法分析代码自动生成部分还没完成.
💻 CPP
字号:
// AutoMakeView3.cpp : implementation file
//

#include "stdafx.h"
#include "AutoMake.h"
#include "AutoMakeView3.h"

#include "Globals.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView3

IMPLEMENT_DYNCREATE(CAutoMakeView3, CScrollView)

CAutoMakeView3::CAutoMakeView3()
{
}

CAutoMakeView3::~CAutoMakeView3()
{
}


BEGIN_MESSAGE_MAP(CAutoMakeView3, CScrollView)
	//{{AFX_MSG_MAP(CAutoMakeView3)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView3 drawing

void CAutoMakeView3::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
	if(DEC3==1)
	{
		CClientDC dc(this);
	    OnPrepareDC(&dc);
	    CRect rc;
	    GetClientRect(&rc);
	    dc.FillRect(&rc,&CBrush(RGB(255,255,255)));
	    PaintMinDFA(&dc,this);
	}
}

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView3 diagnostics

#ifdef _DEBUG
void CAutoMakeView3::AssertValid() const
{
	CScrollView::AssertValid();
}

void CAutoMakeView3::Dump(CDumpContext& dc) const
{
	CScrollView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView3 message handlers

void CAutoMakeView3::OnInitialUpdate() 
{
	CScrollView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	CRect rc;
	GetClientRect(&rc);
	SetScrollSizes(MM_TEXT,CSize(rc.Width()+10000,rc.Height()+18000));
	DEC3=0;
}

void CAutoMakeView3::drawMinDFA()
{
	CClientDC dc(this);
	OnPrepareDC(&dc);
	CRect rc;
	GetClientRect(&rc);
	dc.FillRect(&rc,&CBrush(RGB(255,255,255)));
	PaintMinDFA(&dc,this);
	DEC3=1;
}

⌨️ 快捷键说明

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