1 |
/* Token-reader for Bison's input parser, |
/* Token-reader for Bison's input parser, |
2 |
Copyright 1984, 1986, 1989, 1992, 2000, 2001 Free Software Foundation, Inc. |
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002 |
3 |
|
Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of Bison, the GNU Compiler Compiler. |
This file is part of Bison, the GNU Compiler Compiler. |
6 |
|
|
365 |
obstack_1grow (&token_obstack, '\0'); |
obstack_1grow (&token_obstack, '\0'); |
366 |
token_buffer = obstack_finish (&token_obstack); |
token_buffer = obstack_finish (&token_obstack); |
367 |
symval = getsym (token_buffer); |
symval = getsym (token_buffer); |
368 |
if (symval->number == NUMBER_UNDEFINED) |
symbol_class_set (symval, token_sym); |
369 |
{ |
symbol_user_token_number_set (symval, code); |
|
symval->number = ntokens++; |
|
|
symval->class = token_sym; |
|
|
if (symval->user_token_number == USER_NUMBER_UNDEFINED) |
|
|
symval->user_token_number = code; |
|
|
} |
|
370 |
return tok_identifier; |
return tok_identifier; |
371 |
} |
} |
372 |
|
|
374 |
/* parse the literal string token and treat as an identifier */ |
/* parse the literal string token and treat as an identifier */ |
375 |
|
|
376 |
{ |
{ |
377 |
int code; /* ignored here */ |
int code; |
378 |
|
|
379 |
obstack_1grow (&token_obstack, '\"'); |
obstack_1grow (&token_obstack, '\"'); |
380 |
/* Read up to and including ". */ |
/* Read up to and including ". */ |
388 |
token_buffer = obstack_finish (&token_obstack); |
token_buffer = obstack_finish (&token_obstack); |
389 |
|
|
390 |
symval = getsym (token_buffer); |
symval = getsym (token_buffer); |
391 |
if (symval->number == NUMBER_UNDEFINED) |
symbol_class_set (symval, token_sym); |
|
{ |
|
|
symval->number = ntokens++; |
|
|
symval->class = token_sym; |
|
|
} |
|
|
|
|
392 |
return tok_identifier; |
return tok_identifier; |
393 |
} |
} |
394 |
|
|