Struct ForwardLexer

A lexer that takes a ForwardRange.

This lexer copies the needed characters from the forward 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 slightly faster than RangeLexer, but shoudn't be used if a faster lexer is available.

Template arguments

struct ForwardLexer(T, ErrorHandler, Alloc, std.typecons.Flag!("reuseBuffer").Flag reuseBuffer)
if (isForwardRange!T);

Methods

Name Description
advanceUntil See detailed documentation in std.experimental.xml.interfaces.isLexer
advanceUntilAny See detailed documentation in std.experimental.xml.interfaces.isLexer
dropWhile See detailed documentation in std.experimental.xml.interfaces.isLexer
empty See detailed documentation in std.experimental.xml.interfaces.isLexer
get See detailed documentation in std.experimental.xml.interfaces.isLexer
start See detailed documentation in std.experimental.xml.interfaces.isLexer
testAndAdvance See detailed documentation in std.experimental.xml.interfaces.isLexer

Aliases

Name Description
CharacterType See detailed documentation in std.experimental.xml.interfaces.isLexer
InputType See detailed documentation in std.experimental.xml.interfaces.isLexer

Parameters

NameDescription
T the InputRange to be used as input for this lexer
ErrorHandler a delegate type, used to report the impossibility to complete operations like advanceUntil or advanceUntilAny
Alloc the allocator used to manage internal buffers
reuseBuffer if set to Yes (the default) this parser will always reuse the same buffers, invalidating all previously returned slices

Authors

Lodovico Giaretta

Copyright

Copyright Lodovico Giaretta 2016 --

License

Boost License 1.0.