* ILParser.jay: Implement custom modified types.
authorJackson Harper <jackson@novell.com>
Sun, 15 Jun 2003 00:17:23 +0000 (00:17 -0000)
committerJackson Harper <jackson@novell.com>
Sun, 15 Jun 2003 00:17:23 +0000 (00:17 -0000)
svn path=/trunk/mcs/; revision=15402

mcs/ilasm/parser/ChangeLog
mcs/ilasm/parser/ILParser.jay

index 0463489cd055ce313965c404c88dbcc0de2b804b..de930152cdc535a4d0e270bbeee2d6d6edad39a7 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-14 Jackson Harper <jackson@latitidegeo.com>
+
+       * ILParser.jay: Implement custom modified types.
+               
 2003-06-08 Jackson Harper <jackson@latitudegeo.com>
 
        * ILParser.jay: Implement properties
index d291fac4f87baab6a7532b6431d024db1f1bf4e0..689c229941cb3ce1677d15892d89373ad3428c6d 100644 (file)
@@ -1,7 +1,10 @@
 %{\r
-// Mono::ILASM::ILParser\r
 //\r
+// Mono::ILASM::ILParser\r
+// \r
 // (C) Sergey Chaban (serge@wildwestsoftware.com)\r
+// (C) 2003 Jackson Harper, All rights reserved\r
+//\r
 \r
 using PEAPI;\r
 using System;\r
@@ -433,16 +436,16 @@ class_head                : D_CLASS class_attr id typars_clause extends_clause
                                 codegen.BeginTypeDef ((TypeAttr) $2, (string) $3, \r
                                                $5 as IClassRef, $6 as ArrayList, null);\r
 \r
-                                // Lets not worry about generics for now :p\r
+                                                /*\r
                                 if ($4 != null) {\r
                                         ArrayList typars_list = (ArrayList) $4;\r
                                         foreach (DictionaryEntry entry in typars_list) {\r
-                                                string name = (string) entry.Key;\r
+                                                ITypeRef constraint = (ITypeRef) entry.Key;\r
                                                 string id = (string) entry.Value;\r
-                                                codegen.CurrentTypeDef.AddGenericParam (name, id);\r
+                                                codegen.CurrentTypeDef.AddGenericParam (constraint, id);\r
                                         }\r
                                 }\r
-                                \r
+                                */\r
                           }\r
                        ;\r
 \r
@@ -526,11 +529,11 @@ formal_typars           : formal_typar
                         ;\r
 \r
 \r
-formal_typar            : id\r
+formal_typar            : type\r
                           {\r
                                 $$ = new DictionaryEntry ($1, null);\r
                           }\r
-                        | id id\r
+                        | type id\r
                           {\r
                                 $$ = new DictionaryEntry ($1, $2);\r
                           }\r
@@ -661,23 +664,17 @@ type                      : K_CLASS class_ref
                           }\r
                        | type K_MODREQ OPEN_PARENS class_ref CLOSE_PARENS\r
                           {\r
-                                /*\r
                                 ITypeRef base_type = (ITypeRef) $1;\r
-                                ITypeRef class_ref = (ITypeRef) $4;\r
-\r
-                                $$ = new CustomModifiedType (base_type.Type,\r
-                                        CustomModifier.modreq, (Class) class_ref.Type);\r
-                                */\r
+                                IClassRef class_ref = (IClassRef) $4;\r
+                                base_type.MakeCustomModified (codegen,\r
+                                        CustomModifier.modopt, class_ref);    \r
                           }\r
                        | type K_MODOPT OPEN_PARENS class_ref CLOSE_PARENS\r
                           {\r
-                                /*\r
-                                TypeRef base_type = (TypeRef) $1;\r
-                                TypeRef class_ref = (TypeRef) $4;\r
-\r
-                                $$ = new CustomModifiedType (base_type.Type,\r
-                                        CustomModifier.modopt, (Class) class_ref.Type);\r
-                                */\r
+                                ITypeRef base_type = (ITypeRef) $1;\r
+                                IClassRef class_ref = (IClassRef) $4;\r
+                                base_type.MakeCustomModified (codegen,\r
+                                        CustomModifier.modopt, class_ref);    \r
                           }\r
                        | K_METHOD call_conv type STAR OPEN_PARENS sig_args CLOSE_PARENS\r
                        | K_TYPEDREF\r