Newer
Older
yyval.u = Get_ColorForString(ColorString, -1, yyvsp[0].c, &flag);

Christophe Geuzaine
committed
if(flag) yymsg(GERROR, "Unknown color '%s'", yyvsp[0].c);
if(!(pColCat = Get_ColorOptionCategory(yyvsp[-4].c))){

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown color option class '%s'", yyvsp[-4].c);

Christophe Geuzaine
committed
if(!(pColOpt = (unsigned int (*) (int, int, unsigned int))Get_ColorOption(yyvsp[0].c, pColCat))){

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown color option '%s.Color.%s'", yyvsp[-4].c, yyvsp[0].c);
GmshColorTable *ct = Get_ColorTable((int)yyvsp[-3].d);

Christophe Geuzaine
committed
if(!ct)

Christophe Geuzaine
committed
yymsg(GERROR, "View[%d] does not exist", (int)yyvsp[-3].d);
yyval.c = (char *)Malloc((strlen(yyvsp[-3].c)+strlen(yyvsp[-1].c)+1)*sizeof(char)) ;
strcpy(yyval.c, yyvsp[-3].c) ;
strcat(yyval.c, yyvsp[-1].c) ;
Free(yyvsp[-3].c);
Free(yyvsp[-1].c);
yyval.c = (char *)Malloc((strlen(yyvsp[-1].c)+1)*sizeof(char)) ;
yyval.c[i]='\0';
break;
}
}
i = PrintListOfDouble(yyvsp[-3].c, yyvsp[-1].l, tmpstring);
if(i < 0){

Christophe Geuzaine
committed
yymsg(GERROR, "Too few arguments in Sprintf");
else if(i > 0){
yymsg(GERROR, "%d extra argument%s in Sprintf", i, (i>1)?"s":"");
}
else{
yyval.c = (char*)Malloc((strlen(tmpstring)+1)*sizeof(char));
strcpy(yyval.c, tmpstring);
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-3].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-3].c);
else{
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-1].c, pStrCat)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option '%s.%s'", yyvsp[-3].c, yyvsp[-1].c);
yyval.c = (char*)Malloc((strlen(str)+1)*sizeof(char));
strcpy(yyval.c, str);
}
}
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-6].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-6].c);
else{
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-1].c, pStrCat)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option '%s[%d].%s'", yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-1].c);
yyval.c = (char*)Malloc((strlen(str)+1)*sizeof(char));
strcpy(yyval.c, str);
}
}
;
break;}
}
/* the action file gets copied in in place of this dollarsign */
#line 543 "/usr/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
*++yyvsp = yyval;
#ifdef YYLSP_NEEDED
yylsp++;
if (yylen == 0)
{
yylsp->first_line = yylloc.first_line;
yylsp->first_column = yylloc.first_column;
yylsp->last_line = (yylsp-1)->last_line;
yylsp->last_column = (yylsp-1)->last_column;
yylsp->text = 0;
}
else
{
yylsp->last_line = (yylsp+yylen-1)->last_line;
yylsp->last_column = (yylsp+yylen-1)->last_column;
}
#endif
/* Now "shift" the result of the reduction.
Determine what state that goes to,
based on the state we popped back to
and the rule number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
goto yynewstate;
if (! yyerrstatus)
/* If not already recovering from an error, report this error. */
{
++yynerrs;
yyn = yypact[yystate];
{
int size = 0;
char *msg;
int x, count;
count = 0;
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
if (msg != 0)
{
{
count = 0;
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
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)
YYABORT;
#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;
#endif
yyerrpop: /* pop the current state because it cannot handle the error token */
if (yyssp == yyss) YYABORT;
yyvsp--;
yystate = *--yyssp;
#ifdef YYLSP_NEEDED
yylsp--;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "Error: state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
yyerrhandle:
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);
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){
int i, j, k;
char tmp1[256], tmp2[256];
j=0;
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);
yyerrorstate=1;
}

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);
if(type == GERROR) yyerrorstate=1;
}