|
SciLex
A header-only C++20 lexer built on REAL
|
A lazy range of tokens, returned by lexer::scan. More...
#include <lexer.hpp>
Public Member Functions | |
| token_range (const lexer &owner, std::string_view source, eof_policy policy) | |
| Builds the range. | |
| token_iterator | begin () const |
| Begin iterator (produces the first token). | |
| token_iterator | end () const |
| End sentinel. | |
Private Attributes | |
| const lexer * | owner_ {nullptr} |
| Rules provider (not owned). | |
| std::string_view | source_ |
| Text being scanned. | |
| eof_policy | policy_ {eof_policy::omit} |
| End-of-input policy. | |
A lazy range of tokens, returned by lexer::scan.
Holds the lexer and source by reference/view; usable directly in range-for.
|
inline |
Builds the range.
| [in] | owner | The lexer providing the rules. |
| [in] | source | The text to scan. |
| [in] | policy | Whether to yield a terminal end_of_input token. |
|
inline |
|
inline |
|
private |
|
private |
|
private |