coan  6.0.1
A C/C++ Configuration Analyzer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
unexplained_expansion Struct Reference

struct unexplained_expansion encapsulates macro-expansion of a reference where the --explain option is inoperative. More...

#include <unexplained_expansion.h>

Inheritance diagram for unexplained_expansion:
expansion_base reference

Public Member Functions

 unexplained_expansion (reference const &ref)
 Construct from a reference.
 
unsigned expand () override
 Perform the unexplained expansion of the reference. More...
 
void throw_self () const override
 Throw *this.
 
- Public Member Functions inherited from expansion_base
 expansion_base (reference const &ref)
 Construct from a reference.
 
std::string const & value () const
 Get the current expanded value of the reference.
 
std::string const & invocation () const override
 Get a string representing the invocation of the reference with the current expansions of its arguments.
 
- Public Member Functions inherited from reference
 reference (symbol::locator loc, reference const *invoker=nullptr)
 Construct given a symbol locator. More...
 
 reference (symbol::locator loc, argument_list const &args, reference const *invoker=nullptr)
 Construct given a symbol locator argument_list and optional parent reference.
 
template<class CharSeq >
 reference (symbol::locator loc, chewer< CharSeq > &chew, reference const *invoker=nullptr)
 Construct given a symbol locator, a chewer<CharSeq>, and optional parent reference. More...
 
bool operator== (reference const &other) const
 Equality. More...
 
bool operator!= (reference const &other) const
 Inequality.
 
std::string const & id () const
 Get the name of the symbol referenced.
 
std::string const & expansion ()
 Get the expansion of the reference.
 
evaluation const & eval ()
 Get the evaluation of the expansion.
 
bool reported ()
 Say whether this reference has been reported.
 
bool complete ()
 Say whether this reference has been fully expanded.
 
void report ()
 Report this reference appropriately.
 
symbol::locator const & callee () const
 Get a [const] the state of the referenced symbol.
 
symbol::locator callee ()
 
argument_list const & args () const
 Get a [const] reference to the argument_list of the reference.
 
argument_listargs ()
 

Protected Member Functions

unsigned expand (std::string &str) override
 Expand a string, returning the number of edits applied.
 
- Protected Member Functions inherited from expansion_base
void set_expansion_flags ()
 Assign the expand-flags of the reference's arguments, if any, in accordance with the definition, if any, of the referenced symbol. More...
 
size_t seek_expandable_arg ()
 Seek to the next argument of the reference, if any, that is eligible for expansion, returning its index if found, else args.size()
 
void edit (std::string &str, size_t at, size_t len, std::string const &replacement)
 
unsigned edit_buf (std::string &str, expansion_base const &e, size_t off=0)
 Replace all remaining occurrences of a reference throughout a string. More...
 
unsigned edit_trailing_args (expansion_base const &e, size_t start=0)
 Replace all occurrences of a reference throughout a terminal segment of this expansions's arguments. More...
 
bool args_expansion_done () const
 Say whether all arguments are fully expanded.
 
bool substitute ()
 Substitute the fully expanded arguments into the definition of the reference, returning true if the current value of the expansion is changed.
 
- Protected Member Functions inherited from reference
bool explain () const
 Say whether we are to explain this reference.
 
bool explaining () const
 Say whether this reference is to be explained or is descended from one being explained.
 
bool reportable () const
 Say whether this reference is eligible for reporting.
 
void do_report ()
 Do reporting of the reference if reportable.
 
reference_cache::iterator lower_bound () const
 Get a lower bound to this reference in the reference cache.
 
reference_cache::insert_result lookup ()
 Lookup the reference in the cache. More...
 
reference_cache::value_type digest ()
 Return a cache entry for this reference.
 
reference_cache::entry expand (bool explain)
 Expand the reference. More...
 
evaluation validate () const
 Diagnose a syntactically invalid reference. More...
 

Additional Inherited Members

- Public Types inherited from reference
using insert_result = reference_cache::insert_result
 Type of result from cache insertion.
 
- Static Public Member Functions inherited from expansion_base
static std::unique_ptr
< expansion_base
factory (bool explain, reference const &ref)
 Global factory of subclasses of expansion_base More...
 
static constexpr unsigned max_expansion_size ()
 Cut-off size for macro-expansions.
 
- Protected Attributes inherited from expansion_base
std::string _value
 The current expanded value.
 
size_t _cur_arg = 0
 Index of the first argument not yet fully expanded.
 
- Protected Attributes inherited from reference
symbol::locator _referee
 The symbol_state of the referenced symbol.
 
argument_list _args
 The argument_list of the reference.
 
reference const * _invoker
 Pointer to the reference that invokes this one, if any, else null.
 
std::string _key
 Key to this reference in the reference cache.
 

Detailed Description

struct unexplained_expansion encapsulates macro-expansion of a reference where the --explain option is inoperative.

Definition at line 50 of file unexplained_expansion.h.

Member Function Documentation

unsigned unexplained_expansion::expand ( )
overridevirtual

Perform the unexplained expansion of the reference.

Returns
The number of edits applied.

Implements expansion_base.


The documentation for this struct was generated from the following file: