|Seeking bison/yacc grammar for Java language email@example.com (Evil B) (2004-04-29)|
|Re: Seeking bison/yacc grammar for Java language firstname.lastname@example.org (Scott Nicol) (2004-05-02)|
|Re: Seeking bison/yacc grammar for Java language email@example.com (glen herrmannsfeldt) (2004-05-02)|
|Re: Seeking bison/yacc grammar for Java language firstname.lastname@example.org (Jose Antonio) (2004-05-08)|
|From:||glen herrmannsfeldt <email@example.com>|
|Date:||2 May 2004 21:50:22 -0400|
|Posted-Date:||02 May 2004 21:50:22 EDT|
Evil B wrote:
> Does anyone have a working yacc/bison grammar for the full java language?
> I've been tinkering away at one for a few days, but have hit a roadblock:
> When adding 'Type . class' to 'PrimaryNoNewArray' , I end up with 10
> shift/reduce and 2 reduce/reduce conflicts, and most java sources fail
> to parse.
It might be that there are some true conflicts in the grammar, resolved
only be the language definition, similar to the way that if-then-else
is resolved in C. (Each else closes the nearest preceding if.)
It is legal to have a class name, method name, and instance name,
and maybe package name all the same, though not recommended for style
reasons. Consider that, and the possible conflicts that might arise.
(I once wrote a JNI static method to read the x86 time stamp counter,
class and method both called rdtsc.)
Return to the
Search the comp.compilers archives again.