Newer
Older

Christophe Geuzaine
committed
case 339:
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-3].c))){
vyyerror("Unknown numeric option class '%s'", yyvsp[-3].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-1].c, pNumCat))){
vyyerror("Unknown numeric option '%s.%s'", yyvsp[-3].c, yyvsp[-1].c);

Christophe Geuzaine
committed
else
yyval.d = pNumOpt(0, GMSH_SET|GMSH_GUI, pNumOpt(0, GMSH_GET, 0)+yyvsp[0].i);

Christophe Geuzaine
committed
case 340:

Christophe Geuzaine
committed
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-6].c))){
vyyerror("Unknown numeric option class '%s'", yyvsp[-6].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-1].c, pNumCat))){
vyyerror("Unknown numeric option '%s[%d].%s'", yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-1].c);

Christophe Geuzaine
committed
else
yyval.d = pNumOpt((int)yyvsp[-4].d, GMSH_SET|GMSH_GUI, pNumOpt((int)yyvsp[-4].d, GMSH_GET, 0)+yyvsp[0].i);

Christophe Geuzaine
committed
case 341:
memcpy(yyval.v, yyvsp[0].v, 5*sizeof(double)) ;

Christophe Geuzaine
committed
case 342:
{
for(i=0 ; i<5 ; i++) yyval.v[i] = -yyvsp[0].v[i] ;

Christophe Geuzaine
committed
case 343:
for(i=0 ; i<5 ; i++) yyval.v[i] = yyvsp[0].v[i];
;
break;}

Christophe Geuzaine
committed
case 344:
{
for(i=0 ; i<5 ; i++) yyval.v[i] = yyvsp[-2].v[i] - yyvsp[0].v[i] ;

Christophe Geuzaine
committed
case 345:
{
for(i=0 ; i<5 ; i++) yyval.v[i] = yyvsp[-2].v[i] + yyvsp[0].v[i] ;

Christophe Geuzaine
committed
case 346:
yyval.v[0]=yyvsp[-9].d; yyval.v[1]=yyvsp[-7].d; yyval.v[2]=yyvsp[-5].d; yyval.v[3]=yyvsp[-3].d; yyval.v[4]=yyvsp[-1].d;
;
break;}

Christophe Geuzaine
committed
case 347:
{
yyval.v[0]=yyvsp[-7].d; yyval.v[1]=yyvsp[-5].d; yyval.v[2]=yyvsp[-3].d; yyval.v[3]=yyvsp[-1].d; yyval.v[4]=1.0;

Christophe Geuzaine
committed
case 348:
{
yyval.v[0]=yyvsp[-5].d; yyval.v[1]=yyvsp[-3].d; yyval.v[2]=yyvsp[-1].d; yyval.v[3]=0.0; yyval.v[4]=1.0;
;
break;}

Christophe Geuzaine
committed
case 349:
{
yyval.v[0]=yyvsp[-5].d; yyval.v[1]=yyvsp[-3].d; yyval.v[2]=yyvsp[-1].d; yyval.v[3]=0.0; yyval.v[4]=1.0;
;
break;}

Christophe Geuzaine
committed
case 350:
{
;
break;}

Christophe Geuzaine
committed
case 351:

Christophe Geuzaine
committed
case 352:

Christophe Geuzaine
committed
case 353:

Christophe Geuzaine
committed
case 354:

Christophe Geuzaine
committed
case 355:

Christophe Geuzaine
committed
case 356:

Christophe Geuzaine
committed
case 357:
yyval.l = List_Create(2,1,sizeof(List_T*)) ;

Christophe Geuzaine
committed
case 358:
{
List_Add(yyval.l, &(yyvsp[0].l)) ;
;
break;}

Christophe Geuzaine
committed
case 359:
{
yyval.l = List_Create(2,1,sizeof(double)) ;
List_Add(yyval.l, &(yyvsp[0].d)) ;
;
break;}

Christophe Geuzaine
committed
case 360:

Christophe Geuzaine
committed
case 361:
{
yyval.l=yyvsp[-1].l;
;
break;}

Christophe Geuzaine
committed
case 362:
{
yyval.l=yyvsp[-1].l;
for(i=0 ; i<List_Nbr(yyval.l) ; i++){
pd = (double*)List_Pointer(yyval.l, i);
(*pd) = - (*pd);
;
break;}

Christophe Geuzaine
committed
case 363:
{
yyval.l = List_Create(2,1,sizeof(double)) ;
for(d=yyvsp[-2].d ; (yyvsp[-2].d<yyvsp[0].d)?(d<=yyvsp[0].d):(d>=yyvsp[0].d) ; (yyvsp[-2].d<yyvsp[0].d)?(d+=1.):(d-=1.))
List_Add(yyval.l, &d) ;
;
break;}

Christophe Geuzaine
committed
case 364:
{
yyval.l = List_Create(2,1,sizeof(double)) ;
if(!yyvsp[0].d || (yyvsp[-4].d<yyvsp[-2].d && yyvsp[0].d<0) || (yyvsp[-4].d>yyvsp[-2].d && yyvsp[0].d>0)){
vyyerror("Wrong increment in '%g:%g:%g'", yyvsp[-4].d, yyvsp[-2].d, yyvsp[0].d) ;
List_Add(yyval.l, &(yyvsp[-4].d)) ;
}
else
for(d=yyvsp[-4].d ; (yyvsp[0].d>0)?(d<=yyvsp[-2].d):(d>=yyvsp[-2].d) ; d+=yyvsp[0].d)
List_Add(yyval.l, &d) ;
;
break;}

Christophe Geuzaine
committed
case 365:
{
yyval.l = List_Create(2,1,sizeof(double)) ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
d = 0.0 ;
List_Add(yyval.l, &d);
}
else{
for(i = 0 ; i < List_Nbr(pSymbol->val) ; i++)
List_Add(yyval.l, (double*)List_Pointer_Fast(pSymbol->val, i)) ;

Christophe Geuzaine
committed
case 366:
yyval.l = List_Create(2,1,sizeof(double)) ;
TheSymbol.Name = yyvsp[-2].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
for(i = 0 ; i < List_Nbr(pSymbol->val) ; i++){
d = - *(double*)List_Pointer_Fast(pSymbol->val, i);
List_Add(yyval.l, &d) ;
}

Christophe Geuzaine
committed
case 367:
{
yyval.l = List_Create(2,1,sizeof(double)) ;
TheSymbol.Name = yyvsp[-5].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
}
else{
for(i = 0 ; i < List_Nbr(yyvsp[-2].l) ; i++){
j = (int)(*(double*)List_Pointer_Fast(yyvsp[-2].l, i));
if((pd = (double*)List_Pointer_Test(pSymbol->val, j)))
List_Add(yyval.l, pd) ;
else
vyyerror("Uninitialized variable '%s[%d]'", yyvsp[-5].c, j) ;
;
break;}

Christophe Geuzaine
committed
case 368:
{
yyval.l = List_Create(2,1,sizeof(double)) ;
TheSymbol.Name = yyvsp[-5].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
}
else{
for(i = 0 ; i < List_Nbr(yyvsp[-2].l) ; i++){
j = (int)(*(double*)List_Pointer_Fast(yyvsp[-2].l, i));
if((pd = (double*)List_Pointer_Test(pSymbol->val, j))){
List_Add(yyval.l, &d) ;
}
else
vyyerror("Uninitialized variable '%s[%d]'", yyvsp[-5].c, j) ;
}
}
List_Delete(yyvsp[-2].l);
;
break;}

Christophe Geuzaine
committed
case 369:
{
yyval.l = List_Create(2,1,sizeof(double)) ;
List_Add(yyval.l, &(yyvsp[0].d)) ;
;
break;}

Christophe Geuzaine
committed
case 370:

Christophe Geuzaine
committed
case 371:
{
List_Add(yyval.l, &(yyvsp[0].d)) ;
;
break;}

Christophe Geuzaine
committed
case 372:
{
for(i=0 ; i<List_Nbr(yyvsp[0].l) ; i++){
List_Read(yyvsp[0].l, i, &d) ;
List_Add(yyval.l, &d) ;
}
;
break;}

Christophe Geuzaine
committed
case 373:
{
yyval.u = PACK_COLOR((int)yyvsp[-7].d, (int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d);
;
break;}

Christophe Geuzaine
committed
case 374:
{
yyval.u = PACK_COLOR((int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d, 255);
;
break;}

Christophe Geuzaine
committed
case 375:
{
yyval.u = Get_ColorForString(ColorString, -1, yyvsp[0].c, &flag);

Christophe Geuzaine
committed
case 376:
if(!(pColCat = Get_ColorOptionCategory(yyvsp[-4].c))){

Christophe Geuzaine
committed
if(!(pColOpt = (unsigned int (*) (int, int, unsigned int))Get_ColorOption(yyvsp[0].c, pColCat))){
vyyerror("Unknown color option '%s.Color.%s'", yyvsp[-4].c, yyvsp[0].c);

Christophe Geuzaine
committed
yyval.u = pColOpt(0,GMSH_GET,0) ;

Christophe Geuzaine
committed
case 377:

Christophe Geuzaine
committed
case 378:
yyval.l = List_Create(256,10,sizeof(unsigned int)) ;
GmshColorTable *ct = Get_ColorTable((int)yyvsp[-3].d);

Christophe Geuzaine
committed
if(!ct)
vyyerror("View[%d] does not exist", (int)yyvsp[-3].d);

Christophe Geuzaine
committed
for(i=0 ; i<ct->size ; i++)

Christophe Geuzaine
committed
case 379:
yyval.l = List_Create(256,10,sizeof(unsigned int)) ;
List_Add(yyval.l, &(yyvsp[0].u)) ;

Christophe Geuzaine
committed
case 380:

Christophe Geuzaine
committed
case 381:
{
yyval.c = yyvsp[0].c;
;
break;}

Christophe Geuzaine
committed
case 382:
{
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);
;
break;}

Christophe Geuzaine
committed
case 383:
{
yyval.c = (char *)Malloc((strlen(yyvsp[-1].c)+1)*sizeof(char)) ;
for(i=strlen(yyvsp[-1].c)-1; i>=0; i--){
if(yyvsp[-1].c[i] == '.'){
strncpy(yyval.c,yyvsp[-1].c,i);
yyval.c[i]='\0';
break;
}
}
if(i<=0) strcpy(yyval.c,yyvsp[-1].c);
Free(yyvsp[-1].c);
;
break;}

Christophe Geuzaine
committed
case 384:
{
yyval.c = yyvsp[-1].c;
;
break;}

Christophe Geuzaine
committed
case 385:
i = PrintListOfDouble(yyvsp[-3].c,yyvsp[-1].l,tmpstring);
if(i<0){
vyyerror("Too few arguments in Sprintf");
}
else if(i>0){
vyyerror("Too many arguments (%d) in Sprintf", i);
}
else{
yyval.c = (char*)Malloc((strlen(tmpstring)+1)*sizeof(char));
strcpy(yyval.c, tmpstring);

Christophe Geuzaine
committed
case 386:
{
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-3].c)))
vyyerror("Unknown string option class '%s'", yyvsp[-3].c);
else{
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-1].c, pStrCat)))
vyyerror("Unknown string option '%s.%s'", yyvsp[-3].c, yyvsp[-1].c);
else{
str = pStrOpt(0,GMSH_GET,NULL) ;
yyval.c = (char*)Malloc((strlen(str)+1)*sizeof(char));
strcpy(yyval.c, str);
}
}
;
break;}

Christophe Geuzaine
committed
case 387:
{
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-6].c)))
vyyerror("Unknown string option class '%s'", yyvsp[-6].c);
else{
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-1].c, pStrCat)))
vyyerror("Unknown string option '%s[%d].%s'", yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-1].c);
else{
str = pStrOpt((int)yyvsp[-4].d,GMSH_GET,NULL) ;
yyval.c = (char*)Malloc((strlen(str)+1)*sizeof(char));
strcpy(yyval.c, str);
}
}
}
#line 705 "/usr/share/bison/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
yylsp -= yylen;
#endif
if (yydebug)
{
short *yyssp1 = yyss - 1;
YYFPRINTF (stderr, "state stack now");
while (yyssp1 != yyssp)
YYFPRINTF (stderr, " %d", *++yyssp1);
YYFPRINTF (stderr, "\n");
}
#endif
*++yyvsp = yyval;
#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
yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
YYSIZE_T yysize = 0;
char *yymsg;
int yyx, yycount;
yycount = 0;
/* 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++)
if (yycheck[yyx + yyn] == yyx)
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
yysize += yystrlen ("parse error, unexpected ") + 1;
yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
yymsg = (char *) YYSTACK_ALLOC (yysize);
if (yymsg != 0)
{
char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
{
yycount = 0;
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *));
yyx++)
if (yycheck[yyx + yyn] == yyx)
{
const char *yyq = ! yycount ? ", expecting " : " or ";
yyp = yystpcpy (yyp, yyq);
yyp = yystpcpy (yyp, yytname[yyx]);
yycount++;
}
}
}
else
yyerror ("parse error; also virtual memory exhausted");
}
else
#endif /* defined (YYERROR_VERBOSE) */
yyerror ("parse error");
}
goto yyerrlab1;
/*--------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action |
`--------------------------------------------------*/
yyerrlab1:
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)
YYABORT;
YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
yychar, yytname[yychar1]));
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token after shifting the error
token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
goto yyerrhandle;
/*-------------------------------------------------------------------.
| yyerrdefault -- current state does not do anything special for the |
| error token. |
`-------------------------------------------------------------------*/
yyerrdefault:
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
/* If its default is to accept any token, ok. Otherwise pop it. */
yyn = yydefact[yystate];
if (yyn)
goto yydefault;
#endif
/*---------------------------------------------------------------.
| yyerrpop -- pop the current state because it cannot handle the |
| error token |
`---------------------------------------------------------------*/
yyerrpop:
if (yyssp == yyss)
YYABORT;
yyvsp--;
yystate = *--yyssp;
yylsp--;
#endif
if (yydebug)
{
short *yyssp1 = yyss - 1;
YYFPRINTF (stderr, "Error: state stack now");
while (yyssp1 != yyssp)
YYFPRINTF (stderr, " %d", *++yyssp1);
YYFPRINTF (stderr, "\n");
}
#endif
/*--------------.
| yyerrhandle. |
`--------------*/
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
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;
}
else if (yyn == 0)
goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval;
*++yylsp = yylloc;
#endif
yystate = yyn;
goto yynewstate;
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
/*---------------------------------------------.
| yyoverflowab -- parser overflow comes here. |
`---------------------------------------------*/
yyoverflowlab:
yyerror ("parser stack overflow");
yyresult = 2;
/* Fall through. */
yyreturn:
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
}
void InitSymbols(void){
if(!Symbol_L)
Symbol_L = List_Create(50,10,sizeof(Symbol));
else
List_Reset(Symbol_L);
}
void DeleteSymbols(void){
int i;
for(i = 0 ; i < List_Nbr(Symbol_L) ; i++)
List_Delete(((Symbol*)List_Pointer_Fast(Symbol_L,i))->val);
List_Delete(Symbol_L);
}
int CompareSymbols (const void *a, const void *b){
return(strcmp(((Symbol*)a)->Name,((Symbol*)b)->Name));
}
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
int PrintListOfDouble(char *format, List_T *list, char *buffer){
int i, j, k;
char tmp1[256], tmp2[256];
j=0;
while(format[j]!='%') j++;
strncpy(buffer, format, j);
buffer[j]='\0';
for(i = 0 ; i<List_Nbr(list) ; i++){
k = j;
j++;
if(j<(int)strlen(format)){
if(format[j]=='%'){
strcat(buffer, "%");
j++;
}
while(format[j]!='%' && j<(int)strlen(format)) j++;
if(k != j){
strncpy(tmp1, &(format[k]),j-k);
tmp1[j-k]='\0';
sprintf(tmp2, tmp1, *(double*)List_Pointer(list,i));
strcat(buffer, tmp2);
}
}
else{
return List_Nbr(list)-i;
break ;
}
}
if(j != (int)strlen(format))
return -1;
return 0;
}
void yyerror(char *s){
Msg(PARSER_ERROR, "'%s', line %d : %s (%s)",yyname,yylineno-1,s,yytext);
yyerrorstate=1;
}
va_list args;
va_start (args, fmt);
vsprintf (tmp, fmt, args);
va_end (args);
Msg(PARSER_ERROR, "'%s', line %d : %s", yyname, yylineno-1, tmp);
yyerrorstate=1;
}