Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby27
/
share
/
ri
/
system
/
Psych
/
Parser
/
//opt/alt/ruby27/share/ri/system/Psych/Parser/cdesc-Parser.ri
U:RDoc::NormalClass[iI"Parser:ETI"Psych::Parser;TI"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[ I"KYAML event parser class. This class parses a YAML document and calls ;TI"Nevents on the handler that is passed to the constructor. The events can ;TI"Nbe used for things such as constructing a YAML AST or deserializing YAML ;TI"Ldocuments. It can even be fed back to Psych::Emitter to emit the same ;TI"document that was parsed.;To:RDoc::Markup::BlankLine o; ;[I"QSee Psych::Handler for documentation on the events that Psych::Parser emits.;T@o; ;[I"MHere is an example that prints out ever scalar found in a YAML document:;T@o:RDoc::Markup::Verbatim;[I"+# Handler for detecting scalar values ;TI"*class ScalarHandler < Psych::Handler ;TI"; def scalar value, anchor, tag, plain, quoted, style ;TI" puts value ;TI" end ;TI" end ;TI" ;TI"3parser = Psych::Parser.new(ScalarHandler.new) ;TI"!parser.parse(yaml_document) ;T:@format0o; ;[I"NHere is an example that feeds the parser back in to Psych::Emitter. The ;TI"EYAML document is read from STDIN and written back out to STDERR:;T@o;;[I"=parser = Psych::Parser.new(Psych::Emitter.new($stderr)) ;TI"parser.parse($stdin) ;T;0o; ;[I"HPsych uses Psych::Parser in combination with Psych::TreeBuilder to ;TI"2construct an AST of the parsed YAML document.;T: @fileI""ext/psych/lib/psych/parser.rb;T:0@omit_headings_from_table_of_contents_below0o;;[ ; I"ext/psych/psych_parser.c;T;0; 0;0[[ I"handler;TI"RW;T:privateFI""ext/psych/lib/psych/parser.rb;T[ U:RDoc::Constant[i I"ANY;TI"Psych::Parser::ANY;T:public0o;;[o; ;[I"'Let the parser choose the encoding;T@; @6;0@6@cRDoc::NormalClass0U;[i I" UTF8;TI"Psych::Parser::UTF8;T;0o;;[o; ;[I"UTF-8 Encoding;T@; @6;0@6@@F0U;[i I"UTF16LE;TI"Psych::Parser::UTF16LE;T;0o;;[o; ;[I" UTF-16-LE Encoding with BOM;T@; @6;0@6@@F0U;[i I"UTF16BE;TI"Psych::Parser::UTF16BE;T;0o;;[o; ;[I" UTF-16-BE Encoding with BOM;T@; @6;0@6@@F0[ [[I" class;T[[;[ [:protected[ [;[[I"new;T@;[I" instance;T[[;[ [;[ [;[[I" mark;TI"ext/psych/psych_parser.c;T[I" parse;T@z[ [U:RDoc::Context::Section[i 0o;;[ ; 0;0[I""ext/psych/lib/psych/parser.rb;TI"ext/psych/psych_emitter.c;TI" Psych;TcRDoc::NormalModule