Is the declaration grammar definition of 'Parameter' correct?

Bernard Helyer b.helyer at gmail.com
Mon Jun 7 20:37:18 PDT 2010


http://www.digitalmars.com/d/2.0/declaration.html

So, cut down:

Decl
     BasicType Declarators ;

BasicType
     int
     ...

BasicType2
     *
     [] and co
     function Parameters

Parameter
     Declarator
     ...

Declarator
     BasicType2 Identifier DeclaratorSuffixes (the suffixes are [] 
[assignexpr] [type] and a template parameter list)


So given all that, I can't see how this:

int function(int, int) a;

can be parsed with that grammar.

Additionally, Declarator requires identifier, so wouldn't that make this:

int function(* a, [] b) c;

a valid Decl according to that grammar. I think this is seriously 
incorrect, but I would be open to correction! :D


More information about the Digitalmars-d mailing list