|Grammar for variable and method declarations. email@example.com (wooks) (2007-03-01)|
|Re: Grammar for variable and method declarations. firstname.lastname@example.org (Chris Dollin) (2007-03-03)|
|Re: Grammar for variable and method declarations. email@example.com (George Neuner) (2007-03-03)|
|From:||Chris Dollin <firstname.lastname@example.org>|
|Date:||3 Mar 2007 23:31:52 -0500|
|Organization:||HP labs, Bristol|
|Posted-Date:||03 Mar 2007 23:31:52 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.
Do what I /think/ they do with Java: make the syntax more liberal,
so that you can get a clean grammar, and disallow the excessively
liberal constructs later (for some value of "later").
> The particular difficulty is that both start
> public/private datatype id and are not distinguishable until the 4th
> 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.
The grammar and grammar tools are your servants, not your masters.
Just because you /can/ do it in the grammar doesn't mean you /must/
do it in the grammar.
Chris "electric hedgehog" Dollin
"- born in the lab under strict supervision -", - Magenta, /Genetesis/
Return to the
Search the comp.compilers archives again.