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
TagDirective[] defaultTagDirectives_Default tag handle shortcuts and replacements.Scanner scanner_Scanner providing YAML tokens.Event currentEvent_Event produced by the most recent state.string YAMLVersion_YAML version string.TagDirective[] tagDirectives_Tag handle shortcuts and replacements.Event delegate() @safe state_Current state.Methods
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* ...Event parseImplicitDocumentStart() @safeParse implicit document start, unless explicit detected: if so, parse explicit.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?...string handleDoubleQuotedScalarEscapes(const(char)[] tokenValue) const @safeHandle escape sequences in a double quoted scalar.string processTag(const string tag, const uint handleEnd,
const Mark startMark, const Mark tagMark) const @safeProcess a tag string retrieved from a tag token.Event parseFlowNode() @safeEvent 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.Event parseIndentlessSequenceEntry() @safeindentless_sequence ::= (BLOCK-ENTRY block_node?)+ Parse an entry of an indentless sequence.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...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?)?Event parseFlowValue(TokenID checkId, Event delegate() @safe nextState) @safeParse a mapping value in a flow context.Event parseFlowSequenceEntryMappingValue() @safeParse a mapping value in an entry in a flow sequence.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 ...