dyaml.parser
YAML parser. Code based on PyYAML: http://www.pyyaml.org
class Parser
Types 1
classParser
Generates events from tokens provided by a Scanner.
While Parser receives tokens with non-const character slices, the events it produces are immutable strings, which are usually the same slices, cast to string. Parser is the last layer of D:YAML that may possibly do any modifications to these slices.
Fields
private TagDirective[] defaultTagDirectives_Default tag handle shortcuts and replacements.private Scanner scanner_Scanner providing YAML tokens.private Event currentEvent_Event produced by the most recent state.private string YAMLVersion_YAML version string.private TagDirective[] tagDirectives_Tag handle shortcuts and replacements.private Appender!(Mark[]) marks_Stack of marks used to keep track of extents of e.g. YAML collections.private Event delegate() @safe state_Current state.Methods
private
Event parseStreamStart() @safestream ::= STREAM-START implicit_document? explicit_document* STREAM-END implicit_document ::= block_node DOCUMENT-END* explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* ...private
Event parseImplicitDocumentStart() @safeParse implicit document start, unless explicit detected: if so, parse explicit.private
Event parseNode(const Flag!"block" block,
const Flag!"indentlessSequence" indentlessSequence = No.indentlessSequence) @trustedblock_node_or_indentless_sequence ::= ALIAS | properties (block_content | indentless_block_sequence)? | block_content | indentless_block_sequence block_node ::= ALIAS | properties block_content?...private
string handleDoubleQuotedScalarEscapes(const(char)[] tokenValue) const @safeHandle escape sequences in a double quoted scalar.private
string processTag(const string tag, const uint handleEnd,
const Mark startMark, const Mark tagMark) const @safeProcess a tag string retrieved from a tag token.private
Event parseBlockSequenceEntry(Flag!"first" first)() @safeblock_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END Parse an entry of a block sequence. If first is true, this is the first entry.private
Event parseIndentlessSequenceEntry() @safeindentless_sequence ::= (BLOCK-ENTRY block_node?)+ Parse an entry of an indentless sequence.private
Event parseBlockMappingKey(Flag!"first" first)() @safeblock_mapping ::= BLOCK-MAPPING_START ((KEY block_node_or_indentless_sequence?)? (VALUE block_node_or_indentless_sequence?)?)* BLOCK-END Parse a key in a block mapping. If first is true, this i...private
Event parseFlowSequenceEntry(Flag!"first" first)() @safeflow_sequence ::= FLOW-SEQUENCE-START (flow_sequence_entry FLOW-ENTRY)* flow_sequence_entry? FLOW-SEQUENCE-END flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?private
Event parseFlowSequenceEntryMappingKey() @safeParse a mapping key in an entry in a flow sequence.private
Event parseFlowValue(TokenID checkId, Event delegate() @safe nextState) @safeParse a mapping value in a flow context.private
Event parseFlowSequenceEntryMappingValue() @safeParse a mapping value in an entry in a flow sequence.private
Event parseFlowSequenceEntryMappingEnd() @safeParse end of a mapping in a flow sequence entry.private
Event parseFlowMappingKey(Flag!"first" first)() @safeflow_mapping ::= FLOW-MAPPING-START (flow_mapping_entry FLOW-ENTRY)* flow_mapping_entry? FLOW-MAPPING-END flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? Parse a key in a ...private
Event processEmptyScalar(const Mark mark) @safe pure nothrow const @nogcReturn an empty scalar.