21 #ifndef LITERAL_VALUE_H
22 #define LITERAL_VALUE_H
137 static std::string strip_quotes(
const std::string &lexeme,
char quote);
Helper class for representing literal values (integer, character, and string).
Definition: literal_value.h:45
static LiteralValue from_str_literal(const std::string &lexeme, const Location &loc)
Create a LiteralValue from the lexeme of a string literal token.
Definition: literal_value.cpp:197
LiteralValue()
Default constuctor. The LiteralValueKind is set to NONE.
Definition: literal_value.cpp:26
bool is_unsigned() const
Check whether an INTEGER value is unsigned.
Definition: literal_value.cpp:121
char get_char_value() const
Get the character value of an CHAR literal value.
Definition: literal_value.cpp:88
bool is_long() const
Check whether an INTEGER value is long.
Definition: literal_value.cpp:126
int64_t get_int_value() const
Get the integer value of an INTEGER literal value.
Definition: literal_value.cpp:83
std::string get_str_value() const
Get the string value of an STRING literal value.
Definition: literal_value.cpp:94
LiteralValueKind get_kind() const
Get the LiteralValueKind of this literal value.
Definition: literal_value.cpp:79
std::string get_str_value_escaped() const
Get the true value of a STRING literal value (as opposed to the contents of the original string liter...
Definition: literal_value.cpp:99
static LiteralValue from_char_literal(const std::string &lexeme, const Location &loc)
Create a LiteralValue from the lexeme of a character literal token.
Definition: literal_value.cpp:131
static LiteralValue from_int_literal(const std::string &lexeme, const Location &loc)
Create a LiteralValue from the lexeme of a integer literal token.
Definition: literal_value.cpp:161
LiteralValue & operator=(const LiteralValue &rhs)
Assignment operator.
Definition: literal_value.cpp:68
Definition: location.h:26
LiteralValueKind
Kinds of literal values.
Definition: literal_value.h:35