SliceLexer

A lexer that takes a sliceable input.

This lexer will always return slices of the original input; thus, it does not allocate memory and calls to start don't invalidate the outputs of previous calls to get.

This is the fastest of all lexers, as it only performs very quick searches and slicing operations. It has the downside of requiring the entire input to be loaded in memory at the same time; as such, it is optimal for small file but not suitable for very big ones.

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)
empty
auto empty()
get
CharacterType[] get()

See detailed documentation in newxml.interfaces.isLexer

Functions

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

See detailed documentation in newxml.interfaces.isLexer

Variables

begin
size_t begin;
Undocumented in source.
input
T input;
Undocumented in source.
pos
size_t pos;
Undocumented in source.

Parameters

T

a sliceable type used as input for this lexer

Meta