dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_grammar.y,1.47,1.48


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_grammar.y,1.47,1.48
Date: Thu, 20 Feb 2003 21:00:03 -0500

Update of /cvsroot/dotgnu-pnet/pnet/cscc/csharp
In directory subversions:/tmp/cvs-serv9822/cscc/csharp

Modified Files:
        cs_grammar.y 
Log Message:


Add generic type formals to operator definitions.


Index: cs_grammar.y
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_grammar.y,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -r1.47 -r1.48
*** cs_grammar.y        21 Feb 2003 01:53:39 -0000      1.47
--- cs_grammar.y        21 Feb 2003 02:00:00 -0000      1.48
***************
*** 3116,3123 ****
  NormalOperatorDeclaration
        : OptAttributes OptModifiers Type OPERATOR OverloadableOperator
!                       '(' Type Identifier ')' Block {
                                ILUInt32 attrs;
                                ILNode *params;
  
                                /* Validate the name of the unary operator */
                                if($5.unary == 0)
--- 3116,3125 ----
  NormalOperatorDeclaration
        : OptAttributes OptModifiers Type OPERATOR OverloadableOperator
!                       TypeFormals '(' Type Identifier ')'     Block {
                                ILUInt32 attrs;
                                ILNode *params;
  
+                               /* TODO: generic parameters */
+ 
                                /* Validate the name of the unary operator */
                                if($5.unary == 0)
***************
*** 3133,3137 ****
                                params = ILNode_List_create();
                                ILNode_List_Add(params,
!                                       ILNode_FormalParameter_create(0, 
ILParamMod_empty, $7, $8));
  
                                /* Create a method definition for the operator 
*/
--- 3135,3139 ----
                                params = ILNode_List_create();
                                ILNode_List_Add(params,
!                                       ILNode_FormalParameter_create(0, 
ILParamMod_empty, $8, $9));
  
                                /* Create a method definition for the operator 
*/
***************
*** 3139,3150 ****
                                                ($1, attrs, $3,
                                                 
ILQualIdentSimple(ILInternString($5.unary, -1).string),
!                                                params, $10);
                                CloneLine($$, $3);
                        }
        | OptAttributes OptModifiers Type OPERATOR OverloadableOperator
!                       '(' Type Identifier ',' Type Identifier ')' Block       
{
                                ILUInt32 attrs;
                                ILNode *params;
  
                                /* Validate the name of the binary operator */
                                if($5.binary == 0)
--- 3141,3154 ----
                                                ($1, attrs, $3,
                                                 
ILQualIdentSimple(ILInternString($5.unary, -1).string),
!                                                params, $11);
                                CloneLine($$, $3);
                        }
        | OptAttributes OptModifiers Type OPERATOR OverloadableOperator
!                       TypeFormals '(' Type Identifier ',' Type Identifier ')' 
Block   {
                                ILUInt32 attrs;
                                ILNode *params;
  
+                               /* TODO: generic parameters */
+ 
                                /* Validate the name of the binary operator */
                                if($5.binary == 0)
***************
*** 3161,3168 ****
                                ILNode_List_Add(params,
                                        ILNode_FormalParameter_create
!                                               (0, ILParamMod_empty, $7, $8));
                                ILNode_List_Add(params,
                                        ILNode_FormalParameter_create
!                                               (0, ILParamMod_empty, $10, 
$11));
  
                                /* Create a method definition for the operator 
*/
--- 3165,3172 ----
                                ILNode_List_Add(params,
                                        ILNode_FormalParameter_create
!                                               (0, ILParamMod_empty, $8, $9));
                                ILNode_List_Add(params,
                                        ILNode_FormalParameter_create
!                                               (0, ILParamMod_empty, $11, 
$12));
  
                                /* Create a method definition for the operator 
*/
***************
*** 3171,3175 ****
                                                 ILQualIdentSimple
                                                        
(ILInternString($5.binary, -1).string),
!                                                params, $13);
                                CloneLine($$, $3);
                        }
--- 3175,3179 ----
                                                 ILQualIdentSimple
                                                        
(ILInternString($5.binary, -1).string),
!                                                params, $14);
                                CloneLine($$, $3);
                        }
***************
*** 3202,3246 ****
  
  ConversionOperatorDeclaration
!       : OptAttributes OptModifiers IMPLICIT OPERATOR Type
                        '(' Type Identifier ')' Block   {
                                ILUInt32 attrs;
                                ILNode *params;
  
                                /* Get the operator attributes */
!                               attrs = CSModifiersToOperatorAttrs($5, $2);
  
                                /* Build the formal parameter list */
                                params = ILNode_List_create();
                                ILNode_List_Add(params,
!                                       ILNode_FormalParameter_create(0, 
ILParamMod_empty, $7, $8));
  
                                /* Create a method definition for the operator 
*/
                                $$ = ILNode_MethodDeclaration_create
!                                               ($1, attrs, $5,
                                                 ILQualIdentSimple
                                                        
(ILInternString("op_Implicit", -1).string),
!                                                params, $10);
!                               CloneLine($$, $5);
                        }
!       | OptAttributes OptModifiers EXPLICIT OPERATOR Type
                        '(' Type Identifier ')' Block   {
                                ILUInt32 attrs;
                                ILNode *params;
  
                                /* Get the operator attributes */
!                               attrs = CSModifiersToOperatorAttrs($5, $2);
  
                                /* Build the formal parameter list */
                                params = ILNode_List_create();
                                ILNode_List_Add(params,
!                                       ILNode_FormalParameter_create(0, 
ILParamMod_empty, $7, $8));
  
                                /* Create a method definition for the operator 
*/
                                $$ = ILNode_MethodDeclaration_create
!                                               ($1, attrs, $5,
                                                 ILQualIdentSimple
                                                        
(ILInternString("op_Explicit", -1).string),
!                                                params, $10);
!                               CloneLine($$, $5);
                        }
        ;
--- 3206,3254 ----
  
  ConversionOperatorDeclaration
!       : OptAttributes OptModifiers IMPLICIT OPERATOR TypeFormals Type
                        '(' Type Identifier ')' Block   {
                                ILUInt32 attrs;
                                ILNode *params;
  
+                               /* TODO: generic parameters */
+ 
                                /* Get the operator attributes */
!                               attrs = CSModifiersToOperatorAttrs($6, $2);
  
                                /* Build the formal parameter list */
                                params = ILNode_List_create();
                                ILNode_List_Add(params,
!                                       ILNode_FormalParameter_create(0, 
ILParamMod_empty, $8, $9));
  
                                /* Create a method definition for the operator 
*/
                                $$ = ILNode_MethodDeclaration_create
!                                               ($1, attrs, $6,
                                                 ILQualIdentSimple
                                                        
(ILInternString("op_Implicit", -1).string),
!                                                params, $11);
!                               CloneLine($$, $6);
                        }
!       | OptAttributes OptModifiers EXPLICIT OPERATOR TypeFormals Type
                        '(' Type Identifier ')' Block   {
                                ILUInt32 attrs;
                                ILNode *params;
  
+                               /* TODO: generic parameters */
+ 
                                /* Get the operator attributes */
!                               attrs = CSModifiersToOperatorAttrs($6, $2);
  
                                /* Build the formal parameter list */
                                params = ILNode_List_create();
                                ILNode_List_Add(params,
!                                       ILNode_FormalParameter_create(0, 
ILParamMod_empty, $8, $9));
  
                                /* Create a method definition for the operator 
*/
                                $$ = ILNode_MethodDeclaration_create
!                                               ($1, attrs, $6,
                                                 ILQualIdentSimple
                                                        
(ILInternString("op_Explicit", -1).string),
!                                                params, $11);
!                               CloneLine($$, $6);
                        }
        ;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]