Hi Ashley,
i am just new too, but i was online, so 2 pennies:

Your file seems to have a clear structure, so i would definitely go for the "all in one" approach, not line by line as you seem to. You talk about breaking up, and sub-parsers, and breaking up is good, but they are all just rules (not parsers). You just need one parser, with one root (which will probably be a repeat of the sections you have) And like you sort of suggested in 1) you just create rules that parse the sub-content. And they are made up of rules that parse the sub-content, until you are at strings.

The "gobbling up" problem comes from not having clear ends to the rules. Rules are greedy and will read as much as they can, so if you write any.repeat, that's that. Good news is that your content has clear delimiters, so you just parse until then. So for example you'd have a rule for a line that parses those option strings and is delimited by newline.
And you could have a rule that parses lines, until "commit"

Hope that helps

Torsten


Ashley Penney <mailto:[email protected]>
11. toukokuuta 2014 18.18
--
Ashley Penney
[email protected] <mailto:[email protected]>
Module Engineer

*Join us at PuppetConf 2014**, September 23-24 in San Francisco - http://puppetconf.com <http://puppetconf.com/>*

Reply via email to