automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, yacc-work, updated. v1.12.2


From: Akim Demaille
Subject: [Automake-commit] [SCM] GNU Automake branch, yacc-work, updated. v1.12.2-118-gf08a1a8
Date: Sat, 14 Jul 2012 08:23:36 +0000

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 "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=f08a1a8687880368f47124d9b7e18edd5d6ceb2f

The branch, yacc-work has been updated
       via  f08a1a8687880368f47124d9b7e18edd5d6ceb2f (commit)
       via  c12ad67a2c3260bfc92c0b9f8a9175ed01329f71 (commit)
       via  d7237359b1ae7b0804f4e974ea7d0d704bc03e42 (commit)
       via  b34f1cff54419481b64844e09497cef8dd8bc1d4 (commit)
       via  d4801f6b5c629650297a5c3343fdeab379eceb7f (commit)
      from  a60c884cddb83eeb3d8939c7b5c34a4964c68251 (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 -----------------------------------------------------------------
commit f08a1a8687880368f47124d9b7e18edd5d6ceb2f
Author: Akim Demaille <address@hidden>
Date:   Sat Jul 14 10:11:03 2012 +0200

    ylwrap: fix C++ support
    
    The current logic of ylwrap is to call yacc in a sub directory, and
    pull out of it all the files that were request on its command line.
    Reverse this approach: export *all* the files created in the
    subdirectory, but rename then according to what the command says.
    This way, extra files, such as position.hh, location.hh and stack.hh
    for C++ parsers, but also parser.xml or parser.dot if XML or Dot
    output is enabled, will be preserved.
    
    * lib/ylwrap (pairlist): Remove.
    (main loop): Don't loop over pairlist, but over the files in the
    temporary directory.
    * t/list-of-tests.mk (XFAIL_TESTS): Fixes t/yacc-bison-skeleton-cxx.sh.

commit c12ad67a2c3260bfc92c0b9f8a9175ed01329f71
Author: Akim Demaille <address@hidden>
Date:   Sat Jul 14 10:09:15 2012 +0200

    ylwrap: refactor: move loop invariant
    
    * lib/ylwrap (input_rx): Move its definition next to its sibling's,
    outside of the main loop.

commit d7237359b1ae7b0804f4e974ea7d0d704bc03e42
Author: Akim Demaille <address@hidden>
Date:   Sat Jul 14 10:08:52 2012 +0200

    ylwrap: refactoring: don't rely on the file order
    
    Forthcoming changes will make us iterate over the files in a different
    order.
    
    lib/ylwrap (first): Remove, replaced by...
    (parser): this.

commit b34f1cff54419481b64844e09497cef8dd8bc1d4
Author: Akim Demaille <address@hidden>
Date:   Sat Jul 14 10:01:40 2012 +0200

    tests: upgrade and fix Bison test case
    
    * t/yacc-bison-skeleton-cxx.sh: Request locations, to be
    even more stressful.
    Use %union to make sure the %{...%} is inserted where appropriate.
    Fix some indentation/coding style issues.

commit d4801f6b5c629650297a5c3343fdeab379eceb7f
Author: Akim Demaille <address@hidden>
Date:   Sat Jul 14 09:07:52 2012 +0200

    tests: fix bison input file
    
    Do not provide implementations in the %{...%} section, especially if the
    header is included elsewhere, since then the linker will complain about
    multiple definitions.
    
    Reported by Stefano Lattarini,
    <http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00126.html>.
    
    * t/yacc-bison-skeleton.sh (zardoz.y): Define yylex and yyerror in the
    epilogue.

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

Summary of changes:
 lib/ylwrap                   |   47 +++++++++++++++++-------------------------
 t/list-of-tests.mk           |    1 -
 t/yacc-bison-skeleton-cxx.sh |   20 ++++++++++-------
 t/yacc-bison-skeleton.sh     |    7 ++++-
 4 files changed, 36 insertions(+), 39 deletions(-)

diff --git a/lib/ylwrap b/lib/ylwrap
index 725b388..49116e5 100755
--- a/lib/ylwrap
+++ b/lib/ylwrap
@@ -1,7 +1,7 @@
 #! /bin/sh
 # ylwrap - wrapper for lex/yacc invocations.
 
-scriptversion=2012-07-13.14; # UTC
+scriptversion=2012-07-14.08; # UTC
 
 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
@@ -108,6 +108,7 @@ case "$input" in
     input="`pwd`/$input"
     ;;
 esac
+input_rx=`get_dirname "$input" | quote_for_sed`
 
 # Since DOS filename conventions don't allow two dots,
 # the DOS version of Bison writes out y_tab.c instead of y.tab.c
@@ -117,8 +118,9 @@ if test -f y_tab.c || test -f y_tab.h; then
   y_tab_nodot=true
 fi
 
-# The list of file to rename: FROM TO...
-pairlist=
+# The parser itself, the first file, is the destination of the .y.c
+# rule in the Makefile.
+parser=$1
 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for
 # instance, we rename #include "y.tab.h" into #include "parse.h"
 # during the conversion from y.tab.c to parse.c.
@@ -139,7 +141,6 @@ while test "$#" -ne 0; do
   shift
   to=$1
   shift
-  pairlist="$pairlist $from $to"
   rename_sed="${rename_sed}s|"`quote_for_sed "$from"`"|$to|g;"
 done
 
@@ -171,15 +172,9 @@ esac
 ret=$?
 
 if test $ret -eq 0; then
-  set X $pairlist
-  shift
-  first=yes
-
-  input_rx=`get_dirname "$input" | quote_for_sed`
-
-  while test "$#" -ne 0; do
-    from=$1
-    to=$2
+  for from in *
+  do
+    to=`printf '%s\n' "$from" | sed "$rename_sed"`
     if test -f "$from"; then
       # If $2 is an absolute path name, then just use that,
       # otherwise prepend '../'.
@@ -189,11 +184,11 @@ if test $ret -eq 0; then
       esac
 
       # Do not overwrite unchanged header files to avoid useless
-      # recompilations.  Always update the parser itself (the first
-      # file): it is the destination of the .y.c rule in the Makefile.
-      # Divert the output of all other files to a temporary file so we
-      # can compare them to existing versions.
-      if test $first = no; then
+      # recompilations.  Always update the parser itself: it is the
+      # destination of the .y.c rule in the Makefile.  Divert the
+      # output of all other files to a temporary file so we can
+      # compare them to existing versions.
+      if test $from != $parser; then
         realtarget="$target"
         target=tmp-`printf '%s\n' "$target" | sed s/.*[\\/]//g`
       fi
@@ -207,8 +202,8 @@ if test $ret -eq 0; then
       sed -e "/^#/!b" -e "s|$input_rx|$input_sub_rx|" -e "$rename_sed" \
           -e "s|$FROM|$TARGET|" "$from" >"$target" || ret=$?
 
-      # Check whether header files must be updated.
-      if test $first = no; then
+      # Check whether files must be updated.
+      if test "$from" != "$parser"; then
         if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
           echo "$to is unchanged"
           rm -f "$target"
@@ -218,17 +213,13 @@ if test $ret -eq 0; then
         fi
       fi
     else
-      # A missing file is only an error for the first file.  This
-      # is a blatant hack to let us support using "yacc -d".  If -d
-      # is not specified, we don't want an error when the header
-      # file is "missing".
-      if test $first = yes; then
+      # A missing file is only an error for the parser.  This is a
+      # blatant hack to let us support using "yacc -d".  If -d is not
+      # specified, don't fail when the header file is "missing".
+      if test "$from" = "$parser"; then
         ret=1
       fi
     fi
-    shift
-    shift
-    first=no
   done
 else
   ret=$?
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index ee2556e..2a28992 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -30,7 +30,6 @@ t/pm/Version3.pl
 
 XFAIL_TESTS = \
 t/all.sh \
-t/yacc-bison-skeleton-cxx.sh \
 t/cond17.sh \
 t/gcj6.sh \
 t/override-conditional-2.sh \
diff --git a/t/yacc-bison-skeleton-cxx.sh b/t/yacc-bison-skeleton-cxx.sh
index 609ebc2..a02a25a 100755
--- a/t/yacc-bison-skeleton-cxx.sh
+++ b/t/yacc-bison-skeleton-cxx.sh
@@ -40,10 +40,15 @@ END
 cat > zardoz.yy << 'END'
 %skeleton "lalr1.cc"
 %defines
+%locations
 
+%union
+{
+  int ival;
+};
 %{
-#define YYSTYPE int
-int yylex(YYSTYPE* yylval_param);
+int yylex (yy::parser::semantic_type *yylval,
+           yy::parser::location_type *yylloc);
 %}
 
 %%
@@ -51,23 +56,22 @@ start :        /* empty */
 %%
 
 int
-yylex(YYSTYPE*)
+yylex (yy::parser::semantic_type *yylval,
+       yy::parser::location_type *yylloc)
 {
-    return 0;
+  return 0;
 }
 
 void
-yy::parser::error(const yy::parser::location_type&, const std::string& m)
+yy::parser::error(const yy::parser::location_type&, const std::string&)
 {
-    return;
+  return;
 }
 END
 
 cat > foo.cc << 'END'
 #include "zardoz.hh"
 
-using namespace std;
-
 int
 main(int argc, char** argv)
 {
diff --git a/t/yacc-bison-skeleton.sh b/t/yacc-bison-skeleton.sh
index 5bf9092..9e9f514 100755
--- a/t/yacc-bison-skeleton.sh
+++ b/t/yacc-bison-skeleton.sh
@@ -35,11 +35,14 @@ END
 # Parser.
 cat > zardoz.y << 'END'
 %{
-int yylex () { return 0; }
-void yyerror (const char *s) { return; }
+int yylex ();
+void yyerror (const char *s);
 %}
 %%
 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
+%%
+int yylex () { return 0; }
+void yyerror (const char *s) { return; }
 END
 
 cat > foo.c << 'END'


hooks/post-receive
-- 
GNU Automake



reply via email to

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