On Sun, Nov 27, 2016 at 1:00 AM Achim Gratz <[email protected]> wrote:

> Eric S. Raymond writes:
> > OK, there are two ways we can handle this.
>
> The third way is building a hash table that maps each possible unique
> prefix to the actual full-length command.
>
>
I was on a project years ago that did that (minimal length matching of
command strings).

Someone on team dug up an amazing little utility that ingested a list of
strings, and emitted a human-unreadable table-driven maximally efficient C
function that implemented some computer science magic state machine
character parser that took as a parameter char* and returned a integer or
enum that designated one of the target strings that was minimal matched by
the input.

We then made running this code generator a Makefile production, and
compiled the generator itself as another dependent Makefile production.

I'm struggling now to remember it's name...


...m
_______________________________________________
devel mailing list
[email protected]
http://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to