10 #ifndef _EMBEDDED_RPC__TOKEN_H_ 11 #define _EMBEDDED_RPC__TOKEN_H_ 14 #include "smart_ptr.h" 181 const char *getTokenName()
const;
188 bool isNumberTok()
const;
195 bool isIdentifierTok()
const;
210 bool hasValue()
const {
return m_value.get() !=
nullptr; }
258 const std::string &getStringValue()
const;
271 uint64_t getIntValue()
const;
329 bool isBinaryOp()
const;
334 smart_ptr<Value> m_value;
340 #endif // _EMBEDDED_RPC__TOKEN_H_ ~Token()
Destructor.
Definition: Token.h:152
Token(int token, Value *value, const token_loc_t &loc)
Constructor.
Definition: Token.h:115
void setValue(Value *val)
This function set token value.
Definition: Token.h:245
int m_lastLine
Definition: Token.h:29
Token(int token, Value *value)
Constructor.
Definition: Token.h:94
Value * getValue()
This function returns token value.
Definition: Token.h:221
int getLastLine() const
This function returns last line of token from token location (location from analyzed file)...
Definition: Token.h:320
int m_firstLine
Definition: Token.h:27
void setToken(int tok)
This function set token number.
Definition: Token.h:172
void setLocation(const token_loc_t &loc)
This function set token location (location from analyzed file).
Definition: Token.h:292
Abstract base class for values of arbitrary types.
Definition: Value.h:21
Token(int token)
Constructor.
Definition: Token.h:74
const token_loc_t & getLocation() const
This function returns token location (location from analyzed file).
Definition: Token.h:283
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:210
int m_lastChar
Definition: Token.h:30
Encapsulates all information about a token.
Definition: Token.h:60
const Value * getValue() const
This function returns const token value.
Definition: Token.h:232
int getToken() const
This function returns token number.
Definition: Token.h:163
int m_firstChar
Definition: Token.h:28
Token location in the source file.
Definition: Token.h:25
int getFirstLine() const
This function returns first line of token from token location (location from analyzed file)...
Definition: Token.h:310