calculator.h

来自「一个计算器程序」· C头文件 代码 · 共 75 行

H
75
字号


#if !defined(AFX_CALCULATOR_H__C3A7ABB0_113D_4529_969E_B216CE8DC700__INCLUDED_)
#define AFX_CALCULATOR_H__C3A7ABB0_113D_4529_969E_B216CE8DC700__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Calculator.h : header file
//



// 这一段是记号的定义
#define ADD 0
#define MUL 1
#define LBRACE 2
#define RBRACE 3
#define NUM 4
#define END 5
#define OTHER 6
#define SUB 7
#define DIV 8

/////////////////////////////////////////////////////////////////////////////
// CCalculator command target

class CCalculator : public CCmdTarget
{
	DECLARE_DYNCREATE(CCalculator)
	CCalculator();           // protected constructor used by dynamic creation

// Attributes
public:
 int lookahead;
 int pCur;
 int yylval;
 char string[200];
// Operations
public:
     int yylex();
     void Match(int t);
     long T();
     long E_(int *AFlag);
     long E();
	 long E_();
     long T_();
     long F();
     long T_(int *AFlag);
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCalculator)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CCalculator();

	// Generated message map functions
	//{{AFX_MSG(CCalculator)
		// 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_CALCULATOR_H__C3A7ABB0_113D_4529_969E_B216CE8DC700__INCLUDED_)


⌨️ 快捷键说明

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