G
Guest
Hello,
I have a question about the correctness of the language grammar for the C#
2.0 specification. I am working with the grammar specified in the June 2005
ECMA-334 standard.
Basically, a using-namespace-directive is defined as follows:
using-namespace-directive:
using namespace-name ;
namespace-name:
namespace-or-type-name
namespace-or-type-name:
identifier type-argument-list (opt)
...
type-argument-list:
< type >
Note that the above productions allow this statement to be legal (even if it
doesn't
semantically make sense):
using System<int>;
Obviously, this doesn't make semantic sense in this context. I'm wondering
why
a new production was not introduced specifically for this context as opposed
to using the semantic information provided by the directive itself to not
allow the type-argument-list (optional of course means it could be there).
Any thoughts?
Thanks!
I have a question about the correctness of the language grammar for the C#
2.0 specification. I am working with the grammar specified in the June 2005
ECMA-334 standard.
Basically, a using-namespace-directive is defined as follows:
using-namespace-directive:
using namespace-name ;
namespace-name:
namespace-or-type-name
namespace-or-type-name:
identifier type-argument-list (opt)
...
type-argument-list:
< type >
Note that the above productions allow this statement to be legal (even if it
doesn't
semantically make sense):
using System<int>;
Obviously, this doesn't make semantic sense in this context. I'm wondering
why
a new production was not introduced specifically for this context as opposed
to using the semantic information provided by the directive itself to not
allow the type-argument-list (optional of course means it could be there).
Any thoughts?
Thanks!