Grammar for variable and method declarations.

"wooks" <wookiz@hotmail.com>
1 Mar 2007 21:33:40 -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: "wooks" <wookiz@hotmail.com>
Newsgroups: comp.compilers
Date: 1 Mar 2007 21:33:40 -0500
Organization: Compilers Central
Keywords: parse, question
Posted-Date: 01 Mar 2007 21:33:40 EST

How do you define a grammar where you have a class construct that
starts with a list of instance variables and method declarations for a
language like Java.


The particular difficulty is that both start


public/private datatype id and are not distinguishable until the 4th
token.


I have tried left factoring and I end up getting conflicts on my when
I declare my method and instance variable lists?


Are there some general principles for these situations. Very new to
all this.


Thanks.



Post a followup to this message

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