From a953656ae802e0087f7e8bc4a4d88392cf1bba13 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Sat, 15 Mar 2003 11:01:32 +0000 Subject: [PATCH] * ILParser.jay: Create external method references svn path=/trunk/mcs/; revision=12527 --- mcs/ilasm/parser/ChangeLog | 4 ++++ mcs/ilasm/parser/ILParser.jay | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/mcs/ilasm/parser/ChangeLog b/mcs/ilasm/parser/ChangeLog index 0b416ef1f04..a650cf9cd92 100644 --- a/mcs/ilasm/parser/ChangeLog +++ b/mcs/ilasm/parser/ChangeLog @@ -1,3 +1,7 @@ +2003-03-15 Jackson Harper + + * ILParser.jay: Create external method references + 2003-03-14 Jackson Harper * ILParser.jay: Emit instructions that take a method def as a single param diff --git a/mcs/ilasm/parser/ILParser.jay b/mcs/ilasm/parser/ILParser.jay index 3062ed700fa..439428c7e27 100644 --- a/mcs/ilasm/parser/ILParser.jay +++ b/mcs/ilasm/parser/ILParser.jay @@ -691,6 +691,27 @@ method_ref : internal_method_ref | external_method_ref ; +external_method_ref : type_ref external_type_ref DOUBLE_COLON name1 OPEN_PARENS arg_list CLOSE_PARENS + { + TypeRef parent = (TypeRef) $1; + TypeRef extern_type = (TypeRef) $2; + ClassRef class_ref = (ClassRef) extern_type.Type; + PEAPI.Type[] type_array; + if ($6 != null) { + ArrayList param_list = $6 as ArrayList; + int index = 0; + type_array = new PEAPI.Type[param_list.Count]; + foreach (DictionaryEntry entry in param_list) { + type_array[index] = ((TypeRef)entry.Value).Type; + index++; + } + } else { + type_array = new PEAPI.Type[0]; + } + $$ = class_ref.AddMethod ((string) $4, parent.Type, type_array); + } + ; + internal_method_ref : type_ref internal_type_ref DOUBLE_COLON name1 OPEN_PARENS arg_list CLOSE_PARENS { TypeRef parent, return_type; -- 2.25.1