>>>>> "Hans" == Hans Aberg <[EMAIL PROTECTED]> writes:
Hans> At 15:10 -0700 2002/01/17, Scott Raney wrote: >> That's my point: the required lookahead in the case of "number" is >> 3, not 1. Hans> All LR(n) grammars, n > 1, can be rewritten as LR(1) (to a Hans> grammar producing the same language) and even to LR(0) if each Hans> sentence is followed by an end marker, see Robin Hunter, Hans> "Compilers", sec. 5.2. And all grammars that can be parsed by a Hans> predictive parser can be parsed by LR(n) techniques, see Aho et Hans> al, "Compilers...", sec. 4.7. Hans> So assuming those conditions, you should have a language Hans> describable by a LR(1) grammar. Then the question is whether it Hans> can be cut down to LALR(1), which is what Bison uses. This is over simplification: your words are right, there is an LR(1) for that _language_, but usually it is good for recognition, not for parsing. In other words, it is often very hard to recover the natural parse tree for an LR(k) grammar which has been massaged down to LR(1). _______________________________________________ Freecard-general mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freecard-general