coan 4.2.4
|
![]() |
typedef bool(* canonical_string_char_validator_t)(char ch, canonical_string_const_h cs) |
Type of function to validate characters for addition to a canonical string
ch | The character to be tested for eligibility |
cs | The canonical string for which the eligibility of ch is to be tested. |
Definition at line 198 of file canonical_string.c.
static void canonical_string_copy_init | ( | canonical_string_h | dest, |
canonical_string_const_h | src | ||
) | [static] |
Initialise a canonical string from another.
dest | The canonical string to initialise. Is assumed to control only unitialised storage. |
src | The canonical string to be copied. |
dest is initialised as a copy of src
Definition at line 385 of file canonical_string.c.
References clone(), and canonical_string_impl::text.
Referenced by canonical_string_copy().
static void canonical_string_finis | ( | canonical_string_h | cs | ) | [static] |
Finalise a canonical string, releasing the resources of all contained objects
Definition at line 392 of file canonical_string.c.
References canonical_string_impl::text.
Referenced by canonical_string_dispose().
static void canonical_string_init | ( | canonical_string_h | cs, |
char const * | start, | ||
size_t | nbytes, | ||
char const ** | pend | ||
) | [static] |
Initialise a canonical string.
cs | The canonical string to initialise. Is assumed to control only unitialised storage. |
start | On entry, NULL, or else a pointer to the text to be scanned into a canonical string. If NULL, cs is initialised as the empty string. |
nbytes | 0, or the maximum number of bytes that may consumed from start, when start is not NULL. If 0 when start != NULL then strlen(cp) is assumed. |
pend | If not NULL, then the first address not scanned is stored here on return. |
Definition at line 141 of file canonical_string.c.
References canonical_string_parse_next_part(), chew_on(), clone(), reallocate(), SET_PUBLIC, canonical_string_impl::text, and zallocate().
Referenced by canonical_string_new().
static void canonical_string_init_by_test | ( | canonical_string_h | cs, |
char const ** | cpp, | ||
canonical_string_char_validator_t | validator | ||
) | [static] |
Initialise a canonical string to contain all successive non-0 characters at a text pointer. ignoring line-continuations, that satisfy a test.
cs | The canonical string to initialise. |
cpp | On entry, a pointer to the address of the text to be scanned. On return, stores the address of the first scanned character that fails the test or is null. |
validator | Pointer to the function that tests eligibility of characters. |
Definition at line 354 of file canonical_string.c.
References chew_continuation(), reallocate(), and canonical_string_impl::text.
Referenced by canonical_identifier().
static void canonical_string_parse_next_part | ( | char const ** | start, |
size_t * | len | ||
) | [static] |
Parse the next portion of a canonical string.
start | On entry, points to the address of the text to to be parsed. If on return the value stored here is different then it is the address at which parsing of has stopped after consuming characters to be discarded from the canonical form of the text. If the stored value is unchanged then it is the start of some text that belongs to the canonical form. |
len | The value stored here on entry is insignificant. The meaning of the value stored here on return depends upon the value stored at start:- |
The function can be called with start initialised to the address of a string to be parsed into canonical form. On return, start will contain the address to be passed to the next call to continue the parsing, and the appropriate handling of the returned values can be deduced from a comparsion of the entry and return values at start, together with the value returned at len:-
Definition at line 109 of file canonical_string.c.
References chew_continuation(), chew_on(), chew_unbroken_string(), read_offset(), and read_pos().
Referenced by canonical_string_init().
static char const* integer_type_suffix | ( | canonical_string_const_h | cs | ) | [static] |
Get the integer type suffix, if any, from the numeral represented by a canonical string.
cs | The canonical string to scan |
Definition at line 270 of file canonical_string.c.
Referenced by is_valid_digit().
static bool is_decimal_numeral | ( | canonical_string_const_h | cs | ) | [static] |
Say whether a canonical string consists of a decimal numeral
Definition at line 240 of file canonical_string.c.
Referenced by is_valid_digit().
static bool is_hex_numeral | ( | canonical_string_const_h | cs | ) | [static] |
Say whether a canonical string consists of a hex numeral
Definition at line 225 of file canonical_string.c.
Referenced by is_valid_digit().
static bool is_octal_numeral | ( | canonical_string_const_h | cs | ) | [static] |
Say whether a canonical string consists of an octal numeral
Definition at line 210 of file canonical_string.c.
Referenced by is_valid_digit().
static bool is_type_suffix_char | ( | char | ch | ) | [static] |
Say whether a character can appear in the type-suffix to an integer constant
Definition at line 255 of file canonical_string.c.
Referenced by is_valid_digit().
static bool is_valid_digit | ( | char | ch, |
canonical_string_const_h | cs | ||
) | [static] |
Say whether a character can validly be added to a canonical string to form or extend a numeral.
ch | The candidate character. |
cs | The target canonical string. |
A numeral may consist of an decimal, octal or hex constant as recognised by strtol()
with the usual optional type prefixes composed of 'u'/'U' and 'l'/'L'.
Definition at line 291 of file canonical_string.c.
References integer_type_suffix(), is_decimal_numeral(), is_hex_numeral(), is_octal_numeral(), is_type_suffix_char(), and is_zero_digit().
static bool is_valid_symbol_char | ( | char | ch, |
canonical_string_const_h | cs | ||
) | [static] |
Say whether a character can validly be added to a canonical string to form or extend a symbol name.
ch | The candidate character. |
cs | The target canonical string. |
Definition at line 335 of file canonical_string.c.
References is_symbol_inner_char(), and is_symbol_start_char().
Referenced by canonical_identifier().
static bool is_zero_digit | ( | canonical_string_const_h | cs | ) | [static] |
Say whether a canonical string consists just of the digit '0'
Definition at line 202 of file canonical_string.c.
Referenced by is_valid_digit().