Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 307 KiB
Newer Older
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;}
    break;

#line 2868 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2869 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = sqrt((yyvsp[(3) - (6)].d)*(yyvsp[(3) - (6)].d)+(yyvsp[(5) - (6)].d)*(yyvsp[(5) - (6)].d)); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2870 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (yyvsp[(3) - (4)].d)*(double)rand()/(double)RAND_MAX; ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2872 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = exp((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2873 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = log((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2874 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = log10((yyvsp[(3) - (4)].d));    ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2875 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = sqrt((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2876 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = sin((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2877 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = asin((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2878 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = cos((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2879 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = acos((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2880 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = tan((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2881 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = atan((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2882 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2883 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = sinh((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2884 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = cosh((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2885 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = tanh((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2886 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = fabs((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2887 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = floor((yyvsp[(3) - (4)].d));    ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2888 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = ceil((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2889 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;}
    break;

#line 2890 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2891 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = sqrt((yyvsp[(3) - (6)].d)*(yyvsp[(3) - (6)].d)+(yyvsp[(5) - (6)].d)*(yyvsp[(5) - (6)].d)); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2892 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (yyvsp[(3) - (4)].d)*(double)rand()/(double)RAND_MAX; ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2901 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (yyvsp[(1) - (1)].d); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2902 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = 3.141592653589793; ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2903 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2904 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2905 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = Get_GmshMajorVersion(); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2906 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = Get_GmshMinorVersion(); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

#line 2907 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = Get_GmshPatchVersion(); ;}
    break;

#line 2912 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = (yyvsp[(1) - (1)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (1)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = *(double*)List_Pointer_Fast(pSymbol->val, 0);
      Free((yyvsp[(1) - (1)].c));
    ;}
    break;

#line 2928 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      char tmpstring[1024];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      sprintf(tmpstring, "%s_%d", (yyvsp[(1) - (5)].c), (int)(yyvsp[(4) - (5)].d)) ;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
      TheSymbol.Name = tmpstring;
      Symbol *pSymbol;
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(0, "Unknown variable '%s'", tmpstring);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = *(double*)List_Pointer_Fast(pSymbol->val, 0);
      Free((yyvsp[(1) - (5)].c));
    ;}
    break;

#line 2943 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = (yyvsp[(1) - (4)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double *pd;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)(yyvsp[(3) - (4)].d))))
	  (yyval.d) = *pd;
	  yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (4)].c), (int)(yyvsp[(3) - (4)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  (yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (4)].c));
    ;}
    break;

#line 2963 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = (yyvsp[(2) - (4)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(0, "Unknown variable '%s'", (yyvsp[(2) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = List_Nbr(pSymbol->val);
      Free((yyvsp[(2) - (4)].c));
    ;}
    break;

#line 2976 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = (yyvsp[(1) - (2)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (2)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = (*(double*)List_Pointer_Fast(pSymbol->val, 0) += (yyvsp[(2) - (2)].i));
      Free((yyvsp[(1) - (2)].c));
    ;}
    break;

#line 2989 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = (yyvsp[(1) - (5)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (5)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double *pd;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)(yyvsp[(3) - (5)].d))))
	  (yyval.d) = (*pd += (yyvsp[(5) - (5)].i));
	  yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (5)].c), (int)(yyvsp[(3) - (5)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  (yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (5)].c));
    ;}
    break;

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

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

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

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

#line 3084 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      (yyval.d) = Msg::GetValue((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(3) - (6)].c));
    ;}
    break;

#line 3092 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      memcpy((yyval.v), (yyvsp[(1) - (1)].v), 5*sizeof(double));
    ;}
    break;

#line 3096 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < 5; i++) (yyval.v)[i] = -(yyvsp[(2) - (2)].v)[i];
    ;}
    break;

#line 3100 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(2) - (2)].v)[i];
    ;}
    break;

#line 3104 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(1) - (3)].v)[i] - (yyvsp[(3) - (3)].v)[i];
    ;}
    break;

#line 3108 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(1) - (3)].v)[i] + (yyvsp[(3) - (3)].v)[i];
    ;}
    break;

#line 3115 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      (yyval.v)[0] = (yyvsp[(2) - (11)].d);  (yyval.v)[1] = (yyvsp[(4) - (11)].d);  (yyval.v)[2] = (yyvsp[(6) - (11)].d);  (yyval.v)[3] = (yyvsp[(8) - (11)].d); (yyval.v)[4] = (yyvsp[(10) - (11)].d);
    ;}
    break;

#line 3119 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      (yyval.v)[0] = (yyvsp[(2) - (9)].d);  (yyval.v)[1] = (yyvsp[(4) - (9)].d);  (yyval.v)[2] = (yyvsp[(6) - (9)].d);  (yyval.v)[3] = (yyvsp[(8) - (9)].d); (yyval.v)[4] = 1.0;
    ;}
    break;

#line 3123 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.v)[0] = (yyvsp[(2) - (7)].d);  (yyval.v)[1] = (yyvsp[(4) - (7)].d);  (yyval.v)[2] = (yyvsp[(6) - (7)].d);  (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0;
    ;}
    break;

#line 3127 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.v)[0] = (yyvsp[(2) - (7)].d);  (yyval.v)[1] = (yyvsp[(4) - (7)].d);  (yyval.v)[2] = (yyvsp[(6) - (7)].d);  (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0;
    ;}
    break;

#line 3134 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(List_T*));
      List_Add((yyval.l), &((yyvsp[(1) - (1)].l)));
    ;}
    break;

#line 3139 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      List_Add((yyval.l), &((yyvsp[(3) - (3)].l)));
    ;}
    break;

#line 3147 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
      List_Add((yyval.l), &((yyvsp[(1) - (1)].d)));
    ;}
    break;

#line 3152 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(1) - (1)].l);
    ;}
    break;

#line 3156 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      // creates an empty list
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.l) = List_Create(2, 1, sizeof(double));
    ;}
    break;

#line 3161 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(2) - (3)].l);
    ;}
    break;

#line 3165 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(3) - (4)].l);
      for(int i = 0; i < List_Nbr((yyval.l)); i++){
	double *pd = (double*)List_Pointer((yyval.l), i);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(*pd) = - (*pd);
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

#line 3173 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(4) - (5)].l);
      for(int i = 0; i < List_Nbr((yyval.l)); i++){
	double *pd = (double*)List_Pointer((yyval.l), i);
	(*pd) *= (yyvsp[(1) - (5)].d);
      }
    ;}
    break;

#line 3184 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(2) - (2)].l);
      for(int i = 0; i < List_Nbr((yyval.l)); i++){
	double *pd = (double*)List_Pointer((yyval.l), i);
	(*pd) = - (*pd);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

#line 3192 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(3) - (3)].l);
      for(int i = 0; i < List_Nbr((yyval.l)); i++){
	double *pd = (double*)List_Pointer((yyval.l), i);
	(*pd) *= (yyvsp[(1) - (3)].d);
      }
    ;}
    break;

#line 3200 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      (yyval.l) = List_Create(2, 1, sizeof(double)); 
      for(double d = (yyvsp[(1) - (3)].d); ((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d <= (yyvsp[(3) - (3)].d)) : (d >= (yyvsp[(3) - (3)].d)); ((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d += 1.) : (d -= 1.)) 
	List_Add((yyval.l), &d);
    ;}
    break;

#line 3206 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double)); 
      if(!(yyvsp[(5) - (5)].d) || ((yyvsp[(1) - (5)].d) < (yyvsp[(3) - (5)].d) && (yyvsp[(5) - (5)].d) < 0) || ((yyvsp[(1) - (5)].d) > (yyvsp[(3) - (5)].d) && (yyvsp[(5) - (5)].d) > 0)){
        yymsg(0, "Wrong increment in '%g:%g:%g'", (yyvsp[(1) - (5)].d), (yyvsp[(3) - (5)].d), (yyvsp[(5) - (5)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Add((yyval.l), &((yyvsp[(1) - (5)].d)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	for(double d = (yyvsp[(1) - (5)].d); ((yyvsp[(5) - (5)].d) > 0) ? (d <= (yyvsp[(3) - (5)].d)) : (d >= (yyvsp[(3) - (5)].d)); d += (yyvsp[(5) - (5)].d))
	  List_Add((yyval.l), &d);
   ;}
    break;

#line 3217 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      // 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
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Vertex *v = FindPoint((int)(yyvsp[(3) - (4)].d));
      (yyval.l) = List_Create(3, 1, sizeof(double));      
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!v) {
	yymsg(0, "Unknown point '%d'", (int)(yyvsp[(3) - (4)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d = 0.0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Add((yyval.l), &d);
	List_Add((yyval.l), &d);
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      else{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Add((yyval.l), &v->Pos.X);
	List_Add((yyval.l), &v->Pos.Y);
	List_Add((yyval.l), &v->Pos.Z);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

#line 3237 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(List_Nbr((yyvsp[(1) - (1)].l)), 1, sizeof(double));
      for(int i = 0; i < List_Nbr((yyvsp[(1) - (1)].l)); i++){
	Shape *s = (Shape*) List_Pointer((yyvsp[(1) - (1)].l), i);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d = s->Num;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(1) - (1)].l));
    ;}
    break;

#line 3247 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(List_Nbr((yyvsp[(1) - (1)].l)), 1, sizeof(double));
      for(int i = 0; i < List_Nbr((yyvsp[(1) - (1)].l)); i++){
	Shape *s = (Shape*) List_Pointer((yyvsp[(1) - (1)].l), i);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(1) - (1)].l));
    ;}
    break;

#line 3257 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = (yyvsp[(1) - (3)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (3)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d = 0.0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	for(int i = 0; i < List_Nbr(pSymbol->val); i++)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  List_Add((yyval.l), (double*)List_Pointer_Fast(pSymbol->val, i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (3)].c));
    ;}
    break;

#line 3274 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = (yyvsp[(1) - (6)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d = 0.0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	for(int i = 0; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){
	  int j = (int)(*(double*)List_Pointer_Fast((yyvsp[(4) - (6)].l), i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  double *pd;
	  if((pd = (double*)List_Pointer_Test(pSymbol->val, j)))
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    List_Add((yyval.l), pd);
	    yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (6)].c), j);	  
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (6)].c));
      List_Delete((yyvsp[(4) - (6)].l));
    ;}
    break;

#line 3301 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
      List_Add((yyval.l), &((yyvsp[(1) - (1)].d)));
    ;}
    break;

#line 3306 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(1) - (1)].l);
    ;}
    break;

#line 3310 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      List_Add((yyval.l), &((yyvsp[(3) - (3)].d)));
    ;}
    break;

#line 3314 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < List_Nbr((yyvsp[(3) - (3)].l)); i++){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Read((yyvsp[(3) - (3)].l), i, &d);
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(3) - (3)].l));
    ;}
    break;

#line 3327 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.u) = CTX.PACK_COLOR((int)(yyvsp[(2) - (9)].d), (int)(yyvsp[(4) - (9)].d), (int)(yyvsp[(6) - (9)].d), (int)(yyvsp[(8) - (9)].d));
    ;}
    break;

#line 3331 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.u) = CTX.PACK_COLOR((int)(yyvsp[(2) - (7)].d), (int)(yyvsp[(4) - (7)].d), (int)(yyvsp[(6) - (7)].d), 255);
    ;}
    break;

#line 3343 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.u) = Get_ColorForString(ColorString, -1, (yyvsp[(1) - (1)].c), &flag);
      if(flag) yymsg(0, "Unknown color '%s'", (yyvsp[(1) - (1)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (1)].c));
    ;}
    break;

#line 3350 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      unsigned int (*pColOpt)(int num, int action, unsigned int value);
      StringXColor *pColCat;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pColCat = Get_ColorOptionCategory((yyvsp[(1) - (5)].c)))){
	yymsg(0, "Unknown color option class '%s'", (yyvsp[(1) - (5)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.u) = 0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pColOpt =  (unsigned int (*) (int, int, unsigned int))Get_ColorOption((yyvsp[(5) - (5)].c), pColCat))){
	  yymsg(0, "Unknown color option '%s.Color.%s'", (yyvsp[(1) - (5)].c), (yyvsp[(5) - (5)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  (yyval.u) = 0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  (yyval.u) = pColOpt(0, GMSH_GET, 0);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (5)].c)); Free((yyvsp[(5) - (5)].c));
    ;}
    break;

#line 3371 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(2) - (3)].l);
    ;}
    break;

#line 3375 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(256, 10, sizeof(unsigned int));
      GmshColorTable *ct = Get_ColorTable((int)(yyvsp[(3) - (6)].d));
	yymsg(0, "View[%d] does not exist", (int)(yyvsp[(3) - (6)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	for(int i = 0; i < ct->size; i++) 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  List_Add((yyval.l), &ct->table[i]);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (6)].c));
    ;}
    break;

#line 3390 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(256, 10, sizeof(unsigned int));
      List_Add((yyval.l), &((yyvsp[(1) - (1)].u)));
    ;}
    break;

#line 3395 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      List_Add((yyval.l), &((yyvsp[(3) - (3)].u)));
    ;}
    break;

#line 3402 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.c) = (yyvsp[(1) - (1)].c);
    ;}
    break;

#line 3406 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      Msg::Warning("Named string expressions not implemented yet");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

#line 3413 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.c) = (yyvsp[(1) - (1)].c);
    ;}
    break;

#line 3417 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.c) = (char *)Malloc(32*sizeof(char));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      time_t now;
      time(&now);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      strcpy((yyval.c), ctime(&now));
      (yyval.c)[strlen((yyval.c)) - 1] = '\0';
    ;}
    break;

#line 3425 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (6)].c))+strlen((yyvsp[(5) - (6)].c))+1)*sizeof(char));
      strcpy((yyval.c), (yyvsp[(3) - (6)].c));
      strcat((yyval.c), (yyvsp[(5) - (6)].c));
      Free((yyvsp[(3) - (6)].c));
      Free((yyvsp[(5) - (6)].c));
    ;}
    break;

#line 3433 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (4)].c))+1)*sizeof(char));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      int i;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(i = strlen((yyvsp[(3) - (4)].c))-1; i >= 0; i--){
	if((yyvsp[(3) - (4)].c)[i] == '.'){
	  strncpy((yyval.c), (yyvsp[(3) - (4)].c), i);
	  (yyval.c)[i]='\0';
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(i <= 0) strcpy((yyval.c), (yyvsp[(3) - (4)].c));
      Free((yyvsp[(3) - (4)].c));
    ;}
    break;

#line 3447 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (4)].c))+1)*sizeof(char));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      int i;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(i = strlen((yyvsp[(3) - (4)].c))-1; i >= 0; i--){
	if((yyvsp[(3) - (4)].c)[i] == '/' || (yyvsp[(3) - (4)].c)[i] == '\\')
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  break;
      }
      if(i <= 0)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	strcpy((yyval.c), (yyvsp[(3) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	strcpy((yyval.c), &(yyvsp[(3) - (4)].c)[i+1]);
      Free((yyvsp[(3) - (4)].c));
    ;}
    break;

#line 3461 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.c) = (yyvsp[(3) - (4)].c);
    ;}
    break;

#line 3465 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      char tmpstring[1024];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      int i = PrintListOfDouble((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].l), tmpstring);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(i < 0){
	yymsg(0, "Too few arguments in Sprintf");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.c) = (yyvsp[(3) - (6)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(i > 0){
	yymsg(0, "%d extra argument%s in Sprintf", i, (i>1)?"s":"");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.c) = (yyvsp[(3) - (6)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.c) = (char*)Malloc((strlen(tmpstring)+1)*sizeof(char));
	strcpy((yyval.c), tmpstring);
	Free((yyvsp[(3) - (6)].c));
      }
      List_Delete((yyvsp[(5) - (6)].l));
    ;}
    break;

#line 3484 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      const char* (*pStrOpt)(int num, int action, const char *value);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      StringXString *pStrCat;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pStrCat = Get_StringOptionCategory((yyvsp[(3) - (6)].c)))){
	yymsg(0, "Unknown string option class '%s'", (yyvsp[(3) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.c) = (char*)Malloc(sizeof(char));
	(yyval.c)[0] = '\0';
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
	if(!(pStrOpt = (const char *(*) (int, int, const char *))
	     Get_StringOption((yyvsp[(5) - (6)].c), pStrCat))){
	  yymsg(0, "Unknown string option '%s.%s'", (yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  (yyval.c) = (char*)Malloc(sizeof(char));
	  (yyval.c)[0] = '\0';
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	}
	  const char *str = pStrOpt(0, GMSH_GET, NULL);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  (yyval.c) = (char*)Malloc((strlen(str)+1)*sizeof(char));
	  strcpy((yyval.c), str);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

#line 3507 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      const char* (*pStrOpt)(int num, int action, const char *value);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      StringXString *pStrCat;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pStrCat = Get_StringOptionCategory((yyvsp[(3) - (9)].c)))){
	yymsg(0, "Unknown string option class '%s'", (yyvsp[(3) - (9)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.c) = (char*)Malloc(sizeof(char));
	(yyval.c)[0] = '\0';
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
	if(!(pStrOpt = (const char *(*) (int, int, const char *))
	     Get_StringOption((yyvsp[(8) - (9)].c), pStrCat))){
	  yymsg(0, "Unknown string option '%s[%d].%s'", (yyvsp[(3) - (9)].c), (int)(yyvsp[(5) - (9)].d), (yyvsp[(8) - (9)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  (yyval.c) = (char*)Malloc(sizeof(char));
	  (yyval.c)[0] = '\0';
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	}
	  const char *str = pStrOpt((int)(yyvsp[(5) - (9)].d), GMSH_GET, NULL);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  (yyval.c) = (char*)Malloc((strlen(str)+1)*sizeof(char));
	  strcpy((yyval.c), str);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

/* Line 1267 of yacc.c.  */
#line 7911 "Gmsh.tab.cpp"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      default: break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
  /* 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.  */
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    yystate = yydefgoto[yyn - YYNTOKENS];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#if ! YYERROR_VERBOSE
      yyerror (YY_("syntax error"));
#else
      {
	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
	  {
	    YYSIZE_T yyalloc = 2 * yysize;
	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
	    if (yymsg != yymsgbuf)
	      YYSTACK_FREE (yymsg);
	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
	    if (yymsg)
	      yymsg_alloc = yyalloc;
	    else
	      {
		yymsg = yymsgbuf;
		yymsg_alloc = sizeof yymsgbuf;
	      }
	  }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if (0 < yysize && yysize <= yymsg_alloc)
	  {
	    (void) yysyntax_error (yymsg, yystate, yychar);
	    yyerror (yymsg);
	  }
	else
	  {
	    yyerror (YY_("syntax error"));
	    if (yysize != 0)
	      goto yyexhaustedlab;
	  }
      }
#endif
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      /* If just tried and failed to reuse look-ahead token after an
	 error, discard it.  */
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if (yychar <= YYEOF)
	{
	  /* Return failure if at end of input.  */
	  if (yychar == YYEOF)
	    YYABORT;
	}
      else
	{
	  yydestruct ("Error: discarding",
		      yytoken, &yylval);
	  yychar = YYEMPTY;
	}