coan
6.0.1
A C/C++ Configuration Analyzer
|
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... | |
namespace identifier
encloses free functions associated with identifiers
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)
CharSeq | A character-sequence type |
chew | On 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. |
off | On return, receives the offset in the CharSeq of the first identifier detected, if any, else is unchanged. |
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
CharSeq | A character-sequence type |
id | The identifier to be searched for. |
chew | On 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. |
CharSeq
of the first occurrence found of id
, if any, else string::npos
std::string identifier::read | ( | chewer< CharSeq > & | chew | ) |
Read an identifier from an chewer<CharSeq>
CharSeq | A charcter-sequence type |
chew | On 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. |