STAG-PARSE(1)
β¨ STAG-PARSE(1) β¨
okay bestie, pull up a chair, we're reading a manpage from the User Contributed Perl Documentation section and honestly? it's giving useful. π
πΈ NAME πΈ
stag-parse β parses a file and fires events (e.g. sxpr to xml) π₯
π SYNOPSIS π
no thoughts, just vibes, and also these exact commands:
# 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 basically this is a script wrapper for the Data::Stag modules. π
it feeds in files into a parser object that generates nestarray events, and then feeds those events into a handler/writer class. that's it. that's the whole plot. and honestly? iconic. β¨
π ARGUMENTS π
-p|parserFORMATβFORMATis one ofxml,sxproritext, or the name of a perl module.
this is the class that parsers the input file(s) and generates stag events. yes, the manpage says "parsers", we're not fixing it, that's the author's moment. π«Ά
xml assumed as default. β
-w|writerFORMATβ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. π
xml assumed as default. β
-o|outFILEβ the writer will use this file (defaults toSTDOUT). π-e|errfFILEβ file to store parse error handler output. π-errhandlerFORMAT/MODULEβFORMATis one ofxml,sxproritext, or the name of a perl module.
all parse error events go to this module. no cap. π¨
-r|rootNODE_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). and that's just math, bestie, one tree one root, periodt. π
-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()
π POD ERRORS π
Hey! The above document had some coding errors, which are explained below: π
- Around line 152:
Expected text after =item, not a bullet
not the bullet item sneaking into the pod like it pays rent π we still love it though.
and that's the whole page, bestie!! π written against perl v5.42.0, dated 2025-07-25, and yes it's still STAG-PARSE(1) all the way down. mwah π π
π¦ where this page comes from
- fedora 43: perl-Data-Stag 0.14-28.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms