RangeLexer

A lexer that takes an InputRange.

This lexer copies the needed characters from the input range to an internal buffer, returning slices of it. Whether the buffer is reused (and thus all previously returned slices invalidated) depends on the instantiation parameters.

This is the most flexible lexer, as it imposes very few requirements on its input, which only needs to be an InputRange. It is also the slowest lexer, as it copies characters one by one, so it shall not be used unless it's the only option.

Members

Aliases

CharacterType
alias CharacterType = ElementEncodingType!T
InputType
alias InputType = T
advanceUntil
void advanceUntil(char c, bool included)
advanceUntilAny
size_t advanceUntilAny(string s, bool included)
dropWhile
void dropWhile(string s)

See detailed documentation in newxml.interfaces.isLexer

Functions

empty
bool empty()
get
CharacterType[] get()

See detailed documentation in newxml.interfaces.isLexer

save
auto save()
Undocumented in source. Be warned that the author may not have intended to support it.
setSource
void setSource(T input)
Undocumented in source. Be warned that the author may not have intended to support it.
setSource
void setSource(T input)
Undocumented in source. Be warned that the author may not have intended to support it.
start
void start()
testAndAdvance
bool testAndAdvance(char c)

See detailed documentation in newxml.interfaces.isLexer

Parameters

T

the InputRange to be used as input for this lexer

Meta