/[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.33.2.1 by marc, Fri Aug 24 18:36:50 2001 UTC revision 1.33.2.2 by akim, Mon Sep 10 08:33:25 2001 UTC
# Line 36  const char *token_buffer = NULL; Line 36  const char *token_buffer = NULL;
36  bucket *symval;  bucket *symval;
37  int numval;  int numval;
38    
39  static int unlexed;             /* these two describe a token to be reread */  /* these two describe a token to be reread */
40  static bucket *unlexed_symval;  /* by the next call to lex */  static token_t unlexed = tok_undef;
41    /* by the next call to lex */
42    static bucket *unlexed_symval = NULL;
43    
44    
45  void  void
46  init_lex (void)  init_lex (void)
47  {  {
48    obstack_init (&token_obstack);    obstack_init (&token_obstack);
49    unlexed = -1;    unlexed = tok_undef;
50  }  }
51    
52    
# Line 356  lex (void) Line 358  lex (void)
358    /* Just to make sure. */    /* Just to make sure. */
359    token_buffer = NULL;    token_buffer = NULL;
360    
361    if (unlexed >= 0)    if (unlexed != tok_undef)
362      {      {
363          token_t res = unlexed;
364        symval = unlexed_symval;        symval = unlexed_symval;
365        c = unlexed;        unlexed = tok_undef;
366        unlexed = -1;        return res;
       return c;  
367      }      }
368    
369    c = skip_white_space ();    c = skip_white_space ();
# Line 516  struct percent_table_struct Line 518  struct percent_table_struct
518  {  {
519    const char *name;    const char *name;
520    void *set_flag;    void *set_flag;
521    int retval;    token_t retval;
522  };  };
523    
524  struct percent_table_struct percent_table[] =  struct percent_table_struct percent_table[] =
# Line 566  struct percent_table_struct percent_tabl Line 568  struct percent_table_struct percent_tabl
568  /* Parse a token which starts with %.  /* Parse a token which starts with %.
569     Assumes the % has already been read and discarded.  */     Assumes the % has already been read and discarded.  */
570    
571  int  token_t
572  parse_percent_token (void)  parse_percent_token (void)
573  {  {
   int c;  
574    struct percent_table_struct *tx;    struct percent_table_struct *tx;
575    
576    c = getc (finput);    int c = getc (finput);
577    
578    switch (c)    switch (c)
579      {      {
# Line 635  parse_percent_token (void) Line 636  parse_percent_token (void)
636      case tok_obsolete:      case tok_obsolete:
637        fatal (_("`%s' is no longer supported"), token_buffer);        fatal (_("`%s' is no longer supported"), token_buffer);
638        break;        break;
639    
640        default:
641          /* Other cases do not apply here. */
642          break;
643      }      }
644    
645    return tx->retval;    return tx->retval;

Legend:
Removed from v.1.33.2.1  
changed lines
  Added in v.1.33.2.2

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