Annotation of 43BSDReno/pgrm/yacc/yyfix.sh, revision 1.1.1.1

1.1       root        1: #!/bin/sh -
                      2: #
                      3: # Copyright (c) 1990 The Regents of the University of California.
                      4: # All rights reserved.
                      5: #
                      6: # Redistribution and use in source and binary forms are permitted
                      7: # provided that: (1) source distributions retain this entire copyright
                      8: # notice and comment, and (2) distributions including binaries display
                      9: # the following acknowledgement:  ``This product includes software
                     10: # developed by the University of California, Berkeley and its contributors''
                     11: # in the documentation or other materials provided with the distribution
                     12: # and in all advertising materials mentioning features or use of this
                     13: # software. Neither the name of the University nor the names of its
                     14: # contributors may be used to endorse or promote products derived
                     15: # from this software without specific prior written permission.
                     16: # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
                     17: # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
                     18: # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                     19: #
                     20: #      @(#)yyfix.sh    5.2 (Berkeley) 5/12/90
                     21: #
                     22: OLDYACC="yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef"
                     23: NEWYACC="yylhs yylen yydefred yydgoto yysindex yyrindex yygindex \
                     24:         yytable yycheck"
                     25: 
                     26: file=$1
                     27: >$file
                     28: shift
                     29: 
                     30: if [ $# -eq 0 ] ; then
                     31:        if grep yylhs y.tab.c > /dev/null ; then
                     32:                if grep yyname y.tab.c > /dev/null ; then
                     33:                        NEWYACC="$NEWYACC yyname"
                     34:                fi
                     35:                if grep yyrule y.tab.c > /dev/null ; then
                     36:                        NEWYACC="$NEWYACC yyrule"
                     37:                fi
                     38:                set $NEWYACC
                     39:        else
                     40:                set $OLDYACC
                     41:        fi
                     42: fi
                     43: 
                     44: for i
                     45: do
                     46: ed - y.tab.c << END
                     47: /^\(.*\)$i[    ]*\[]/s//extern \1 $i[];\\
                     48: \1 $i []/
                     49: .ka
                     50: /}/kb
                     51: 'br $file
                     52: 'a,.w $file
                     53: 'a,.d
                     54: w
                     55: q
                     56: END
                     57: done

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.