coan
6.0.1
A C/C++ Configuration Analyzer
|
#include <reference.h>
Public Types | |
using | insert_result = reference_cache::insert_result |
Type of result from cache insertion. | |
Public Member Functions | |
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. | |
virtual std::string const & | invocation () const |
Get a string representation of the reference. | |
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_list & | args () |
Protected Member Functions | |
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... | |
Protected Attributes | |
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. | |
Class reference
encapsulates a reference of a symbol,
A reference is a use of the symbol, possibly with macro arguments.
Definition at line 56 of file reference.h.
|
inlineexplicit |
Construct given a symbol locator.
loc | Locator of the referenced symbol |
invoker | Pointer to the symbol reference, if any, in whose resolution the symbol is referenced, |
This constructor represents a simple reference to the a symbol, optionallly in the context of resolving the reference's invoker
Definition at line 72 of file reference.h.
|
inline |
Construct given a symbol locator, a chewer<CharSeq>
, and optional parent reference.
CharSeq | A character-sequence type |
loc | Locator of the referenced symbol. |
chew | On entry, a chewer<CharSeq> positioned at the offset in the associated CharSeq from which to scan for an argument list. On return chew is positioned at the first offset not consumed. |
invoker | Pointer to the symbol reference, if any, in whose resolution the symbol is referenced, |
Definition at line 105 of file reference.h.
|
protected |
Expand the reference.
explain | True if the --explain option is operative. |
reference_cache::entry
recording the expansion. Definition at line 115 of file reference.cpp.
|
protected |
Lookup the reference in the cache.
If the reference is not found in the cache it is inserted now.
reference_cache::insert_result
whose first element is an iterator to the cache record of this reference and whose second boolean element is true if the reference was inserted and false if there was already a cached record of this reference. Definition at line 67 of file reference.cpp.
|
inline |
Equality.
other | A reference compared with *this . |
other == *this
. References are equal iff they are references of the the same symbol with the same arguments. Definition at line 125 of file reference.h.
|
protected |
Diagnose a syntactically invalid reference.
evaluation
that is set insoluble if the reference is syntactically invalid. Definition at line 212 of file reference.cpp.