34 static char sccsid[] =
"@(#)lexi.c 8.1 (Berkeley) 6/6/93";
123 0, 0, 0, 0, 0, 0, 0, 0,
124 0, 0, 0, 0, 0, 0, 0, 0,
125 0, 0, 0, 0, 0, 0, 0, 0,
126 0, 0, 0, 0, 0, 0, 0, 0,
127 0, 3, 0, 0, 1, 3, 3, 0,
128 0, 0, 3, 3, 0, 3, 0, 3,
129 1, 1, 1, 1, 1, 1, 1, 1,
130 1, 1, 0, 0, 3, 3, 3, 3,
131 0, 1, 1, 1, 1, 1, 1, 1,
132 1, 1, 1, 1, 1, 1, 1, 1,
133 1, 1, 1, 1, 1, 1, 1, 1,
134 1, 1, 1, 0, 0, 0, 3, 1,
135 0, 1, 1, 1, 1, 1, 1, 1,
136 1, 1, 1, 1, 1, 1, 1, 1,
137 1, 1, 1, 1, 1, 1, 1, 1,
138 1, 1, 1, 0, 3, 0, 3, 0
144 return (strcmp(e1, *(
const char *
const *)e2));
163 int in_comment =
false;
164 int in_slash_comment =
false;
182 if (lastc ==
'*' &&
c ==
'/')
184 }
else if (lastc ==
'/' &&
c ==
'*' && !in_slash_comment)
186 else if (in_slash_comment) {
188 in_slash_comment =
false;
189 }
else if (lastc ==
'/' &&
c ==
'/')
190 in_slash_comment =
true;
202 }
else if (paren_depth == 0) {
206 else if (
c ==
';' ||
c ==
',')
228 state->last_nl =
false;
231 state->col_1 =
false;
245 if (isdigit((
unsigned char)*
buf_ptr) ||
260 len = strspn(
buf_ptr + 2,
"0123456789ABCDEFabcdef") + 2;
270 diag2(1,
"Unterminated literal");
302 if (!(seensfx & 2) && (strchr(
"fFlL", *
buf_ptr) != NULL)) {
344 state->last_u_d =
true;
366 state->last_u_d =
true;
371 state->last_u_d =
true;
382 if (
state->p_l_follow) {
390 if (p != NULL && p->
rwcode == 3)
392 if (
state->p_l_follow)
414 state->in_parameter_declaration == 0 &&
state->block_init == 0) {
418 state->in_parameter_declaration = 1;
427 else if (!
state->p_l_follow && !
state->block_init &&
430 isalpha((
unsigned char)*
buf_ptr)) &&
434 state->last_u_d =
true;
439 state->last_u_d =
true;
454 unary_delim =
state->last_u_d;
455 state->last_nl =
true;
470 diag2(1,
"Unterminated literal");
506 unary_delim =
state->last_u_d;
542 unary_delim =
state->last_u_d;
543 state->last_nl =
true;
581 state->want_blank =
false;
588 state->block_init = 1;
625 if (!
state->last_u_d) {
651 unary_delim =
state->last_u_d;
670 state->last_u_d = unary_delim;
709 for (p = 0; (comparison = strcmp(
key,
typenames[p])) > 0; p++)
void err(int eval, const char *fmt,...)
void diag2(int, const char *)
void lookahead_reset(void)
#define CHECK_SIZE_TOKEN(desired_size)
void add_typename(const char *key)
static int strcmp_type(const void *e1, const void *e2)
int lexi(struct parser_state *state)
void alloc_typenames(void)
static int is_func_definition(char *tp)