36 #ifndef _EMBEDDED_RPC__TOKEN_H_ 37 #define _EMBEDDED_RPC__TOKEN_H_ 40 #include "smart_ptr.h" 207 const char *getTokenName()
const;
214 bool isNumberTok()
const;
221 bool isIdentifierTok()
const;
236 bool hasValue()
const {
return m_value.get() !=
nullptr; }
284 const std::string &getStringValue()
const;
297 uint64_t getIntValue()
const;
355 bool isBinaryOp()
const;
360 smart_ptr<Value> m_value;
366 #endif // _EMBEDDED_RPC__TOKEN_H_ ~Token()
Destructor.
Definition: Token.h:178
Token(int token, Value *value, const token_loc_t &loc)
Constructor.
Definition: Token.h:141
void setValue(Value *val)
This function set token value.
Definition: Token.h:271
int m_lastLine
Definition: Token.h:55
Token(int token, Value *value)
Constructor.
Definition: Token.h:120
Value * getValue()
This function returns token value.
Definition: Token.h:247
int getLastLine() const
This function returns last line of token from token location (location from analyzed file)...
Definition: Token.h:346
int m_firstLine
Definition: Token.h:53
void setToken(int tok)
This function set token number.
Definition: Token.h:198
void setLocation(const token_loc_t &loc)
This function set token location (location from analyzed file).
Definition: Token.h:318
Abstract base class for values of arbitrary types.
Definition: Value.h:47
Token(int token)
Constructor.
Definition: Token.h:100
const token_loc_t & getLocation() const
This function returns token location (location from analyzed file).
Definition: Token.h:309
token_loc_t & operator=(const token_loc_t &other)=default
Default assign operator.
bool hasValue() const
This function return true/false, when token has/hasn't value.
Definition: Token.h:236
int m_lastChar
Definition: Token.h:56
Encapsulates all information about a token.
Definition: Token.h:86
const Value * getValue() const
This function returns const token value.
Definition: Token.h:258
int getToken() const
This function returns token number.
Definition: Token.h:189
int m_firstChar
Definition: Token.h:54
Token location in the source file.
Definition: Token.h:51
int getFirstLine() const
This function returns first line of token from token location (location from analyzed file)...
Definition: Token.h:336