Parse::Indented

Given a Pythonesque set of indented lines, parses them into a convenient hierarchical structure
Download

Parse::Indented Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Publisher Name:
  • Michael Roberts
  • Publisher web site:
  • http://search.cpan.org/~michael/

Parse::Indented Tags


Parse::Indented Description

Given a Pythonesque set of indented lines, parses them into a convenient hierarchical structure Given a Pythonesque set of indented lines, the Parse::Indented module parses them into a convenient hierarchical structure.Developer commentsI have a bad habit of writing pseudocode when thinking of data structures. Since I learned Python, it's only gotten worse. So every time I start a new research project, I end up scratching out some pseudocode specifications for the various data or semantics or what have you, and then I bog down in writing yet another incomplete, buggy parser. This module represents my first try at setting down that incomplete, buggy parser where I can find it, so maybe next time I'll start from something other than scratch, and end up with a less incomplete and less buggy parser.Because I'm lazy, the output of this parser is an XML::xmlapi structure, because that API is embedded in my brainstem at this point.This parser does absolutely nothing with the actual lines themselves, but you can give it a function to call on each line to parse it and splice it into the final result. Parse::RecDescent::Simple is a good choice (not that I'm partial or anything). use Parse::Indented; my $parser = Parse::Indented->new(sub {$_}); # Just pass the line through as content for a simple parse. my $obj = $parser->parse (q{ }); Requirements: · Perl


Parse::Indented Related Software