Related articles |
---|
[2 earlier articles] |
Re: Reduce/Reduce conflict in Algol60 grammar idknow@gmail.com (idknow@gmail.com) (2006-10-11) |
Re: Reduce/Reduce conflict in Algol60 grammar wyrmwif@tsoft.org (SM Ryan) (2006-10-11) |
Re: Reduce/Reduce conflict in Algol60 grammar cfc@shell01.TheWorld.com (Chris F Clark) (2006-10-12) |
Re: Reduce/Reduce conflict in Algol60 grammar wyrmwif@tsoft.org (SM Ryan) (2006-10-13) |
Re: Reduce/Reduce conflict in Algol60 grammar kenrose@nc-sys.com (Ken Rose) (2006-10-14) |
Re: Reduce/Reduce conflict in Algol60 grammar bobduff@shell01.TheWorld.com (Robert A Duff) (2006-10-14) |
Re: Reduce/Reduce conflict in Algol60 grammar DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-10-14) |
Re: Reduce/Reduce conflict in Algol60 grammar cfc@shell01.TheWorld.com (Chris F Clark) (2006-10-15) |
From: | Hans-Peter Diettrich <DrDiettrich1@aol.com> |
Newsgroups: | comp.compilers |
Date: | 14 Oct 2006 16:10:20 -0400 |
Organization: | Compilers Central |
References: | 06-10-057 06-10-058 |
Keywords: | parse, algol60 |
Posted-Date: | 14 Oct 2006 16:10:20 EDT |
SM Ryan wrote:
> The problem is you can't distinguish Boolean variable from arithmetic
> variable merely by looking variable characters themselves. You need to
> match the variable to its declaration and that requires a context
> sensitive grammar. In a context free grammar a Boolean variable and
> arithmetic variable (or function names) are indistinguishable hence
> the reduce-reduce conflict.
This was my impression as well. An arithmetic_expression is a special
case of a boolean_expression, slipping in by "relation". Adding a dummy
relation, which turns any arithmetic_expression (in detail
arithmetic_primary: variable, function_designator) into an
"boolean_primary", IMO would solve the syntax (context) problem.
DoDi
Return to the
comp.compilers page.
Search the
comp.compilers archives again.