Re: Can Pascal be parsed by LR(1) parsing algorithm?

andy@Theory.Stanford.EDU (Andy Freeman)
Fri, 26 Oct 90 22:08:03 GMT

          From comp.compilers

Related articles
[9 earlier articles]
Re: Can Pascal be parsed by LR(1) parsing algorithm? firth@sei.cmu.edu (1990-10-17)
Re: Can Pascal be parsed by LR(1) parsing algorithm? firth@sei.cmu.edu (1990-10-17)
Re: Can Pascal be parsed by LR(1) parsing algorithm? firth@sei.cmu.edu (1990-10-18)
Re: Can Pascal be parsed by LR(1) parsing algorithm? djones@megatest.uucp (1990-10-21)
Re: Can Pascal be parsed by LR(1) parsing algorithm? crocker@Alliant.COM (1990-10-23)
Re: Can Pascal be parsed by LR(1) parsing algorithm? piet@cs.ruu.nl (1990-10-26)
Re: Can Pascal be parsed by LR(1) parsing algorithm? andy@Theory.Stanford.EDU (1990-10-26)
Re: Can Pascal be parsed by LR(1) parsing algorithm? jas@Ingres.COM (1990-10-28)
Re: Can Pascal be parsed by LR(1) parsing algorithm? firth@sei.cmu.edu (1990-11-05)
| List of all articles for this month |
Newsgroups: comp.compilers
From: andy@Theory.Stanford.EDU (Andy Freeman)
Keywords: Pascal, LL(1)
Organization: Computer Science Department, Stanford University
References: <9112@fy.sei.cmu.edu) <9010232339.AA20860@Alliant.COM>
Date: Fri, 26 Oct 90 22:08:03 GMT

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.<digit>".


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
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.