Struct 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.

Template arguments

struct RangeLexer(T, ErrorHandler, Alloc, std.typecons.Flag!("reuseBuffer").Flag reuseBuffer)
if (isInputRange!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.