context-free grammar

Walter Bright newshound2 at digitalmars.com
Fri Mar 4 20:29:25 PST 2011


SiegeLord wrote:
> Gives an error. I don't see any problem here:
> 
> a * b; // always a pointer declaration
> (a * b); // always a binary expression

There isn't one.

C++ decides if a*b=c; is a declaration or expression based on whether 'a' is a 
type or a variable. That requires semantic analysis. D's rule does not.


More information about the Digitalmars-d mailing list