386BSD 0.1 development
authorWilliam F. Jolitz <wjolitz@soda.berkeley.edu>
Thu, 20 Feb 1992 07:44:07 +0000 (23:44 -0800)
committerWilliam F. Jolitz <wjolitz@soda.berkeley.edu>
Thu, 20 Feb 1992 07:44:07 +0000 (23:44 -0800)
Work on file usr/src/bin/sh/token.def

Co-Authored-By: Lynne Greer Jolitz <ljolitz@cardio.ucsf.edu>
Synthesized-from: 386BSD-0.1

usr/src/bin/sh/token.def [new file with mode: 0644]

diff --git a/usr/src/bin/sh/token.def b/usr/src/bin/sh/token.def
new file mode 100644 (file)
index 0000000..7644cb9
--- /dev/null
@@ -0,0 +1,108 @@
+#define TEOF 0
+#define TNL 1
+#define TSEMI 2
+#define TBACKGND 3
+#define TAND 4
+#define TOR 5
+#define TPIPE 6
+#define TLP 7
+#define TRP 8
+#define TENDCASE 9
+#define TENDBQUOTE 10
+#define TREDIR 11
+#define TWORD 12
+#define TIF 13
+#define TTHEN 14
+#define TELSE 15
+#define TELIF 16
+#define TFI 17
+#define TWHILE 18
+#define TUNTIL 19
+#define TFOR 20
+#define TDO 21
+#define TDONE 22
+#define TBEGIN 23
+#define TEND 24
+#define TCASE 25
+#define TESAC 26
+
+/* Array indicating which tokens mark the end of a list */
+const char tokendlist[] = {
+       1,
+       0,
+       0,
+       0,
+       0,
+       0,
+       0,
+       0,
+       1,
+       1,
+       1,
+       0,
+       0,
+       0,
+       1,
+       1,
+       1,
+       1,
+       0,
+       0,
+       0,
+       1,
+       1,
+       0,
+       1,
+       0,
+       1,
+};
+
+char *const tokname[] = {
+       "end of file",
+       "newline",
+       "\";\"",
+       "\"&\"",
+       "\"&&\"",
+       "\"||\"",
+       "\"|\"",
+       "\"(\"",
+       "\")\"",
+       "\";;\"",
+       "\"`\"",
+       "redirection",
+       "word",
+       "\"if\"",
+       "\"then\"",
+       "\"else\"",
+       "\"elif\"",
+       "\"fi\"",
+       "\"while\"",
+       "\"until\"",
+       "\"for\"",
+       "\"do\"",
+       "\"done\"",
+       "\"{\"",
+       "\"}\"",
+       "\"case\"",
+       "\"esac\"",
+};
+
+#define KWDOFFSET 13
+
+char *const parsekwd[] = {
+       "if",
+       "then",
+       "else",
+       "elif",
+       "fi",
+       "while",
+       "until",
+       "for",
+       "do",
+       "done",
+       "{",
+       "}",
+       "case",
+       "esac",
+       0
+};