`template struct chewer<CharSeq> is a cursor-like type that is associated with a character-sequence type upon which it can performs some routine forms of lexical scanning.
More...
|
| chewer (bool cxx, sequence_type &seq, size_t off=0) |
| Construct from a sequence_type and initial offset. More...
|
|
template<class Mode > |
| chewer (bool cxx, Mode mode, sequence_type &seq, size_t off=0) |
| Construct, scanning a given a sequence_type from a given offset. More...
|
|
bool | cxx () const |
| Say whether scanning as C/C++ source.
|
|
void | sync () |
| Synchronise the object with the associated sequence_type More...
|
|
template<class Mode > |
void | scan (Mode mode, size_t off) |
| Scan the associated sequence_type in a given mode from a given offset.
|
|
template<class FirstMode , class... OtherModes> |
void | scan (ptrdiff_t adjust, FirstMode first_mode, OtherModes...other_modes) |
| Adjust position and then scan in a sequence of modes. More...
|
|
template<class FirstMode , class... OtherModes> |
void | scan () |
| Scan in a sequence of modes. More...
|
|
bool | overshoot (size_t off=0) const |
| Say whether the scanning position is past the end of the associated sequence_type
|
|
char_type | atoff (ptrdiff_t off) const |
| Get the character at an offset from the scanning position.
|
|
char_type & | atoff (size_t off) |
| Get a reference to the character at an offset from the scanning position.
|
|
char_type | operator[] (size_t off) const |
| operator[]() const is an alias for atoff() const
|
|
char_type & | operator[] (size_t off) |
| operator[]() is an alias for atoff()
|
|
size_t | cursor () const |
| Get the scanning position.
|
|
size_t | remaining () const |
| Get the remaining length of the associated sequence_type from the scanning position.
|
|
void | cursor (size_t off) |
| Set the scanning position. More...
|
|
char_type | curch () const |
| Get the character at the scanning position.
|
|
char_type & | curch () |
| Get a reference to the character at the scanning position.
|
|
chewer & | operator= (size_t off) |
| Assign the scanning position, returning *this
|
|
| operator size_t () const |
| Explicitly cast to size_t , returning the scanning positition.
|
|
char_type | operator* () const |
| operator*() const is an alias for curch() const .
|
|
char_type & | operator* () |
| operator*() is an alias for curch() .
|
|
| operator bool () const |
| Explicitly cast to bool, returning !overshoot()
|
|
void | on (size_t n) |
| Advance the scanning position an amount. More...
|
|
void | back (size_t n) |
| Retreat the scanning position an amount. More...
|
|
chewer & | operator++ () |
| Increment the scanning position, returning *this
|
|
chewer & | operator-- () |
| Decrement the scanning position, returning *this
|
|
chewer & | operator+= (size_t n) |
| Advance the scanning position an amount, returning *this
|
|
chewer & | operator-= (size_t n) |
| Retreat the scanning position an amount, returning *this
|
|
template<class Mode > |
chewer & | operator() (ptrdiff_t move, Mode mode) |
| operator()(move,mode) calls scan(move,mode) returning *this
|
|
template<class FirstMode , class... OtherModes> |
std::enable_if
<!std::is_arithmetic
< FirstMode >::value, chewer & >
::type | operator() (FirstMode first_mode, OtherModes...other_modes) |
| operator()(mode) calls scan(mode) returning *this
|
|
|
sequence_type & | buf () |
| Get a [const] reference to the associated sequence_type
|
|
sequence_type const & | buf () const |
|
|
unsigned | eol (size_t off=0) |
| Test for a newline-sequence at an offset from the scanning position. More...
|
|
bool | line_continues (size_t off=0) |
| Say whether there is a line-continuation at an offset. More...
|
|
template<char_type Opener, char_type Closer> |
void | consume_enclosed_string () |
| Consume characters between delimiting characters.
|
|
void | missing_terminator (size_t off, char_type missing) |
| Diagnose a missing terminator character.
|
|
void | eof_in_comment () |
| Diagnose end of file in C-comment.
|
|
|
template<typename U = sequence_type> |
void | extend (if_sequence_is_extensible< U > *=nullptr) |
| Extend the associated sequence_type by reading more input.
|
|
template<typename U = sequence_type> |
void | extend (if_sequence_is_not_extensible< U > *=nullptr) |
|
|
template<typename U = sequence_type> |
void | extend (size_t skip, if_sequence_is_extensible< U > *=nullptr) |
| Extend the associated sequence_type by reading more input, possibly replacing skip characters ahead of the cursor.
|
|
template<typename U = sequence_type> |
void | extend (size_t skip, if_sequence_is_not_extensible< U > *=nullptr) |
|
|
template<class Mode > |
void_if< Mode,
chew_mode::continuation > | consume () |
| Consume characters satisfying a given mode, without preliminary snyc()
|
|
template<class Mode > |
void_if< Mode,
chew_mode::whitespace > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::number_space > | consume () |
|
template<class Mode > |
void_if< Mode, chew_mode::name > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::punctuation > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::stringify > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::token_paste > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::cxx_comment > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::c_comment > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::string_literal > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::header_name > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::character_literal > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::raw_string_literal > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::greyspace > | consume () |
|
template<class Mode > |
void_if< Mode, chew_mode::code > | consume () |
|
template<class Mode > |
void_if< Mode,
chew_mode::literal_space > | consume () |
|
|
template<class First , class Next , class... Rest> |
std::enable_if< sizeof...(Rest)==0 >
::type | consume () |
| Consume characters satisfying a sequence of modes, without preliminary sync()
|
|
template<class First , class Next , class... Rest> |
std::enable_if< sizeof...(Rest)!=0 >
::type | consume () |
|
template<class CharSeq>
struct chewer< CharSeq >
`template struct chewer<CharSeq> is a cursor-like type that is associated with a character-sequence type upon which it can performs some routine forms of lexical scanning.
- Template Parameters
-
CharSeq | A character-sequence type |
Definition at line 248 of file chew.h.