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

namespace identifier encloses free functions associated with identifiers More...

Functions

bool is_start_char (char ch)
 Say whether a character can be the first of an identifier.
 
bool is_valid_char (char ch)
 Say whether a character can occur in an identifier.
 
template<class CharSeq >
size_t find_first_in (std::string const &id, chewer< CharSeq > &chew)
 Find the first occurrence of an identifier within a terminal segment a CharSeq More...
 
template<class CharSeq >
std::string find_any_in (chewer< CharSeq > &chew, size_t &off)
 Search a terminal portion of a CharSeq for any identifier. More...
 
template<class CharSeq >
std::string read (chewer< CharSeq > &chew)
 Read an identifier from an chewer<CharSeq> More...
 

Detailed Description

namespace identifier encloses free functions associated with identifiers

Function Documentation

template<class CharSeq >
std::string identifier::find_any_in ( chewer< CharSeq > &  chew,
size_t &  off 
)

Search a terminal portion of a CharSeq for any identifier.

Search a terminal portion of a CharSeq to find the first syntactic occurrence of an identifier (parsed greedily)

Template Parameters
CharSeqA character-sequence type
Parameters
chewOn entry, a chewer<CharSeq> positioned at the offset in the associated CharSeq from which to scan. On return chew is positioned just passed the first syntactic occurrence found of identifier, or at the end of the CharSeq` if none.
offOn return, receives the offset in the CharSeq of the first identifier detected, if any, else is unchanged.
Returns
The identifier detected, if any, else any empty string.
template<class CharSeq >
size_t identifier::find_first_in ( std::string const &  id,
chewer< CharSeq > &  chew 
)

Find the first occurrence of an identifier within a terminal segment a CharSeq

Template Parameters
CharSeqA character-sequence type
Parameters
idThe identifier to be searched for.
chewOn entry, a chewer<CharSeq> positioned at the offset in the associated CharSeq from which to scan. On return chew is positioned just passed the first occurrence found of id, or at the end of the CharSeq if none.
Returns
The offset in the CharSeq of the first occurrence found of id, if any, else string::npos
template<class CharSeq >
std::string identifier::read ( chewer< CharSeq > &  chew)

Read an identifier from an chewer<CharSeq>

Template Parameters
CharSeqA charcter-sequence type
Parameters
chewOn entry, a chewer<CharSeq> positioned at the offset in the associated CharSeq from which to scan for an identifier. On return chew is positioned at the first offset not consumed.
Returns
The parsed identifier.