Path: utzoo!attcan!uunet!decwrl!apple!olivea!mintaka!spdcc!esegue!compilers-sender From: andy@Theory.Stanford.EDU (Andy Freeman) Newsgroups: comp.compilers Subject: Re: Can Pascal be parsed by LR(1) parsing algorithm? Keywords: Pascal, LL(1) Message-ID: <1990Oct26.220803.1411@Neon.Stanford.EDU> Date: 26 Oct 90 22:08:03 GMT References: <9112@fy.sei.cmu.edu) <9010232339.AA20860@Alliant.COM> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: andy@Theory.Stanford.EDU (Andy Freeman) Organization: Computer Science Department, Stanford University Lines: 20 Approved: compilers@esegue.segue.boston.ma.us In article <9010232339.AA20860@Alliant.COM> crocker@Alliant.COM (Ben Crocker) writes: >Having written a Pascal compiler with an LL(1) parser generator, I can >vouch for the proposition that Pascal is LL(1). Such compilers are built on tokenizers with 2 character look-ahead. Remember that "1..5" has the same tokens as "1 .. 5", but requires 2 character look-ahead to distinguish from streams containing "1.". Look-ahead 2 tokenising feeding a Lx(1) parser does not demonstrate that Pascal is Lx(1); it demonstrates that a tokenized version of a language may have different look-ahead requirements than the stream-of-characters version. -andy -- UUCP: {arpa gateways, sun, decwrl, uunet, rutgers}!neon.stanford.edu!andy ARPA: andy@neon.stanford.edu BELLNET: (415) 723-3088 -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.