STAG-PARSE(1p)

πŸ“¦
version 0.14 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’– 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 β€” FORMAT is one of xml, sxpr or itext, or the name of a perl module πŸ’– this is the class that parses the input file(s) and generates stag events. xml is 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 is 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 πŸ’€
  • -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, bestie, that's just the rules) πŸ‘‘
  • -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()

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