Newer
Older
yyval.l = List_Create(2, 1, sizeof(double));
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-2].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-2].c);
double d = 0.0;
for(int i = 0; i < List_Nbr(pSymbol->val); i++){
double d = - *(double*)List_Pointer_Fast(pSymbol->val, i);
List_Add(yyval.l, &d);
yyval.l = List_Create(2, 1, sizeof(double));
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-5].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-5].c);
double d = 0.0;
for(int i = 0; i < List_Nbr(yyvsp[-2].l); i++){
int j = (int)(*(double*)List_Pointer_Fast(yyvsp[-2].l, i));
double *pd;
if((pd = (double*)List_Pointer_Test(pSymbol->val, j)))
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-5].c, j);
yyval.l = List_Create(2, 1, sizeof(double));
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-5].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-5].c);
double d = 0.0;
for(int i = 0; i < List_Nbr(yyvsp[-2].l); i++){
int j = (int)(*(double*)List_Pointer_Fast(yyvsp[-2].l, i));
double *pd;
if((pd = (double*)List_Pointer_Test(pSymbol->val, j))){
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-5].c, j);
}
}
List_Delete(yyvsp[-2].l);
yyval.l = List_Create(2, 1, sizeof(double));
List_Add(yyval.l, &(yyvsp[0].d));
for(int i = 0; i < List_Nbr(yyvsp[0].l); i++){
double d;
List_Read(yyvsp[0].l, i, &d);
List_Add(yyval.l, &d);
}
yyval.u = PACK_COLOR((int)yyvsp[-7].d, (int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d);
yyval.u = PACK_COLOR((int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d, 255);
yyval.u = Get_ColorForString(ColorString, -1, yyvsp[0].c, &flag);

Christophe Geuzaine
committed
if(flag) yymsg(GERROR, "Unknown color '%s'", yyvsp[0].c);
unsigned int (*pColOpt)(int num, int action, unsigned int value);
StringXColor *pColCat;
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.l = List_Create(256, 10, sizeof(unsigned int));
List_Add(yyval.l, &(yyvsp[0].u));
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));
int i;
yyval.c[i]='\0';
break;
}
}
char tmpstring[1024];
int i = PrintListOfDouble(yyvsp[-3].c, yyvsp[-1].l, tmpstring);

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);
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;
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);
}
}
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;
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);
}
}
/* Line 991 of yacc.c. */
#line 10300 "Gmsh.tab.cpp"
yyvsp -= yylen;
yyssp -= yylen;
*++yyvsp = yyval;
/* 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 - YYNTOKENS] + *yyssp;
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
goto yynewstate;
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
yyn = yypact[yystate];
{
YYSIZE_T yysize = 0;
int yytype = YYTRANSLATE (yychar);
char *yymsg;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
yysize += yystrlen ("syntax error, unexpected ") + 1;
yysize += yystrlen (yytname[yytype]);
{
char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
yyp = yystpcpy (yyp, yytname[yytype]);
{
yycount = 0;
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *));
yyx++)
{
const char *yyq = ! yycount ? ", expecting " : " or ";
yyp = yystpcpy (yyp, yyq);
}
}
}
else
}
else
}
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
error, discard it. */
/* Return failure if at end of input. */
if (yychar == YYEOF)
/* Pop the error token. */
YYPOPSTACK;
/* Pop the rest of the stack. */
while (yyss < yyssp)
{
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
yydestruct (yystos[*yyssp], yyvsp);
YYPOPSTACK;
}
YYABORT;
YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
yydestruct (yytoken, &yylval);
yychar = YYEMPTY;
/* Else will try to reuse lookahead token after shifting the error
token. */
/*----------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action. |
`----------------------------------------------------*/
yyerrlab1:
/* Suppress GCC warning that yyerrlab1 is unused when no action
invokes YYERROR. */
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \
&& !defined __cplusplus
__attribute__ ((__unused__))
/*---------------------------------------------------------------.
| yyerrlab2 -- pop states until the error token can be shifted. |
`---------------------------------------------------------------*/
yyerrlab2:
for (;;)
{
yyn = yypact[yystate];
if (yyn != YYPACT_NINF)
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
{
yyn = yytable[yyn];
if (0 < yyn)
break;
}
}
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
YYABORT;
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
yydestruct (yystos[yystate], yyvsp);
yyvsp--;
yystate = *--yyssp;
}
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval;
yystate = yyn;
goto yynewstate;
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
#ifndef yyoverflow
/*----------------------------------------------.
| yyoverflowlab -- parser overflow comes here. |
`----------------------------------------------*/
yyoverflowlab:
yyerror ("parser stack overflow");
yyresult = 2;
/* Fall through. */
yyreturn:
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
}
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){
buffer[j] = '\0';
while(j < (int)strlen(format) && format[j] != '%') j++;
strncpy(buffer, format, j);
buffer[j]='\0';
strcat(buffer, "%");
j++;
}
strcat(buffer, tmp2);
}
}
else{
return List_Nbr(list)-i;
}
}
if(j != (int)strlen(format))
return -1;
return 0;
}

Christophe Geuzaine
committed
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
int CheckViewErrorFlags(Post_View *v){
if(View->adaptive) return 0; // hope for the best :-)
char *name[8] = { "point", "line", "triangle", "quadrangle",
"tetrahedron", "hexahedron", "prism", "pyramid" };
char *type[3] = { "scalar", "vector", "tensor" };
if(8 * 3 != VIEW_NB_ELEMENT_TYPES){
Msg(GERROR, "Please upgrade CheckViewErrorFlags!");
return 0;
}
for(int i = 0; i < VIEW_NB_ELEMENT_TYPES; i++)
if(ViewErrorFlags[i])
Msg(GERROR, "%d %s %s%s in View[%d] contain%s a wrong number of values",
ViewErrorFlags[i], type[i%3], name[i/3], (ViewErrorFlags[i] > 1) ? "s" : "",
v->Index, (ViewErrorFlags[i] > 1) ? "" : "s");
return 0;
}
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);
}