Updated from Radius repository
Showing
1 changed file
with
20 additions
and
6 deletions
... | @@ -2,7 +2,6 @@ | ... | @@ -2,7 +2,6 @@ |
2 | # ylwrap - wrapper for lex/yacc invocations. | 2 | # ylwrap - wrapper for lex/yacc invocations. |
3 | # Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc. | 3 | # Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc. |
4 | # Written by Tom Tromey <tromey@cygnus.com>. | 4 | # Written by Tom Tromey <tromey@cygnus.com>. |
5 | # -yy modification by Sergey Poznyakoff <gray@farlep.net> | ||
6 | # | 5 | # |
7 | # This program is free software; you can redistribute it and/or modify | 6 | # This program is free software; you can redistribute it and/or modify |
8 | # it under the terms of the GNU General Public License as published by | 7 | # it under the terms of the GNU General Public License as published by |
... | @@ -72,6 +71,7 @@ input_dir="`echo $input | sed -e 's,/[^/]*$,,'`" | ... | @@ -72,6 +71,7 @@ input_dir="`echo $input | sed -e 's,/[^/]*$,,'`" |
72 | input_rx="`echo $input_dir | sed -e 's,\.,\\\.,g'`" | 71 | input_rx="`echo $input_dir | sed -e 's,\.,\\\.,g'`" |
73 | 72 | ||
74 | pairlist= | 73 | pairlist= |
74 | defout=$1 | ||
75 | while test "$#" -ne 0; do | 75 | while test "$#" -ne 0; do |
76 | if test "$1" = "--"; then | 76 | if test "$1" = "--"; then |
77 | shift | 77 | shift |
... | @@ -81,16 +81,26 @@ while test "$#" -ne 0; do | ... | @@ -81,16 +81,26 @@ while test "$#" -ne 0; do |
81 | shift | 81 | shift |
82 | done | 82 | done |
83 | 83 | ||
84 | STDOUT="" | ||
84 | if [ $# -ne 0 ]; then | 85 | if [ $# -ne 0 ]; then |
85 | if [ "x$1" = "x-yy" ]; then | 86 | while test "$#" -ne 0; do |
87 | case "x$1" in | ||
88 | x-yy) | ||
86 | shift | 89 | shift |
87 | if [ $# -eq 0 ]; then | 90 | if [ $# -eq 0 ]; then |
88 | echo "ylwrap: -yy requires an argument" | 91 | echo "ylwrap: -yy requires an argument" |
89 | exit 1 | 92 | exit 1 |
90 | fi | 93 | fi |
91 | YYREPL=$1 | 94 | YYREPL=$1 |
95 | shift;; | ||
96 | x-stdout) | ||
92 | shift | 97 | shift |
93 | fi | 98 | STDOUT=$defout |
99 | ;; | ||
100 | *) | ||
101 | break;; | ||
102 | esac | ||
103 | done | ||
94 | fi | 104 | fi |
95 | 105 | ||
96 | # FIXME: add hostname here for parallel makes that run commands on | 106 | # FIXME: add hostname here for parallel makes that run commands on |
... | @@ -101,7 +111,11 @@ mkdir $dirname || exit 1 | ... | @@ -101,7 +111,11 @@ mkdir $dirname || exit 1 |
101 | 111 | ||
102 | cd $dirname | 112 | cd $dirname |
103 | 113 | ||
104 | $prog ${1+"$@"} "$input" | 114 | if [ -n "$STDOUT" ]; then |
115 | $prog ${1+"$@"} "$input" > $STDOUT | ||
116 | else | ||
117 | $prog ${1+"$@"} "$input" | ||
118 | fi | ||
105 | status=$? | 119 | status=$? |
106 | 120 | ||
107 | if test $status -eq 0; then | 121 | if test $status -eq 0; then |
... | @@ -140,7 +154,8 @@ if test $status -eq 0; then | ... | @@ -140,7 +154,8 @@ if test $status -eq 0; then |
140 | # resulting debug information to point at an absolute srcdir; | 154 | # resulting debug information to point at an absolute srcdir; |
141 | # it is better for it to just mention the .y file with no | 155 | # it is better for it to just mention the .y file with no |
142 | # path. | 156 | # path. |
143 | EXPR="/^#/ s,$input_rx/,," | 157 | T=`basename $target` |
158 | EXPR="/^#/ s,$input_rx/,,;s,\"$from\",\"$T\"," | ||
144 | if [ ! -z "$YYREPL" ]; then | 159 | if [ ! -z "$YYREPL" ]; then |
145 | EXPR="$EXPR;s/yy/$YYREPL/g" | 160 | EXPR="$EXPR;s/yy/$YYREPL/g" |
146 | fi | 161 | fi |
... | @@ -167,4 +182,3 @@ cd .. | ... | @@ -167,4 +182,3 @@ cd .. |
167 | rm -rf $dirname | 182 | rm -rf $dirname |
168 | 183 | ||
169 | exit $status | 184 | exit $status |
170 | ... | ... |
-
Please register or sign in to post a comment