STAG-PARSE(1)

πŸ“¦
version 0.14 Β· 3 versions
, in fedora 43

✨ 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|parser FORMAT β€” FORMAT is one of xml, sxpr or itext, 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|writer FORMAT β€” FORMAT is one of xml, sxpr or itext, 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|out FILE β€” the writer will use this file (defaults to STDOUT). πŸ’Œ
  • -e|errf FILE β€” file to store parse error handler output. πŸ“
  • -errhandler FORMAT/MODULE β€” FORMAT is one of xml, sxpr or itext, or the name of a perl module.

all parse error events go to this module. no cap. 🚨

  • -r|root NODE_NAME β€” if this is specified, NODE_NAME becomes 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 for itext and xml). 🌈

🧚 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