coan 4.2.4
|
![]() |
Files | |
file | integer_constant.c |
file | integer_constant.h |
Functions | |
int_spec_t | eval_numeral (char const *num, char const **numend) |
int_spec_t | eval_character_constant (char const **cpp) |
int_spec_t eval_character_constant | ( | char const ** | cpp | ) |
Consume an character constant from a buffer, returning its integer value as an int_spect_t.
cpp | Pointer to the address of the putative character constant. On return, the address of the next unconsumed character is stored here. |
Definition at line 516 of file integer_constant.c.
References char_escape_val(), chew_continuation(), decode_utf8(), eval_hex_character_constant(), eval_octal_character_constant(), GRIPE_CHAR_CONSTANT_TOO_LONG, GRIPE_MULITBYTE_CHAR_CONSTANT, GRIPE_UNCLOSED_QUOTE, INT_INSOLUBLE, INT_INT, INT_SPEC_INITOR, report(), int_spec::type, and int_spec::val.
Referenced by eval_unary().
int_spec_t eval_numeral | ( | char const * | num, |
char const ** | numend | ||
) |
Evaluate a string as a numeral.
num | The putative numeral, 0-terminated. |
numend | The address terminating any valid numeral is stored here on return. |
The parsed numeral is attributed type signed long long unless an unsigned or narrower type is expressly indicated.
The numeral may include any of the type-indicating suffixes 'L', 'LL' 'UL', 'LU', 'ULL', 'LLU' or their case-variants.
The numeral may begin with a minus or plus sign. If a minus sign is found it overrides any indication that the value is unsigned.
If the number N of characters *numend - num is > 0 at return then then those N characters comprise the evaluated numeral. If *numend != 0 then the 0-terminated string at num is not a valid numeral, and if N == 0 then no numeral was parsed.
The string "0x" or "0X" is parsed as a valid numeral "0" followed by 'x' or 'X'.
Definition at line 387 of file integer_constant.c.
References chew_continuation(), eval_numeral_helper(), GRIPE_FORCED_UNSIGNED, GRIPE_INT_OVERFLOW, INT_INSOLUBLE, INT_INT, INT_LLONG, INT_LONG, INT_TOO_BIG, INT_UINT, INT_ULLONG, INT_ULONG, INT_UNION_INITOR, IS_SIGNED, MAKE_UNSIGNED, release(), report(), int_spec::type, and int_spec::val.
Referenced by eval_unary().