coan 4.2.4
|
![]() |
Modules | |
Macro-generated code | |
Files | |
file | directives_tally.c |
file | directives_tally.h |
Enumerations | |
enum | directive_type_t { HASH_UNKNOWN, HASH_IF, HASH_IFDEF, HASH_IFNDEF, HASH_ELSE, HASH_ELIF, HASH_ENDIF, HASH_DEFINE, HASH_UNDEF, HASH_INCLUDE, HASH_PRAGMA, HASH_ERROR, HASH_COUNT } |
Functions | |
void | directive_tally (canonical_string_const_h cl, directive_type_t directive_type) |
directive_type_t | get_directive_type (char const **keyword) |
char const * | get_directive_keyword (directive_type_t directive_type) |
enum directive_type_t |
Symbolic constants for types of directives
Definition at line 50 of file directives_tally.h.
void directive_tally | ( | canonical_string_const_h | cl, |
directive_type_t | directive_type | ||
) |
Tally an occurrence of a preprocessor directive argument.
cl | A canonical string containg the directive argument. |
directive_type | The type of directive found with arg. |
Arguments of directives are stored, differentiated by directive type, in the lookup tables in canonical_string_h form. arg is looked up by forming a canonical_string_h from arg and searching the table associated with directive_type for that cleaned line.
If no argument matching arg exists in in the lookup table for directive_type then the new canonical_string_h is added to the table.
The occurrence of the arg
is reported on stdout if the same argument has not already been recorded for directive_type or if --once
is not in effect.
Definition at line 179 of file directives_tally.c.
References directive_text_add(), directive_text_lookup(), GET_PUBLIC, and report_directive().
Referenced by eval_free_form_directive(), eval_hash_define(), and eval_hash_undef().
char const* get_directive_keyword | ( | directive_type_t | directive_type | ) |
Get the preprocessor keyword associated with a given directive type.
directive_type | Type of directive for which the keyword is required. |
Definition at line 167 of file directives_tally.c.
References directives_dict, HASH_UNKNOWN, directive::keyword, and directive::type.
Referenced by report_directive().
directive_type_t get_directive_type | ( | char const ** | keyword | ) |
Determine the type of a putative directive.
keyword | On entry, a pointer to the address of the putative directve. On return, stores the address of the character just passed the matched directive, if any is matched; otherwise unchanged. |
Definition at line 155 of file directives_tally.c.
References directives_dict, HASH_UNKNOWN, directive::keyword, match_keyword(), and directive::type.
Referenced by eval_line().