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 implicitdocument? explicitdocument STREAM-END implicitdocument ::= blocknode DOCUMENT-END explicitdocument ::= DIRECTIVE DOCUMENT-START blocknode? DOCUMENT-END Parse stre...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) @trustedblocknodeorindentlesssequence ::= ALIAS | properties (blockcontent | indentlessblocksequence)? | blockcontent | indentlessblocksequence blocknode ::= ALIAS | properties blockcontent? | blockcont...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)() @safeblocksequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY blocknode?)* BLOCK-END Parse an entry of a block sequence. If first is true, this is the first entry.Event parseIndentlessSequenceEntry() @safeindentlesssequence ::= (BLOCK-ENTRY blocknode?)+ Parse an entry of an indentless sequence.Event parseBlockMappingKey(Flag!"first" first)() @safeblockmapping ::= BLOCK-MAPPINGSTART ((KEY blocknodeorindentlesssequence?)? (VALUE blocknodeorindentlesssequence?)?)* BLOCK-END Parse a key in a block mapping. If first is true, this is the firs...Event parseFlowSequenceEntry(Flag!"first" first)() @safeflowsequence ::= FLOW-SEQUENCE-START (flowsequenceentry FLOW-ENTRY)* flowsequenceentry? FLOW-SEQUENCE-END flowsequenceentry ::= flownode | KEY flownode? (VALUE flownode?)?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)() @safeflowmapping ::= FLOW-MAPPING-START (flowmappingentry FLOW-ENTRY)* flowmappingentry? FLOW-MAPPING-END flowmappingentry ::= flownode | KEY flownode? (VALUE flownode?)? Parse a key in a flow mapping.