📄 token.cpp
字号:
/******************************************************************************
文件名 :Token.cpp
版本号 : 1.0
作者 : Amos Peng
生成日期 :2008-07-08
最近修改 :
功能描述 :运算符
函数列表 :
*******************************************************************************/
#include "Token.h"
using namespace ExprEval;
// Constructor
CToken::CToken(TokenType type, ::std::string::size_type start, ::std::string::size_type end) :
m_type(type),
m_start(start),
m_end(end)
{
}
// Construct identifier token
CToken::CToken(const ::std::string &ident, ::std::string::size_type start, ::std::string::size_type end) :
m_type(CToken::TypeIdentifier),
m_ident(ident),
m_start(start),
m_end(end)
{
}
// Construct value token
CToken::CToken(double value, string::size_type start, string::size_type end) :
m_type(CToken::TypeValue),
m_value(value),
m_start(start),
m_end(end)
{
}
// Get type
CToken::TokenType CToken::GetType() const
{
return m_type;
}
// Get identifier
const ::std::string& CToken::GetIdentifier() const
{
return m_ident;
}
// Get value
double CToken::GetValue() const
{
return m_value;
}
// Get start
::std::string::size_type CToken::GetStart() const
{
return m_start;
}
::std::string::size_type CToken::GetEnd() const
{
return m_end;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -