Structure property bug?

James Dennett jdennett at acm.org
Thu Oct 4 23:51:58 PDT 2007


Regan Heath wrote:
> Steven Schveighoffer wrote:
>> "Regan Heath" wrote
>>> http://www.digitalmars.com/d/archives/12484.html
>>>
>>> <g>
>>>
>>
>> Hm... I guess we know Walter's opinion :)  If it's just a question of
>> not having time to do the table, would it be possible for someone to
>> write one and submit it for Walter to include?  Because telling
>> someone to manually parse the grammar to me is like telling someone to
>> go read the compiler code to figure out the precedence.  I know a lot
>> of good coders who don't necessarily read language grammar specs. 
>> Even I, who understood generally what the grammar spec means, didn't
>> get that the operator precedence was "hidden" in the grammar.  I
>> generally ignore the grammar boxes and just read the english
>> descriptions/examples.
> 
> I think that's a good idea, the most likely to see results any time
> soon.  I suspect operator precedence in D is almost identical to C/C++
> so I'd start by copying a table for C/C++, eg.
> 
> (a quick google)
> http://www.difranco.net/cop2220/op-prec.htm

Operator precendence for C++ cannot be (correctly) expressed
in a linear table; a grammar is the simplest way to capture
it accurately.  (That may not be true for D, which has been
able to keep many things simpler.)

-- James



More information about the Digitalmars-d mailing list