Re: Grammar for variable and method declarations.

George Neuner <gneuner2@comcast.net>
3 Mar 2007 23:32:37 -0500

          From comp.compilers

Related articles
Grammar for variable and method declarations. wookiz@hotmail.com (wooks) (2007-03-01)
Re: Grammar for variable and method declarations. chris.dollin@hp.com (Chris Dollin) (2007-03-03)
Re: Grammar for variable and method declarations. gneuner2@comcast.net (George Neuner) (2007-03-03)
| List of all articles for this month |
From: George Neuner <gneuner2@comcast.net>
Newsgroups: comp.compilers
Date: 3 Mar 2007 23:32:37 -0500
Organization: Compilers Central
References: 07-03-014
Keywords: parse
Posted-Date: 03 Mar 2007 23:32:37 EST

On 1 Mar 2007 21:33:40 -0500, "wooks" <wookiz@hotmail.com> wrote:


>How do you define a grammar where ...
>public/private datatype id and are not distinguishable until the 4th
>token.


The language is not LL(1), left factoring can not remove all the
conflicts. You need extended look ahead and/or predication and
backtracking to parse the language in LL.


LL(k>1) tools such as Antlr and JavaCC can handle this problem in the
natural way, as can any of the LR tools.


George



Post a followup to this message

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