Dump bison

Eric S. Raymond esr at thyrsus.com
Thu Jun 21 12:22:24 UTC 2018


Hal Murray <hmurray at megapathdsl.net>:
> 
> esr at thyrsus.com said:
> > I thought about that back when I was looking at this code.  Concluded it
> > wouldn't be that useful to (effectively) just dump the input tokens with a
> > slightly different syntax. 
> 
> How else would you check/test a parser?

If we had introspection in the target language we would automatically
get the entire parse structure when we dumped each syntax tree, rather
than an ad-hoc representation that's mostly leaf nodes.  We would also
get things like dumping the composed filter blocks from multiple
restrictions rather than each partial specification.

There are other kinds of composition of directives that get done
early; the more of those there are, the more value there is in dumping
the composed form rather than simply echoing each of the source-level
directives.

> Why should the syntax be slightly different?  If it is the same, I can use 
> diff to check things.

You pointed out correcly that the order of parameters would be lost.

> How useful is that level of checking?  I'm a bit surprised we don't have 
> something like that.  Are we just coasting along, depending on that area not 
> being changed much and/or any additions will get tested by the implementer 
> before it is committed?

That's the current state of things, yes.

We could do better, but not that much better.  I'd take some convincing
that the return on effort is worth it.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

My work is funded by the Internet Civil Engineering Institute: https://icei.org
Please visit their site and donate: the civilization you save might be your own.




More information about the devel mailing list