#
# 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
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
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\
/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.
\ }\
\ 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