On Sep 22, 2004, at 5:06 PM, Edward Peschko wrote:

How do you do that?  Generation and matching are two different things
algorithmically.

yes, but they are intimately linked. just like the transformation of a string
into a number, and from a number to a string. Two algorithmically different
things as well, but they'd damn-well better be exact inverses of the other.

But they're not:

        "  3 foo" --> 3 --> "3"

My point is that if inputting strings into grammars is low level
enough to be an op, why isn't generating strings *from* grammars?

Maybe, because it's a less common thing to want to do? (Which is a bit ironic, since technically grammars are typically characterized as sets of rules for how to generate all the acceptable strings of the language they define, and parsing is sort of running that in reverse.)


But you seemed to be saying (to which Luke replied the "How do you do that?" above) that they should somehow share an implementation, so that they can't accidentally diverge. But algorithmically it seems they can't share an implementation, so making them both fundamental ops doesn't achieve the goal of ensuring parity.

JEff



Reply via email to