?? stackmachine.h
字號:
//
// Graphite For WinCE(Pocket PC)
// Initially Written By Hyouck "Hawk" Kim, peakhunt@yahoo.com
// 2002, All Rights Reserved
//
// This is GPLed, open source based, software development project.
// For more question about GPL,
// visit http://www.gnu.org/licenses/gpl.txt
//
//
// Revision History
// Nov/30/2002, Initial Release hkim
//
//
// StackMachine.h: interface for the CStackMachine class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_STACKMACHINE_H__AEFEABD1_5B18_41FC_BFC8_5888AB4D347E__INCLUDED_)
#define AFX_STACKMACHINE_H__AEFEABD1_5B18_41FC_BFC8_5888AB4D347E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//
// Alas...
// On WinCE, STL is not yet provided...
//
class CMathToken;
struct CStackElement
{
double val;
struct CStackElement* next;
};
struct CListElement
{
CMathToken* token;
struct CListElement* next;
};
class CStacmMachine;
class CTokenList
{
public:
friend class CStackMachine;
CTokenList();
~CTokenList();
void addTail(CMathToken* elem);
private:
struct CListElement* m_head;
struct CListElement* m_tail;
};
class CSimpleStack
{
public:
CSimpleStack();
~CSimpleStack();
bool isEmpty();
double pop(void);
void push(double val);
private:
struct CStackElement* m_top;
};
class CStackMachine
{
public:
double mathFunc(double variable[2], int len, CString func);
double mathOP(double variable[2], int len, CString& op);
void changeFormula(CTokenList* list);
CStackMachine();
virtual ~CStackMachine();
double execute(double x);
bool isValid(void) { return m_valid; }
private:
CTokenList* m_list;
bool m_valid;
};
#endif // !defined(AFX_STACKMACHINE_H__AEFEABD1_5B18_41FC_BFC8_5888AB4D347E__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -