bind9_parser icon indicating copy to clipboard operation
bind9_parser copied to clipboard

New Feature: Dump parsed config via outputter (after edit)

Open gianks opened this issue 3 years ago • 2 comments

Hi, this is not really an issue but a feature request.

It would be really nice if after parsing the configuration, one could dump it back out, possibly after altering the data structure as needed.

Thanks for this nice project!

gianks avatar Mar 01 '22 22:03 gianks

yeah, it is called a outputter (not a generator, as I had incorrectly stated firstly).

I have been looking at various add-on to the pyparsing module for generating from its graph tree.

Even am looking at alternative parser that may have a builtin generator.

At the moment, one could add members to pyparsing to support this.

Still tabulating cost effectiveness of development time here, but this is one feature that is rather high on my list.

egberts avatar Mar 04 '22 01:03 egberts

I'm conferring with the @ptmcg (author of pyparsing) about the re-outputting of the config file.

One thing we have to remember, any comment lines will be lost.

There are two general classes of parsers, and only one of them can save comments as well as inline comments of Python/C/C++ varieties.:

  • token to AST (pyparsing, antler, any PEG parser).
  • All Text (TextEdit, PyCharm, CLion++)

egberts avatar May 21 '22 22:05 egberts