On 30/07/2013 7:42 a.m., Kinkie wrote:
After this patch, if I type parametres(foo) instead of parameters(foo),
will Squid think that I am defining a regular expression instead of
importing foo where my true regular expressions are stored?
Guys, one question: I understand that everyone here is very
distrusting of lex/yacc parser generators.
Why is that? in cases such as these a full parser would just be able
to make sense from the context, instead of covering corner cases such
as this one.
I understand that hand-parsing is better in very complex code paths,
but here there is no performance issue...

I'm not in that distrusting camp. I have worked with them quite a lot and you may have noticed the parser loops I hand-roll have a lot of similarity to an optimized yacc parse loop.

The downsides which can be problematic center around complexity in the ruleset given to them: * They are very finicky about the lexicon and the rulesets blow out quite quickly to cope with edge cases. * They provide no better assurity for us getting that ruleset correct and than any hand-rolled code does. * The resulting code is much more verbose and less easily debugged as a direct result of the more complex ruleset.


That said, if anyone wants to run up a parser for interpreting the squid.conf syntax we have now I am interesting in seeing what ruleset they come up with.

Amos

Reply via email to