(Module): Oops. Reversed unintended checkin.
authorJambunathan K <jambunathan@mono-cvs.ximian.com>
Fri, 30 Jul 2004 08:07:51 +0000 (08:07 -0000)
committerJambunathan K <jambunathan@mono-cvs.ximian.com>
Fri, 30 Jul 2004 08:07:51 +0000 (08:07 -0000)
svn path=/trunk/mcs/; revision=31645

mcs/mbas/mb-parser.jay

index 081d9439f13be35de5bcc885fb3beb5097b2a606..616c925f5d760e86bfc3c3da1171a4da92e765b9 100644 (file)
@@ -608,7 +608,7 @@ compilation_unit
        : logical_end_of_line
          opt_option_directives
          opt_imports_directives 
-         opt_global_attributes
+         opt_attributes
          opt_declarations 
          EOF
          {
@@ -791,14 +791,14 @@ opt_params
        | OPEN_PARENS CLOSE_PARENS      { $$ = Parameters.EmptyReadOnlyParameters; }
        | OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS    { $$ = $2; }
        ;
-
-opt_global_attributes
+       
+opt_attributes
        : /* empty */
-       | global_attribute_sections     { $$ = $1; }
+       | attribute_sections    { $$ = $1; }
        ;
 
-global_attribute_sections
-       : global_attribute_section
+attribute_sections
+       : attribute_section
           { 
                AttributeSection sect = (AttributeSection) $1;
 
@@ -813,7 +813,7 @@ global_attribute_sections
                     otherwise an exception should be thrown since VB.NET 
                     only allows one attribute section 
           */  
-       | global_attribute_section global_attribute_sections
+       | attribute_sections attribute_section
          {
                Attributes attrs = null;
                AttributeSection sect = (AttributeSection) $2;
@@ -829,31 +829,21 @@ global_attribute_sections
                $$ = attrs;
          }     
        ;
-
-attribute_begin
-       : OP_LT
-       ;
-
-attribute_end
-       : OP_GT
-       ;
-
-global_attribute_begin
-       : OP_LT attribute_target_specifier
-         {
-                 $$ = $2;
-         }
-
-global_attribute_section
-       : global_attribute_begin attribute_list attribute_end
+       
+attribute_section
+       : OP_LT attribute_target_specifier attribute_list OP_GT
          { 
                string target = null;
                
-               if ($1 != null)
-                       target = (string) $1;
+               if ($2 != null)
+                       target = (string) $2;
                
                $$ = new AttributeSection (target, (ArrayList) $3);
          }     
+       | OP_LT attribute_list OP_GT
+         {
+               $$ = new AttributeSection (null, (ArrayList) $2);
+         }     
        ; 
 
 attribute_target_specifier
@@ -869,54 +859,9 @@ attribute_target
                CheckAttributeTarget ((string) $1);
                $$ = $1;
          }
+        | EVENT  { $$ = "event"; }       
+        | RETURN { $$ = "return"; }
        ;
-
-       
-opt_attributes
-       : /* empty */
-       | attribute_sections    { $$ = $1; }
-       ;
-
-attribute_sections
-       : attribute_section
-          { 
-               AttributeSection sect = (AttributeSection) $1;
-
-               if (sect.Target == "assembly") 
-                       RootContext.AddGlobalAttributeSection (current_container, sect);
-               
-               $$ = new Attributes ((AttributeSection) $1, lexer.Location);
-               
-          }    
-          /* 
-             FIXME: we should check if extended syntax is enabled;
-                    otherwise an exception should be thrown since VB.NET 
-                    only allows one attribute section 
-          */  
-       | attribute_sections attribute_section
-         {
-               Attributes attrs = null;
-               AttributeSection sect = (AttributeSection) $2;
-
-               if (sect.Target == "assembly")
-                       RootContext.AddGlobalAttributeSection (current_container, sect);
-
-               if ($1 != null) {
-                       attrs = (Attributes) $1;
-                       attrs.AddAttributeSection (sect);
-               }
-               
-               $$ = attrs;
-         }     
-       ;
-       
-attribute_section
-       : attribute_begin attribute_list attribute_end
-         {
-               $$ = new AttributeSection (null, (ArrayList) $2);
-         }     
-       ; 
-
        
 attribute_list
        : attribute 
@@ -4713,8 +4658,7 @@ void CheckAttributeTarget (string a)
 {
        switch (a) {
 
-       case "assembly" : 
-       case "module" :
+       case "assembly" : case "field" : case "method" : case "param" : case "property" : case "type" :
                return;
                
        default :