2000-03-31 Akim Demaille <akim@epita.fr>
- Clean the error reporting functions.
+ * allocate.c: s/return (foo)/return foo/.
+ * lalr.c: Likewise.
+ * LR0.c: Likewise.
+ * output.c: Likewise.
+ * reader.c: Likewise.
+ * symtab.c: Likewise.
+ * vmsgetargs.c: Likewise.
+
+2000-03-31 Akim Demaille <akim@epita.fr>
+
+ Clean up the error reporting functions.
* src/report.c: New file.
* src/report.h: Likewise.
msgid ""
msgstr ""
"Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2000-03-31 15:40+0200\n"
+"POT-Creation-Date: 2000-03-31 16:02+0200\n"
"PO-Revision-Date: 1996-10-10 17:54 MET DST\n"
"Last-Translator: Ulrich Drepper <drepper@gnu.ai.mit.edu>\n"
"Language-Team: German <de@li.org>\n"
msgid ""
msgstr ""
"Project-Id-Version: GNU bison 1.25\n"
-"POT-Creation-Date: 2000-03-31 15:40+0200\n"
+"POT-Creation-Date: 2000-03-31 16:02+0200\n"
"PO-Revision-Date: 1998-09-21 10:19+0200\n"
"Last-Translator: Nicolás García-Pedrajas <ngarcia-pedrajas@acm.org>\n"
"Language-Team: Spanish <es@li.org>\n"
msgid ""
msgstr ""
"Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2000-03-31 15:40+0200\n"
+"POT-Creation-Date: 2000-03-31 16:02+0200\n"
"PO-Revision-Date: 1996-03-19 20:05 EST\n"
"Last-Translator: Dominique Boucher <boucherd@IRO.UMontreal.CA>\n"
"Language-Team: French <fr@li.org>\n"
msgid ""
msgstr ""
"Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2000-03-31 15:40+0200\n"
+"POT-Creation-Date: 2000-03-31 16:02+0200\n"
"PO-Revision-Date: 1996-08-27 15:34 MET DST\n"
"Last-Translator: Erick Branderhorst <branderh@debian.org>\n"
"Language-Team: Dutch <nl@li.org>\n"
msgid ""
msgstr ""
"Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2000-03-31 15:40+0200\n"
+"POT-Creation-Date: 2000-03-31 16:02+0200\n"
"PO-Revision-Date: 1999-07-12 12:18\n"
"Last-Translator: Dmitry S. Sivachenko <dima@Chg.RU>\n"
"Language-Team: Russian <ru@li.org>\n"
state_table[key] = sp = new_state(symbol);
}
- return (sp->number);
+ return sp->number;
}
nstates++;
- return (p);
+ return p;
}
done (1);
}
- return (block);
+ return block;
}
char *
done (1);
}
- return (block);
+ return block;
}
middle = (low + high) / 2;
s = from_state[middle];
if (s == state)
- return (middle);
+ return middle;
else if (s < state)
low = middle + 1;
else
FREE(temp_R);
- return (new_R);
+ return new_R;
}
break;
default:
- return (c);
+ return c;
}
}
}
symval = unlexed_symval;
c = unlexed;
unlexed = -1;
- return (c);
+ return c;
}
c = skip_white_space();
{
case EOF:
strcpy(token_buffer, "EOF");
- return (ENDFILE);
+ return ENDFILE;
case 'A': case 'B': case 'C': case 'D': case 'E':
case 'F': case 'G': case 'H': case 'I': case 'J':
*p = 0;
ungetc(c, finput);
symval = getsym(token_buffer);
- return (IDENTIFIER);
+ return IDENTIFIER;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
}
*p = 0;
ungetc(c, finput);
- return (NUMBER);
+ return NUMBER;
}
case '\'':
symval->class = STOKEN;
if (! symval->user_token_number)
symval->user_token_number = code;
- return (IDENTIFIER);
+ return IDENTIFIER;
}
case '\"':
symval = getsym(token_buffer);
symval->class = STOKEN;
- return (IDENTIFIER);
+ return IDENTIFIER;
}
case ',':
- return (COMMA);
+ return COMMA;
case ':':
- return (COLON);
+ return COLON;
case ';':
- return (SEMICOLON);
+ return SEMICOLON;
case '|':
- return (BAR);
+ return BAR;
case '{':
- return (LEFT_CURLY);
+ return LEFT_CURLY;
case '=':
do
if (c == '{')
{
strcpy(token_buffer, "={");
- return(LEFT_CURLY);
+ return LEFT_CURLY;
}
else
{
ungetc(c, finput);
- return(ILLEGAL);
+ return ILLEGAL;
}
case '<':
c = getc(finput);
}
*p = 0;
- return (TYPENAME);
+ return TYPENAME;
case '%':
- return (parse_percent_token());
+ return parse_percent_token();
default:
- return (ILLEGAL);
+ return ILLEGAL;
}
}
switch (c)
{
case '%':
- return (TWO_PERCENTS);
+ return TWO_PERCENTS;
case '{':
- return (PERCENT_LEFT_CURLY);
+ return PERCENT_LEFT_CURLY;
case '<':
- return (LEFT);
+ return LEFT;
case '>':
- return (RIGHT);
+ return RIGHT;
case '2':
- return (NONASSOC);
+ return NONASSOC;
case '0':
- return (TOKEN);
+ return TOKEN;
case '=':
- return (PREC);
+ return PREC;
}
if (!isalpha(c))
- return (ILLEGAL);
+ return ILLEGAL;
p = token_buffer;
*p++ = '%';
-/* figure out the actions for the specified state, indexed by lookahead token type.
+/* Figure out the actions for the specified state, indexed by
+ lookahead token type.
- The yydefact table is output now. The detailed info
- is saved for putting into yytable later. */
+ The yydefact table is output now. The detailed info is saved for
+ putting into yytable later. */
void
token_actions (void)
-/* Decide what to do for each type of token if seen as the lookahead token in specified state.
- The value returned is used as the default action (yydefact) for the state.
- In addition, actrow is filled with what to do for each kind of token,
- index by symbol number, with zero meaning do the default action.
- The value MINSHORT, a very negative number, means this situation
- is an error. The parser recognizes this value specially.
+/* Decide what to do for each type of token if seen as the lookahead
+ token in specified state. The value returned is used as the
+ default action (yydefact) for the state. In addition, actrow is
+ filled with what to do for each kind of token, index by symbol
+ number, with zero meaning do the default action. The value
+ MINSHORT, a very negative number, means this situation is an error.
+ The parser recognizes this value specially.
- This is where conflicts are resolved. The loop over lookahead rules
- considered lower-numbered rules last, and the last rule considered that likes
- a token gets to handle it. */
+ This is where conflicts are resolved. The loop over lookahead
+ rules considered lower-numbered rules last, and the last rule
+ considered that likes a token gets to handle it. */
int
action_row (int state)
if (nreds >= 1)
{
- /* loop over all the rules available here which require lookahead */
+ /* loop over all the rules available here which require
+ lookahead */
m = lookaheads[state];
n = lookaheads[state + 1];
wordp = LA + i * tokensetsize;
mask = 1;
- /* and find each token which the rule finds acceptable to come next */
+ /* and find each token which the rule finds acceptable
+ to come next */
for (j = 0; j < ntokens; j++)
{
- /* and record this rule as the rule to use if that token follows. */
+ /* and record this rule as the rule to use if that
+ token follows. */
if (mask & *wordp)
actrow[j] = rule;
shiftp = shift_table[state];
- /* now see which tokens are allowed for shifts in this state.
- For them, record the shift as the thing to do. So shift is preferred to reduce. */
+ /* Now see which tokens are allowed for shifts in this state. For
+ them, record the shift as the thing to do. So shift is preferred
+ to reduce. */
if (shiftp)
{
actrow[symbol] = shift_state;
- /* do not use any default reduction if there is a shift for error */
-
- if (symbol == error_token_number) nodefault = 1;
+ /* Do not use any default reduction if there is a shift for
+ error */
+ if (symbol == error_token_number)
+ nodefault = 1;
}
}
errp = err_table[state];
- /* See which tokens are an explicit error in this state
- (due to %nonassoc). For them, record MINSHORT as the action. */
+ /* See which tokens are an explicit error in this state (due to
+ %nonassoc). For them, record MINSHORT as the action. */
if (errp)
{
}
}
- /* now find the most common reduction and make it the default action for this state. */
+ /* Now find the most common reduction and make it the default action
+ for this state. */
if (nreds >= 1 && ! nodefault)
{
actrow[j] = 0;
}
- return (default_rule);
+ return default_rule;
}
n = goto_map[symbol + 1];
if (m == n)
- return (-1);
+ return -1;
for (i = 0; i < nstates; i++)
state_count[i] = 0;
}
}
- return (default_state);
+ return default_state;
}
i = order[vector];
if (i >= nstates)
- return (-1);
+ return -1;
t = tally[i];
w = width[i];
{
j = order[prev];
if (width[j] != w || tally[j] != t)
- return (-1);
+ return -1;
match = 1;
for (k = 0; match && k < t; k++)
}
if (match)
- return (j);
+ return j;
}
- return (-1);
+ return -1;
}
if (loc > high)
high = loc;
- return (j);
+ return j;
}
}
FREE(state_table);
- for (cp = first_state; cp; cp = cptmp) {
- cptmp=cp->next;
- FREE(cp);
- }
+ for (cp = first_state; cp; cp = cptmp)
+ {
+ cptmp=cp->next;
+ FREE(cp);
+ }
}
FREE(shift_table);
- for (sp = first_shift; sp; sp = sptmp) {
- sptmp=sp->next;
- FREE(sp);
- }
+ for (sp = first_shift; sp; sp = sptmp)
+ {
+ sptmp=sp->next;
+ FREE(sp);
+ }
}
FREE(reduction_table);
- for (rp = first_reduction; rp; rp = rptmp) {
- rptmp=rp->next;
- FREE(rp);
- }
+ for (rp = first_reduction; rp; rp = rptmp)
+ {
+ rptmp=rp->next;
+ FREE(rp);
+ }
}
i++;
}
- return (rp->sym->type_name);
+ return rp->sym->type_name;
}
sym = getsym(token_buffer);
sym->class = SNTERM;
sym->value = nvars++;
- return (sym);
+ return sym;
}
/* Parse the input grammar into a one symbol_list structure.
switch (t)
{
case SEMICOLON:
- return (lex());
+ return lex();
case COMMA:
break;
break;
default:
- return (t);
+ return t;
}
}
}
while (*cp)
k = ((k << 1) ^ (*cp++)) & 0x3fff;
- return (k % TABSIZE);
+ return k % TABSIZE;
}
result = xmalloc((unsigned int)i);
strcpy(result, s);
- return (result);
+ return result;
}
symtab[hashval] = bp;
}
- return (bp);
+ return bp;
}
*/
if (cli_present("BISON$FILE_PREFIX"))
{
- cli_get_value("BISON$FILE_PREFIX", file_prefix_spec,
+ cli_get_value("BISON$FILE_PREFIX", file_prefix_spec,
sizeof(file_prefix_spec));
for (cp = spec_file_prefix = file_prefix_spec; *cp; cp++)
if (isupper(*cp))
*/
if (cli_present("BISON$NAME_PREFIX"))
{
- cli_get_value("BISON$NAME_PREFIX", name_prefix_spec,
+ cli_get_value("BISON$NAME_PREFIX", name_prefix_spec,
sizeof(name_prefix_spec));
for (cp = spec_name_prefix = name_prefix_spec; *cp; cp++)
if (isupper(*cp))
Descr.Ptr = Name;
Descr.Size = strlen(Name);
- return((cli$present(&Descr) & 1) ? 1 : 0);
+ return (cli$present(&Descr) & 1) ? 1 : 0;
}
/*
Descr2.Size = Size-1;
if (cli$get_value(&Descr1,&Descr2,&Descr2.Size) & 1) {
Buffer[Descr2.Size] = 0;
- return(1);
+ return 1;
}
- return(0);
+ return 0;
}