|
|
1.1 root 1: /*
2: * Note that any mods made to this enum must be matched by mods made
3: * to the token dope table 'tkdopes' defined in 'readonly.c'.
4: */
5: typedef enum
6: {
7: tk_and, /* & */
8: tk_andand, /* && */
9: tk_auto, /* auto */
10: tk_bar, /* | */
11: tk_barbar, /* || */
12: tk_break, /* break */
13: tk_case, /* case */
14: tk_cchar, /* constant char */
15: tk_cdouble, /* constant double */
16: tk_cfloat, /* constant float */
17: tk_char, /* char */
18: tk_cint, /* constant int */
19: tk_clong, /* constant long */
20: tk_colon, /* : */
21: tk_comma, /* , */
22: tk_continue, /* continue */
23: tk_default, /* default */
24: tk_do, /* do */
25: tk_dot, /* . */
26: tk_double, /* double */
27: tk_else, /* else */
28: tk_enum, /* enum */
29: tk_eof, /* eof */
30: tk_eq, /* = */
31: tk_eqeq, /* == */
32: tk_extern, /* extern */
33: tk_float, /* float */
34: tk_for, /* for */
35: tk_goto, /* goto */
36: tk_grt, /* > */
37: tk_grteq, /* >= */
38: tk_grtgrt, /* >> */
39: tk_if, /* if */
40: tk_int, /* int */
41: tk_less, /* < */
42: tk_lesseq, /* <= */
43: tk_lessless, /* << */
44: tk_lsminus, /* <- */
45: tk_long, /* long */
46: tk_maxof, /* maxof */
47: tk_minof, /* minof */
48: tk_minus, /* - */
49: tk_minusgrt, /* -> */
50: tk_minusminus, /* -- */
51: tk_name, /* name */
52: tk_not, /* ! */
53: tk_noteq, /* != */
54: tk_null, /* null */
55: tk_offcurly, /* } */
56: tk_offround, /* ) */
57: tk_offsquare, /* ] */
58: tk_oncurly, /* { */
59: tk_onround, /* ( */
60: tk_onsquare, /* [ */
61: tk_percent, /* % */
62: tk_plus, /* + */
63: tk_plusplus, /* ++ */
64: tk_question, /* ? */
65: tk_register, /* register */
66: tk_return, /* return */
67: tk_semicolon, /* ; */
68: tk_set, /* set */
69: tk_short, /* short */
70: tk_sizeof, /* sizeof */
71: tk_slash, /* / */
72: tk_static, /* static */
73: tk_string, /* ".." */
74: tk_struct, /* struct */
75: tk_switch, /* switch */
76: tk_tilda, /* ~ */
77: tk_times, /* * */
78: tk_typedef, /* typedef */
79: tk_union, /* union */
80: tk_unsigned, /* unsigned */
81: tk_uparrow, /* ^ */
82: tk_void, /* void */
83: tk_while, /* while */
84: }
85: tokens;
86:
87: typedef set tokens tkset;
88:
89: struct token
90: {
91: tokens t_what;
92: int t_lineno;
93: st_node *t_filename;
94: data t_value;
95: token *t_next;
96: };
97:
98: extern token *tok_list;
99:
100: #if !defined(TOKEN_CALLS) && !defined(TOKEN_INTRIN)
101: #define get_token() (tok_list = (ttmp = tok_list == NULL ? tok_fill() : tok_list)->t_next, ttmp)
102: #define unget_token(p) (ttmp = tok_list, (tok_list = (p))->t_next = ttmp)
103: #else
104: extern token *get_token();
105: extern void unget_token();
106: #endif
107:
108: #define sync(t) (global_filename = (t)->t_filename, global_lineno = (t)->t_lineno)
109:
110: #define TOK_STASH 64
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.