if (int x=..) but no while(int x=..) ?

kellywilson at nowhere.com kellywilson at nowhere.com
Thu Mar 16 16:17:31 PST 2006


Hey Kyle,


In article <dvctqg$269v$1 at digitaldaemon.com>, Kyle Furlong says...
>My point was not that it should be able to support it currently, but that it would be symmetric to support it in a while 
>statement as well.

I see what you are saying. I simply replied that it was possible to change the
grammar at this point and that I had a concern about the
validity/usability/maintainability.

>> "Declarator = Expression" rule? Yes, I just modified my grammar and it works
>> without conflicts. As for any deeper questions about the
>> validity/usability/maintainability of this...well that is for Walter to decide,
>> I guess.


I was also pointing out that Ithink that the Do/While/If constructs could and/or
should be symmetric below.

>> By the way:
>> 
>> Each of the "IfStatement"/"WhileStatement"/"DoStatement" rules are explained
>> with the following in the documentation:
>> 
>> "Expression is evaluated and must have a type that can be converted to a
>> boolean."
>> 
>> This would seem to indicate that each of these constructs can use the
>> "Declarator = Expression" rule I mentioned above.

As for the rest...I was just being a little verbose and pointing out that the
grammar is lagging behind the actual parser in this case ;)

Thanks,
Kelly Wilson





More information about the Digitalmars-d mailing list