2 # Copyright 1989 by Kenneth Almquist. All rights reserved.
4 # This file is part of ash. Ash is distributed under the terms specified
5 # by the Ash General Public License. See the file named LICENSE.
7 # All calls to awk removed, because Minix bawk is deficient. (kjb)
11 echo "Usage: $0 <unary_op> <binary_op>" >&2
19 sed -e '/^[^#]/!d' "$unary_op" "$binary_op" |
while read line
26 echo "#define FIRST_BINARY_OP" `sed -e '/^[^#]/!d' "$unary_op" | wc -l`
28 #define OP_INT 1 /* arguments to operator are integer */
29 #define OP_STRING 2 /* arguments to operator are string */
30 #define OP_FILE 3 /* argument is a file name */
32 extern char *const unary_op[];
33 extern char *const binary_op[];
34 extern const char op_priority[];
35 extern const char op_argflag[];'
39 * Operators used in the expr/test command.
44 #include "operators.h"
46 char *const unary_op[] = {'
49 s/^[^ ][^ ]* \([^ ][^ ]*\).*/ "\1",/
54 char *const binary_op[] = {'
57 s/^[^ ][^ ]* \([^ ][^ ]*\).*/ "\1",/
62 const char op_priority[] = {'
65 s/^[^ ][^ ]* [^ ][^ ]* \([^ ][^ ]*\).*/ \1,/
66 ' "$unary_op" "$binary_op"
69 const char op_argflag[] = {'
72 s/^[^ ][^ ]* [^ ][^ ]* [^ ][^ ]*$/& 0/
73 s/^[^ ][^ ]* [^ ][^ ]* [^ ][^ ]* \([^ ][^ ]*\)/ \1,/
74 ' "$unary_op" "$binary_op"