On Tue, 26 Mar 2002, Chemolli Francesco (USI) wrote:
> I've done something similar by turning my squid.conf in a
> cpp-interpreted file.
This would require to have a C preprocessor installed, would not it?
> > Would be nice to have in 2.6. I have one implementation
> > for that, based on recursive configfile parser. recursion
> > loops are detected by remembering inodes of seen configs.
Inodes?! Would not file name be sufficient?
> > I don't consider recursion here as evil, besides it makes
> > for pretty simple patch.
I agree that it is not evil, but using up all RAM at start-up for no
obvious reason can be annoying, especially if it is a result of a
minor typo made in a perfectly fine and used-to-work file. In my
experience, once you let people use #includes, some will create very
complicated cfg file hierarchies.
> Alternatively, we could redesign the configuration parsing engine
> to be a yacc+lex thing. We'd trade some flexibility
> (lexically-variable lex parsers are hard to implement - if it's
> possible at all) in favour of genericity. Of course, this would
> unfortunately also mean that Robert's generic parser work should
> be dropped.
I do not have up-to-date information, but lex and yacc were not
portable enough 5 years ago. They were also huge. I do not know what
you mean by "lexically-variable lex parsers", but I am sure yacc+lex
can do everything Squid would ever need. Squid does not need more that
LALR(1) parser, does it?
Alex.
Received on Tue Mar 26 2002 - 11:47:44 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:53 MST