Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 376 KiB
Newer Older
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3795 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = cosh((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3796 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = tanh((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3797 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = fabs((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3798 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = floor((yyvsp[(3) - (4)].d));    }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3799 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = ceil((yyvsp[(3) - (4)].d));     }
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3800 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3801 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3802 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise 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;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3803 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = (yyvsp[(3) - (4)].d) * (double)rand() / (double)RAND_MAX; }
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3812 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = (yyvsp[(1) - (1)].d); }
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3813 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = 3.141592653589793; }
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3814 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = Msg::GetCommRank(); }
Jean-François Remacle's avatar
 
Jean-François Remacle committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3815 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = Msg::GetCommSize(); }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3816 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = GetGmshMajorVersion(); }
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3817 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = GetGmshMinorVersion(); }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3818 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
    { (yyval.d) = GetGmshPatchVersion(); }
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3823 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!gmsh_yysymbols.count((yyvsp[(1) - (1)].c))){
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (1)].c));
	(yyval.d) = 0.;
      else{
        if(gmsh_yysymbols[(yyvsp[(1) - (1)].c)].empty()){
          yymsg(0, "Uninitialized variable '%s'", (yyvsp[(1) - (1)].c));
          (yyval.d) = 0.;
        }
        else
          (yyval.d) = gmsh_yysymbols[(yyvsp[(1) - (1)].c)][0];
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (1)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3842 "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)) ;
      if(!gmsh_yysymbols.count(tmpstring)){
	yymsg(0, "Unknown variable '%s'", tmpstring);
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      else{
        if(gmsh_yysymbols[tmpstring].empty()){
          yymsg(0, "Uninitialized variable '%s'", tmpstring);
          (yyval.d) = 0.;
        }
        else
          (yyval.d) = gmsh_yysymbols[tmpstring][0];
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (5)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3860 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      int index = (int)(yyvsp[(3) - (4)].d);
      if(!gmsh_yysymbols.count((yyvsp[(1) - (4)].c))){
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (4)].c));
	(yyval.d) = 0.;
      else if((int)gmsh_yysymbols[(yyvsp[(1) - (4)].c)].size() < index + 1){
	yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (4)].c), index);
	(yyval.d) = 0.;
	(yyval.d) = gmsh_yysymbols[(yyvsp[(1) - (4)].c)][index];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3875 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!gmsh_yysymbols.count((yyvsp[(2) - (4)].c))){
	yymsg(0, "Unknown variable '%s'", (yyvsp[(2) - (4)].c));
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else
	(yyval.d) = gmsh_yysymbols[(yyvsp[(2) - (4)].c)].size();
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(2) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3885 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!gmsh_yysymbols.count((yyvsp[(1) - (2)].c))){
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (2)].c));
	(yyval.d) = 0.;
      else{
        if(gmsh_yysymbols[(yyvsp[(1) - (2)].c)].empty()){
          yymsg(0, "Uninitialized variable '%s'", (yyvsp[(1) - (2)].c));
          (yyval.d) = 0.;
        }
        else
          (yyval.d) = (gmsh_yysymbols[(yyvsp[(1) - (2)].c)][0] += (yyvsp[(2) - (2)].i));
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (2)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3901 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      int index = (int)(yyvsp[(3) - (5)].d);
      if(!gmsh_yysymbols.count((yyvsp[(1) - (5)].c))){
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (5)].c));
	(yyval.d) = 0.;
      else if((int)gmsh_yysymbols[(yyvsp[(1) - (5)].c)].size() < index + 1){
	yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (5)].c), index);
	(yyval.d) = 0.;
	(yyval.d) = (gmsh_yysymbols[(yyvsp[(1) - (5)].c)][index] += (yyvsp[(5) - (5)].i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (5)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3919 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      NumberOption(GMSH_GET, (yyvsp[(1) - (3)].c), 0, (yyvsp[(3) - (3)].c), (yyval.d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (3)].c)); Free((yyvsp[(3) - (3)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3924 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      NumberOption(GMSH_GET, (yyvsp[(1) - (6)].c), (int)(yyvsp[(3) - (6)].d), (yyvsp[(6) - (6)].c), (yyval.d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (6)].c)); Free((yyvsp[(6) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3929 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      double d = 0.;
      if(NumberOption(GMSH_GET, (yyvsp[(1) - (4)].c), 0, (yyvsp[(3) - (4)].c), d)){
	d += (yyvsp[(4) - (4)].i);
	NumberOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (4)].c), 0, (yyvsp[(3) - (4)].c), d);
	(yyval.d) = d;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (4)].c)); Free((yyvsp[(3) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3939 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      double d = 0.;
      if(NumberOption(GMSH_GET, (yyvsp[(1) - (7)].c), (int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c), d)){
	d += (yyvsp[(7) - (7)].i);
	NumberOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (7)].c), (int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c), d);
	(yyval.d) = d;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (7)].c)); Free((yyvsp[(6) - (7)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3949 "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));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3957 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      memcpy((yyval.v), (yyvsp[(1) - (1)].v), 5*sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3961 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < 5; i++) (yyval.v)[i] = -(yyvsp[(2) - (2)].v)[i];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3965 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(2) - (2)].v)[i];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3969 "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];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3973 "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];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3980 "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);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3984 "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;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3988 "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;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3992 "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;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 3999 "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)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4004 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      List_Add((yyval.l), &((yyvsp[(3) - (3)].l)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4011 "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)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4016 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(1) - (1)].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4020 "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));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4025 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(2) - (3)].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4029 "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);
	(*pd) = - (*pd);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4037 "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);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4048 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4052 "Gmsh.y"
    {
      if(!strcmp((yyvsp[(1) - (1)].c), "*") || !strcmp((yyvsp[(1) - (1)].c), "all"))
        (yyval.l) = 0;
      else{
        yyerror("Unknown special string for list replacement");
        (yyval.l) = List_Create(2, 1, sizeof(double));
      }
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4064 "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;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4072 "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);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4080 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      (yyval.l) = List_Create(2, 1, sizeof(double)); 
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      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);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4087 "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));
	List_Add((yyval.l), &((yyvsp[(1) - (5)].d)));
	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);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4098 "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));
	double d = 0.0;
	List_Add((yyval.l), &d);
	List_Add((yyval.l), &d);
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      else{
	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;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4118 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4122 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4126 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4130 "Gmsh.y"
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4134 "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);
	double d = s->Num;
	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));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4144 "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);
	double d = s->Num;
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(1) - (1)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4154 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
      if(!gmsh_yysymbols.count((yyvsp[(1) - (3)].c)))
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (3)].c));
	for(unsigned int i = 0; i < gmsh_yysymbols[(yyvsp[(1) - (3)].c)].size(); i++)
	  List_Add((yyval.l), &gmsh_yysymbols[(yyvsp[(1) - (3)].c)][i]);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (3)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4164 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
      if(!gmsh_yysymbols.count((yyvsp[(1) - (6)].c)))
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (6)].c));
	for(int i = 0; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){
	  int index = (int)(*(double*)List_Pointer_Fast((yyvsp[(4) - (6)].l), i));
	  if((int)gmsh_yysymbols[(yyvsp[(1) - (6)].c)].size() < index + 1)
	    yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (6)].c), index);
	  else
	    List_Add((yyval.l), &gmsh_yysymbols[(yyvsp[(1) - (6)].c)][index]);
	}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (6)].c));
      List_Delete((yyvsp[(4) - (6)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4184 "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)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4189 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(1) - (1)].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4193 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      List_Add((yyval.l), &((yyvsp[(3) - (3)].d)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4197 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < List_Nbr((yyvsp[(3) - (3)].l)); i++){
	double d;
	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));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4209 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.u) = CTX::instance()->packColor((int)(yyvsp[(2) - (9)].d), (int)(yyvsp[(4) - (9)].d), (int)(yyvsp[(6) - (9)].d), (int)(yyvsp[(8) - (9)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4213 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.u) = CTX::instance()->packColor((int)(yyvsp[(2) - (7)].d), (int)(yyvsp[(4) - (7)].d), (int)(yyvsp[(6) - (7)].d), 255);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4225 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.u) = GetColorForString(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));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4232 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      unsigned int val = 0;
      ColorOption(GMSH_GET, (yyvsp[(1) - (5)].c), 0, (yyvsp[(5) - (5)].c), val);
      (yyval.u) = val;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (5)].c)); Free((yyvsp[(5) - (5)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4242 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(2) - (3)].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

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

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4261 "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)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4266 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      List_Add((yyval.l), &((yyvsp[(3) - (3)].u)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4273 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.c) = (yyvsp[(1) - (1)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4277 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!gmsh_yystringsymbols.count((yyvsp[(1) - (1)].c))){
	yymsg(0, "Unknown string variable '%s'", (yyvsp[(1) - (1)].c));
	(yyval.c) = (yyvsp[(1) - (1)].c);
	std::string val = gmsh_yystringsymbols[(yyvsp[(1) - (1)].c)];
	(yyval.c) = (char *)Malloc((val.size() + 1) * sizeof(char));
	strcpy((yyval.c), val.c_str());
	Free((yyvsp[(1) - (1)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4290 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      std::string out;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      StringOption(GMSH_GET, (yyvsp[(1) - (3)].c), 0, (yyvsp[(3) - (3)].c), out);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.c) = (char*)Malloc((out.size() + 1) * sizeof(char));
      strcpy((yyval.c), out.c_str());
      Free((yyvsp[(1) - (3)].c)); Free((yyvsp[(3) - (3)].c));
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4298 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      std::string out;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      StringOption(GMSH_GET, (yyvsp[(1) - (6)].c), (int)(yyvsp[(3) - (6)].d), (yyvsp[(6) - (6)].c), out);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.c) = (char*)Malloc((out.size() + 1) * sizeof(char));
      strcpy((yyval.c), out.c_str());
      Free((yyvsp[(1) - (6)].c)); Free((yyvsp[(6) - (6)].c));
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4309 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.c) = (yyvsp[(1) - (1)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4313 "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';
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4321 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      const char *env = GetEnvironmentVar((yyvsp[(3) - (4)].c));
      if(!env) env = "";
      (yyval.c) = (char *)Malloc((sizeof(env) + 1) * sizeof(char));
      strcpy((yyval.c), env);
      Free((yyvsp[(3) - (4)].c));
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4329 "Gmsh.y"
    { 
      std::string s = Msg::GetString((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].c));
      (yyval.c) = (char *)Malloc((s.size() + 1) * sizeof(char));
      strcpy((yyval.c), s.c_str());
      Free((yyvsp[(3) - (6)].c));
      Free((yyvsp[(5) - (6)].c));
Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4337 "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));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      strcpy((yyval.c), (yyvsp[(3) - (6)].c));
      strcat((yyval.c), (yyvsp[(5) - (6)].c));
      Free((yyvsp[(3) - (6)].c));
      Free((yyvsp[(5) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4345 "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;
      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';
	  break;
	}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(i <= 0) strcpy((yyval.c), (yyvsp[(3) - (4)].c));
      Free((yyvsp[(3) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4359 "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;
      for(i = strlen((yyvsp[(3) - (4)].c)) - 1; i >= 0; i--){
	if((yyvsp[(3) - (4)].c)[i] == '/' || (yyvsp[(3) - (4)].c)[i] == '\\')
	  break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      if(i <= 0)
	strcpy((yyval.c), (yyvsp[(3) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else
	strcpy((yyval.c), &(yyvsp[(3) - (4)].c)[i+1]);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(3) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4373 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.c) = (yyvsp[(3) - (4)].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Emilie Marchandise's avatar
Emilie Marchandise committed
/* Line 1806 of yacc.c  */
Gaetan Bricteux's avatar
Gaetan Bricteux committed
#line 4377 "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");
	(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" : "");
	(yyval.c) = (yyvsp[(3) - (6)].c);
	(yyval.c) = (char*)Malloc((strlen(tmpstring) + 1) * sizeof(char));
	strcpy((yyval.c), tmpstring);
	Free((yyvsp[(3) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      List_Delete((yyvsp[(5) - (6)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;


/* Line 1806 of yacc.c  */
#line 9981 "Gmsh.tab.cpp"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      default: break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    }
Emilie Marchandise's avatar
Emilie Marchandise committed
  /* User semantic actions sometimes alter yychar, and that requires
     that yytoken be updated with the new translation.  We take the
     approach of translating immediately before every use of yytoken.
     One alternative is translating here after every semantic action,
     but that translation would be missed if the semantic action invokes
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
     incorrect destructor might then be invoked immediately.  In the
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
     to an incorrect destructor call or verbose syntax error message
     before the lookahead is translated.  */
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);