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

📄 automakeview2.cpp

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

#include "stdafx.h"
#include "AutoMake.h"
#include "AutoMakeView2.h"

#include "Globals.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView2

IMPLEMENT_DYNCREATE(CAutoMakeView2, CScrollView)

CAutoMakeView2::CAutoMakeView2()
{
}

CAutoMakeView2::~CAutoMakeView2()
{
}


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

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView2 drawing

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

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView2 diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView2 message handlers

void CAutoMakeView2::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));
	DEC2=0;
}


void CAutoMakeView2::drawDFA()
{
	CClientDC dc(this);
	OnPrepareDC(&dc);
	CRect rc;
	GetClientRect(&rc);
	dc.FillRect(&rc,&CBrush(RGB(255,255,255)));
	PaintDFA(&dc,this);
	DEC2=1;
}

⌨️ 快捷键说明

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