coan 4.2.4
The Integer Constant component interface.
Collaboration diagram for The Integer Constant component interface.:

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)

Function Documentation

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.

Parameters:
cppPointer to the address of the putative character constant. On return, the address of the next unconsumed character is stored here.
Returns:
An int_spec_t that represents the integer value of the parsed character constant, or INT_SPEC_INITOR if no constant is parsed.

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().

Here is the call graph for this function:

int_spec_t eval_numeral ( char const *  num,
char const **  numend 
)

Evaluate a string as a numeral.

Parameters:
numThe putative numeral, 0-terminated.
numendThe address terminating any valid numeral is stored here on return.
Returns:
An int_spec_t that represents the integer value of the numeral, unless the value is too big for the explicit or implied type of the numeral.

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().

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines