Home | History | Annotate | Download | only in sh
      1 #define TEOF 0
      2 #define TNL 1
      3 #define TSEMI 2
      4 #define TBACKGND 3
      5 #define TAND 4
      6 #define TOR 5
      7 #define TPIPE 6
      8 #define TLP 7
      9 #define TRP 8
     10 #define TENDCASE 9
     11 #define TENDBQUOTE 10
     12 #define TREDIR 11
     13 #define TWORD 12
     14 #define TIF 13
     15 #define TTHEN 14
     16 #define TELSE 15
     17 #define TELIF 16
     18 #define TFI 17
     19 #define TWHILE 18
     20 #define TUNTIL 19
     21 #define TFOR 20
     22 #define TDO 21
     23 #define TDONE 22
     24 #define TBEGIN 23
     25 #define TEND 24
     26 #define TCASE 25
     27 #define TESAC 26
     28 #define TNOT 27
     29 
     30 /* Array indicating which tokens mark the end of a list */
     31 const char tokendlist[] = {
     32 	1,
     33 	0,
     34 	0,
     35 	0,
     36 	0,
     37 	0,
     38 	0,
     39 	0,
     40 	1,
     41 	1,
     42 	1,
     43 	0,
     44 	0,
     45 	0,
     46 	1,
     47 	1,
     48 	1,
     49 	1,
     50 	0,
     51 	0,
     52 	0,
     53 	1,
     54 	1,
     55 	0,
     56 	1,
     57 	0,
     58 	1,
     59 	0,
     60 };
     61 
     62 const char *const tokname[] = {
     63 	"end of file",
     64 	"newline",
     65 	"\";\"",
     66 	"\"&\"",
     67 	"\"&&\"",
     68 	"\"||\"",
     69 	"\"|\"",
     70 	"\"(\"",
     71 	"\")\"",
     72 	"\";;\"",
     73 	"\"`\"",
     74 	"redirection",
     75 	"word",
     76 	"\"if\"",
     77 	"\"then\"",
     78 	"\"else\"",
     79 	"\"elif\"",
     80 	"\"fi\"",
     81 	"\"while\"",
     82 	"\"until\"",
     83 	"\"for\"",
     84 	"\"do\"",
     85 	"\"done\"",
     86 	"\"{\"",
     87 	"\"}\"",
     88 	"\"case\"",
     89 	"\"esac\"",
     90 	"\"!\"",
     91 };
     92 
     93 #define KWDOFFSET 13
     94 
     95 const char *const parsekwd[] = {
     96 	"if",
     97 	"then",
     98 	"else",
     99 	"elif",
    100 	"fi",
    101 	"while",
    102 	"until",
    103 	"for",
    104 	"do",
    105 	"done",
    106 	"{",
    107 	"}",
    108 	"case",
    109 	"esac",
    110 	"!",
    111 	0
    112 };
    113