Enum member isLowLevelParser

Checks whether its argument fulfills all requirements to be used as XML parser.

An XML parser is the second component in the parsing chain. It is usually built on top of a lexer and used to feed a cursor. The slices contained in the tokens returned by the parser are ephemeral: every reference to them may or may not be invalidated by subsequent calls to popFront. If the caller needs them, it has to copy them somewhere else.

Declaration

enum isLowLevelParser(P) = isInputRange!P && is(typeof(ElementType!P.kind) == XMLKind) && is(typeof(ElementType!P.content) == P.CharacterType[]);

Parameters

NameDescription
P the type to be tested

Returns

true if P satisfies the XML parser specification here stated; false otherwise

Specification

The parser shall at least:

  • have alias CharacterType: the type of a single source character;
  • have alias InputType: the type of the input which is used to feed this parser;
  • be an InputRange, whose elements shall support at least the following fields:
    • XMLKind kind: the kind of this node;
    • P.CharacterType[] content: the contents of this node, excluding the delimiters specified in the documentation of XMLKind;
  • have void setSource(InputType): sets the input source for this parser and eventual underlying components; the parser may perform other initialization work and even consume part of the input during this operation; after (partial or complete) usage, a parser may be reinitialized and used with another input by calling this function;

Authors

Lodovico Giaretta

Copyright

Copyright Lodovico Giaretta 2016 --

License

Boost License 1.0.