%token K_OFF\r
%token K_FORWARDER\r
%token K_CHARMAPERROR\r
+%token K_LEGACY\r
+%token K_LIBRARY\r
+%token K_AUTO\r
\r
/* end generated */\r
\r
| class_attr K_NESTED K_FAMANDASSEM { $$ = (TypeAttr)$1 | TypeAttr.NestedFamAndAssem; }\r
| class_attr K_NESTED K_FAMORASSEM { $$ = (TypeAttr)$1 | TypeAttr.NestedFamOrAssem; }\r
| class_attr K_VALUE { is_value_class = true; }\r
- | class_attr K_ENUM { is_enum_class = true; is_value_class = true;\r
- }\r
+ | class_attr K_ENUM { is_enum_class = true; }\r
| class_attr K_INTERFACE { $$ = (TypeAttr)$1 | TypeAttr.Interface; }\r
| class_attr K_SEALED { $$ = (TypeAttr)$1 | TypeAttr.Sealed; }\r
| class_attr K_ABSTRACT { $$ = (TypeAttr)$1 | TypeAttr.Abstract; }\r
}\r
;\r
\r
-assembly_head : D_ASSEMBLY asm_attr slashed_name\r
+assembly_head : D_ASSEMBLY legacylibrary_opt asm_attr slashed_name\r
{\r
- codegen.SetThisAssembly ((string) $3, (PEAPI.AssemAttr) $2);\r
+ codegen.SetThisAssembly ((string) $4, (PEAPI.AssemAttr) $3);\r
codegen.CurrentCustomAttrTarget = codegen.ThisAssembly;\r
codegen.CurrentDeclSecurityTarget = codegen.ThisAssembly;\r
}\r
assemblyref_all : assemblyref_head OPEN_BRACE assemblyref_decls CLOSE_BRACE\r
;\r
\r
-assemblyref_head : D_ASSEMBLY K_EXTERN asm_attr slashed_name\r
+assemblyref_head : D_ASSEMBLY K_EXTERN legacylibrary_opt asm_attr slashed_name\r
{\r
System.Reflection.AssemblyName asmb_name = \r
new System.Reflection.AssemblyName ();\r
- asmb_name.Name = (string) $4;\r
- codegen.BeginAssemblyRef ((string) $4, asmb_name, (PEAPI.AssemAttr) $3);\r
+ asmb_name.Name = (string) $5;\r
+ codegen.BeginAssemblyRef ((string) $5, asmb_name, (PEAPI.AssemAttr) $4);\r
}\r
- | D_ASSEMBLY K_EXTERN asm_attr slashed_name K_AS slashed_name\r
+ | D_ASSEMBLY K_EXTERN legacylibrary_opt asm_attr slashed_name K_AS slashed_name\r
{\r
System.Reflection.AssemblyName asmb_name = \r
new System.Reflection.AssemblyName ();\r
- asmb_name.Name = (string) $4;\r
- codegen.BeginAssemblyRef ((string) $6, asmb_name, (PEAPI.AssemAttr) $3);\r
+ asmb_name.Name = (string) $5;\r
+ codegen.BeginAssemblyRef ((string) $7, asmb_name, (PEAPI.AssemAttr) $4);\r
}\r
;\r
\r
if (codegen.CurrentCustomAttrTarget != null)\r
codegen.CurrentCustomAttrTarget.AddCustomAttribute ((CustomAttr) $1);\r
}\r
+ | K_AUTO /* MS ilasm uses this keyword to lookup the specified assembly in the GAC and embeds its attributes, we just ignore it */\r
;\r
\r
exptype_all : exptype_head OPEN_BRACE exptype_decls CLOSE_BRACE\r
| SEMICOLON\r
;\r
\r
+legacylibrary_opt : /* empty */\r
+ | K_LEGACY K_LIBRARY /* MS ilasm has these keywords for backwards compatibility, we just ignore them */\r
+ ;\r
+\r
%%\r
\r
}\r