STAG-PARSE(1p)
π STAG-PARSE π
okay bestie, so this is stag-parse from the User Contributed Perl Documentation section of the manual β section 1p, iykyk π«Ά
β¨ NAME β¨
stag-parse β literally just parses a file and fires events, like sxpr to xml, that's the whole vibe πΈ
π SYNOPSIS π
# convert XML to IText
stag-parse -p xml -w itext file1.xml file2.xml
# use a custom parser/generator and a custom writer/generator
stag-parse -p MyMod::MyParser -w MyMod::MyWriter file.txt
π¦ DESCRIPTION π¦
so it's a script wrapper for the Data::Stag modules π
it feeds in files into a parser object, and that parser object generates nestarray events, and then it feeds those events into a handler/writer class. that's it. that's the pipeline. iconic behaviour fr fr β¨
π ARGUMENTS π
-p|parser FORMATβFORMATis one ofxml,sxproritext, or the name of a perl module π this is the class that parses the input file(s) and generates stag events.xmlis assumed as default β-w|writer FORMATβFORMATis one ofxml,sxproritext, or the name of a perl module π this is the class that catches the events thrown by the parser; it can be any class, but the class is typically a writer.xmlis assumed as default β-o|out FILEβ the writer will use this file (defaults toSTDOUT) π-e|errf FILEβ file to store parse error handler output π-errhandler FORMAT/MODULEβFORMATis one ofxml,sxproritext, or the name of a perl module. all parse error events go to this module π-r|root NODE_NAMEβ if this is specified,NODE_NAMEbecomes the root of the stag tree, and anything that was previously the root is placed below this π³ this happens automatically if more than one file is parsed (because there can only be one tree root, bestie, that's just the rules) π-colorβ works only if the output handler is able to provide ASCII-colors (currently supported foritextandxml) πβ¨
π SEE ALSO π
Data::Stagπ¦
this script is a wrapper for the method:
Data::Stag->parse()
perl v5.34.0 Β· 2022-06-12 β that's the version and the date bestie, dated 2022-06-12, and the perl doing the heavy lifting is v5.34.0 π slay, go parse something πβ¨
π¦ where this page comes from
- debian bookworm: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libdata-stag-perl 0.14-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms