78 static void report(std::string
const & keyword, std::string
const & arg);
88 static void report(
bool seen,
89 std::string
const & keyword, std::string
const & arg);
140 template<directive_type Type>
205 static directives_table::iterator
insert(std::string
const & arg) {
210 directives_table::iterator
_loc;
directive(std::string const &arg)
Explicitly construct a directive from a directive body.
directives_table::iterator _loc
An iterator locating this directive in the global lookup table.
static void report(std::string const &keyword, std::string const &arg)
Report a directive.
static std::map< std::string, directive_type > _keyword_to_type_map_
Map from keywords to directive types.
line_type(*)(chewer< parse_buffer > &) evaluator
Type of evaluation functions applied to directive bodies.
Encapsulates a directive of a given type.
bool reported() const
Say whether the directive has been reported.
static line_type eval_ifdef_or_ifndef(directive_type type, chewer< parse_buffer > &chew)
Evaluate an #ifdef or #ifndef directive.
virtual ~directive()=default
Destructor.
static directives_table::iterator insert(std::string const &arg)
Insert a directive into the global lookup table.
static std::string const _keyword_
The keyword for directives of the type.
static line_type eval(std::string keyword, chewer< parse_buffer > &chew)
Evaluate a directive.
void set_reported(bool reported=true)
Set the status of the directive as reported or unreported.
static directive_type const _type_
The directive_type of this class.
virtual void report()
Report the directive.
static line_type eval(chewer< parse_buffer > &chew)
Evaluate a directive of this type.
A utility class to prevent copying of containing class.
directive_type
Symbolic constants denoting types of directives.
static directive_type get_type(std::string const &keyword)
Get the directive_type of a directive given a keyword.
static directives_table _directives_tab_
The global lookup table for directives of this type.
template struct directive_base is a base for specializations of template struct directive<Type> ...
directives_table::value_type table_entry
Type of entry in directives_table.
std::map< std::string, bool > directives_table
Type of global lookup table for directives of this type.
static std::vector< evaluator > _evaluator_tab_
Table of evaluation functions for directive types, indexed by directive_type.
`template struct chewer<CharSeq> is a cursor-like type that is associated with a character-sequence t...
line_type
Enumeration of types of input lines.
static void erase_all()
Forget all directives table used by the operative command.
std::string const & argument() const
Get the body of the directive.