Received: from VMS.DC.LSOFT.COM (vms.dc.lsoft.com [205.186.43.2]) by locke.ccil.org (8.6.9/8.6.10) with ESMTP id NAA11346 for ; Wed, 25 Oct 1995 13:10:54 -0400 Message-Id: <199510251710.NAA11346@locke.ccil.org> Received: from PEACH.EASE.LSOFT.COM (205.186.43.4) by VMS.DC.LSOFT.COM (LSMTP for OpenVMS v1.0a) with SMTP id 02761FAF ; Wed, 25 Oct 1995 13:05:23 -0400 Date: Wed, 25 Oct 1995 13:02:00 LCL Reply-To: BARRETO%VELAHF@ECCSA.TR.UNISYS.COM Sender: Lojban list From: Paulo Barreto Subject: Re: conflicts in grammar.235 X-To: lojban%cuvmb.cc.columbia.edu@TRSVR.UniGate1.Unisys.COM To: John Cowan Status: OR X-From-Space-Date: Wed Oct 25 13:10:56 1995 X-From-Space-Address: LOJBAN%CUVMB.BITNET@UBVM.CC.BUFFALO.EDU me: >I checked grammar.235 with yacc and three shift-reduce errors were >reported. Mark: >I don't know that shift/reduce conflicts qualify as a "problem." >They're an ambiguity in the grammar, but yacc (and presumably lojban) >generates an unambiguous parse in these cases by resolving in favor of >shifting instead of reducing (I think). If a grammar submitted to yacc presents a conflict it is either ambiguous (most probably, in practice), or non-LALR(1). yacc solves conflicts by looking for explicit precedence/associativity clauses, favoring shifts (if the conflict is shift/reduce), or favoring the first production listed in the grammar (for reduce/reduce conflicts). If grammar.235 is simply non-LALR(1) but still unambiguous, some rewriting may be done to force that property (and a big headache :-) If it is AMBIGUOUS, the LANGUAGE (more precisely, the underlying context-free model of the language) will always admit more than one parse for some sentence, notwithstanding the yacc workaround to select one of them. I wouldn't expect every listener to behave exactly like yacc; hence misunderstanding may arise. Even worse: you have in general no warranty that the language accepted by the yacc parser is the same generated by the grammar. Perhaps in circumstances like building a parser this kind of grammar is adequate (giving rise to smaller parsing tables, etc.), but I really don't think that a language designed to be syntactically unambiguous should tolerate such an anomaly in its formal definition. Paulo S. L. M. Barreto -- Software Analyst -- Unisys Brazil Standard disclaimer applies ("I do not speak for Unisys", etc.) e'osai ko sarji la lojban.