On Wed, 16 Jan 2002 Hans Aberg <[EMAIL PROTECTED]> wrote: > Also, it seems that the semantics of the two different OR's will be > different, so therefore I think that it will not suffice by merely fiddling > around with OR precedences. -- You need to write your grammar in such a way > that it is possible to insert the actions correctly.
Hey, and that's an easy one. Wait until you get to "the number of card", at which point the next token could be "button", at which point "number" is a property, or "buttons", at which point it's a function. We gave up on the idea of a lex/yacc parser for MetaCard very early on for this and other reasons, and hand-coded it all (albeit with some consolidation for common elements). But "number" was a big problem even for us. long/short/abbrev are also no picnic (sometimes they modify a function, sometimes a property). > Otherwise, I think this is a sign of poor language design. If you later > want to design your own scripting language, then you should avoid the > confusion that will inevitably arise by the "or"'s having different > semantic meaning. Natural language has always been a major headache for computer-science types specifically because of these kinds of token ambiguities. But I wouldn't go so far as to say HT is an example of poor design (well, it does have its flaws, but this kind of multi-use token isn't one of them). It's just much more English-like than is convenient for language implementers ;-) Regards, Scott > Hans Aberg ******************************************************** Scott Raney [EMAIL PROTECTED] http://www.metacard.com MetaCard: You know, there's an easier way to do that... _______________________________________________ Freecard-general mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freecard-general