INN's config parser

Russ Allbery rra at stanford.edu
Thu Jun 21 10:58:09 UTC 2001


Aidan Cully <aidan at panix.com> writes:

> FYI, I don't know if you've come any further along with your parser,
> but I've rewritten mine, again, and I consider it very nearly feature
> complete at this stage.  I've attached a little demonstration utility
> that understands some of the format of the readers.conf.  The parser
> files are readers.[ch], and are generated from readers.g by my parser
> generator, tentatively titled GUCS.  If you don't get the tarball,
> it's also available on my FTP site,
> ftp://ftp.jalacy.com/pub/src/gucs-inn-demo.tgz

Thanks for the example!

This looks quite nice if we were go to the generated parser route.  I
think there are enough other reasons to not take that route that the route
that I took is better for INN, but your approach definitely also would
have worked.  The part that I'm not fond of about it is that it integrates
knowledge of the types and valid parameters very tightly into the parser,
so it's harder for programs that don't care about many of the parameter
values to be able to still use the same configuration files without
needing the full parser, or to be able to combine all configuration files
for all of INN into a single logical configuration file that includes
other ones and just have programs ignore the parts they don't care about.

I also found that I was able to understand what was going on better with a
sharp division between the syntactic parsing and the semantic analysis,
and therefore maintain the code better because once the parsing was done,
I didn't have to look at it and could treat it as a completely black box.

> If this is something you think INN would benefit from having, let me
> know...  I started the project partly because I felt guilty about the
> readers.conf implementation, and I'd like to try and make up for that.

Don't feel guilty; it's been a major feature of INN 2.3!  :)

I don't think we're going to want to go this route, but I very much
appreciate the example and the thoughts.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>


More information about the inn-patches mailing list