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

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

[Dotgnu-pnet-commits] treecc ChangeLog, 1.90, 1.91 context.c, 1.6, 1.7 g


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] treecc ChangeLog, 1.90, 1.91 context.c, 1.6, 1.7 gen_cpp.c, 1.7, 1.8 gen_cs.c, 1.3, 1.4 gen_java.c, 1.4, 1.5 info.h, 1.11, 1.12 options.c, 1.9, 1.10
Date: Thu, 20 Nov 2003 00:16:12 +0000

Update of /cvsroot/dotgnu-pnet/treecc
In directory subversions:/tmp/cvs-serv16853

Modified Files:
        ChangeLog context.c gen_cpp.c gen_cs.c gen_java.c info.h 
        options.c 
Log Message:


Add the "base_type" option.


Index: context.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/context.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** context.c   4 Jul 2003 04:53:48 -0000       1.6
--- context.c   20 Nov 2003 00:16:09 -0000      1.7
***************
*** 59,62 ****
--- 59,63 ----
        context->block_size = 0;
        context->nodeNumber = 1;
+       context->baseType = 0;
        return context;
  }

Index: options.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/options.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** options.c   4 Jul 2003 04:53:48 -0000       1.9
--- options.c   20 Nov 2003 00:16:09 -0000      1.10
***************
*** 383,386 ****
--- 383,407 ----
  
  /*
+  * "base_type": use the type as the base type for the root treecc node 
+  */
+ static int BaseTypeOption(TreeCCContext *context, char *value, int flag)
+ {
+       if(!value)
+       {
+               return TREECC_OPT_NEED_VALUE;
+       }
+       else if(value == '\0')
+       {
+               context->baseType = 0;
+               return TREECC_OPT_OK;
+       }
+       else
+       {
+               context->baseType = value;
+               return TREECC_OPT_KEEP_VALUE;
+       }
+ }
+ 
+ /*
   * Table of option handlers.
   */
***************
*** 423,426 ****
--- 444,448 ----
        {"gc_allocator",                GCAllocatorOption,              1},
        {"no_gc_allocator",             GCAllocatorOption,              0},
+       {"base_type",                   BaseTypeOption,                 0},
        {0,                                             0,                      
                        0},
  };

Index: gen_cs.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/gen_cs.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** gen_cs.c    30 Dec 2002 21:54:14 -0000      1.3
--- gen_cs.c    20 Nov 2003 00:16:09 -0000      1.4
***************
*** 333,343 ****
                if(isAbstract)
                {
!                       TreeCCStreamPrint(stream, "%s abstract class %s\n{\n",
                                                          accessMode, 
node->name);
                }
                else
                {
!                       TreeCCStreamPrint(stream, "%s class %s\n{\n",
                                                          accessMode, 
node->name);
                }
  
--- 333,359 ----
                if(isAbstract)
                {
!                       if(context->baseType)
!                       {
!                               TreeCCStreamPrint(stream, "%s abstract class %s 
: %s\n{\n",
!                                                         accessMode, 
node->name, context->baseType);
!                       }
!                       else
!                       {
!                               TreeCCStreamPrint(stream, "%s abstract class 
%s\n{\n",
                                                          accessMode, 
node->name);
+                       }
                }
                else
                {
!                       if(context->baseType)
!                       {
!                               TreeCCStreamPrint(stream, "%s class %s : 
%s\n{\n",
!                                                         accessMode, 
node->name, context->baseType);
!                       }
!                       else
!                       {
!                               TreeCCStreamPrint(stream, "%s class %s\n{\n",
                                                          accessMode, 
node->name);
+                       }
                }
  

Index: info.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/info.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** info.h      4 Jul 2003 04:53:48 -0000       1.11
--- info.h      20 Nov 2003 00:16:09 -0000      1.12
***************
*** 251,254 ****
--- 251,257 ----
        char               *outputDirectory;
  
+       /* name of the base type which is what %typedef expands to */
+       char               *baseType;
+ 
  } TreeCCContext;
  

Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/ChangeLog,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -d -r1.90 -r1.91
*** ChangeLog   17 Jul 2003 00:36:18 -0000      1.90
--- ChangeLog   20 Nov 2003 00:16:09 -0000      1.91
***************
*** 1,3 ****
--- 1,8 ----
  
+ 2003-11-20  Gopal.V  <address@hidden>
+ 
+       * context.c, gen_cpp.c, gen_cs.c, gen_java.c, info.h, options.c,
+       doc/treecc.texi: add the "base_type" option.
+ 
  2003-07-17  Rhys Weatherley  <address@hidden>
  

Index: gen_cpp.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/gen_cpp.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** gen_cpp.c   5 Jul 2003 11:05:57 -0000       1.7
--- gen_cpp.c   20 Nov 2003 00:16:09 -0000      1.8
***************
*** 227,231 ****
        {
                /* This type is the base of a class hierarchy */
!               TreeCCStreamPrint(stream, "class %s\n{\n", node->name);
  
                /* The following fields have protected access */
--- 227,238 ----
        {
                /* This type is the base of a class hierarchy */
!               if(context->baseType)
!               {
!                       TreeCCStreamPrint(stream, "class %s : public %s\n{\n", 
node->name,context->baseType);
!               }
!               else
!               {
!                       TreeCCStreamPrint(stream, "class %s\n{\n", node->name);
!               }
  
                /* The following fields have protected access */

Index: gen_java.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/gen_java.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** gen_java.c  30 Dec 2002 21:54:14 -0000      1.4
--- gen_java.c  20 Nov 2003 00:16:09 -0000      1.5
***************
*** 322,331 ****
                if(isAbstract)
                {
!                       TreeCCStreamPrint(stream, "public abstract class 
%s\n{\n",
!                                                         node->name);
                }
                else
                {
!                       TreeCCStreamPrint(stream, "public class %s\n{\n", 
node->name);
                }
  
--- 322,347 ----
                if(isAbstract)
                {
!                       if(context->baseType)
!                       {
!                               TreeCCStreamPrint(stream, "public abstract 
class %s extends %s\n{\n",
!                                                                 
node->name,context->baseType);
!                       }
!                       else
!                       {
!                               TreeCCStreamPrint(stream, "public abstract 
class %s\n{\n",
!                                                                 node->name);
!                       }
                }
                else
                {
!                       if(context->baseType)
!                       {
!                               TreeCCStreamPrint(stream, "public class %s 
extends %s\n{\n",
!                                                                 
node->name,context->baseType);
!                       }
!                       else
!                       {
!                               TreeCCStreamPrint(stream, "public class 
%s\n{\n", node->name);
!                       }
                }
  





reply via email to

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