[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/ilasm ilasm_build.c,1.20,1.21 ilasm_bui
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/ilasm ilasm_build.c,1.20,1.21 ilasm_build.h,1.8,1.9 ilasm_grammar.y,1.31,1.32 |
Date: |
Fri, 28 Feb 2003 19:47:28 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/ilasm
In directory subversions:/tmp/cvs-serv23701/ilasm
Modified Files:
ilasm_build.c ilasm_build.h ilasm_grammar.y
Log Message:
Add explicit custom attribute owner syntax to ilasm (Bug #2675).
Index: ilasm_build.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilasm/ilasm_build.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** ilasm_build.c 18 Feb 2003 05:25:08 -0000 1.20
--- ilasm_build.c 1 Mar 2003 00:47:26 -0000 1.21
***************
*** 942,946 ****
}
! void ILAsmAttributeCreate(ILProgramItem *type, ILIntString *value)
{
ILAttribute *attr;
--- 942,947 ----
}
! void ILAsmAttributeCreateFor(ILToken ownerToken, ILProgramItem *type,
! ILIntString *value)
{
ILAttribute *attr;
***************
*** 1004,1008 ****
/* Attach the attribute to its owner */
! owner = ILProgramItem_FromToken(ILAsmImage, ILAsmLastToken);
if(!owner)
{
--- 1005,1009 ----
/* Attach the attribute to its owner */
! owner = ILProgramItem_FromToken(ILAsmImage, ownerToken);
if(!owner)
{
***************
*** 1015,1018 ****
--- 1016,1024 ----
ILProgramItemAddAttribute(owner, attr);
}
+ }
+
+ void ILAsmAttributeCreate(ILProgramItem *type, ILIntString *value)
+ {
+ ILAsmAttributeCreateFor(ILAsmLastToken, type, value);
}
Index: ilasm_build.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilasm/ilasm_build.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** ilasm_build.h 18 Feb 2003 05:25:08 -0000 1.8
--- ilasm_build.h 1 Mar 2003 00:47:26 -0000 1.9
***************
*** 199,202 ****
--- 199,208 ----
/*
+ * Create a custom attribute and attach it to a particular item.
+ */
+ void ILAsmAttributeCreateFor(ILToken token, ILProgramItem *type,
+ ILIntString *value);
+
+ /*
* Create a custom attribute and attach it to the current item.
*/
Index: ilasm_grammar.y
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilasm/ilasm_grammar.y,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** ilasm_grammar.y 28 Feb 2003 06:04:03 -0000 1.31
--- ilasm_grammar.y 1 Mar 2003 00:47:26 -0000 1.32
***************
*** 954,958 ****
%type <exception> JavaExceptionClause JavaExceptionClauses
%type <token> MethodReference InstanceMethodReference
! %type <token> GenericMethodReference
%type <integer> DataItemCount
%type <params> FormalGenericParamsOpt FormalGenericParams
--- 954,958 ----
%type <exception> JavaExceptionClause JavaExceptionClauses
%type <token> MethodReference InstanceMethodReference
! %type <token> GenericMethodReference CustomOwner
%type <integer> DataItemCount
%type <params> FormalGenericParamsOpt FormalGenericParams
***************
*** 3830,3841 ****
ILAsmAttributeCreate($2, &($4));
}
;
- /* Note: the first case has been removed because it creates
- too many shift/reduce conflicts. Besides, that usage is
- supposed to be obsolete in newer versions of the standard */
CustomType
! : /*TypeSpecification { $$ = $1.item; }
! |*/ MethodReference { $$ = ILProgramItem_FromToken(ILAsmImage, $1); }
;
--- 3830,3860 ----
ILAsmAttributeCreate($2, &($4));
}
+ | D_CUSTOM '(' CustomOwner ')' CustomType '=' Bytes {
+ ILAsmAttributeCreateFor($3, $5, &($7));
+ }
+ | D_CUSTOM '(' CustomOwner ')' CustomType '=' ComposedString {
+ ILAsmAttributeCreateFor($3, $5, &($7));
+ }
+ | D_CUSTOM '(' CustomOwner ')' CustomType {
+ ILAsmAttributeCreateFor($3, $5, 0);
+ }
;
CustomType
! : MethodReference { $$ = ILProgramItem_FromToken(ILAsmImage, $1); }
! ;
!
! CustomOwner
! : TypeSpecification { $$ =
ILProgramItem_Token($1.item); }
! | K_METHOD MethodReference { $$ = $2; }
! | K_FIELD Type TypeSpecification COLON_COLON Identifier {
! $$ = ILAsmResolveMember($3.item, $5.string, $2,
!
IL_META_MEMBERKIND_FIELD);
! }
! | K_FIELD Type Identifier {
! $$ =
ILAsmResolveMember(ILToProgramItem(ILAsmClass),
!
$3.string, $2,
!
IL_META_MEMBERKIND_FIELD);
! }
;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/ilasm ilasm_build.c,1.20,1.21 ilasm_build.h,1.8,1.9 ilasm_grammar.y,1.31,1.32,
Rhys Weatherley <address@hidden> <=