eRPC Generator (erpcgen)
Rev. 1.12.0
NXP Semiconductors
|
Encapsulates all information about a token. More...
#include <Token.hpp>
Public Member Functions | |
Token (int token) | |
Constructor. More... | |
Token (int token, Value *value) | |
Constructor. More... | |
Token (int token, Value *value, const token_loc_t &loc) | |
Constructor. More... | |
Token (const Token &other) | |
This function is copy constructor. More... | |
Token & | operator= (const Token &other) |
This function copy data from one token to other token with using assigned operator. More... | |
~Token () | |
Destructor. | |
Token | |
int | getToken () const |
This function returns token number. More... | |
void | setToken (int tok) |
This function set token number. More... | |
const char * | getTokenName () const |
This function returns token name. More... | |
bool | isNumberTok () const |
Returns true if token is an integer or float literal. More... | |
bool | isIdentifierTok () const |
Returns true if token is an identifier. More... | |
Value | |
bool | hasValue () const |
This function return true/false, when token has/hasn't value. More... | |
Value * | getValue () |
This function returns token value. More... | |
const Value * | getValue () const |
This function returns const token value. More... | |
void | setValue (Value *val) |
This function set token value. More... | |
const std::string & | getStringValue () const |
This function returns string value. More... | |
uint64_t | getIntValue () const |
This function returns integer value. More... | |
Location | |
const token_loc_t & | getLocation () const |
This function returns token location (location from analyzed file). More... | |
void | setLocation (const token_loc_t &loc) |
This function set token location (location from analyzed file). More... | |
void | setLocation (const token_loc_t &first, const token_loc_t &last) |
This function set token location (location from analyzed file). More... | |
int | getFirstLine () const |
This function returns first line of token from token location (location from analyzed file). More... | |
int | getLastLine () const |
This function returns last line of token from token location (location from analyzed file). More... | |
bool | isBinaryOp () const |
This function returns last line of token from token location (location from analyzed file). More... | |
Encapsulates all information about a token.
|
inlineexplicit |
Constructor.
This function set token number for this object to given token number.
[in] | token | Given token number. |
|
inline |
Constructor.
This function set token number to given token number and value to given value for this object.
[in] | token | Given token number. |
[in] | value | Pointer to given value. |
|
inline |
Constructor.
This function set token number to given token number, value to given value and location in file to given location for this object.
[in] | token | Given token number. |
[in] | value | Pointer to given value. |
[in] | loc | Struct with token location in file. |
|
explicit |
This function is copy constructor.
This function copy value from given token to new token, when his constructor is called (when token variable is declared).
[in] | other | Token, which values are copied to this object. |
|
inline |
This function returns first line of token from token location (location from analyzed file).
uint64_t Token::getIntValue | ( | ) | const |
This function returns integer value.
The function returns integer value converted from type value.
internal_error | Thrown if variable m_value is null. |
|
inline |
This function returns last line of token from token location (location from analyzed file).
|
inline |
This function returns token location (location from analyzed file).
const string & Token::getStringValue | ( | ) | const |
This function returns string value.
The function returns string value converted from type value.
internal_error | Thrown if variable m_value is null. |
|
inline |
const char * Token::getTokenName | ( | ) | const |
This function returns token name.
The function returns token name for current token.
|
inline |
This function returns token value.
|
inline |
This function returns const token value.
|
inline |
This function return true/false, when token has/hasn't value.
true | When token has value. |
false | When token hasn't value. |
bool Token::isBinaryOp | ( | ) | const |
This function returns last line of token from token location (location from analyzed file).
true | Return true when token means binary operation. |
false | Return false when token doesn't mean binary operation. |
bool Token::isIdentifierTok | ( | ) | const |
Returns true if token is an identifier.
True | when token is identifier type, else false. |
bool Token::isNumberTok | ( | ) | const |
Returns true if token is an integer or float literal.
True | when token is number type, else false. |
This function copy data from one token to other token with using assigned operator.
The function copy all necessary data from token at right side to token at left side, which are separated by operator "=".
[in] | other | Token, which values are copied to this object. |
|
inline |
This function set token location (location from analyzed file).
[in] | loc | Token location (location from analyzed file). |
void Token::setLocation | ( | const token_loc_t & | first, |
const token_loc_t & | last | ||
) |
|
inline |
|
inline |
This function set token value.
The function set token value for current token.
[in] | val | Pointer to given value. |