coan
6.0.1
A C/C++ Configuration Analyzer
|
Encapsulates a directive of a given type. More...
#include <directive.h>
Public Member Functions | |
virtual | ~directive ()=default |
Destructor. | |
directive (std::string const &arg) | |
Explicitly construct a directive from a directive body. More... | |
std::string const & | argument () const |
Get the body of the directive. | |
virtual void | report () |
Report the directive. | |
bool | reported () const |
Say whether the directive has been reported. | |
void | set_reported (bool reported=true) |
Set the status of the directive as reported or unreported. | |
Static Public Attributes | |
static directive_type const | _type_ = Type |
The directive_type of this class. | |
Protected Types | |
using | directives_table = std::map< std::string, bool > |
Type of global lookup table for directives of this type. More... | |
using | table_entry = directives_table::value_type |
Type of entry in directives_table . | |
Static Protected Member Functions | |
static line_type | eval (chewer< parse_buffer > &chew) |
Evaluate a directive of this type. More... | |
static directives_table::iterator | insert (std::string const &arg) |
Insert a directive into the global lookup table. More... | |
![]() | |
static void | report (std::string const &keyword, std::string const &arg) |
Report a directive. More... | |
static void | report (bool seen, std::string const &keyword, std::string const &arg) |
Report a directive. More... | |
static line_type | eval (directive_type type, chewer< parse_buffer > &chew) |
Evaluate a directive. More... | |
static line_type | eval_ifdef_or_ifndef (directive_type type, chewer< parse_buffer > &chew) |
Evaluate an #ifdef or #ifndef directive. More... | |
Protected Attributes | |
directives_table::iterator | _loc |
An iterator locating this directive in the global lookup table. | |
Static Protected Attributes | |
static std::string const | _keyword_ |
The keyword for directives of the type. | |
static directives_table | _directives_tab_ |
The global lookup table for directives of this type. | |
Friends | |
struct | directive_base |
Additional Inherited Members | |
![]() | |
static line_type | eval (std::string keyword, chewer< parse_buffer > &chew) |
Evaluate a directive. More... | |
static void | erase_all () |
Forget all directives table used by the operative command. | |
Encapsulates a directive of a given type.
template struct directive<Type>
encapsulates a directive of a given type and provides a global lookup container for tracking occurrences of directives of that type.
The class template supports the coan commands that report occurrences of directives. The container is keyed by the canonicalised text of directive occurrence. Storing the directive occurrences in canonicalised form enables occurrences to be compared regardless of insignificant differences of whitespace or comments.
Type | The directive_type of directives contained by this class. |
Definition at line 141 of file directive.h.
|
protected |
Type of global lookup table for directives of this type.
The container maps the canonicalized text of the directive to a bool
indicating whether the directive has been reported.
Definition at line 196 of file directive.h.
|
inlineexplicit |
Explicitly construct a directive from a directive body.
arg | The directive body. |
Definition at line 154 of file directive.h.
|
staticprotected |
Evaluate a directive of this type.
chew | On entry, a chewer<parse_buffer> positioned to the offset in the associated parse_buffer from which to scan. On return chew is positioned to the first offset not consumed. |
line_type
determined by evaluation denoting the action to be taken on this line.
|
inlinestaticprotected |
Insert a directive into the global lookup table.
arg | The body of the directive. |
Definition at line 205 of file directive.h.