blob: 60b466d9a2a10a2af2d591003852381f84a51056 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
?RCS: $Id: yacc.U 167 2013-05-08 17:58:00Z rmanfredi $
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: yacc.U,v $
?RCS: Revision 3.0.1.1 1994/05/13 15:28:48 ram
?RCS: patch27: added byacc as another alternative (ADO)
?RCS:
?RCS: Revision 3.0 1993/08/18 12:10:03 ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?MAKE:yacc yaccflags: Guess Myread Loc Oldconfig byacc bison cat test
?MAKE: -pick add $@ %<
?S:yacc:
?S: This variable holds the name of the compiler compiler we
?S: want to use in the Makefile. It can be yacc, byacc, or bison -y.
?S:.
?S:yaccflags:
?S: This variable contains any additional yacc flags desired by the
?S: user. It is up to the Makefile to use this.
?S:.
?T:comp
: determine compiler compiler
echo " "
comp='yacc'
if $test -f "$byacc"; then
comp="byacc or $comp"
fi
if $test -f "$bison"; then
comp="$comp or bison -y"
fi
case "$yacc" in
'')
yacc=`./loc yacc yacc $pth`
if $test -f "$yacc"; then
dflt='yacc'
elif $test -f "$byacc"; then
dflt='byacc'
elif $test -f "$bison"; then
dflt='bison'
else
dflt=''
fi
;;
*) dflt="$yacc";;
esac
rp="Which compiler compiler ($comp) shall I use?"
. ./myread
yacc="$ans"
case "$yacc" in
*bis*)
case "$yacc" in
*-y*) ;;
*)
yacc="$yacc -y"
echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
;;
esac
;;
esac
@if yaccflags
: see if we need extra yacc flags
dflt="$yaccflags"
case "$dflt" in
'') dflt=none;;
esac
$cat <<EOH
Your yacc program may need extra flags to normally process the parser sources.
Do NOT specify any -d or -v flags here, since those are explicitly known
by the various Makefiles. However, if your machine has strange/undocumented
options (like -Sr# on SCO to specify the maximum number of grammar rules), then
please add them here. To use no flags, specify the word "none".
EOH
rp="Any additional yacc flags?"
. ./myread
case "$ans" in
none) yaccflags='';;
*) yaccflags="$ans";;
esac
@end
|