views:

101

answers:

1

Unix configuration files come in all shapes and forms. I know that Webmin has a Perl API that makes it easy to parse and modify most common configuration programmatically, while preserving changes that might have been made by hand.

Are there any other libraries that has similar functionality, perhaps for other languages (Python, Ruby, C, C++, etc)?

+2  A: 

At least for Python there are numerous libraries that intends to simplify parsing. One of the simplest might be picoparse (http://github.com/brehaut/picoparse) which is constructed to provide straight forward parsing without the need of regexps.

Another one worth a look might be funcparselib (http://code.google.com/p/funcparserlib/) also for python.

If you intend to use C the most common tools for building parsers are Yacc and Flex. These tools are rather complex and has a rather high threshold before being usable.

khn
This is a step in the right direction. Not that it will solve my immediate problem.
Chen Levy