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.73,1.74 context.c,1.3,1.4


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: treecc ChangeLog,1.73,1.74 context.c,1.3,1.4 info.h,1.8,1.9 options.c,1.6,1.7 stream.c,1.4,1.5
Date: Sun, 26 Jan 2003 19:25:27 -0500

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

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


Add the "print_lines" and "no_print_lines" options to suppress #line directives.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/ChangeLog,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -r1.73 -r1.74
*** ChangeLog   27 Jan 2003 00:15:39 -0000      1.73
--- ChangeLog   27 Jan 2003 00:25:25 -0000      1.74
***************
*** 1,3 ****
--- 1,8 ----
  
+ 2003-01-27  James Michael DuPont  <address@hidden>
+ 
+       * context.c, info.h, options.c, stream.c: add the "print_lines"
+       and "no_print_lines" options to suppress #line directives.
+ 
  2003-01-27  Rhys Weatherley  <address@hidden>
  

Index: context.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/context.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** context.c   17 Mar 2002 10:35:28 -0000      1.3
--- context.c   27 Jan 2003 00:25:25 -0000      1.4
***************
*** 49,52 ****
--- 49,53 ----
        context->kind_in_vtable = 0;
        context->strip_filenames = 0;
+       context->print_lines = 1;
        context->yy_replacement = "yy";
        context->state_type = "YYNODESTATE";

Index: info.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/info.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** info.h      10 Jan 2003 22:13:37 -0000      1.8
--- info.h      27 Jan 2003 00:25:25 -0000      1.9
***************
*** 225,228 ****
--- 225,229 ----
        int                             kind_in_vtable : 1;     /* Put kind 
value in vtable only */
        int                             strip_filenames : 1; /* Strip names in 
#line directives */
+       int                             print_lines : 1;        /* Dont emit 
#line directives */
        int                             internal_access : 1; /* Use "internal" 
classes in C# */
  

Index: options.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/options.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** options.c   10 Jan 2003 22:13:37 -0000      1.6
--- options.c   27 Jan 2003 00:25:25 -0000      1.7
***************
*** 298,301 ****
--- 298,319 ----
  }
  
+ 
+ 
+ /*
+  * "print_lines": print out line number directives.
+  */
+ static int PrintLineNumberOption(TreeCCContext *context, char *value, int 
flag)
+ {
+       if(value)
+       {
+               return TREECC_OPT_NO_VALUE;
+       }
+       else
+       {
+               context->print_lines = flag;
+               return TREECC_OPT_OK;
+       }
+ }
+ 
  /*
   * "strip_filenames": strip filenames in #line directives down
***************
*** 364,367 ****
--- 382,387 ----
        {"block_size",                  BlockSizeOption,                0},
        {"strip_filenames",             StripFilenamesOption,   1},
+       {"print_lines",                 PrintLineNumberOption,  1},
+       {"no_print_lines",              PrintLineNumberOption,  0},
        {"no_strip_filenames",  StripFilenamesOption,   0},
        {"internal_access",             InternalAccessOption,   1},

Index: stream.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/stream.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** stream.c    9 Jan 2003 09:18:47 -0000       1.4
--- stream.c    27 Jan 2003 00:25:25 -0000      1.5
***************
*** 661,675 ****
                                          const char *filename)
  {
!       int len;
!       if(stream->context->strip_filenames)
        {
!               len = strlen(filename);
!               while(len > 0 && filename[len - 1] != '/' && filename[len - 1] 
!= '\\')
                {
!                       --len;
                }
!               filename += len;
        }
-       TreeCCStreamPrint(stream, "#line %ld \"%s\"\n", linenum, filename);
  }
  
--- 661,679 ----
                                          const char *filename)
  {
!       if(stream->context->print_lines)
        {
!               int len;
!               if(stream->context->strip_filenames)
                {
!                       len = strlen(filename);
!                       while(len > 0 && filename[len - 1] != '/' &&
!                                 filename[len - 1] != '\\')
!                       {
!                               --len;
!                       }
!                       filename += len;
                }
!               TreeCCStreamPrint(stream, "#line %ld \"%s\"\n", linenum, 
filename);
        }
  }
  





reply via email to

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