Newer
Older
{ yyval.d = sqrt(yyvsp[-3].d*yyvsp[-3].d+yyvsp[-1].d*yyvsp[-1].d); ;
break;}
case 267:
{ yyval.d = yyvsp[-1].d*(double)rand()/(double)RAND_MAX; ;
break;}
case 268:
{ yyval.d = exp(yyvsp[-1].d); ;
break;}
case 269:
{ yyval.d = log(yyvsp[-1].d); ;
break;}
case 270:
{ yyval.d = log10(yyvsp[-1].d); ;
break;}
case 271:
#line 2910 "Gmsh.y"
{ yyval.d = sqrt(yyvsp[-1].d); ;
break;}
case 272:
#line 2911 "Gmsh.y"
{ yyval.d = sin(yyvsp[-1].d); ;
break;}
case 273:
#line 2912 "Gmsh.y"
{ yyval.d = asin(yyvsp[-1].d); ;
break;}
case 274:
#line 2913 "Gmsh.y"
{ yyval.d = cos(yyvsp[-1].d); ;
break;}
case 275:
#line 2914 "Gmsh.y"
{ yyval.d = acos(yyvsp[-1].d); ;
break;}
case 276:
#line 2915 "Gmsh.y"
{ yyval.d = tan(yyvsp[-1].d); ;
break;}
case 277:
#line 2916 "Gmsh.y"
{ yyval.d = atan(yyvsp[-1].d); ;
break;}
case 278:
#line 2917 "Gmsh.y"
{ yyval.d = atan2(yyvsp[-3].d, yyvsp[-1].d);;
break;}
case 279:
{ yyval.d = sinh(yyvsp[-1].d); ;
break;}
case 280:
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
{ yyval.d = cosh(yyvsp[-1].d); ;
break;}
case 281:
#line 2920 "Gmsh.y"
{ yyval.d = tanh(yyvsp[-1].d); ;
break;}
case 282:
#line 2921 "Gmsh.y"
{ yyval.d = fabs(yyvsp[-1].d); ;
break;}
case 283:
#line 2922 "Gmsh.y"
{ yyval.d = floor(yyvsp[-1].d); ;
break;}
case 284:
#line 2923 "Gmsh.y"
{ yyval.d = ceil(yyvsp[-1].d); ;
break;}
case 285:
#line 2924 "Gmsh.y"
{ yyval.d = fmod(yyvsp[-3].d, yyvsp[-1].d); ;
break;}
case 286:
#line 2925 "Gmsh.y"
{ yyval.d = fmod(yyvsp[-3].d, yyvsp[-1].d); ;
break;}
case 287:
#line 2926 "Gmsh.y"
{ yyval.d = sqrt(yyvsp[-3].d*yyvsp[-3].d+yyvsp[-1].d*yyvsp[-1].d); ;
break;}
case 288:
#line 2927 "Gmsh.y"
{ yyval.d = yyvsp[-1].d*(double)rand()/(double)RAND_MAX; ;
break;}
case 289:
#line 2936 "Gmsh.y"
{ yyval.d = yyvsp[0].d; ;
break;}
case 290:
#line 2937 "Gmsh.y"
{ yyval.d = 3.141592653589793; ;
break;}
case 291:
#line 2938 "Gmsh.y"
{ yyval.d = ParUtil::Instance()->rank(); ;
break;}
case 292:
#line 2939 "Gmsh.y"
{ yyval.d = ParUtil::Instance()->size(); ;
break;}
case 293:
#line 2940 "Gmsh.y"
{ yyval.d = Get_GmshMajorVersion(); ;
break;}
case 294:
#line 2941 "Gmsh.y"
{ yyval.d = Get_GmshMinorVersion(); ;
break;}
case 295:
#line 2942 "Gmsh.y"
{ yyval.d = Get_GmshPatchVersion(); ;
break;}
case 296:
#line 2947 "Gmsh.y"
{
yymsg(GERROR, "Unknown variable '%s'", yyvsp[0].c);
yyval.d = 0.;

Christophe Geuzaine
committed
else
yyval.d = *(double*)List_Pointer_Fast(pSymbol->val, 0);
Free(yyvsp[0].c);
;
break;}
case 297:
#line 2963 "Gmsh.y"
{
sprintf(tmpstring, "%s_%d", yyvsp[-4].c, (int)yyvsp[-1].d) ;
Symbol TheSymbol;
TheSymbol.Name = tmpstring;
Symbol *pSymbol;
if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
yymsg(GERROR, "Unknown variable '%s'", tmpstring);
yyval.d = *(double*)List_Pointer_Fast(pSymbol->val, 0);
Free(yyvsp[-4].c);
;
break;}
case 298:
#line 2978 "Gmsh.y"
{
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-3].c);
yyval.d = 0.;
if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-1].d)))
yyval.d = *pd;
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-3].c, (int)yyvsp[-1].d);
yyval.d = 0.;
Free(yyvsp[-3].c);
;
break;}
case 299:
#line 2998 "Gmsh.y"
{
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-2].c);
yyval.d = 0.;
Free(yyvsp[-2].c);
;
break;}
case 300:
#line 3012 "Gmsh.y"
{
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-1].c);
yyval.d = 0.;

Christophe Geuzaine
committed
else
yyval.d = (*(double*)List_Pointer_Fast(pSymbol->val, 0) += yyvsp[0].i);
Free(yyvsp[-1].c);
;
break;}
case 301:
#line 3025 "Gmsh.y"
{
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-4].c);
yyval.d = 0.;
if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-2].d)))
yyval.d = (*pd += yyvsp[0].i);
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-4].c, (int)yyvsp[-2].d);
yyval.d = 0.;
Free(yyvsp[-4].c);
;
break;}
case 302:
#line 3048 "Gmsh.y"
{
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-2].c))){
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-2].c);
yyval.d = 0.;
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[0].c, pNumCat))){
yymsg(GERROR, "Unknown numeric option '%s.%s'", yyvsp[-2].c, yyvsp[0].c);
yyval.d = 0.;

Christophe Geuzaine
committed
else
Free(yyvsp[-2].c); Free(yyvsp[0].c);
;
break;}
case 303:
#line 3066 "Gmsh.y"
{
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-5].c))){
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-5].c);
yyval.d = 0.;
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[0].c, pNumCat))){
yymsg(GERROR, "Unknown numeric option '%s[%d].%s'", yyvsp[-5].c, (int)yyvsp[-3].d, yyvsp[0].c);
yyval.d = 0.;

Christophe Geuzaine
committed
else
yyval.d = pNumOpt((int)yyvsp[-3].d, GMSH_GET, 0);
Free(yyvsp[-5].c); Free(yyvsp[0].c);
;
break;}
case 304:
#line 3084 "Gmsh.y"
{
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-3].c))){
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-3].c);
yyval.d = 0.;
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-1].c, pNumCat))){
yymsg(GERROR, "Unknown numeric option '%s.%s'", yyvsp[-3].c, yyvsp[-1].c);
yyval.d = 0.;

Christophe Geuzaine
committed
else
yyval.d = pNumOpt(0, GMSH_SET|GMSH_GUI, pNumOpt(0, GMSH_GET, 0)+yyvsp[0].i);
Free(yyvsp[-3].c); Free(yyvsp[-1].c);
;
break;}
case 305:
#line 3102 "Gmsh.y"
{
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-6].c))){
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-6].c);
yyval.d = 0.;
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-1].c, pNumCat))){
yymsg(GERROR, "Unknown numeric option '%s[%d].%s'", yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-1].c);
yyval.d = 0.;

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);
Free(yyvsp[-6].c); Free(yyvsp[-1].c);
;
break;}
case 306:
#line 3120 "Gmsh.y"
{
yyval.d = GetValue(yyvsp[-3].c, yyvsp[-1].d);
Free(yyvsp[-3].c);
;
break;}
case 307:
#line 3128 "Gmsh.y"
{
memcpy(yyval.v, yyvsp[0].v, 5*sizeof(double));
;
break;}
case 308:
#line 3132 "Gmsh.y"
{
for(int i = 0; i < 5; i++) yyval.v[i] = -yyvsp[0].v[i];
;
break;}
case 309:
#line 3136 "Gmsh.y"
{
for(int i = 0; i < 5; i++) yyval.v[i] = yyvsp[0].v[i];
;
break;}
case 310:
#line 3140 "Gmsh.y"
{
for(int i = 0; i < 5; i++) yyval.v[i] = yyvsp[-2].v[i] - yyvsp[0].v[i];
;
break;}
case 311:
#line 3144 "Gmsh.y"
{
for(int i = 0; i < 5; i++) yyval.v[i] = yyvsp[-2].v[i] + yyvsp[0].v[i];
;
break;}
case 312:
#line 3151 "Gmsh.y"
{
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;}
case 313:
#line 3155 "Gmsh.y"
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
{
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;
;
break;}
case 314:
#line 3159 "Gmsh.y"
{
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;}
case 315:
#line 3163 "Gmsh.y"
{
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;}
case 316:
#line 3170 "Gmsh.y"
{
yyval.l = List_Create(2, 1, sizeof(List_T*));
List_Add(yyval.l, &(yyvsp[0].l));
;
break;}
case 317:
#line 3175 "Gmsh.y"
{
List_Add(yyval.l, &(yyvsp[0].l));
;
break;}
case 318:
#line 3183 "Gmsh.y"
{
yyval.l = List_Create(2, 1, sizeof(double));
List_Add(yyval.l, &(yyvsp[0].d));
;
break;}
case 319:
#line 3188 "Gmsh.y"
{
yyval.l = yyvsp[0].l;
;
break;}
case 320:
#line 3192 "Gmsh.y"
{
yyval.l = List_Create(2, 1, sizeof(double));
;
break;}
case 321:
#line 3197 "Gmsh.y"
{
yyval.l = yyvsp[-1].l;
;
break;}
case 322:
#line 3201 "Gmsh.y"
{
yyval.l = yyvsp[-1].l;
for(int i = 0; i < List_Nbr(yyval.l); i++){
double *pd = (double*)List_Pointer(yyval.l, i);
;
break;}
case 323:
#line 3209 "Gmsh.y"
{
yyval.l = yyvsp[-1].l;
for(int i = 0; i < List_Nbr(yyval.l); i++){
double *pd = (double*)List_Pointer(yyval.l, i);
(*pd) *= yyvsp[-4].d;
}
;
break;}
case 324:
#line 3220 "Gmsh.y"
{
yyval.l = yyvsp[0].l;
for(int i = 0; i < List_Nbr(yyval.l); i++){
double *pd = (double*)List_Pointer(yyval.l, i);
(*pd) = - (*pd);
#line 3228 "Gmsh.y"
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
{
yyval.l = yyvsp[0].l;
for(int i = 0; i < List_Nbr(yyval.l); i++){
double *pd = (double*)List_Pointer(yyval.l, i);
(*pd) *= yyvsp[-2].d;
}
;
break;}
case 326:
#line 3236 "Gmsh.y"
{
yyval.l = List_Create(2, 1, sizeof(double));
for(double 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;}
case 327:
#line 3242 "Gmsh.y"
{
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)){
yymsg(GERROR, "Wrong increment in '%g:%g:%g'", yyvsp[-4].d, yyvsp[-2].d, yyvsp[0].d);
List_Add(yyval.l, &(yyvsp[-4].d));
for(double 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;}
case 328:
#line 3253 "Gmsh.y"
{
// Returns the coordinates of a point and fills a list with it.
// This allows to ensure e.g. that relative point positions are
// always conserved
Vertex *v = FindPoint((int)yyvsp[-1].d);
yyval.l = List_Create(3, 1, sizeof(double));
yymsg(GERROR, "Unknown point '%d'", (int) yyvsp[-1].d);
List_Add(yyval.l, &d);
List_Add(yyval.l, &d);
List_Add(yyval.l, &d);
List_Add(yyval.l, &v->Pos.X);
List_Add(yyval.l, &v->Pos.Y);
List_Add(yyval.l, &v->Pos.Z);
}
;
break;}
case 329:
#line 3273 "Gmsh.y"
{
yyval.l = List_Create(List_Nbr(yyvsp[0].l), 1, sizeof(double));
for(int i = 0; i < List_Nbr(yyvsp[0].l); i++){
Shape *s = (Shape*) List_Pointer(yyvsp[0].l, i);
List_Delete(yyvsp[0].l);
;
break;}
case 330:
#line 3283 "Gmsh.y"
{
yyval.l = List_Create(List_Nbr(yyvsp[0].l), 1, sizeof(double));
for(int i = 0; i < List_Nbr(yyvsp[0].l); i++){
Shape *s = (Shape*) List_Pointer(yyvsp[0].l, i);
List_Delete(yyvsp[0].l);
;
break;}
case 331:
#line 3293 "Gmsh.y"
{
yyval.l = List_Create(List_Nbr(yyvsp[0].l), 1, sizeof(double));
for(int i = 0; i < List_Nbr(yyvsp[0].l); i++){
Shape *s = (Shape*) List_Pointer(yyvsp[0].l, i);
double d = s->Num;
List_Delete(yyvsp[0].l);
;
break;}
case 332:
#line 3303 "Gmsh.y"
{
yyval.l = List_Create(2, 1, sizeof(double));
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-2].c);
List_Add(yyval.l, (double*)List_Pointer_Fast(pSymbol->val, i));
Free(yyvsp[-2].c);
;
break;}
case 333:
#line 3320 "Gmsh.y"
{
yyval.l = List_Create(2, 1, sizeof(double));
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-5].c);
for(int i = 0; i < List_Nbr(yyvsp[-2].l); i++){
int j = (int)(*(double*)List_Pointer_Fast(yyvsp[-2].l, i));
if((pd = (double*)List_Pointer_Test(pSymbol->val, j)))
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-5].c, j);
Free(yyvsp[-5].c);
List_Delete(yyvsp[-2].l);
;
break;}
case 334:
#line 3347 "Gmsh.y"
{
yyval.l = List_Create(2, 1, sizeof(double));
List_Add(yyval.l, &(yyvsp[0].d));
;
break;}
case 335:
#line 3352 "Gmsh.y"
{
yyval.l = yyvsp[0].l;
;
break;}
case 336:
#line 3356 "Gmsh.y"
{
List_Add(yyval.l, &(yyvsp[0].d));
;
break;}
case 337:
#line 3360 "Gmsh.y"
{
for(int i = 0; i < List_Nbr(yyvsp[0].l); i++){
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
List_Read(yyvsp[0].l, i, &d);
List_Add(yyval.l, &d);
}
List_Delete(yyvsp[0].l);
;
break;}
case 338:
#line 3373 "Gmsh.y"
{
yyval.u = CTX.PACK_COLOR((int)yyvsp[-7].d, (int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d);
;
break;}
case 339:
#line 3377 "Gmsh.y"
{
yyval.u = CTX.PACK_COLOR((int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d, 255);
;
break;}
case 340:
#line 3389 "Gmsh.y"
{
yyval.u = Get_ColorForString(ColorString, -1, yyvsp[0].c, &flag);
if(flag) yymsg(GERROR, "Unknown color '%s'", yyvsp[0].c);
Free(yyvsp[0].c);
;
break;}
case 341:
#line 3396 "Gmsh.y"
{
unsigned int (*pColOpt)(int num, int action, unsigned int value);
StringXColor *pColCat;
if(!(pColCat = Get_ColorOptionCategory(yyvsp[-4].c))){
yymsg(GERROR, "Unknown color option class '%s'", yyvsp[-4].c);
yyval.u = 0;
if(!(pColOpt = (unsigned int (*) (int, int, unsigned int))Get_ColorOption(yyvsp[0].c, pColCat))){
yymsg(GERROR, "Unknown color option '%s.Color.%s'", yyvsp[-4].c, yyvsp[0].c);
yyval.u = 0;
Free(yyvsp[-4].c); Free(yyvsp[0].c);
;
break;}
case 342:
#line 3418 "Gmsh.y"
{
yyval.l = yyvsp[-1].l;
;
break;}
case 343:
#line 3422 "Gmsh.y"
{
yyval.l = List_Create(256, 10, sizeof(unsigned int));
GmshColorTable *ct = Get_ColorTable((int)yyvsp[-3].d);

Christophe Geuzaine
committed
if(!ct)
yymsg(GERROR, "View[%d] does not exist", (int)yyvsp[-3].d);
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
Free(yyvsp[-5].c);
;
break;}
case 344:
#line 3437 "Gmsh.y"
{
yyval.l = List_Create(256, 10, sizeof(unsigned int));
List_Add(yyval.l, &(yyvsp[0].u));
;
break;}
case 345:
#line 3442 "Gmsh.y"
{
List_Add(yyval.l, &(yyvsp[0].u));
;
break;}
case 346:
#line 3449 "Gmsh.y"
{
yyval.c = yyvsp[0].c;
;
break;}
case 347:
#line 3453 "Gmsh.y"
{
;
break;}
case 348:
#line 3460 "Gmsh.y"
{
yyval.c = yyvsp[0].c;
;
break;}
case 349:
#line 3464 "Gmsh.y"
{
yyval.c = (char *)Malloc(32*sizeof(char));
strcpy(yyval.c, ctime(&now));
yyval.c[strlen(yyval.c) - 1] = '\0';
;
break;}
case 350:
#line 3472 "Gmsh.y"
{
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;}
case 351:
#line 3480 "Gmsh.y"
{
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';
if(i <= 0) strcpy(yyval.c, yyvsp[-1].c);
Free(yyvsp[-1].c);
;
break;}
case 352:
#line 3494 "Gmsh.y"
{
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] == '/' || yyvsp[-1].c[i] == '\\')
strcpy(yyval.c, &yyvsp[-1].c[i+1]);
Free(yyvsp[-1].c);
;
break;}
case 353:
#line 3508 "Gmsh.y"
{
yyval.c = yyvsp[-1].c;
;
break;}
case 354:
#line 3512 "Gmsh.y"
{
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":"");
yyval.c = (char*)Malloc((strlen(tmpstring)+1)*sizeof(char));
strcpy(yyval.c, tmpstring);
Free(yyvsp[-3].c);
}
List_Delete(yyvsp[-1].l);
;
break;}
case 355:
#line 3531 "Gmsh.y"
{
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-3].c))){
yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-3].c);
yyval.c = (char*)Malloc(sizeof(char));
yyval.c[0] = '\0';
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-1].c, pStrCat))){
yymsg(GERROR, "Unknown string option '%s.%s'", yyvsp[-3].c, yyvsp[-1].c);
yyval.c = (char*)Malloc(sizeof(char));
yyval.c[0] = '\0';
yyval.c = (char*)Malloc((strlen(str)+1)*sizeof(char));
strcpy(yyval.c, str);
;
break;}
case 356:
#line 3553 "Gmsh.y"
{
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-6].c))){
yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-6].c);
yyval.c = (char*)Malloc(sizeof(char));
yyval.c[0] = '\0';
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-1].c, pStrCat))){
yymsg(GERROR, "Unknown string option '%s[%d].%s'", yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-1].c);
yyval.c = (char*)Malloc(sizeof(char));
yyval.c[0] = '\0';
char *str = pStrOpt((int)yyvsp[-4].d, GMSH_GET, NULL);
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;
#ifdef YYLSP_NEEDED
yylsp -= yylen;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
*++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;
yyerrlab: /* here on detecting error */
if (! yyerrstatus)
/* If not already recovering from an error, report this error. */
{
++yynerrs;
#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
if (yyn > YYFLAG && yyn < YYLAST)
{
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)
{
strcpy(msg, "parse error");
if (count < 5)
{
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++;
}
}
yyerror(msg);
free(msg);
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
yyerror("parse error");
}
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. */
/* return failure if at end of input */
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. */
yyerrstatus = 3; /* Each real token shifted decrements this */
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
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;