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_decls.tc,1.38,1.39 cs_gr


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_decls.tc,1.38,1.39 cs_grammar.y,1.63,1.64
Date: Wed, 25 Jun 2003 09:03:36 -0400

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

Modified Files:
        cs_decls.tc cs_grammar.y 
Log Message:


Introduce some new syntax to make it easier to call C code from C#.


Index: cs_decls.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_decls.tc,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** cs_decls.tc 1 Jun 2003 06:46:59 -0000       1.38
--- cs_decls.tc 25 Jun 2003 13:03:34 -0000      1.39
***************
*** 1095,1098 ****
--- 1095,1112 ----
        }
  
+       /* If the "extern" flag is set, and this method is contained
+          within the "<Module>" class, then suppress code generation.
+          Such methods are imported from a foreign C module, and
+          should not be generated from the C# application */
+       if((node->modifiers & CS_SPECIALATTR_EXTERN) != 0)
+       {
+               if(info->currentClass &&
+                  !strcmp(((ILNode_ClassDefn *)(info->currentClass))->name,
+                                  "<Module>"))
+               {
+                       node->suppressCodeGen = 1;
+               }
+       }
+ 
        /* Leave the unsafe context for the method */
        if((node->modifiers & CS_SPECIALATTR_UNSAFE) != 0)

Index: cs_grammar.y
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_grammar.y,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -r1.63 -r1.64
*** cs_grammar.y        14 Jun 2003 19:24:42 -0000      1.63
--- cs_grammar.y        25 Jun 2003 13:03:34 -0000      1.64
***************
*** 1463,1466 ****
--- 1463,1467 ----
        | REFTYPE '(' Expression ')'                    { MakeUnary(RefType, 
$3); }
        | REFVALUE '(' Expression ',' Type ')'  { MakeBinary(RefValue, $3, $5); 
}
+       | MODULE                        { $$ = ILQualIdentSimple("<Module>"); }
        ;
  





reply via email to

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