SciLex
A header-only C++20 lexer built on REAL
Loading...
Searching...
No Matches
Public Member Functions | List of all members
scilex::token_range Class Reference

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.
 

Detailed Description

A lazy range of tokens, returned by lexer::scan.

Holds the lexer and source by reference/view; usable directly in range-for.

Constructor & Destructor Documentation

◆ token_range()

scilex::token_range::token_range ( const lexer &  owner,
std::string_view  source,
eof_policy  policy 
)
inline

Builds the range.

Parameters
[in]ownerThe lexer providing the rules.
[in]sourceThe text to scan.
[in]policyWhether to yield a terminal end_of_input token.

Member Function Documentation

◆ begin()

token_iterator scilex::token_range::begin ( ) const
inline

Begin iterator (produces the first token).

Returns
The iterator.

◆ end()

token_iterator scilex::token_range::end ( ) const
inline

End sentinel.

Returns
A default-constructed iterator.

The documentation for this class was generated from the following file: