Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 246 KiB
Newer Older
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1928 "Gmsh.y"
{
      if(!(pArrCat = Get_ArrayOptionCategory(yyvsp[-5].c)))
	vyyerror("Unknown Array Option Class '%s'", yyvsp[-5].c);
      else{
	if(!(pArrOpt = Get_ArrayOption(yyvsp[-3].c, pArrCat, &i)))
	  vyyerror("Unknown Array Option '%s.%s'", yyvsp[-5].c, yyvsp[-3].c);
	else{
	  switch(i){
	  case GMSH_DOUBLE :
	    for(j=0 ; j<4; j++) ((double*)pArrOpt)[j] -= yyvsp[-1].v[j] ;
	    break ;
	  case GMSH_FLOAT :
	    for(j=0 ; j<4; j++) ((float*)pArrOpt)[j] -= (float)yyvsp[-1].v[j] ;
	    break ;
	  case GMSH_LONG :
	    for(j=0 ; j<4; j++) ((long*)pArrOpt)[j] -= (long)yyvsp[-1].v[j] ;
	    break ;
	  case GMSH_INT :
	    for(j=0 ; j<4; j++) ((int*)pArrOpt)[j] -= (int)yyvsp[-1].v[j] ;
case 231:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1953 "Gmsh.y"
{
      if(strcmp(yyvsp[-10].c, "Post"))
	vyyerror("Unknown View Option Class '%s'", yyvsp[-10].c);
      else{
	if(!(pArrOpt = Get_ArrayViewOption((int)yyvsp[-6].d, yyvsp[-3].c, &i))){
	  if(i < 0) vyyerror("PostProcessing View %d does not Exist", (int)yyvsp[-6].d);
	  else	    vyyerror("Unknown Array Option '%s.View[%d].%s'", 
			     yyvsp[-10].c, (int)yyvsp[-6].d, yyvsp[-3].c);
	}
	else{
	  switch(i){
	  case GMSH_DOUBLE :
	    for(j=0 ; j<3; j++) ((double*)pArrOpt)[j] -= yyvsp[-1].v[j] ;
	    break ;
	  case GMSH_FLOAT :
	    for(j=0 ; j<3; j++) ((float*)pArrOpt)[j] -= (float)yyvsp[-1].v[j] ;
	    break ;
	  case GMSH_LONG :
	    for(j=0 ; j<3; j++) ((long*)pArrOpt)[j] -= (long)yyvsp[-1].v[j] ;
	    break ;
	  case GMSH_INT :
	    for(j=0 ; j<3; j++) ((int*)pArrOpt)[j] -= (int)yyvsp[-1].v[j] ;
	    break ;
	  }
	}
      }
    ;
    break;}
case 232:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1984 "Gmsh.y"
      if(!(pColCat = Get_ColorOptionCategory(yyvsp[-7].c)))
	vyyerror("Unknown Color Option Class '%s'", yyvsp[-7].c);
      else{
	if(!(pColOpt = Get_ColorOption(yyvsp[-3].c, pColCat)))
	  vyyerror("Unknown Color Option '%s.%s'", yyvsp[-7].c, yyvsp[-3].c);
	else{
	  *pColOpt = yyvsp[-1].u ;
	}
      }
case 236:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2023 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{yyval.i = 1;;
case 237:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2024 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{yyval.i = 0;;
case 238:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2025 "Gmsh.y"
case 239:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2026 "Gmsh.y"
case 240:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2027 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{yyval.i = -1;;
case 241:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2031 "Gmsh.y"
{ yyval.d = yyvsp[0].d;           ;
case 242:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2032 "Gmsh.y"
{ yyval.d = yyvsp[-1].d ;          ;
case 243:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2033 "Gmsh.y"
{ yyval.d = -yyvsp[0].d ;         ;
case 244:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2034 "Gmsh.y"
{ yyval.d = yyvsp[0].d;           ;
case 245:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2035 "Gmsh.y"
{ yyval.d = !yyvsp[0].d ;         ;
case 246:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2036 "Gmsh.y"
{ yyval.d = yyvsp[-2].d - yyvsp[0].d ;     ;
case 247:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2037 "Gmsh.y"
{ yyval.d = yyvsp[-2].d + yyvsp[0].d ;     ;
case 248:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2038 "Gmsh.y"
{ yyval.d = yyvsp[-2].d * yyvsp[0].d ;     ;
case 249:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2039 "Gmsh.y"
{ yyval.d = yyvsp[-2].d / yyvsp[0].d ;     ;
case 250:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2040 "Gmsh.y"
{ yyval.d = (int)yyvsp[-2].d % (int)yyvsp[0].d ;  ;
    break;}
case 251:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2041 "Gmsh.y"
{ yyval.d = pow(yyvsp[-2].d,yyvsp[0].d) ;  ;
    break;}
case 252:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2042 "Gmsh.y"
{ yyval.d = yyvsp[-2].d < yyvsp[0].d ;     ;
    break;}
case 253:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2043 "Gmsh.y"
{ yyval.d = yyvsp[-2].d > yyvsp[0].d ;     ;
    break;}
case 254:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2044 "Gmsh.y"
{ yyval.d = yyvsp[-2].d <= yyvsp[0].d ;    ;
    break;}
case 255:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2045 "Gmsh.y"
{ yyval.d = yyvsp[-2].d >= yyvsp[0].d ;    ;
    break;}
case 256:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2046 "Gmsh.y"
{ yyval.d = yyvsp[-2].d == yyvsp[0].d ;    ;
    break;}
case 257:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2047 "Gmsh.y"
{ yyval.d = yyvsp[-2].d != yyvsp[0].d ;    ;
    break;}
case 258:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2048 "Gmsh.y"
{ yyval.d = yyvsp[-2].d && yyvsp[0].d ;    ;
    break;}
case 259:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2049 "Gmsh.y"
{ yyval.d = yyvsp[-2].d || yyvsp[0].d ;    ;
    break;}
case 260:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2050 "Gmsh.y"
{ yyval.d = yyvsp[-4].d? yyvsp[-2].d : yyvsp[0].d ; ;
    break;}
case 261:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2051 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = exp(yyvsp[-1].d);      ;
case 262:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2052 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = log(yyvsp[-1].d);      ;
case 263:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2053 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = log10(yyvsp[-1].d);    ;
case 264:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2054 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = sqrt(yyvsp[-1].d);     ;
case 265:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2055 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = sin(yyvsp[-1].d);      ;
case 266:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2056 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = asin(yyvsp[-1].d);     ;
case 267:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2057 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = cos(yyvsp[-1].d);      ;
case 268:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2058 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = acos(yyvsp[-1].d);     ;
case 269:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2059 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = tan(yyvsp[-1].d);      ;
case 270:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2060 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = atan(yyvsp[-1].d);     ;
case 271:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2061 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = atan2(yyvsp[-3].d,yyvsp[-1].d); ;
case 272:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2062 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = sinh(yyvsp[-1].d);     ;
case 273:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2063 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = cosh(yyvsp[-1].d);     ;
case 274:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2064 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = tanh(yyvsp[-1].d);     ;
case 275:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2065 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = fabs(yyvsp[-1].d);     ;
case 276:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2066 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = floor(yyvsp[-1].d);    ;
case 277:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2067 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = ceil(yyvsp[-1].d);     ;
case 278:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2068 "Gmsh.y"
{ yyval.d = fmod(yyvsp[-3].d,yyvsp[-1].d);  ;
    break;}
case 279:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2069 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = fmod(yyvsp[-3].d,yyvsp[-1].d);  ;
case 280:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2070 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = sqrt(yyvsp[-3].d*yyvsp[-3].d+yyvsp[-1].d*yyvsp[-1].d);  ;
case 281:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2074 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = yyvsp[0].d; ;
case 282:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2075 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{ yyval.d = 3.141592653589793; ;
    break;}
case 283:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2077 "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;}
case 284:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2086 "Gmsh.y"
{
      if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-2].c)))
	vyyerror("Unknown Numeric Option Class '%s'", yyvsp[-2].c);
      else{
	if(!(pNumOpt = Get_NumberOption(yyvsp[0].c, pNumCat, &i)))
	  vyyerror("Unknown Numeric Option '%s.%s'", yyvsp[-2].c, yyvsp[0].c);
	else{
	  switch(i){
	  case GMSH_DOUBLE : yyval.d = *(double*)pNumOpt ; break ;
	  case GMSH_FLOAT : yyval.d = (double)(*(float*)pNumOpt) ; break ;
	  case GMSH_LONG : yyval.d = (double)(*(long*)pNumOpt) ; break ;
	  case GMSH_INT : yyval.d = (double)(*(int*)pNumOpt) ; break ;
	  }
	}
      }
    ;
    break;}
case 285:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2103 "Gmsh.y"
{
      if(strcmp(yyvsp[-7].c, "Post"))
	vyyerror("Unknown View Option Class '%s'", yyvsp[-7].c);
      else{
	if(!(pNumOpt = Get_NumberViewOption((int)yyvsp[-3].d, yyvsp[0].c, &i))){
	  if(i < 0) vyyerror("PostProcessing View %d does not Exist", (int)yyvsp[-3].d);
	  else	    vyyerror("Unknown Numeric Option '%s.View[%d].%s'", 
			     yyvsp[-7].c, (int)yyvsp[-3].d, yyvsp[0].c);
	}
	else{
	  switch(i){
	  case GMSH_DOUBLE : yyval.d = *(double*)pNumOpt ; break ;
	  case GMSH_FLOAT : yyval.d = (double)(*(float*)pNumOpt) ; break ;
	  case GMSH_LONG : yyval.d = (double)(*(long*)pNumOpt) ; break ;
	  case GMSH_INT : yyval.d = (double)(*(int*)pNumOpt) ; break ;
	  }
	}
      }
    ;
    break;}
case 286:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2124 "Gmsh.y"
{
      if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-3].c)))
	vyyerror("Unknown Numeric Option Class '%s'", yyvsp[-3].c);
      else{
	if(!(pNumOpt = Get_NumberOption(yyvsp[-1].c, pNumCat, &i)))
	  vyyerror("Unknown Numeric Option '%s.%s'", yyvsp[-3].c, yyvsp[-1].c);
	else{
	  switch(i){
	  case GMSH_DOUBLE : yyval.d = (*(double*)pNumOpt += 1.) ; break ;
	  case GMSH_FLOAT : yyval.d = (double)(*(float*)pNumOpt += 1.) ; break ;
	  case GMSH_LONG : yyval.d = (double)(*(long*)pNumOpt += 1) ; break ;
	  case GMSH_INT : yyval.d = (double)(*(int*)pNumOpt += 1) ; break ;
	  }
	}
      }
    ;
    break;}
case 287:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2141 "Gmsh.y"
{
      if(strcmp(yyvsp[-8].c, "Post"))
	vyyerror("Unknown View Option Class '%s'", yyvsp[-8].c);
      else{
	if(!(pNumOpt = Get_NumberViewOption((int)yyvsp[-4].d, yyvsp[-1].c, &i))){
	  if(i < 0) vyyerror("PostProcessing View %d does not Exist", (int)yyvsp[-4].d);
	  else	    vyyerror("Unknown Numeric Option '%s.View[%d].%s'", 
			     yyvsp[-8].c, (int)yyvsp[-4].d, yyvsp[-1].c);
	}
	else{
	  switch(i){
	  case GMSH_DOUBLE : yyval.d = (*(double*)pNumOpt += 1.) ; break ;
	  case GMSH_FLOAT : yyval.d = (double)(*(float*)pNumOpt += 1.) ; break ;
	  case GMSH_LONG : yyval.d = (double)(*(long*)pNumOpt += 1) ; break ;
	  case GMSH_INT : yyval.d = (double)(*(int*)pNumOpt += 1) ; break ;
	  }
	}
      }
    ;
    break;}
case 288:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2162 "Gmsh.y"
{
      if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-3].c)))
	vyyerror("Unknown Numeric Option Class '%s'", yyvsp[-3].c);
      else{
	if(!(pNumOpt = Get_NumberOption(yyvsp[-1].c, pNumCat, &i)))
	  vyyerror("Unknown Numeric Option '%s.%s'", yyvsp[-3].c, yyvsp[-1].c);
	else{
	  switch(i){
	  case GMSH_DOUBLE : yyval.d = (*(double*)pNumOpt -= 1.) ; break ;
	  case GMSH_FLOAT : yyval.d = (double)(*(float*)pNumOpt -= 1.) ; break ;
	  case GMSH_LONG : yyval.d = (double)(*(long*)pNumOpt -= 1) ; break ;
	  case GMSH_INT : yyval.d = (double)(*(int*)pNumOpt -= 1) ; break ;
	  }
	}
      }
    ;
    break;}
case 289:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2179 "Gmsh.y"
{
      if(strcmp(yyvsp[-8].c, "Post"))
	vyyerror("Unknown View Option Class '%s'", yyvsp[-8].c);
      else{
	if(!(pNumOpt = Get_NumberViewOption((int)yyvsp[-4].d, yyvsp[-1].c, &i))){
	  if(i < 0) vyyerror("PostProcessing View %d does not Exist", (int)yyvsp[-4].d);
	  else	    vyyerror("Unknown Numeric Option '%s.View[%d].%s'", 
			     yyvsp[-8].c, (int)yyvsp[-4].d, yyvsp[-1].c);
	}
	else{
	  switch(i){
	  case GMSH_DOUBLE : yyval.d = (*(double*)pNumOpt -= 1.) ; break ;
	  case GMSH_FLOAT : yyval.d = (double)(*(float*)pNumOpt -= 1.) ; break ;
	  case GMSH_LONG : yyval.d = (double)(*(long*)pNumOpt -= 1) ; break ;
	  case GMSH_INT : yyval.d = (double)(*(int*)pNumOpt -= 1) ; break ;
	  }
	}
      }
    ;
    break;}
case 290:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2202 "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;}
case 291:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2208 "Gmsh.y"
{
      ListOfDouble2_L = List_Create(2,1,sizeof(double)) ; 
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      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(ListOfDouble2_L, &(yyvsp[-4].d)) ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	for(d=yyvsp[-4].d ; (yyvsp[0].d>0)?(d<=yyvsp[-2].d):(d>=yyvsp[-2].d) ; d+=yyvsp[0].d)
case 292:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2222 "Gmsh.y"
      yyval.v = yyvsp[0].v;
case 293:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2226 "Gmsh.y"
      for(i=0 ; i<6 ; i++) yyval.v[i] = -yyvsp[0].v[i] ;
case 294:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2230 "Gmsh.y"
{ 
      yyval.v = yyvsp[0].v;
    ;
    break;}
case 295:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2234 "Gmsh.y"
{ 
      for(i=0 ; i<6 ; i++) yyval.v[i] = yyvsp[-2].v[i] - yyvsp[0].v[i] ;
    ;
    break;}
case 296:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2238 "Gmsh.y"
      for(i=0 ; i<6 ; i++) yyval.v[i] = yyvsp[-2].v[i] + yyvsp[0].v[i] ;
case 297:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2244 "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 298:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2248 "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;}
case 299:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2252 "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;
case 300:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2256 "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;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    ;
    break;}
case 301:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2260 "Gmsh.y"
      if(!(pArrCat = Get_ArrayOptionCategory(yyvsp[-2].c)))
	vyyerror("Unknown Array Option Class '%s'", yyvsp[-2].c);
      else{
	if(!(pArrOpt = Get_ArrayOption(yyvsp[0].c, pArrCat, &i)))
	  vyyerror("Unknown Array Option '%s.%s'", yyvsp[-2].c, yyvsp[0].c);
	else{
	  switch(i){
	  case GMSH_DOUBLE :
	    for(j=0 ; j<4 ; j++) yyval.v[j] = ((double*)pArrOpt)[j] ; 
	    break ;
	  case GMSH_FLOAT :
	    for(j=0 ; j<4 ; j++) yyval.v[j] = (double)((float*)pArrOpt)[j] ;
	    break ;
	  case GMSH_LONG : 
	    for(j=0 ; j<4 ; j++) yyval.v[j] = (double)((int*)pArrOpt)[j] ; 
	    break ;
	  case GMSH_INT :
	    for(j=0 ; j<4 ; j++) yyval.v[j] = (double)((int*)pArrOpt)[j] ; 
	    break ;
	  }
	  yyval.v[4] = 1. ;
	}
      }
case 302:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2286 "Gmsh.y"
      if(strcmp(yyvsp[-7].c, "Post"))
	vyyerror("Unknown View Option Class '%s'", yyvsp[-7].c);
      else{
	if(!(pArrOpt = Get_ArrayViewOption((int)yyvsp[-3].d, yyvsp[0].c, &i))){
	  if(i < 0) vyyerror("PostProcessing View %d does not Exist", (int)yyvsp[-3].d);
	  else	    vyyerror("Unknown Array Option '%s.View[%d].%s'", 
			     yyvsp[-7].c, (int)yyvsp[-3].d, yyvsp[0].c);
	}
	else{
	  switch(i){
	  case GMSH_DOUBLE :
	    for(j=0 ; j<3 ; j++) yyval.v[j] = ((double*)pArrOpt)[j] ; 
	    break ;
	  case GMSH_FLOAT :
	    for(j=0 ; j<3 ; j++) yyval.v[j] = (double)((float*)pArrOpt)[j] ;
	    break ;
	  case GMSH_LONG : 
	    for(j=0 ; j<3 ; j++) yyval.v[j] = (double)((int*)pArrOpt)[j] ; 
	    break ;
	  case GMSH_INT :
	    for(j=0 ; j<3 ; j++) yyval.v[j] = (double)((int*)pArrOpt)[j] ; 
	    break ;
	  }
	  yyval.v[3] = 0. ;
	  yyval.v[4] = 1. ;
	}
      }
case 303:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2319 "Gmsh.y"
case 304:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2322 "Gmsh.y"
case 305:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2328 "Gmsh.y"
case 306:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2331 "Gmsh.y"
case 307:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2337 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2340 "Gmsh.y"
case 309:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2344 "Gmsh.y"
David Colignon's avatar
David Colignon committed
       yyval.l=ListOfListOfDouble_L;
case 310:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2351 "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;}
case 311:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2356 "Gmsh.y"
David Colignon's avatar
David Colignon committed
      List_Add(ListOfListOfDouble_L, &(yyvsp[0].l)) ;
case 312:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2363 "Gmsh.y"
David Colignon's avatar
David Colignon committed
{
    ;
    break;}
case 313:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2366 "Gmsh.y"
{
      ListOfDouble_L = List_Create(2,1,sizeof(double)) ;
      List_Add(ListOfDouble_L, &(yyvsp[0].d)) ;
      yyval.l=ListOfDouble_L;
    ;
    break;}
case 314:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2372 "Gmsh.y"
case 315:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2380 "Gmsh.y"
{
      ListOfDouble_L = List_Create(2,1,sizeof(double)) ;
      List_Add(ListOfDouble_L, &(yyvsp[0].d)) ;
    ;
    break;}
case 316:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2385 "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;}
case 317:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2394 "Gmsh.y"
{
      List_Add(ListOfDouble_L, &(yyvsp[0].d)) ;
    ;
    break;}
case 318:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2398 "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;}
case 319:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2409 "Gmsh.y"
{
      yyval.u = PACK_COLOR((int)yyvsp[-7].d, (int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d);
    ;
    break;}
case 320:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2413 "Gmsh.y"
{
      yyval.u = PACK_COLOR((int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d, 255);
    ;
    break;}
case 321:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2417 "Gmsh.y"
{
      yyval.u = Get_ColorForString(ColorString, (int)yyvsp[-1].d, yyvsp[-3].c, &flag);
      if(flag) vyyerror("Unknown Color '%s'", yyvsp[-3].c);
    ;
    break;}
case 322:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2422 "Gmsh.y"
{
      yyval.u = Get_ColorForString(ColorString, -1, yyvsp[0].c, &flag);
      if(flag) vyyerror("Unknown Color '%s'", yyvsp[0].c);
    ;
    break;}
case 323:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2427 "Gmsh.y"
{
      if(!(pColCat = Get_ColorOptionCategory(yyvsp[-4].c)))
	vyyerror("Unknown Color Option Class '%s'", yyvsp[-4].c);
      else{
	if(!(pColOpt = Get_ColorOption(yyvsp[0].c, pColCat)))
	  vyyerror("Unknown Color Option '%s.%s'", yyvsp[-4].c, yyvsp[0].c);
	else{
	  yyval.u = *pColOpt ;
	}
      }
    ;
    break;}
}
   /* the action file gets copied in in place of this dollarsign */
#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;

 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;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2440 "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;
}

Christophe Geuzaine's avatar
Christophe Geuzaine committed
void vyyerror(char *fmt, ...){
Christophe Geuzaine's avatar
Christophe Geuzaine committed
  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;
}