|
|
1.1 ! root 1: #ifndef lint ! 2: static char sccsid[] = "@(#)token.c 4.2 8/11/83"; ! 3: #endif ! 4: ! 5: #include "awk.h" ! 6: struct tok ! 7: { char *tnm; ! 8: int yval; ! 9: } tok[] = { ! 10: "FIRSTTOKEN", 257, ! 11: "FINAL", 258, ! 12: "FATAL", 259, ! 13: "LT", 260, ! 14: "LE", 261, ! 15: "GT", 262, ! 16: "GE", 263, ! 17: "EQ", 264, ! 18: "NE", 265, ! 19: "MATCH", 266, ! 20: "NOTMATCH", 267, ! 21: "APPEND", 268, ! 22: "ADD", 269, ! 23: "MINUS", 270, ! 24: "MULT", 271, ! 25: "DIVIDE", 272, ! 26: "MOD", 273, ! 27: "UMINUS", 274, ! 28: "ASSIGN", 275, ! 29: "ADDEQ", 276, ! 30: "SUBEQ", 277, ! 31: "MULTEQ", 278, ! 32: "DIVEQ", 279, ! 33: "MODEQ", 280, ! 34: "JUMP", 281, ! 35: "XBEGIN", 282, ! 36: "XEND", 283, ! 37: "NL", 284, ! 38: "PRINT", 285, ! 39: "PRINTF", 286, ! 40: "SPRINTF", 287, ! 41: "SPLIT", 288, ! 42: "IF", 289, ! 43: "ELSE", 290, ! 44: "WHILE", 291, ! 45: "FOR", 292, ! 46: "IN", 293, ! 47: "NEXT", 294, ! 48: "EXIT", 295, ! 49: "BREAK", 296, ! 50: "CONTINUE", 297, ! 51: "PROGRAM", 298, ! 52: "PASTAT", 299, ! 53: "PASTAT2", 300, ! 54: "ASGNOP", 301, ! 55: "BOR", 302, ! 56: "AND", 303, ! 57: "NOT", 304, ! 58: "NUMBER", 305, ! 59: "VAR", 306, ! 60: "ARRAY", 307, ! 61: "FNCN", 308, ! 62: "SUBSTR", 309, ! 63: "LSUBSTR", 310, ! 64: "INDEX", 311, ! 65: "GETLINE", 312, ! 66: "RELOP", 313, ! 67: "MATCHOP", 314, ! 68: "OR", 315, ! 69: "STRING", 316, ! 70: "DOT", 317, ! 71: "CCL", 318, ! 72: "NCCL", 319, ! 73: "CHAR", 320, ! 74: "CAT", 321, ! 75: "STAR", 322, ! 76: "PLUS", 323, ! 77: "QUEST", 324, ! 78: "POSTINCR", 325, ! 79: "PREINCR", 326, ! 80: "POSTDECR", 327, ! 81: "PREDECR", 328, ! 82: "INCR", 329, ! 83: "DECR", 330, ! 84: "FIELD", 331, ! 85: "INDIRECT", 332, ! 86: "LASTTOKEN", 333, ! 87: }; ! 88: ptoken(n) ! 89: { ! 90: if(n<128) printf("lex: %c\n",n); ! 91: else if(n<=256) printf("lex:? %o\n",n); ! 92: else if(n<LASTTOKEN) printf("lex: %s\n",tok[n-257].tnm); ! 93: else printf("lex:? %o\n",n); ! 94: return; ! 95: } ! 96: ! 97: char *tokname(n) ! 98: { ! 99: if (n<=256 || n >= LASTTOKEN) ! 100: n = 257; ! 101: return(tok[n-257].tnm); ! 102: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.