summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7b306f5)
* bison.s1 (yyparse): In the label yyerrlab, when YYERROR_VERBOSE,
add yychar in msg.
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ On syntax errors, report the token on which we choked.
+
+ * bison.s1 (yyparse): In the label yyerrlab, when YYERROR_VERBOSE,
+ add yychar in msg.
+
2000-03-17 Akim Demaille <akim@epita.fr>
* reader.c (copy_at): New function.
2000-03-17 Akim Demaille <akim@epita.fr>
* reader.c (copy_at): New function.
gettextize && \
autoconf && \
autoheader && \
gettextize && \
autoconf && \
autoheader && \
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
- msg = (char *) malloc(size + 15);
+ size += strlen ("parse error, unexpected `") + 1;
+ size += strlen (yytname[YYTRANSLATE (yychar)]);
+ msg = (char *) malloc (size);
- strcpy(msg, "parse error");
+ strcpy (msg, "parse error, unexpected `");
+ strcat (msg, yytname[YYTRANSLATE (yychar)]);
+ strcat (msg, "'");
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
- strcat(msg, count == 0 ? ", expecting `" : " or `");
- strcat(msg, yytname[x]);
- strcat(msg, "'");
+ strcat (msg, count == 0 ? ", expecting `" : " or `");
+ strcat (msg, yytname[x]);
+ strcat (msg, "'");
- yyerror(msg);
- free(msg);
+ yyerror (msg);
+ free (msg);
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
- yyerror("parse error");
+ yyerror ("parse error");
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
- msg = (char *) malloc(size + 15);
+ size += strlen ("parse error, unexpected `") + 1;
+ size += strlen (yytname[YYTRANSLATE (yychar)]);
+ msg = (char *) malloc (size);
- strcpy(msg, "parse error");
+ strcpy (msg, "parse error, unexpected `");
+ strcat (msg, yytname[YYTRANSLATE (yychar)]);
+ strcat (msg, "'");
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
- strcat(msg, count == 0 ? ", expecting `" : " or `");
- strcat(msg, yytname[x]);
- strcat(msg, "'");
+ strcat (msg, count == 0 ? ", expecting `" : " or `");
+ strcat (msg, yytname[x]);
+ strcat (msg, "'");
- yyerror(msg);
- free(msg);
+ yyerror (msg);
+ free (msg);
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
- yyerror("parse error");
+ yyerror ("parse error");