1 # Copyright 1989 by Kenneth Almquist. All rights reserved.
3 # This file is part of ash. Ash is distributed under the terms specified
4 # by the Ash General Public License. See the file named LICENSE.
6 # All calls to awk removed, because Minix bawk is deficient. (kjb)
10 echo "Usage: $0 <unary_op> <binary_op>" >&2
18 sed -e '/^[^#]/!d' "$unary_op" "$binary_op" | while read line
25 echo "#define FIRST_BINARY_OP" `sed -e '/^[^#]/!d' "$unary_op" | wc -l`
27 #define OP_INT 1 /* arguments to operator are integer */
28 #define OP_STRING 2 /* arguments to operator are string */
29 #define OP_FILE 3 /* argument is a file name */
31 extern char *const unary_op[];
32 extern char *const binary_op[];
33 extern const char op_priority[];
34 extern const char op_argflag[];'
38 * Operators used in the expr/test command.
43 #include "operators.h"
45 char *const unary_op[] = {'
48 s/^[^ ][^ ]* \([^ ][^ ]*\).*/ "\1",/
53 char *const binary_op[] = {'
56 s/^[^ ][^ ]* \([^ ][^ ]*\).*/ "\1",/
61 const char op_priority[] = {'
64 s/^[^ ][^ ]* [^ ][^ ]* \([^ ][^ ]*\).*/ \1,/
65 ' "$unary_op" "$binary_op"
68 const char op_argflag[] = {'
71 s/^[^ ][^ ]* [^ ][^ ]* [^ ][^ ]*$/& 0/
72 s/^[^ ][^ ]* [^ ][^ ]* [^ ][^ ]* \([^ ][^ ]*\)/ \1,/
73 ' "$unary_op" "$binary_op"