From: Tim Bunce Date: Fri, 5 Sep 1997 00:00:00 +0000 (+0000) Subject: Enhance perly.fixer to help porters. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=25c49cb6c6f3bfa58236f2866fad8049f77a03df;p=p5sagit%2Fp5-mst-13.2.git Enhance perly.fixer to help porters. --- diff --git a/perly.fixer b/perly.fixer index 98296a7..1568816 100755 --- a/perly.fixer +++ b/perly.fixer @@ -5,8 +5,9 @@ # # However, if the user wishes to use byacc, or wishes to try another # compiler compiler (e.g. bison or yacc), this script will get run. +# See makefile run_byacc target for more details. # -# Currently, only byacc version 1.8 is supported. +# Currently, only byacc version 1.8 is fully supported. # # Hacks to make it work with Interactive's SysVr3 Version 2.2 # doughera@lafvax.lafayette.edu (Andy Dougherty) 3/23/91 @@ -44,7 +45,15 @@ fi plan="unknown" -# Below, we check for various yaccpar outputs. +echo "" +echo "Warning: the yacc you have used is not directly supported by perl." +echo "The perly.fixer script will attempt to make some changes to the generated" +echo "file. The changes may be incomplete and that might lead to problems later" +echo "(especially with complex scripts). You may need to apply the changes" +echo "embedded in perl.fixer (and/or perly.c.dif*) by hand." +echo "" + +# Below, we check for various characteristic yaccpar outputs. # Test for BSD 4.3 version. # Also tests for the SunOS 4.0.2 version @@ -73,13 +82,15 @@ if *\( *\+\+yy_ps *>= *&yys\[ *YYMAXDEPTH *\] *\)' $input >$tmp 2>/dev/null fi fi +# ------ + case "$plan" in ################################################################## # The SunOS 4.0.2 version has the comparison fixed already. # Also added are out of memory checks (makes porting the generated # code easier) For most systems, it can't hurt. -- TD "bsd43") - echo "Patching perly.c to allow dynamic yacc stack allocation" + echo "Attempting to path perly.c to allow dynamic yacc stack allocation" echo "Assuming bsd4.3 yaccpar" cat >$tmp <<'END' /YYSTYPE[ ]*yyv\[ *YYMAXDEPTH *\];/c\ @@ -128,11 +139,15 @@ short *maxyyps; /yacc stack overflow.*}/d /yacc stack overflow/,/}/d END - sed -f $tmp <$input >$output ;; + if sed -f $tmp <$input >$output + then echo "The edit seems to have been applied okay." + else echo "The edit seems to have failed!" + fi + ;; ####################################################### "isc") # Interactive Systems 2.2 version - echo "Patching perly.c to allow dynamic yacc stack allocation" + echo "Attempting to path perly.c to allow dynamic yacc stack allocation" echo "Assuming Interactive SysVr3 2.2 yaccpar" # Easier to simply put whole script here than to modify the # bsd script with sed. @@ -178,11 +193,20 @@ int *maxyyps; \ }\ \ if (yyv == NULL || yys == NULL) END - sed -f $tmp < $input > $output ;; + if sed -f $tmp < $input > $output + then echo "The edit seems to have been applied okay." + else echo "The edit seems to have failed!" + fi + ;; ###################################################### # Plan still unknown - *) sed -e 's/Received token/ *** Received token/' $input >$output; + *) + echo "Unable to patch perly.c to allow dynamic yacc stack allocation (plan=$plan)" + # just do minimal change to write $output from $input + sed -e 's/Received token/ *** Received token/' $input >$output + ;; esac +echo "" rm -rf $tmp $input