Return-Path: Received: from SEGATE.SUNET.SE by xiron.pc.helsinki.fi with smtp (Linux Smail3.1.28.1 #1) id m0t8FQy-0000ZQC; Thu, 26 Oct 95 01:40 EET Message-Id: Received: from listmail.sunet.se by SEGATE.SUNET.SE (LSMTP for OpenVMS v1.0a) with SMTP id 20AC5D5B ; Thu, 26 Oct 1995 0:40:35 +0100 Date: Wed, 25 Oct 1995 15:32: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: Veijo Vilva Content-Length: 1576 Lines: 32 la dn. cusku di'e > Shift/reduce conflicts tend not to be much of problem with yacc Syntactical conflicts are not much of a problem for a human to parse any natural language. The problem is that Lojban is claimed to be syntactically unambiguous. As a practical consideration for compiler construction, I agree with you. Take for instance the well-known "dangling else" construct present in many programming languages; it's easier to keep the ambiguity and solve the conflicts a priori than to rewrite the grammar. However, yacc's workarounds does not make a grammar less ambiguous. Take an intrinsically ambiguous context-free language. Given a suitable grammar, yacc will generate a parser for it. Still the grammar, as well as the language, are syntactically ambiguous: parsers that were not generated by yacc could parse sentences differently, as different (and valid) parses do exist. I read somewhere that some flaws in Loglan were detected and solved with yacc. If we now keep new flaws, why were the original ones removed at all? On the other hand, if the conflicts are due to non-LALR(1) constructs (but still LR(k) for some k, say), then only the usefulness of yacc is reduced as a check for unambiguity. I think the best solution is to find out why the conflicts arise, and rewrite the grammar to circumvent them. This does not mean changing the language, only the grammar. 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.