[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_grammar.y,1.30,1.31
From: |
Gopal.V <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_grammar.y,1.30,1.31 |
Date: |
Sun, 03 Nov 2002 05:46:09 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/cscc/csharp
In directory subversions:/tmp/cvs-serv21563/cscc/csharp
Modified Files:
cs_grammar.y
Log Message:
support for Interface Indexers like IList.this[int x]
Index: cs_grammar.y
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_grammar.y,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** cs_grammar.y 3 Nov 2002 09:25:15 -0000 1.30
--- cs_grammar.y 3 Nov 2002 10:46:06 -0000 1.31
***************
*** 321,325 ****
* public int <name>[int posn] would have been a cleaner design
*/
! static ILNode *GetIndexerName(ILGenInfo *info,ILNode_AttributeTree *attrTree)
{
ILNode_ListIter iter;
--- 321,326 ----
* public int <name>[int posn] would have been a cleaner design
*/
! static ILNode *GetIndexerName(ILGenInfo *info,ILNode_AttributeTree *attrTree,
! ILNode*
prefixName)
{
ILNode_ListIter iter;
***************
*** 329,332 ****
--- 330,334 ----
ILNode_List *args;
ILEvalValue evalValue;
+ char* prefix=(prefixName) ? ILQualIdentName(prefixName,0) : NULL;
if(attrTree && attrTree->sections)
{
***************
*** 349,355 ****
if(evalValue.valueType==ILMachineType_String)
{
! return
ILQualIdentSimple(ILInternString(
!
evalValue.un.strValue.str
!
,evalValue.un.strValue.len).string);
}
}
--- 351,365 ----
if(evalValue.valueType==ILMachineType_String)
{
! if(!prefix)
! {
! return
ILQualIdentSimple(
!
ILInternString("Item", 4).string);
! }
! else
! {
! return
ILNode_QualIdent_create(prefixName,
!
ILQualIdentSimple(
!
ILInternString("Item",4).string));
! }
}
}
***************
*** 358,363 ****
}
}
! /* THE BIG ELSE */
! return ILQualIdentSimple(ILInternString("Item", 4).string);
}
/*
--- 368,376 ----
}
}
! if(!prefix)
! return ILQualIdentSimple(ILInternString("Item", 4).string);
! else
! return ILNode_QualIdent_create(prefixName,
!
ILQualIdentSimple(ILInternString("Item",4).string));
}
/*
***************
*** 2894,2898 ****
: OptAttributes OptModifiers IndexerDeclarator
StartAccessorBlock AccessorBlock {
! ILNode*
name=GetIndexerName(NULL,(ILNode_AttributeTree*)$1);
ILUInt32 attrs =
CSModifiersToPropertyAttrs($3.type, $2);
$$ = ILNode_PropertyDeclaration_create($1,
--- 2907,2912 ----
: OptAttributes OptModifiers IndexerDeclarator
StartAccessorBlock AccessorBlock {
! ILNode*
name=GetIndexerName(NULL,(ILNode_AttributeTree*)$1,
! $3.ident);
ILUInt32 attrs =
CSModifiersToPropertyAttrs($3.type, $2);
$$ = ILNode_PropertyDeclaration_create($1,
***************
*** 2911,2923 ****
: Type THIS FormalIndexParameters {
$$.type = $1;
! $$.ident = ILQualIdentSimple
!
(ILInternString("Item", 4).string);
$$.params = $3;
}
| Type QualifiedIdentifier '.' THIS FormalIndexParameters {
$$.type = $1;
! $$.ident = ILNode_QualIdent_create($2,
! ILQualIdentSimple
!
(ILInternString("Item", 4).string));
$$.params = $5;
}
--- 2925,2934 ----
: Type THIS FormalIndexParameters {
$$.type = $1;
! $$.ident = ILQualIdentSimple(NULL);
$$.params = $3;
}
| Type QualifiedIdentifier '.' THIS FormalIndexParameters {
$$.type = $1;
! $$.ident = $2;
$$.params = $5;
}
***************
*** 3466,3470 ****
IL_META_METHODDEF_SPECIAL_NAME |
IL_META_METHODDEF_NEW_SLOT;
! ILNode*
name=GetIndexerName(NULL,(ILNode_AttributeTree*)$1);
$$ = ILNode_PropertyDeclaration_create
($1, attrs, $3,
name, $5, 0, 0, $7);
--- 3477,3482 ----
IL_META_METHODDEF_SPECIAL_NAME |
IL_META_METHODDEF_NEW_SLOT;
! ILNode*
name=GetIndexerName(NULL,(ILNode_AttributeTree*)$1,
!
ILQualIdentSimple(NULL));
$$ = ILNode_PropertyDeclaration_create
($1, attrs, $3,
name, $5, 0, 0, $7);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_grammar.y,1.30,1.31,
Gopal.V <address@hidden> <=