/[bison]/bison/src/lex.c
ViewVC logotype

Diff of /bison/src/lex.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.57 by akim, Sat May 25 16:12:40 2002 UTC revision 1.58 by akim, Mon Jun 10 08:38:10 2002 UTC
# Line 1  Line 1 
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    
# Line 364  lex (void) Line 365  lex (void)
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    
# Line 378  lex (void) Line 374  lex (void)
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 ".  */
# Line 392  lex (void) Line 388  lex (void)
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    

Legend:
Removed from v.1.57  
changed lines
  Added in v.1.58

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26