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

📄 code.h

📁 PL0的编译系统,使用MFC编写界面,采用浮动窗口来仿VC的环境
💻 H
字号:
#if !defined(AFX_CODE_H__A5B4FA95_3436_43BC_9D7B_89095274AB6B__INCLUDED_)
#define AFX_CODE_H__A5B4FA95_3436_43BC_9D7B_89095274AB6B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Code.h : header file
//
enum fct {lit,opr,lod,sto,cal,intint,jmp,jpc};
#define CODE_SIZE	200
#define RUN_STACK_SIZE	500
/////////////////////////////////////////////////////////////////////////////
// CCode window
struct instruction
{
	fct f;	//fuction code
	int l;	//level
	int a;	//displacement addr
};

#include "Compiler.h"
class CCode : public CWnd
{
// Construction
public:
	CCode();
	CCode(CCompiler *);
// Attributes
public:
	CCompiler	*mCompiler;
	int		cx;
	int		b;
	int		s[RUN_STACK_SIZE];
	instruction	code[CODE_SIZE];
// Operations
public:
	void Gen(fct f,int l,int a);
	int Base(int l);
	void Interpret();
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCode)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CCode();

	// Generated message map functions
protected:
	//{{AFX_MSG(CCode)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_CODE_H__A5B4FA95_3436_43BC_9D7B_89095274AB6B__INCLUDED_)

⌨️ 快捷键说明

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