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

#include <reference.h>

Inheritance diagram for reference:
expansion_base explained_expansion unexplained_expansion

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_listargs ()
 

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

reference::reference ( symbol::locator  loc,
reference const *  invoker = nullptr 
)
inlineexplicit

Construct given a symbol locator.

Parameters
locLocator of the referenced symbol
invokerPointer 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.

template<class CharSeq >
reference::reference ( symbol::locator  loc,
chewer< CharSeq > &  chew,
reference const *  invoker = nullptr 
)
inline

Construct given a symbol locator, a chewer<CharSeq>, and optional parent reference.

Template Parameters
CharSeqA character-sequence type
Parameters
locLocator of the referenced symbol.
chewOn 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.
invokerPointer to the symbol reference, if any, in whose resolution the symbol is referenced,

Definition at line 105 of file reference.h.

Member Function Documentation

reference_cache::entry reference::expand ( bool  explain)
protected

Expand the reference.

Parameters
explainTrue if the --explain option is operative.
Returns
A reference_cache::entry recording the expansion.

Definition at line 115 of file reference.cpp.

reference::insert_result reference::lookup ( )
protected

Lookup the reference in the cache.

If the reference is not found in the cache it is inserted now.

Returns
A 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.

bool reference::operator== ( reference const &  other) const
inline

Equality.

Parameters
otherA reference compared with *this.
Returns
True iff 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.

evaluation reference::validate ( ) const
protected

Diagnose a syntactically invalid reference.

Returns
An evaluation that is set insoluble if the reference is syntactically invalid.

Definition at line 212 of file reference.cpp.


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