Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!hubcap!raghutp From: raghutp@hubcap.clemson.edu (Raghu Toppur) Newsgroups: comp.lang.prolog Subject: Re: Looking for source code for Prolog (general) Summary: parsers for PROLOG Message-ID: <1991May2.155052.16813@hubcap.clemson.edu> Date: 2 May 91 15:50:52 GMT References: <1991Apr30.075951.9679@news.iastate.edu> <5525@goanna.cs.rmit.oz.au> Organization: Clemson University Lines: 17 In article <5525@goanna.cs.rmit.oz.au>, ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: > > You cannot parse Prolog using Yacc, because Prolog is not an LR(1) > language. It is possible to construct a Prolog term of any desired > length such that the interpretation of the first token (atom? prefix op?) > cannot be determinee until the last token has been seen, which means > that Prolog is not LR(k) or LL(k) for _any_ k. > Surely there is a "subset" of Prolog language for which an LR(1) grammar could be used ? My question is briefly as follows : What aspects of Prolog syntax cause it to be non-LR(1) ? Is the "op" predicate considered central to the definition of Prolog ? That would mean that the yacc-parser I've been using so far isn't fully complete (yet!) and never will be. -- Raghu Toppur e-mail : raghutp@hubcap.clemson.edu Dept of Comp Sc, Phone : 803-656-2637 Clemson University, Clemson, SC 29631.