Newer
Older
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
strcat(msg, yytname[x]);
strcat(msg, "'");
count++;
}
}
}
else
}
else
}
goto yyerrlab1;
yyerrlab1: /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
{
/* if just tried and failed to reuse lookahead token after an error, discard it. */
if (yychar == YYEOF)
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token
after shifting the error token. */
yyerrdefault: /* current state does not do anything special for the error token. */
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
if (yyn) goto yydefault;
yyerrpop: /* pop the current state because it cannot handle the error token */
short *ssp1 = yyss - 1;
fprintf (stderr, "Error: state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
#endif
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yyerrdefault;
yyn += YYTERROR;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
goto yyerrdefault;
yyn = yytable[yyn];
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrpop;
yyn = -yyn;
goto yyreduce;
}
if (yyn == YYFINAL)
YYACCEPT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting error token, ");
#endif
*++yyvsp = yylval;
yystate = yyn;
goto yynewstate;
yyacceptlab:
/* YYACCEPT comes here. */
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 0;
yyabortlab:
/* YYABORT comes here. */
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
}
void DeleteSymbol(void *a, void *b){
Symbol *s = (Symbol*)a;
Free(s->Name);
List_Delete(s->val);
}
int CompareSymbols (const void *a, const void *b){
}
void InitSymbols(void){
if(Symbol_T){
Tree_Action(Symbol_T, DeleteSymbol);
Tree_Delete(Symbol_T);
}
Symbol_T = Tree_Create(sizeof(Symbol), CompareSymbols);
}
int PrintListOfDouble(char *format, List_T *list, char *buffer){
strncpy(buffer, format, j);
buffer[j]='\0';
strcat(buffer, tmp2);
}
}
else{
return List_Nbr(list)-i;
}
}
if(j != (int)strlen(format))
return -1;
return 0;
}

Christophe Geuzaine
committed
void yyerror(char *s){
Msg(GERROR, "'%s', line %d : %s (%s)", yyname, yylineno-1, s, yytext);
}

Christophe Geuzaine
committed
void yymsg(int type, char *fmt, ...){
va_list args;
va_start (args, fmt);
vsprintf (tmp, fmt, args);
va_end (args);

Christophe Geuzaine
committed
Msg(type, "'%s', line %d : %s", yyname, yylineno-1, tmp);