;
outer_declaration
- : using_directive
+ : extern_alias_directive
+ | using_directive
| namespace_member_declaration
;
-
+
+extern_alias_directives
+ : extern_alias_directive
+ | extern_alias_directives extern_alias_directive;
+
+extern_alias_directive
+ : EXTERN IDENTIFIER IDENTIFIER SEMICOLON
+ {
+ LocatedToken lt = (LocatedToken) $2;
+ string s = lt.Value;
+ if (s != "alias"){
+ Report.Error (1003, lt.Location, "'alias' expected");
+ } else if (RootContext.Version == LanguageVersion.ISO_1) {
+ Report.FeatureIsNotStandardized (lt.Location, "external alias");
+ } else {
+ lt = (LocatedToken) $3;
+ current_namespace.UsingExternalAlias (lt.Value, lt.Location);
+ }
+ }
+ ;
+
using_directives
: using_directive
| using_directives using_directive
{
LocatedToken lt = (LocatedToken) $2;
current_namespace.UsingAlias (lt.Value, (MemberName) $4, (Location) $1);
+ current_namespace.UsingFound = true;
}
| USING error {
CheckIdentifierToken (yyToken, GetLocation ($2));
: USING namespace_name SEMICOLON
{
current_namespace.Using ((MemberName) $2, (Location) $1);
+ current_namespace.UsingFound = true;
}
;
if (RootContext.Documentation != null)
Lexer.doc_state = XmlCommentState.Allowed;
}
+ opt_extern_alias_directives
opt_using_directives
opt_namespace_member_declarations
CLOSE_BRACE
| using_directives
;
+opt_extern_alias_directives
+ : /* empty */
+ | extern_alias_directives
+ ;
+
opt_namespace_member_declarations
: /* empty */
| namespace_member_declarations
GenericMethod generic = null;
if (name.TypeArguments != null) {
- generic = new GenericMethod (current_namespace, current_class, name);
+ generic = new GenericMethod (current_namespace, current_class, name,
+ (Expression) $3, (Parameters) $6);
generic.SetParameterInfo ((ArrayList) $9);
}
Method method;
GenericMethod generic = null;
if (name.TypeArguments != null) {
- generic = new GenericMethod (current_namespace, current_class, name);
+ generic = new GenericMethod (current_namespace, current_class, name,
+ TypeManager.system_void_expr, (Parameters) $6);
generic.SetParameterInfo ((ArrayList) $9);
}
GenericMethod generic = null;
if (name.TypeArguments != null) {
- generic = new GenericMethod (current_namespace, current_class, name);
+ generic = new GenericMethod (current_namespace, current_class, name,
+ (Expression) $3, (Parameters) $6);
generic.SetParameterInfo ((ArrayList) $9);
}
GenericMethod generic = null;
if (name.TypeArguments != null) {
- generic = new GenericMethod (current_namespace, current_class, name);
+ generic = new GenericMethod (current_namespace, current_class, name,
+ TypeManager.system_void_expr, (Parameters) $6);
generic.SetParameterInfo ((ArrayList) $9);
}
}
| non_expression_type rank_specifier
{
- $$ = new ComposedCast ((Expression) $1, (string) $2);
+ Location loc = GetLocation ($1);
+ if (loc.IsNull)
+ loc = lexer.Location;
+ $$ = new ComposedCast ((Expression) $1, (string) $2, loc);
}
| non_expression_type STAR
{
- $$ = new ComposedCast ((Expression) $1, "*");
+ Location loc = GetLocation ($1);
+ if (loc.IsNull)
+ loc = lexer.Location;
+ $$ = new ComposedCast ((Expression) $1, "*", loc);
}
| expression rank_specifiers
{
}
| builtin_types STAR
{
- $$ = new ComposedCast ((Expression) $1, "*");
+ $$ = new ComposedCast ((Expression) $1, "*", lexer.Location);
}
| VOID STAR
{