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). */ |
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 |
} |
} |