token.cpp
来自「a basic interpreter free basic」· C++ 代码 · 共 46 行
CPP
46 行
#include "StdAfx.h"
#include "Token.h"
CToken::CToken(void)
: m_TokenType(T_NONE),
m_Lexeme("")
{
}
CToken::~CToken(void)
{
this->m_Lexeme.clear();
}
// Construct the token to populate
CToken::CToken(tokentype_t TokenType, string Lexeme)
: m_TokenType(TokenType),
m_Lexeme(Lexeme)
{
}
// Set the token type
void CToken::SetTokenType(tokentype_t TokenType)
{
this->m_TokenType = TokenType;
}
// Get the token type
tokentype_t CToken::GetTokenType(void)
{
return this->m_TokenType;
}
// Set the token lexeme
void CToken::SetLexeme(string Lexeme)
{
this->m_Lexeme = Lexeme;
}
// Get the token lexeme
string CToken::GetLexeme(void)
{
return this->m_Lexeme;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?