coan 4.2.4
|
![]() |
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) |
static int char_escape_val | ( | char const ** | cpp | ) | [static] |
Consume a possibly escaped ASCII character from a buffer returning its escaped value.
cpp | Pointer 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. |
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().
static unsigned long long decode_utf8 | ( | char const ** | cpp | ) | [static] |
Decode an UTF-8 encoded character from a buffer, ignoring embedded line-continautions.
cpp | On 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. |
Definition at line 123 of file integer_constant.c.
References chew_continuation().
Referenced by eval_character_constant().
static unsigned long long eval_hex_character_constant | ( | char const ** | cpp | ) | [static] |
Consume a hex character constant from a buffer returning its integer value.
cpp | Pointer to the address from which the constant is to be consumed. On return, the address of the next unconsumed character is stored here. |
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().
static unsigned long long eval_numeral_helper | ( | char const ** | pnum, |
unsigned int | base, | ||
bool * | overflow | ||
) | [static] |
Get the integer value of a numeral.
pnum | On entry, pointer to the address of the numeral to evaluate. On return, the address of the first unconsumed character. |
base | The arithmetic base in which the numeral is to be evaluated. |
overflow | On return, true is stored here is the integer value of the numeral overflows unsigned long long, else false is stored. |
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().
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.
cpp | Pointer to the address from which the constant is to be consumed. On return, the address of the next unconsumed character is stored here. |
base | The presumed base of the constant, either 8 (octal) or 16 (hex). |
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().
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.
cpp | Pointer to the address from which the constant is to be consumed. On return, the address of the next unconsumed character is stored here. |
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().