gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-3963-gae870c0


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-3963-gae870c0
Date: Sun, 26 Apr 2020 10:06:16 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-5.1-stable has been updated
       via  ae870c0e8d05e3e88b555edfe12dcb486e067a33 (commit)
       via  461ed6d987ad5ab4e4fce811abd639f1d055a311 (commit)
      from  7de3b57a8a7e36acd718ab1313c25276607e9b41 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=ae870c0e8d05e3e88b555edfe12dcb486e067a33

commit ae870c0e8d05e3e88b555edfe12dcb486e067a33
Author: Arnold D. Robbins <address@hidden>
Date:   Sun Apr 26 17:04:33 2020 +0300

    Add Ascii Art statist picture for gawkinet.texi.

diff --git a/doc/ChangeLog b/doc/ChangeLog
index 91c5904..61e1ac5 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,10 @@
+2020-04-26         Arnold D. Robbins     <address@hidden>
+
+       * gawkinet.texi: Include ASCII Art version of the statist
+       image. Thanks again to Manuel Collado.  Also update copyright
+       year and update month.
+       * statist.txt: New file.
+
 2020-04-20         Arnold D. Robbins     <address@hidden>
 
        * gawkinet.texi: Include statist figure in HTML version. Thanks
diff --git a/doc/gawkinet.info b/doc/gawkinet.info
index 6f3314a..c8e885f 100644
--- a/doc/gawkinet.info
+++ b/doc/gawkinet.info
@@ -5,8 +5,8 @@ This is Edition 1.5 of 'TCP/IP Internetworking with 'gawk'', 
for the
 5.1.0 (or later) version of the GNU implementation of AWK.
 
 
-   Copyright (C) 2000, 2001, 2002, 2004, 2009, 2010, 2016, 2019 Free
-Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2004, 2009, 2010, 2016, 2019, 2020
+Free Software Foundation, Inc.
 
 
    Permission is granted to copy, distribute and/or modify this document
@@ -33,8 +33,8 @@ END-INFO-DIR-ENTRY
 5.1.0 (or later) version of the GNU implementation of AWK.
 
 
-   Copyright (C) 2000, 2001, 2002, 2004, 2009, 2010, 2016, 2019 Free
-Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2004, 2009, 2010, 2016, 2019, 2020
+Free Software Foundation, Inc.
 
 
    Permission is granted to copy, distribute and/or modify this document
@@ -64,8 +64,8 @@ This file documents the networking features in GNU Awk 
('gawk') version
 5.1.0 (or later) version of the GNU implementation of AWK.
 
 
-   Copyright (C) 2000, 2001, 2002, 2004, 2009, 2010, 2016, 2019 Free
-Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2004, 2009, 2010, 2016, 2019, 2020
+Free Software Foundation, Inc.
 
 
    Permission is granted to copy, distribute and/or modify this document
@@ -2337,7 +2337,31 @@ File: gawkinet.info,  Node: STATIST,  Next: MAZE,  Prev: 
WEBGRAB,  Up: Some Appl
 3.6 STATIST: Graphing a Statistical Distribution
 ================================================
 
-In the HTTP server examples we've shown thus far, we never present an
+      0.4 ,------------.------------_------------.------------,
+          |                        : :          sample 1 :::: |
+          |                       :   :         sample 2 ---- |
+      0.3 |-                     :     :_                    -|
+          |                      :    ,: `,                   |
+          |                     :    /  :  \                  |
+      0.2 |-                   :    /    :  \                -|
+          |                    :   /     :   \                |
+          |                   :   /       :   \               |
+      0.1 |-                 :   /         :   \             -|
+          |                  :  /          :    \             |
+          |                 : ,'            :    `,           |
+        0 |----------------'-'               `-----`----------|
+          |                                                   |
+          |                                                   |
+     -0.1 |-                    p(m1=m2) =0.0863798346775753 -|
+          |                                                   |
+          |                                                   |
+     -0.2 |-                    p(v1=v2) =0.31647637745891   -|
+          |                                                   |
+          |                                                   |
+     -0.3 `------------'------------'------------'------------'
+         -10           5            0            5           10
+
+   In the HTTP server examples we've shown thus far, we never present an
 image to the browser and its user.  Presenting images is one task.
 Generating images that reflect some user input and presenting these
 dynamically generated images is another.  In this node, we use GNUPlot
@@ -4242,7 +4266,7 @@ Index
 * input/output, two-way, See Also gawk, networking: Gawk Special Files.
                                                               (line  19)
 * Internet, See networks:                Interacting.         (line  48)
-* JavaScript:                            STATIST.             (line  56)
+* JavaScript:                            STATIST.             (line  80)
 * Linux:                                 Troubleshooting.     (line  54)
 * Linux <1>:                             Interacting.         (line  27)
 * Linux <2>:                             REMCONF.             (line   6)
@@ -4269,7 +4293,7 @@ Index
 * networks, ports, reserved:             Setting Up.          (line  37)
 * networks, ports, specifying:           Special File Fields. (line  24)
 * networks, See Also web pages:          PANIC.               (line   6)
-* Numerical Recipes:                     STATIST.             (line  24)
+* Numerical Recipes:                     STATIST.             (line  48)
 * ORS variable, HTTP and:                Web page.            (line  29)
 * ORS variable, POP and:                 Email.               (line  36)
 * PANIC program:                         PANIC.               (line   6)
@@ -4282,7 +4306,7 @@ Index
 * POP (Post Office Protocol):            Email.               (line   6)
 * POP (Post Office Protocol) <1>:        Email.               (line  36)
 * Post Office Protocol (POP):            Email.               (line   6)
-* PostScript:                            STATIST.             (line 138)
+* PostScript:                            STATIST.             (line 162)
 * PROLOG:                                Challenges.          (line  75)
 * PROTBASE:                              PROTBASE.            (line   6)
 * protocol field:                        Special File Fields. (line  17)
@@ -4354,60 +4378,60 @@ Index
 
 
 Tag Table:
-Node: Top2034
-Node: Preface5683
-Node: Introduction7058
-Node: Stream Communications8084
-Node: Datagram Communications9258
-Node: The TCP/IP Protocols10888
-Ref: The TCP/IP Protocols-Footnote-111572
-Node: Basic Protocols11729
-Ref: Basic Protocols-Footnote-113774
-Node: Ports13803
-Node: Making Connections15210
-Ref: Making Connections-Footnote-117768
-Ref: Making Connections-Footnote-217815
-Node: Using Networking17996
-Node: Gawk Special Files20319
-Node: Special File Fields22128
-Ref: table-inet-components26021
-Node: Comparing Protocols27332
-Node: File /inet/tcp27866
-Node: File /inet/udp28894
-Ref: File /inet/udp-Footnote-130593
-Node: TCP Connecting30847
-Node: Troubleshooting33193
-Ref: Troubleshooting-Footnote-136252
-Node: Interacting36825
-Node: Setting Up39565
-Node: Email43068
-Node: Web page45400
-Ref: Web page-Footnote-148217
-Node: Primitive Service48415
-Node: Interacting Service51156
-Ref: Interacting Service-Footnote-160323
-Node: CGI Lib60355
-Node: Simple Server67330
-Ref: Simple Server-Footnote-175075
-Node: Caveats75176
-Node: Challenges76321
-Ref: Challenges-Footnote-185063
-Node: Some Applications and Techniques85164
-Node: PANIC87629
-Node: GETURL89353
-Node: REMCONF91986
-Node: URLCHK97482
-Node: WEBGRAB101334
-Node: STATIST105798
-Ref: STATIST-Footnote-1117548
-Node: MAZE117993
-Node: MOBAGWHO124200
-Ref: MOBAGWHO-Footnote-1138218
-Node: STOXPRED138273
-Node: PROTBASE152561
-Node: Links165677
-Node: GNU Free Documentation License169110
-Node: Index194230
+Node: Top2046
+Node: Preface5701
+Node: Introduction7076
+Node: Stream Communications8102
+Node: Datagram Communications9276
+Node: The TCP/IP Protocols10906
+Ref: The TCP/IP Protocols-Footnote-111590
+Node: Basic Protocols11747
+Ref: Basic Protocols-Footnote-113792
+Node: Ports13821
+Node: Making Connections15228
+Ref: Making Connections-Footnote-117786
+Ref: Making Connections-Footnote-217833
+Node: Using Networking18014
+Node: Gawk Special Files20337
+Node: Special File Fields22146
+Ref: table-inet-components26039
+Node: Comparing Protocols27350
+Node: File /inet/tcp27884
+Node: File /inet/udp28912
+Ref: File /inet/udp-Footnote-130611
+Node: TCP Connecting30865
+Node: Troubleshooting33211
+Ref: Troubleshooting-Footnote-136270
+Node: Interacting36843
+Node: Setting Up39583
+Node: Email43086
+Node: Web page45418
+Ref: Web page-Footnote-148235
+Node: Primitive Service48433
+Node: Interacting Service51174
+Ref: Interacting Service-Footnote-160341
+Node: CGI Lib60373
+Node: Simple Server67348
+Ref: Simple Server-Footnote-175093
+Node: Caveats75194
+Node: Challenges76339
+Ref: Challenges-Footnote-185081
+Node: Some Applications and Techniques85182
+Node: PANIC87647
+Node: GETURL89371
+Node: REMCONF92004
+Node: URLCHK97500
+Node: WEBGRAB101352
+Node: STATIST105816
+Ref: STATIST-Footnote-1119042
+Node: MAZE119487
+Node: MOBAGWHO125694
+Ref: MOBAGWHO-Footnote-1139712
+Node: STOXPRED139767
+Node: PROTBASE154055
+Node: Links167171
+Node: GNU Free Documentation License170604
+Node: Index195724
 
 End Tag Table
 
diff --git a/doc/gawkinet.texi b/doc/gawkinet.texi
index f76d42d..a9305dc 100644
--- a/doc/gawkinet.texi
+++ b/doc/gawkinet.texi
@@ -62,7 +62,7 @@
 
 @set TITLE TCP/IP Internetworking with @command{gawk}
 @set EDITION 1.5
-@set UPDATE-MONTH July, 2019
+@set UPDATE-MONTH April, 2020
 @c gawk versions:
 @set VERSION 5.1
 @set PATCHLEVEL 0
@@ -72,7 +72,7 @@ This is Edition @value{EDITION} of @cite{@value{TITLE}},
 for the @value{VERSION}.@value{PATCHLEVEL} (or later) version of the GNU
 implementation of AWK.
 @sp 2
-Copyright (C) 2000, 2001, 2002, 2004, 2009, 2010, 2016, 2019
+Copyright (C) 2000, 2001, 2002, 2004, 2009, 2010, 2016, 2019, 2020
 Free Software Foundation, Inc.
 @sp 2
 Permission is granted to copy, distribute and/or modify this document
@@ -2887,6 +2887,12 @@ sure that none of the above reveals too much information 
about your system.
 @ifnotinfo
 @image{statist,3in}
 @end ifnotinfo
+@ifinfo
+@example
+@include statist.txt
+@end example
+@end ifinfo
+
 In the HTTP server examples we've shown thus far, we never present an image
 to the browser and its user. Presenting images is one task. Generating
 images that reflect some user input and presenting these dynamically
diff --git a/doc/statist.txt b/doc/statist.txt
new file mode 100644
index 0000000..261019d
--- /dev/null
+++ b/doc/statist.txt
@@ -0,0 +1,23 @@
+ 0.4 ,------------.------------_------------.------------,
+     |                        : :          sample 1 :::: | 
+     |                       :   :         sample 2 ---- |
+ 0.3 |-                     :     :_                    -|
+     |                      :    ,: `,                   |
+     |                     :    /  :  \                  |
+ 0.2 |-                   :    /    :  \                -|
+     |                    :   /     :   \                |
+     |                   :   /       :   \               |
+ 0.1 |-                 :   /         :   \             -|
+     |                  :  /          :    \             |
+     |                 : ,'            :    `,           |
+   0 |----------------'-'               `-----`----------|
+     |                                                   |
+     |                                                   |
+-0.1 |-                    p(m1=m2) =0.0863798346775753 -|
+     |                                                   |
+     |                                                   |
+-0.2 |-                    p(v1=v2) =0.31647637745891   -|
+     |                                                   |
+     |                                                   |
+-0.3 `------------'------------'------------'------------'
+    -10           5            0            5           10
\ No newline at end of file

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=461ed6d987ad5ab4e4fce811abd639f1d055a311

commit 461ed6d987ad5ab4e4fce811abd639f1d055a311
Author: Arnold D. Robbins <address@hidden>
Date:   Sun Apr 26 16:59:01 2020 +0300

    Speedup to dfa.c.

diff --git a/support/ChangeLog b/support/ChangeLog
index 2e1dadf..6098e40 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-26         Arnold D. Robbins     <address@hidden>
+
+       * dfa.c: Speed improvements from Norihiro Tanaka <address@hidden>,
+       copied in from the bug-grep list.
+
 2020-04-14         Arnold D. Robbins     <address@hidden>
 
        * 5.1.0: Release tar ball made.
diff --git a/support/dfa.c b/support/dfa.c
index c088a92..7e67112 100644
--- a/support/dfa.c
+++ b/support/dfa.c
@@ -485,6 +485,7 @@ struct dfa
   bool fast;                   /* The DFA is fast.  */
   token utf8_anychar_classes[9]; /* To lower ANYCHAR in UTF-8 locales.  */
   mbstate_t mbs;               /* Multibyte conversion state.  */
+  bool epsilon;
 
   /* The following are valid only if MB_CUR_MAX > 1.  */
 
@@ -1612,13 +1613,21 @@ addtok_mb (struct dfa *dfa, token t, char mbprop)
       dfa->parse.depth--;
       break;
 
-    case BACKREF:
-      dfa->fast = false;
+    case BEGLINE:
+    case ENDLINE:
+    case BEGWORD:
+    case ENDWORD:
+    case LIMWORD:
+    case NOTLIMWORD:
+    case EMPTY:
+      dfa->epsilon = true;
       FALLTHROUGH;
+
     default:
-      dfa->nleaves++;
-      FALLTHROUGH;
-    case EMPTY:
+      if (t == BACKREF)
+        dfa->fast = false;
+      if (t != EMPTY)
+        dfa->nleaves++;
       dfa->parse.depth++;
       break;
     }
@@ -2294,14 +2303,15 @@ state_index (struct dfa *d, position_set const *s, int 
context)
    constraint.  Repeat exhaustively until no funny positions are left.
    S->elems must be large enough to hold the result.  */
 static void
-epsclosure (struct dfa const *d)
+epsclosure (struct dfa const *d, position_set *backword)
 {
   position_set tmp;
   alloc_position_set (&tmp, d->nleaves);
   for (idx_t i = 0; i < d->tindex; i++)
     if (d->follows[i].nelem > 0 && d->tokens[i] >= NOTCHAR
         && d->tokens[i] != BACKREF && d->tokens[i] != ANYCHAR
-        && d->tokens[i] != MBCSET && d->tokens[i] < CSET)
+        && d->tokens[i] != MBCSET && d->tokens[i] < CSET
+        && d->tokens[i] != BEG)
       {
         unsigned int constraint;
         switch (d->tokens[i])
@@ -2324,16 +2334,21 @@ epsclosure (struct dfa const *d)
           case NOTLIMWORD:
             constraint = NOTLIMWORD_CONSTRAINT;
             break;
-          default:
+          case EMPTY:
             constraint = NO_CONSTRAINT;
             break;
+          default:
+            abort ();
           }
 
         delete (i, &d->follows[i]);
 
-        for (idx_t j = 0; j < d->tindex; j++)
-          if (i != j && d->follows[j].nelem > 0)
-            replace (&d->follows[j], i, &d->follows[i], constraint, &tmp);
+        for (idx_t j = 0; j < backword[i].nelem; j++)
+          replace (&d->follows[backword[i].elems[j].index], i, &d->follows[i],
+                   constraint, &tmp);
+        for (idx_t j = 0; j < d->follows[i].nelem; j++)
+          replace (&backword[d->follows[i].elems[j].index], i, &backword[i],
+                   NO_CONSTRAINT, &tmp);
       }
   free (tmp.elems);
 }
@@ -2640,6 +2655,7 @@ dfaanalyze (struct dfa *d, bool searchflag)
   /* Firstpos and lastpos elements.  */
   position *firstpos = posalloc;
   position *lastpos = firstpos + d->nleaves;
+  position_set *backword = NULL;
   position pos;
   position_set tmp;
 
@@ -2672,6 +2688,9 @@ dfaanalyze (struct dfa *d, bool searchflag)
   alloc_position_set (&merged, d->nleaves);
   d->follows = xcalloc (d->tindex, sizeof *d->follows);
 
+  if (d->epsilon)
+    backword = xcalloc (d->tindex, sizeof *backword);
+
   for (idx_t i = 0; i < d->tindex; i++)
     {
       switch (d->tokens[i])
@@ -2709,6 +2728,17 @@ dfaanalyze (struct dfa *d, bool searchflag)
         case CAT:
           /* Every element in the firstpos of the second argument is in the
              follow of every element in the lastpos of the first argument.  */
+          if (d->epsilon)
+            {
+              tmp.nelem = stk[-2].nlastpos;
+              tmp.elems = lastpos - stk[-1].nlastpos - stk[-2].nlastpos;
+              position *p = firstpos - stk[-1].nfirstpos;
+              for (idx_t j = 0; j < stk[-1].nfirstpos; j++)
+                {
+                  merge (&tmp, &backword[p[j].index], &merged);
+                  copy (&merged, &backword[p[j].index]);
+                }
+            }
           {
             tmp.nelem = stk[-1].nfirstpos;
             tmp.elems = firstpos - stk[-1].nfirstpos;
@@ -2798,9 +2828,15 @@ dfaanalyze (struct dfa *d, bool searchflag)
 #endif
     }
 
-  /* For each follow set that is the follow set of a real position, replace
-     it with its epsilon closure.  */
-  epsclosure (d);
+  if (d->epsilon)
+    {
+      /* For each follow set that is the follow set of a real position,
+         replace it with its epsilon closure.  */
+      epsclosure (d, backword);
+
+      for (idx_t i = 0; i < d->tindex; i++)
+        free (backword[i].elems);
+    }
 
   dfaoptimize (d);
 
@@ -2862,6 +2898,7 @@ dfaanalyze (struct dfa *d, bool searchflag)
   d->min_trcount++;
   d->trcount = 0;
 
+  free (backword);
   free (posalloc);
   free (stkalloc);
   free (merged.elems);

-----------------------------------------------------------------------

Summary of changes:
 doc/ChangeLog     |   7 +++
 doc/gawkinet.info | 152 +++++++++++++++++++++++++++++++-----------------------
 doc/gawkinet.texi |  10 +++-
 doc/statist.txt   |  23 +++++++++
 support/ChangeLog |   5 ++
 support/dfa.c     |  65 ++++++++++++++++++-----
 6 files changed, 182 insertions(+), 80 deletions(-)
 create mode 100644 doc/statist.txt


hooks/post-receive
-- 
gawk



reply via email to

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