coan 4.2.4
|
![]() |
typedef struct canonical_string_impl const* canonical_string_const_h |
Abstract type of constant canonical string object
Definition at line 54 of file canonical_string.h.
typedef struct canonical_string_impl* canonical_string_h |
Abstract type of canonical string object
Definition at line 51 of file canonical_string.h.
canonical_string_h canonical_identifier | ( | char const ** | cpp | ) |
Construct a new canonical string to contain a symbol name.
cpp | On entry, pointer to the address of the text to be parsed as a symbol name. On return, stores the address of the first scanned character that is not part of an identifier. |
Definition at line 424 of file canonical_string.c.
References canonical_string_init_by_test(), is_valid_symbol_char(), and zallocate().
Referenced by configured_symbol_seek_const(), eval_hash_define(), eval_hash_undef(), eval_line(), eval_possible_symbol(), and eval_unary().
canonical_string_h canonical_numeral | ( | struct int_spec const * | int_spec | ) |
Forward decl
Construct a new canonical string to represent a given integer as a numeral.
Referenced by symbol_resolve().
void canonical_string_appendc | ( | canonical_string_h | cs, |
char | more | ||
) |
Append a character to a canonical string.
cs | The canonical string to be extended. |
more | The character to be appended. |
Definition at line 539 of file canonical_string.c.
References canonical_string_length(), reallocate(), and canonical_string_impl::text.
void canonical_string_appends | ( | canonical_string_h | cs, |
canonical_string_const_h | more, | ||
bool | punct | ||
) |
Append one canonical string to another
cs | The canonical string to be extended. |
more | The canonical string to be appended. |
punct | If true then a punctuating space is appended to cs before more is appended. |
Definition at line 520 of file canonical_string.c.
References canonical_string_assign(), canonical_string_length(), reallocate(), and canonical_string_impl::text.
void canonical_string_assign | ( | canonical_string_h | dest, |
canonical_string_const_h | src | ||
) |
Assign one canonical string to another
Definition at line 459 of file canonical_string.c.
References canonical_string_copy(), canonical_string_dispose(), and canonical_string_swap().
Referenced by canonical_string_appends(), and hash_include_define().
int canonical_string_compare | ( | canonical_string_const_h | lhs, |
void const * | rhs, | ||
size_t | rhslen | ||
) |
Compare a canonical string with another canonical string or region of text.
lhs | First canonical string to be compared. |
rhs | Second canonical string or pointer to text. |
rhslen | If 0 then rhs addresses a second canonical string to be compared with lhs. Otherwise rhs addresses text of length keylen to be compared with the text of lhs. |
Definition at line 481 of file canonical_string.c.
Referenced by directive_text_lookup().
canonical_string_h canonical_string_copy | ( | canonical_string_const_h | src | ) |
Construct a copy of a canonical string.
Definition at line 432 of file canonical_string.c.
References allocate(), and canonical_string_copy_init().
Referenced by canonical_string_assign(), directive_text_lookup(), eval_hash_undef(), hash_include_define(), symbol_copy_init(), and symbol_definition_resolve().
void canonical_string_dispose | ( | canonical_string_h | cs | ) |
Destroy a canonical string
Definition at line 442 of file canonical_string.c.
References canonical_string_finis().
Referenced by canonical_string_assign(), directive_text_lookup(), eval_hash_define(), eval_hash_undef(), eval_line(), eval_result_clear(), eval_unary(), symbol_define(), symbol_definition_resolve(), symbol_resolve(), and symbol_undefine().
bool canonical_string_equal | ( | canonical_string_const_h | lhs, |
canonical_string_const_h | rhs | ||
) |
Say whether two canonical strings are equal
Definition at line 469 of file canonical_string.c.
References eq().
Referenced by hash_include_tally(), symbol_define(), and symbol_equal().
size_t canonical_string_length | ( | canonical_string_const_h | cs | ) |
Get the length of a canonical string
cs | The canonical string to query. |
Definition at line 513 of file canonical_string.c.
Referenced by canonical_string_appendc(), canonical_string_appends(), canonical_string_replace(), canonical_string_substr(), configured_symbol_find(), eval_line(), eval_possible_symbol(), and eval_unary().
canonical_string_h canonical_string_new | ( | char const * | start, |
size_t | nbytes, | ||
char const ** | pend | ||
) |
Construct a new canonical string from given text. The constructed canonical string contains the given text with all comments stripped, all line-continuations joined and all whitespace sequences condensed to a single space.
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 405 of file canonical_string.c.
References canonical_string_init(), and zallocate().
Referenced by eval_free_form_directive(), eval_hash_define(), symbol_define(), and symbol_resolve().
void canonical_string_replace | ( | canonical_string_h | cs, |
size_t | start, | ||
size_t | len, | ||
canonical_string_const_h | subst | ||
) |
Replace a portion of a canonical string
cs | The canonical string to be modified. |
start | The offset in cs of the portion to be replaced. |
len | The length of the portion to be replaced. |
subst | The string to replace the delimited portion. |
Definition at line 560 of file canonical_string.c.
References canonical_string_length(), canonical_string_impl::text, and zallocate().
Referenced by symbol_definition_resolve().
canonical_string_h canonical_string_substr | ( | canonical_string_const_h | cs, |
size_t | start, | ||
size_t | len | ||
) |
Get a substring of a canonical string
cs | The canonical string from which a substring is required. |
start | The offset in cs of the required substring. |
len | The length of the substring. |
Definition at line 548 of file canonical_string.c.
References canonical_string_length(), clone(), canonical_string_impl::text, and zallocate().
void canonical_string_swap | ( | canonical_string_h | lhs, |
canonical_string_h | rhs | ||
) |
Swap two canonical strings
Definition at line 451 of file canonical_string.c.
References PODSWAP, and canonical_string_impl::text.
Referenced by canonical_string_assign(), and symbol_swap().
char const* canonical_string_text | ( | canonical_string_const_h | cs | ) |
Get a pointer to the text of a canonical string
cs | The canonical string to query. |
Definition at line 506 of file canonical_string.c.
Referenced by configured_symbol_find(), configured_symbol_seek_const(), directive_text_lookup(), eval_hash_define(), eval_hash_include(), eval_hash_undef(), eval_line(), eval_possible_symbol(), eval_unary(), report_directive(), report_include(), report_symbol(), report_symbol_configuration(), symbol_definition_resolve(), and symbol_resolve().