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

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

[Dotgnu-pnet-commits] CVS: treecc ChangeLog,1.75,1.76 context.c,1.4,1.5


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: treecc ChangeLog,1.75,1.76 context.c,1.4,1.5 gen_c.c,1.5,1.6 gen_cpp.c,1.3,1.4 info.h,1.9,1.10 options.c,1.7,1.8
Date: Tue, 28 Jan 2003 19:16:18 -0500

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

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


Add the "allocator" and "no_allocator" options, which allow treecc's
C/C++ node allocators to be replaced with third party node allocators.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/ChangeLog,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -r1.75 -r1.76
*** ChangeLog   27 Jan 2003 00:30:29 -0000      1.75
--- ChangeLog   29 Jan 2003 00:16:16 -0000      1.76
***************
*** 1,3 ****
--- 1,11 ----
  
+ 2003-01-29  Rhys Weatherley  <address@hidden>
+ 
+       * context.c, gen_c.c, gen_cpp.c, info.h, options.c, doc/treecc.texi,
+       etc/cpp_skel.cc, tests/output5.out, tests/output6.out,
+       tests/output9.out: add the "allocator" and "no_allocator" options,
+       which allow treecc's C/C++ node allocators to be replaced with
+       third party node allocators.
+ 
  2003-01-27  James Michael DuPont  <address@hidden>
  

Index: context.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/context.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** context.c   27 Jan 2003 00:25:25 -0000      1.4
--- context.c   29 Jan 2003 00:16:16 -0000      1.5
***************
*** 50,53 ****
--- 50,55 ----
        context->strip_filenames = 0;
        context->print_lines = 1;
+       context->internal_access = 0;
+       context->use_allocator = 1;
        context->yy_replacement = "yy";
        context->state_type = "YYNODESTATE";

Index: gen_c.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/gen_c.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** gen_c.c     17 Mar 2002 10:35:28 -0000      1.5
--- gen_c.c     29 Jan 2003 00:16:16 -0000      1.6
***************
*** 1705,1715 ****
  
        /* Generate the contents of the source stream */
!       if(context->commonSource)
        {
!               WriteSourceSkeleton(context, context->commonSource);
!       }
!       else
!       {
!               WriteSourceSkeleton(context, context->sourceStream);
        }
        TreeCCNodeVisitAll(context, DefineVtables);
--- 1705,1718 ----
  
        /* Generate the contents of the source stream */
!       if(context->use_allocator)
        {
!               if(context->commonSource)
!               {
!                       WriteSourceSkeleton(context, context->commonSource);
!               }
!               else
!               {
!                       WriteSourceSkeleton(context, context->sourceStream);
!               }
        }
        TreeCCNodeVisitAll(context, DefineVtables);

Index: gen_cpp.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/gen_cpp.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** gen_cpp.c   12 Sep 2002 05:18:07 -0000      1.3
--- gen_cpp.c   29 Jan 2003 00:16:16 -0000      1.4
***************
*** 663,670 ****
                                                  context->state_type);
                TreeCCStreamPrint(stream, "}\n\n");
!               TreeCCStreamPrint(stream, "void %s::operator delete(void *, 
size_t)\n",
                                                  node->name);
                TreeCCStreamPrint(stream, "{\n");
!               TreeCCStreamPrint(stream, "\t// not used: use %s::pop() 
instead\n",
                                                  context->state_type);
                TreeCCStreamPrint(stream, "}\n\n");
--- 663,671 ----
                                                  context->state_type);
                TreeCCStreamPrint(stream, "}\n\n");
!               TreeCCStreamPrint(stream,
!                               "void %s::operator delete(void *ptr__, size_t 
size__)\n",
                                                  node->name);
                TreeCCStreamPrint(stream, "{\n");
!               TreeCCStreamPrint(stream, "\t%s::getState()->dealloc(ptr__, 
size__);\n",
                                                  context->state_type);
                TreeCCStreamPrint(stream, "}\n\n");
***************
*** 835,839 ****
        /* Declare the node pool handling functions */
        TreeCCStreamPrint(stream, "public:\n\n");
!       TreeCCStreamPrint(stream, "\tvoid *alloc(size_t size);\n");
        TreeCCStreamPrint(stream, "\tint push();\n");
        TreeCCStreamPrint(stream, "\tvoid pop();\n");
--- 836,841 ----
        /* Declare the node pool handling functions */
        TreeCCStreamPrint(stream, "public:\n\n");
!       TreeCCStreamPrint(stream, "\tvoid *alloc(size_t);\n");
!       TreeCCStreamPrint(stream, "\tvoid dealloc(void *, size_t);\n");
        TreeCCStreamPrint(stream, "\tint push();\n");
        TreeCCStreamPrint(stream, "\tvoid pop();\n");
***************
*** 955,958 ****
--- 957,965 ----
        {
                TreeCCStreamPrint(stream, "#define %s_TRACK_LINES 1\n",
+                                                 context->state_type);
+       }
+       if(context->use_allocator)
+       {
+               TreeCCStreamPrint(stream, "#define %s_USE_ALLOCATOR 1\n",
                                                  context->state_type);
        }

Index: info.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/info.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** info.h      27 Jan 2003 00:25:25 -0000      1.9
--- info.h      29 Jan 2003 00:16:16 -0000      1.10
***************
*** 227,230 ****
--- 227,231 ----
        int                             print_lines : 1;        /* Dont emit 
#line directives */
        int                             internal_access : 1; /* Use "internal" 
classes in C# */
+       int                             use_allocator : 1;      /* Use the 
skeleton allocator */
  
        /* String to use to replace "yy" in output files */

Index: options.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/options.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** options.c   27 Jan 2003 00:25:25 -0000      1.7
--- options.c   29 Jan 2003 00:16:16 -0000      1.8
***************
*** 351,354 ****
--- 351,370 ----
  
  /*
+  * "allocator": use (or don't use) the standard treecc allocator for C/C++.
+  */
+ static int AllocatorOption(TreeCCContext *context, char *value, int flag)
+ {
+       if(value)
+       {
+               return TREECC_OPT_NO_VALUE;
+       }
+       else
+       {
+               context->use_allocator = flag;
+               return TREECC_OPT_OK;
+       }
+ }
+ 
+ /*
   * Table of option handlers.
   */
***************
*** 387,390 ****
--- 403,408 ----
        {"internal_access",             InternalAccessOption,   1},
        {"public_access",               InternalAccessOption,   0},
+       {"allocator",                   AllocatorOption,                1},
+       {"no_allocator",                AllocatorOption,                0},
        {0,                                             0,                      
                        0},
  };





reply via email to

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