Re: LL(1) Grammar for Expressions with Assignment

parrt@lonewolf.parr-research.com (Terence John Parr)
Sat, 1 Jul 1995 16:55:53 GMT

          From comp.compilers

Related articles
LL(1) Grammar for Expressions with Assignment bergmann@elvis.rowan.edu (1995-06-27)
Re: LL(1) Grammar for Expressions with Assignment jos@and.nl (1995-06-30)
Re: LL(1) Grammar for Expressions with Assignment parrt@lonewolf.parr-research.com (1995-07-01)
| List of all articles for this month |
Newsgroups: comp.compilers
From: parrt@lonewolf.parr-research.com (Terence John Parr)
Keywords: LL(1), parse
Organization: Parr Research Corporation
References: 95-06-075
Date: Sat, 1 Jul 1995 16:55:53 GMT

Seth Bergmann (bergmann@elvis.rowan.edu) wrote:
: I've been trying to find an LL(1) grammar for the language of
: expressions such as:
  ...
: but excluded would be things like:
: 3+a=4 and 2 = a


: analysis. I suspect this language of expressions is not LL(1).


I believe that it is non-LL(k) for any finite k; for example,
I can write this


(((((((((((3+a))))))))))) = 4


You would never be able to see past the '('s with finite lookahead.
I believe a semantic analysis of the resulting AST would be the best
route.


I suspect that any grammar that could describe this lvalue problem
(purely) syntactically would be very very large.


Regards,
Terence
--


Post a followup to this message

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