/[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.51 by akim, Thu Jan 24 17:09:34 2002 UTC revision 1.52 by akim, Mon Mar 4 12:06:07 2002 UTC
# Line 485  parse_percent_token (void) Line 485  parse_percent_token (void)
485    obstack_1grow (&token_obstack, '%');    obstack_1grow (&token_obstack, '%');
486    obstack_1grow (&token_obstack, c);    obstack_1grow (&token_obstack, c);
487    
488    switch (c)    if (!isalpha (c))
489      {      {
490      case '%':        obstack_1grow (&token_obstack, '\0');
491        token_buffer = obstack_finish (&token_obstack);        token_buffer = obstack_finish (&token_obstack);
       return tok_two_percents;  
492    
493      case '{':        switch (c)
494        token_buffer = obstack_finish (&token_obstack);          {
495        return tok_percent_left_curly;          case '%':
496              return tok_two_percents;
497    
498        /* The following guys are here for backward compatibility with          case '{':
499           very ancient Yacc versions.  The paper of Johnson mentions            return tok_percent_left_curly;
          them (as ancient :).  */  
     case '<':  
       token_buffer = obstack_finish (&token_obstack);  
       return tok_left;  
500    
501      case '>':            /* The following guys are here for backward compatibility with
502        token_buffer = obstack_finish (&token_obstack);               very ancient Yacc versions.  The paper of Johnson mentions
503        return tok_right;               them (as ancient :).  */
504            case '<':
505              return tok_left;
506    
507      case '2':          case '>':
508        token_buffer = obstack_finish (&token_obstack);            return tok_right;
       return tok_nonassoc;  
509    
510      case '0':          case '2':
511        token_buffer = obstack_finish (&token_obstack);            return tok_nonassoc;
       return tok_token;  
512    
513      case '=':          case '0':
514        token_buffer = obstack_finish (&token_obstack);            return tok_token;
       return tok_prec;  
     }  
515    
516    if (!isalpha (c))          case '=':
517      {            return tok_prec;
518        token_buffer = obstack_finish (&token_obstack);  
519        return tok_illegal;          default:
520              return tok_illegal;
521            }
522      }      }
523    
524    while (c = getc (finput), isalpha (c) || c == '_' || c == '-')    while (c = getc (finput), isalpha (c) || c == '_' || c == '-')

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

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