Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 148 KiB
Newer Older
#line 985 "Gmsh.y"
case 162:
#line 986 "Gmsh.y"
case 163:
#line 987 "Gmsh.y"
case 164:
#line 992 "Gmsh.y"
{
      yyval.l = List_Create(3,3,sizeof(Shape));
    ;
    break;}
case 165:
#line 996 "Gmsh.y"
{
      List_Add(yyval.l,&yyvsp[0].s);
      yyval.l = yyvsp[-1].l;
    ;
    break;}
case 166:
#line 1008 "Gmsh.y"
{
      yyval.l = List_Create(3,3,sizeof(Shape));
      for(i=0;i<List_Nbr(yyvsp[-1].l);i++){
	List_Read (yyvsp[-1].l,i,&TheShape);
	CopyShape(TheShape.Type,TheShape.Num,&j);
	TheShape.Num = j;
	List_Add(yyval.l,&TheShape);
      }
    ;
    break;}
case 167:
#line 1026 "Gmsh.y"
{
      for(i=0;i<List_Nbr(yyvsp[-1].l);i++){
	List_Read (yyvsp[-1].l,i,&TheShape);
	DeleteShape(TheShape.Type,TheShape.Num);
      }
    ;
    break;}
case 168:
#line 1041 "Gmsh.y"
{
      yyinTab[RecursionLevel++] = yyin;
      strcpy(tmpstring, ThePathForIncludes);
      if((yyin = fopen(strcat(tmpstring,yyvsp[-1].c),"r"))){
	strcpy(yynameTab[RecursionLevel-1],yyname);
	yylinenoTab[RecursionLevel-1]=yylineno;
	yylineno=1;
	strcpy(yyname,yyvsp[-1].c);
	while(!feof(yyin)){
	  yyparse();
	}
	fclose(yyin);
	yyin = yyinTab[--RecursionLevel];
	strcpy(yyname,yynameTab[RecursionLevel]);
	yylineno = yylinenoTab[RecursionLevel];
      }
      else{
	vyyerror("Unknown File '%s'", yyvsp[-1].c) ;  
case 169:
#line 1072 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Curve *pc, *prc;
      Extrude_ProtudePoint(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,&pc,&prc,NULL);
case 170:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1077 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Curve *pc, *prc;
      Extrude_ProtudePoint(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d,
			   &pc,&prc,NULL);
case 171:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1083 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Extrude_ProtudeCurve(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,NULL);
case 172:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1087 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Extrude_ProtudeCurve(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d,NULL);
case 173:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1091 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Extrude_ProtudeSurface(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,0,NULL);
case 174:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1095 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Extrude_ProtudeSurface(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d,0,NULL);
case 175:
#line 1099 "Gmsh.y"
{
    int vol = NEWREG();
    Extrude_ProtudeSurface(1,(int)yyvsp[-7].d,yyvsp[-5].v[0],yyvsp[-5].v[1],yyvsp[-5].v[2],0.,0.,0.,0.,vol,&extr);
  ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 176:
#line 1104 "Gmsh.y"
{
    int vol = NEWREG();
    Extrude_ProtudeSurface(0,(int)yyvsp[-11].d,yyvsp[-9].v[0],yyvsp[-9].v[1],yyvsp[-9].v[2],yyvsp[-7].v[0],yyvsp[-7].v[1],yyvsp[-7].v[2],yyvsp[-5].d,vol,&extr);
  ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 177:
#line 1112 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 178:
#line 1115 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 179:
#line 1121 "Gmsh.y"
{
      double d;
      int j;
      extr.mesh.NbLayer = List_Nbr(yyvsp[-6].l);
      extr.mesh.ExtrudeMesh = true;
      for(int i=0;i<List_Nbr(yyvsp[-6].l);i++){
	List_Read(yyvsp[-6].l,i,&d);
	j = (int)d;
	extr.mesh.NbElmLayer[i] = j;
	List_Read(yyvsp[-4].l,i,&d);
	j = (int)d;
	extr.mesh.ZonLayer[i] = j;
	List_Read(yyvsp[-2].l,i,&d);
	extr.mesh.hLayer[i] = d;
      }
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 180:
#line 1138 "Gmsh.y"
{
      extr.mesh.Recombine = true;
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 181:
#line 1149 "Gmsh.y"
{
      Curve *c;
      for(i=0;i<List_Nbr(yyvsp[-3].l);i++){
	List_Read(yyvsp[-3].l,i,&d);
	j = (int)fabs(d);
        c = FindCurve(j,THEM);
	if(!c)
	  vyyerror("Unkown Curve %d", j);
	else{
	  c->Method = TRANSFINI;
	  c->ipar[0] = (int)yyvsp[-1].d;
	  c->ipar[1] = sign(d);
	  c->dpar[0] = 1.0;
	}
      }
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 182:
#line 1166 "Gmsh.y"
{
      Curve *c;
      for(i=0;i<List_Nbr(yyvsp[-6].l);i++){
	List_Read(yyvsp[-6].l,i,&d);
	j = (int)fabs(d);
        c = FindCurve(j,THEM);
	if(!c)
	  vyyerror("Unkown Curve %d", j);
	else{
	  c->Method = TRANSFINI;
	  c->ipar[0] = (int)yyvsp[-4].d;
	  c->ipar[1] = sign(d); /* Progresion : code 1 ou -1 */
	  c->dpar[0] = fabs(yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 183:
#line 1183 "Gmsh.y"
{
      Curve *c;
      for(i=0;i<List_Nbr(yyvsp[-6].l);i++){
	List_Read(yyvsp[-6].l,i,&d);
	j = (int)fabs(d);
        c = FindCurve(j,THEM);
	if(!c)
	  vyyerror("Unkown Curve %d", j);
	else{
	  c->Method = TRANSFINI;
	  c->ipar[0] = (int)yyvsp[-4].d;
	  c->ipar[1] = 2*sign(d); /* Bump : code 2 ou -2 */
	  c->dpar[0] = fabs(yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 184:
#line 1200 "Gmsh.y"
{
      Surface *s = FindSurface((int)yyvsp[-4].d,THEM);
      if(!s)
	vyyerror("Unkown Surface %d", (int)yyvsp[-4].d);
      else{
	s->Method = TRANSFINI;
	k = List_Nbr(yyvsp[-1].l);
	if(k!=3 && k!=4){
	  vyyerror("Wrong Definition of Transfinite Surface %d: "
		   "%d Points Instead of 3 or 4" , yyvsp[-4].d, k) ;
	}
	else{
	  for(i=0;i<k;i++){
	    List_Read(yyvsp[-1].l,i,&d);
	    j = (int)fabs(d);
	    s->ipar[i] = j;
	  }
	}
      }
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 185:
#line 1221 "Gmsh.y"
{
      Surface *s = FindSurface((int)yyvsp[-4].d,THEM);
      if(!s)
	vyyerror("Unkown Surface %d", (int)yyvsp[-4].d);
      else{
        s->Method = ELLIPTIC;
        k = List_Nbr(yyvsp[-1].l);
        if(k != 4)
	  vyyerror("Wrong Definition of Elliptic Surface %d: "
		   "%d Points Instead of 4" , yyvsp[-4].d, k) ;
        else{
	  for(i=0;i<k;i++){
	    List_Read(yyvsp[-1].l,i,&d);
	    j = (int)fabs(d);
	    s->ipar[i] = j;
	  }
	}
      }
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 186:
#line 1241 "Gmsh.y"
{
      Volume *v = FindVolume((int)yyvsp[-4].d,THEM);
      if(!v)
	vyyerror("Unkown Volume %d", (int)yyvsp[-4].d);
      else{
	v->Method = TRANSFINI;
	k = List_Nbr(yyvsp[-1].l);
	if(k!=6 && k!=8)
	  vyyerror("Wrong Definition of Transfinite Volume %d: "
		   "%d Points Instead of 6 or 8" , yyvsp[-4].d, k) ;
	else{
	  for(i=0;i<k;i++){
	    List_Read(yyvsp[-1].l,i,&d);
	    j = (int)fabs(d);
	    v->ipar[i] = j;
	  }
	}
      }
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 187:
#line 1261 "Gmsh.y"
{
      Surface *s;
      for(i=0;i<List_Nbr(yyvsp[-3].l);i++){
	List_Read(yyvsp[-3].l,i,&d);
	j = (int)d;
	s = FindSurface(j,THEM);
	if(!s){
	  /* Allow generic lists, even if the surfaces don't exist
	     vyyerror("Unkown Surface %d", j); */
	}
	else{
	  s->Recombine = 1;
	  s->RecombineAngle = yyvsp[-1].d;
	}
      }
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 188:
#line 1278 "Gmsh.y"
{
      Surface *s;
      for(i=0;i<List_Nbr(yyvsp[-1].l);i++){
	List_Read(yyvsp[-1].l,i,&d);
	j = (int)d;
        s = FindSurface(j,THEM);
	if(!s){
	  /* Allow generic lists, even if the surfaces don't exist
	     vyyerror("Unkown Surface %d", j); */
	}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 189:
#line 1303 "Gmsh.y"
David Colignon's avatar
David Colignon committed
case 191:
#line 1315 "Gmsh.y"
{
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      i = (int)yyvsp[-12].d ;
David Colignon's avatar
David Colignon committed
      if(i < 0 || i > 5)
	vyyerror("Wrong Clip Plane Number %d", i);
      else{
	CTX.clip[i] = 1;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	CTX.clip_plane[i][0] = yyvsp[-8].d;
	CTX.clip_plane[i][1] = yyvsp[-6].d;
	CTX.clip_plane[i][2] = yyvsp[-4].d;
	CTX.clip_plane[i][3] = yyvsp[-2].d;
David Colignon's avatar
David Colignon committed
      }
    ;
    break;}
case 194:
#line 1336 "Gmsh.y"
David Colignon's avatar
David Colignon committed
case 196:
#line 1339 "Gmsh.y"
David Colignon's avatar
David Colignon committed
case 198:
#line 1342 "Gmsh.y"
David Colignon's avatar
David Colignon committed
case 202:
#line 1353 "Gmsh.y"
{
      i = Get_ColorForString(ColorString, -1, yyvsp[-1].c, &flag);
      if(flag) vyyerror("Unknown Color '%s'", yyvsp[-1].c);
      Get_ColorPointerForString(ColorField, yyvsp[-3].c, &flag, &ptr);
      if(flag)
	vyyerror("Unknown Color Field '%s'", yyvsp[-3].c);
David Colignon's avatar
David Colignon committed
case 203:
#line 1363 "Gmsh.y"
{
      i = Get_ColorForString(ColorString, (int)yyvsp[-2].d, yyvsp[-4].c, &flag);
      if(flag) vyyerror("Unknown Color '%s'", yyvsp[-4].c);
      Get_ColorPointerForString(ColorField, yyvsp[-7].c, &flag, &ptr);
      if(flag)
	vyyerror("Unknown Color Field '%s'", yyvsp[-7].c);
David Colignon's avatar
David Colignon committed
case 204:
#line 1373 "Gmsh.y"
{
      Get_ColorPointerForString(ColorField, yyvsp[-3].c, &flag, &ptr);
      if(flag)
	vyyerror("Unknown Color Field '%s'", yyvsp[-1].v);
      else
	*ptr = PACK_COLOR((int)yyvsp[-1].v[0], (int)yyvsp[-1].v[1], (int)yyvsp[-1].v[2], (int)yyvsp[-1].v[3]);
    ;
    break;}
David Colignon's avatar
David Colignon committed
case 205:
#line 1384 "Gmsh.y"
{
      yyval.v[0]=yyvsp[-7].d;
      yyval.v[1]=yyvsp[-5].d;
      yyval.v[2]=yyvsp[-3].d;
      yyval.v[3]=yyvsp[-1].d;
    ;
    break;}
David Colignon's avatar
David Colignon committed
case 206:
#line 1391 "Gmsh.y"
{
      yyval.v[0]=yyvsp[-5].d;
      yyval.v[1]=yyvsp[-3].d;
      yyval.v[2]=yyvsp[-1].d;
      yyval.v[3]=255.;
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 207:
David Colignon's avatar
David Colignon committed
#line 1467 "Gmsh.y"
{yyval.i = 1;;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 208:
David Colignon's avatar
David Colignon committed
#line 1468 "Gmsh.y"
{yyval.i = 0;;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 209:
David Colignon's avatar
David Colignon committed
#line 1469 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 210:
David Colignon's avatar
David Colignon committed
#line 1470 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 211:
David Colignon's avatar
David Colignon committed
#line 1471 "Gmsh.y"
{yyval.i = -1;;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 212:
David Colignon's avatar
David Colignon committed
#line 1475 "Gmsh.y"
{ yyval.d = yyvsp[0].d; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 213:
David Colignon's avatar
David Colignon committed
#line 1476 "Gmsh.y"
{ yyval.d = yyvsp[-1].d; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 214:
David Colignon's avatar
David Colignon committed
#line 1477 "Gmsh.y"
{ yyval.d = yyvsp[-2].d - yyvsp[0].d; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 215:
David Colignon's avatar
David Colignon committed
#line 1478 "Gmsh.y"
{ yyval.d = yyvsp[-2].d + yyvsp[0].d; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 216:
David Colignon's avatar
David Colignon committed
#line 1479 "Gmsh.y"
{ yyval.d = yyvsp[-2].d * yyvsp[0].d; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 217:
David Colignon's avatar
David Colignon committed
#line 1480 "Gmsh.y"
{ yyval.d = yyvsp[-2].d / yyvsp[0].d; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 218:
David Colignon's avatar
David Colignon committed
#line 1481 "Gmsh.y"
{ yyval.d = pow(yyvsp[-2].d, yyvsp[0].d); ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 219:
David Colignon's avatar
David Colignon committed
#line 1482 "Gmsh.y"
{ yyval.d = - yyvsp[0].d; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 220:
David Colignon's avatar
David Colignon committed
#line 1483 "Gmsh.y"
{ yyval.d = yyvsp[0].d; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 221:
David Colignon's avatar
David Colignon committed
#line 1484 "Gmsh.y"
{ yyval.d = exp(yyvsp[-1].d);      ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 222:
David Colignon's avatar
David Colignon committed
#line 1485 "Gmsh.y"
{ yyval.d = log(yyvsp[-1].d);      ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 223:
David Colignon's avatar
David Colignon committed
#line 1486 "Gmsh.y"
{ yyval.d = log10(yyvsp[-1].d);    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 224:
David Colignon's avatar
David Colignon committed
#line 1487 "Gmsh.y"
{ yyval.d = sqrt(yyvsp[-1].d);     ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 225:
David Colignon's avatar
David Colignon committed
#line 1488 "Gmsh.y"
{ yyval.d = sin(yyvsp[-1].d);      ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 226:
David Colignon's avatar
David Colignon committed
#line 1489 "Gmsh.y"
{ yyval.d = asin(yyvsp[-1].d);     ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 227:
David Colignon's avatar
David Colignon committed
#line 1490 "Gmsh.y"
{ yyval.d = cos(yyvsp[-1].d);      ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 228:
David Colignon's avatar
David Colignon committed
#line 1491 "Gmsh.y"
{ yyval.d = acos(yyvsp[-1].d);     ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 229:
David Colignon's avatar
David Colignon committed
#line 1492 "Gmsh.y"
{ yyval.d = tan(yyvsp[-1].d);      ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 230:
David Colignon's avatar
David Colignon committed
#line 1493 "Gmsh.y"
{ yyval.d = atan(yyvsp[-1].d);     ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 231:
David Colignon's avatar
David Colignon committed
#line 1494 "Gmsh.y"
{ yyval.d = atan2(yyvsp[-3].d,yyvsp[-1].d); ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 232:
David Colignon's avatar
David Colignon committed
#line 1495 "Gmsh.y"
{ yyval.d = sinh(yyvsp[-1].d);     ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 233:
David Colignon's avatar
David Colignon committed
#line 1496 "Gmsh.y"
{ yyval.d = cosh(yyvsp[-1].d);     ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 234:
David Colignon's avatar
David Colignon committed
#line 1497 "Gmsh.y"
{ yyval.d = tanh(yyvsp[-1].d);     ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 235:
David Colignon's avatar
David Colignon committed
#line 1498 "Gmsh.y"
{ yyval.d = fabs(yyvsp[-1].d);     ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 236:
David Colignon's avatar
David Colignon committed
#line 1499 "Gmsh.y"
{ yyval.d = floor(yyvsp[-1].d);    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 237:
David Colignon's avatar
David Colignon committed
#line 1500 "Gmsh.y"
{ yyval.d = ceil(yyvsp[-1].d);     ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 238:
David Colignon's avatar
David Colignon committed
#line 1501 "Gmsh.y"
{ yyval.d = fmod(yyvsp[-3].d,yyvsp[-1].d);  ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 239:
David Colignon's avatar
David Colignon committed
#line 1502 "Gmsh.y"
{ yyval.d = fmod(yyvsp[-3].d,yyvsp[-1].d);  ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 240:
David Colignon's avatar
David Colignon committed
#line 1503 "Gmsh.y"
{ yyval.d = sqrt(yyvsp[-3].d*yyvsp[-3].d+yyvsp[-1].d*yyvsp[-1].d);  ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 241:
David Colignon's avatar
David Colignon committed
#line 1507 "Gmsh.y"
{ yyval.d = yyvsp[0].d; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 242:
David Colignon's avatar
David Colignon committed
#line 1508 "Gmsh.y"
{ yyval.d = 3.141592653589793; ;
    break;}
case 243:
#line 1510 "Gmsh.y"
{
      TheSymbol.Name = yyvsp[0].c ;
      if (!List_Query(Symbol_L, &TheSymbol, CompareSymbols)) {
	vyyerror("Unknown variable '%s'", yyvsp[0].c) ;  yyval.d = 0. ;
      }
      else  yyval.d = TheSymbol.val ;
      Free(yyvsp[0].c);
    ;
    break;}
David Colignon's avatar
David Colignon committed
case 244:
#line 1522 "Gmsh.y"
{ 
      ListOfDouble2_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(ListOfDouble2_L, &d) ;
    ;
    break;}
David Colignon's avatar
David Colignon committed
case 245:
#line 1528 "Gmsh.y"
{
      ListOfDouble2_L = List_Create(2,1,sizeof(double)) ; 
      if(!yyvsp[-2].d || (yyvsp[-5].d<yyvsp[0].d && yyvsp[-2].d<0) || (yyvsp[-5].d>yyvsp[0].d && yyvsp[-2].d>0)){
        vyyerror("Wrong Increment in '%g :[%g] %g'", yyvsp[-5].d, yyvsp[-2].d, yyvsp[0].d) ;
	List_Add(ListOfDouble2_L, &(yyvsp[-5].d)) ;
      }
      else 
	for(d=yyvsp[-5].d ; (yyvsp[-2].d>0)?(d<=yyvsp[0].d):(d>=yyvsp[0].d) ; d+=yyvsp[-2].d)
	  List_Add(ListOfDouble2_L, &d) ;
   ;
    break;}
David Colignon's avatar
David Colignon committed
case 246:
#line 1542 "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;}
David Colignon's avatar
David Colignon committed
case 247:
#line 1550 "Gmsh.y"
{
      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;}
David Colignon's avatar
David Colignon committed
case 248:
#line 1558 "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;}
David Colignon's avatar
David Colignon committed
case 249:
#line 1566 "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;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 250:
David Colignon's avatar
David Colignon committed
#line 1577 "Gmsh.y"
case 251:
David Colignon's avatar
David Colignon committed
#line 1580 "Gmsh.y"
case 252:
David Colignon's avatar
David Colignon committed
#line 1586 "Gmsh.y"
case 253:
David Colignon's avatar
David Colignon committed
#line 1589 "Gmsh.y"
case 254:
David Colignon's avatar
David Colignon committed
#line 1595 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 255:
David Colignon's avatar
David Colignon committed
#line 1598 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 256:
David Colignon's avatar
David Colignon committed
#line 1602 "Gmsh.y"
David Colignon's avatar
David Colignon committed
       yyval.l=ListOfListOfDouble_L;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 257:
David Colignon's avatar
David Colignon committed
#line 1609 "Gmsh.y"
David Colignon's avatar
David Colignon committed
      ListOfListOfDouble_L = List_Create(2,1,sizeof(List_T*)) ;
      List_Add(ListOfListOfDouble_L, &(yyvsp[0].l)) ;
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 258:
David Colignon's avatar
David Colignon committed
#line 1614 "Gmsh.y"
David Colignon's avatar
David Colignon committed
      List_Add(ListOfListOfDouble_L, &(yyvsp[0].l)) ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 259:
David Colignon's avatar
David Colignon committed
#line 1621 "Gmsh.y"
{
    ;
    break;}
case 260:
#line 1624 "Gmsh.y"
{
      ListOfDouble_L = List_Create(2,1,sizeof(double)) ;
      List_Add(ListOfDouble_L, &(yyvsp[0].d)) ;
      yyval.l=ListOfDouble_L;
    ;
    break;}
David Colignon's avatar
David Colignon committed
case 261:
#line 1630 "Gmsh.y"
David Colignon's avatar
David Colignon committed
case 262:
#line 1644 "Gmsh.y"
{
      ListOfDouble_L = List_Create(2,1,sizeof(double)) ;
      List_Add(ListOfDouble_L, &(yyvsp[0].d)) ;
    ;
    break;}
David Colignon's avatar
David Colignon committed
case 263:
#line 1649 "Gmsh.y"
{ 
      ListOfDouble_L = List_Create(2,1,sizeof(double)) ;
      for(i=0 ; i<List_Nbr(ListOfDouble2_L) ; i++){
	List_Read(ListOfDouble2_L, i, &d) ;
	List_Add(ListOfDouble_L, &d) ;
      }
      List_Delete(ListOfDouble2_L);
    ;
    break;}
David Colignon's avatar
David Colignon committed
case 264:
#line 1658 "Gmsh.y"
{
      List_Add(ListOfDouble_L, &(yyvsp[0].d)) ;
    ;
    break;}
David Colignon's avatar
David Colignon committed
case 265:
#line 1662 "Gmsh.y"
{
      for(i=0 ; i<List_Nbr(ListOfDouble2_L) ; i++){
	List_Read(ListOfDouble2_L, i, &d) ;
	List_Add(ListOfDouble_L, &d) ;
      }
      List_Delete(ListOfDouble2_L);
    ;
    break;}
}
   /* the action file gets copied in in place of this dollarsign */
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 543 "/usr/lib/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");
    }
#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
    yystate = yydefgoto[yyn - YYNTBASE];

  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];

      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 */

  goto yyerrhandle;

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;
    }
  else if (yyn == 0)
    goto yyerrpop;

  if (yyn == YYFINAL)
    YYACCEPT;

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting error token, ");
#endif

  *++yyvsp = yylval;
#ifdef YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  yystate = yyn;
  goto yynewstate;
Christophe Geuzaine's avatar
Christophe Geuzaine committed

 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);
#endif
    }
  return 1;
David Colignon's avatar
David Colignon committed
#line 1672 "Gmsh.y"


void InitSymbols(void){
  Symbol_L = List_Create(10,1,sizeof(Symbol));
}

void DeleteSymbols(void){
  List_Delete(Symbol_L);
}

int CompareSymbols (const void *a, const void *b){
  return(strcmp(((Symbol*)a)->Name,((Symbol*)b)->Name));
}
  
void yyerror(char *s){
  Msg(PARSER_ERROR, "'%s', line %d : %s (%s)",yyname,yylineno-1,s,yytext);
  yyerrorstate=1;
}

void  vyyerror (char *fmt, ...){
  va_list args;
  char    tmp[TEXT_BUFFER_SIZE];

  va_start (args, fmt);
  vsprintf (tmp, fmt, args);
  va_end (args);

  Msg(PARSER_ERROR, "'%s', line %d : %s", yyname, yylineno-1, tmp);
  yyerrorstate=1;
}

int Get_ColorForString(StringX4Int SX4I[], int alpha, 
		       char * string, int * FlagError) {
  int  i = 0 ;
  while ((SX4I[i].string != NULL) && (strcmp(SX4I[i].string, string)))  i++ ;
  *FlagError = (SX4I[i].string == NULL)? 1 : 0 ;
  if(alpha > 0)
    return PACK_COLOR(SX4I[i].int1,SX4I[i].int2,SX4I[i].int3,alpha) ;
  else
    return PACK_COLOR(SX4I[i].int1,SX4I[i].int2,SX4I[i].int3,SX4I[i].int4) ;
}

void Get_ColorPointerForString(StringXPointer SXP[], char * string,
			  int * FlagError, unsigned int **Pointer) {
  int  i = 0 ;
  while ((SXP[i].string != NULL) && (strcmp(SXP[i].string, string)))  i++ ;
  *FlagError = (SXP[i].string == NULL)? 1 : 0 ;
  *Pointer = (unsigned int *)SXP[i].Pointer ;
}