[m-rev.] diff: merge IL properties
Peter Ross
petdr at cs.mu.OZ.AU
Thu Jun 21 00:16:26 AEST 2001
Hi,
===================================================================
Estimated hours taken: 0.25
Branches: main
compiler/ilasm.m:
Merge the change to support properties in IL from the dotnet-foreign
branch.
Index: compiler/ilasm.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/ilasm.m,v
retrieving revision 1.10
diff -u -r1.10 ilasm.m
--- compiler/ilasm.m 2001/05/29 13:06:27 1.10
+++ compiler/ilasm.m 2001/06/20 14:06:27
@@ -117,6 +117,13 @@
maybe(int32), % offset for explicit layout
field_initializer % initializer
)
+ % .property (a class property)
+ ; property(
+ ilds__type, % property type
+ ilds__id, % property name
+ maybe(methodhead), % get property
+ maybe(methodhead) % set property
+ )
% .class (a nested class)
; nested_class(
list(classattr), % attributes for the class
@@ -431,8 +438,33 @@
output_id(IlId),
output_field_initializer(Initializer).
-ilasm__output_classdecl(nested_class(Attrs, Id, Extends, Implements, Contents),
- Info0, Info) -->
+ilasm__output_classdecl(
+ property(Type, Name, MaybeGet, MaybeSet), Info0, Info) -->
+ io__write_string(".property instance "),
+ output_type(Type, Info0, Info1),
+ io__write_string(" "),
+ output_id(Name),
+ io__write_string("() {"),
+ ( { MaybeGet = yes(methodhead(_, GetMethodName, GetSignature, _)) },
+ io__nl,
+ io__write_string("\t.get instance "),
+ output_name_signature_and_call_conv(GetSignature,
+ yes(GetMethodName), Info1, Info2)
+ ; { MaybeGet = no },
+ { Info2 = Info1 }
+ ),
+ ( { MaybeSet = yes(methodhead(_, SetMethodName, SetSignature, _)) },
+ io__nl,
+ io__write_string("\t.set instance "),
+ output_name_signature_and_call_conv(SetSignature,
+ yes(SetMethodName), Info2, Info)
+ ; { MaybeSet = no },
+ { Info = Info2 }
+ ),
+ io__write_string("\n}\n").
+
+ilasm__output_classdecl(nested_class(Attrs, Id, Extends, Implements,
+ Contents), Info0, Info) -->
ilasm__output_decl(class(Attrs, Id, Extends, Implements, Contents),
Info0, Info).
----
Peter Ross
PhD Student University of Melbourne
http://www.cs.mu.oz.au/~petdr/
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list