📄 token.h
字号:
// Token.h: interface for the Token class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_TOKEN_H__54D3F2E2_73B8_4263_87FF_7508EEA45273__INCLUDED_)
#define AFX_TOKEN_H__54D3F2E2_73B8_4263_87FF_7508EEA45273__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <string>
using namespace std;
class Token {
public:
enum {NUM=256, DIV=257, MOD=258, ID=259,
DONE=260, EMPTY=261, NONE=-1 };
// Token's type: NUM, DIV, MOD, ID
// DONE: pseudo type indicate EOF
// NONE: empty token value and token_type is input char
// EMPTY: pseudo type indicate Token object's initial
int type;
int value; // index if type is ID, or keywords(DIV,MOD)
// digit value if type is NUM
// NONE otherwise
Token(int atype, int avalue=Token::NONE);
Token();
bool operator==(const Token& tk) const;
string toStr() const;
};
#endif // !defined(AFX_TOKEN_H__54D3F2E2_73B8_4263_87FF_7508EEA45273__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -