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

Diff of /bison/src/output.c

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

revision 1.150 by akim, Fri May 3 08:42:48 2002 UTC revision 1.151 by akim, Sat May 4 08:48:04 2002 UTC
# Line 582  token_definitions_output (FILE *out) Line 582  token_definitions_output (FILE *out)
582        symbol_t *symbol = symbols[i];        symbol_t *symbol = symbols[i];
583        int number = symbol->user_token_number;        int number = symbol->user_token_number;
584    
585        if (number == SALIAS)        /* At this stage, if there are literal aliases, they are part of
586          continue;           SYMBOLS, so we should not find symbols which are the aliases
587             here.  */
588          assert (number != USER_NUMBER_ALIAS);
589    
590        /* Skip error token.  */        /* Skip error token.  */
591        if (symbol == errtoken)        if (symbol == errtoken)
592          continue;          continue;
593        if (symbol->tag[0] == '\'')  
594          continue;               /* skip literal character */        /* If this string has an alias, then it is necessarily the alias
595        if (symbol->tag[0] == '\"')           which is to be output.  */
596          {        if (symbol->alias)
597            /* use literal string only if given a symbol with an alias */          symbol = symbol->alias;
598            if (symbol->alias)  
599              symbol = symbol->alias;        /* Don't output literal chars or strings (when defined only as a
600            else           string).  Note that must be done after the alias resolution:
601              continue;           think about `%token 'f' "f"'.  */
602          }        if (symbol->tag[0] == '\'' || symbol->tag[0] == '\"')
603            continue;
604    
605        /* Don't #define nonliteral tokens whose names contain periods        /* Don't #define nonliteral tokens whose names contain periods
606           or '$' (as does the default value of the EOF token).  */           or '$' (as does the default value of the EOF token).  */
# Line 605  token_definitions_output (FILE *out) Line 609  token_definitions_output (FILE *out)
609    
610        fprintf (out, "%s[[[%s]], [%d]]",        fprintf (out, "%s[[[%s]], [%d]]",
611                 first ? "" : ",\n", symbol->tag, number);                 first ? "" : ",\n", symbol->tag, number);
612    
613        first = 0;        first = 0;
614      }      }
615  }  }

Legend:
Removed from v.1.150  
changed lines
  Added in v.1.151

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