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

Files

file  integer_constant.c

Functions

static int char_escape_val (char const **cpp)
static unsigned long long decode_utf8 (char const **cpp)
static unsigned long long eval_numeral_helper (char const **pnum, unsigned int base, bool *overflow)
static unsigned long long eval_numerical_character_constant (char const **cpp, int base)
static unsigned long long eval_octal_character_constant (char const **cpp)
static unsigned long long eval_hex_character_constant (char const **cpp)

Function Documentation

static int char_escape_val ( char const **  cpp) [static]

Consume a possibly escaped ASCII character from a buffer returning its escaped value.

Parameters:
cppPointer to the address from which a character is to be consumed. On return, the address of the next unconsumed character is stored here. A null character will not be consumed.
Returns:
The integer value of the possibly escaped character consumed, if any, else EOF.

If cpp addresses the escape character '\' on entry then that character is consumed and, if the next character is non-null, its escaped value is returned: if the next character is null then EOF is returned.

If cpp does not address the escape character on entry then, if *cpp is non-null, its integer value is returned: if *cpp is null then EOF is returned.

Definition at line 71 of file integer_constant.c.

References chew_continuation().

Referenced by eval_character_constant().

Here is the call graph for this function:

static unsigned long long decode_utf8 ( char const **  cpp) [static]

Decode an UTF-8 encoded character from a buffer, ignoring embedded line-continautions.

Parameters:
cppOn entry, a pointer to the address of the first byte to to be decoded. On return, stores the address of the first byte not decoded.
Returns:
The integer value of the UTF-8 character parsed, or ULLONG_MAX if none is parsed.

Definition at line 123 of file integer_constant.c.

References chew_continuation().

Referenced by eval_character_constant().

Here is the call graph for this function:

static unsigned long long eval_hex_character_constant ( char const **  cpp) [static]

Consume a hex character constant from a buffer returning its integer value.

Parameters:
cppPointer to the address from which the constant is to be consumed. On return, the address of the next unconsumed character is stored here.
Returns:
The integer value of the hex constant, if a hex constant is found, else ULONG_MAX.

It is assumed that the possible hex constant at *cpp is enclosed in single quotes and that *cpp on entry addresses the opening quote. If parsing of a hex constant does not conume a closing quote then nothing is consumed from the buffer

Definition at line 377 of file integer_constant.c.

References eval_numerical_character_constant().

Referenced by eval_character_constant().

Here is the call graph for this function:

static unsigned long long eval_numeral_helper ( char const **  pnum,
unsigned int  base,
bool overflow 
) [static]

Get the integer value of a numeral.

Parameters:
pnumOn entry, pointer to the address of the numeral to evaluate. On return, the address of the first unconsumed character.
baseThe arithmetic base in which the numeral is to be evaluated.
overflowOn return, true is stored here is the integer value of the numeral overflows unsigned long long, else false is stored.
Returns:
The integer value of the numeral as unsigned long long, if it is representable as such. The returned value is not valid if overflow occurred/

The function consumes characters after num for as long as they can form part of a numeral with the indicated base.

Definition at line 216 of file integer_constant.c.

References chew_continuation().

Referenced by eval_numeral(), and eval_numerical_character_constant().

Here is the call graph for this function:

static unsigned long long eval_numerical_character_constant ( char const **  cpp,
int  base 
) [static]

Consume a numerically encoded character constant from a buffer returning its integer value.

Parameters:
cppPointer to the address from which the constant is to be consumed. On return, the address of the next unconsumed character is stored here.
baseThe presumed base of the constant, either 8 (octal) or 16 (hex).
Returns:
The integer value of encoded constant, if any is found, else ULONG_MAX.

It is assumed that the possible constant at *cpp is enclosed in single quotes and that *cpp on entry addresses the opening quote. If parsing of an encoded constant does not conume a closing quote then nothing is consumed from the buffer

Definition at line 317 of file integer_constant.c.

References chew_continuation(), and eval_numeral_helper().

Referenced by eval_hex_character_constant(), and eval_octal_character_constant().

Here is the call graph for this function:

static unsigned long long eval_octal_character_constant ( char const **  cpp) [static]

Consume a an octal character constant from a buffer returning its integer value.

Parameters:
cppPointer to the address from which the constant is to be consumed. On return, the address of the next unconsumed character is stored here.
Returns:
The integer value of the octal constant, if an octal constant is found, else ULONG_MAX.

It is assumed that the possible octal constant at *cpp is enclosed in single quotes and that *cpp on entry addresses the opening quote. If parsing of an octal constant does not conume a closing quote then nothing is consumed from the buffer

Definition at line 359 of file integer_constant.c.

References eval_numerical_character_constant().

Referenced by eval_character_constant().

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines