Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 250 KiB
Newer Older

  goto yybackup;
 yybackup:

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* yyresume: */

  /* First try to decide what to do without reference to lookahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* yychar is either YYEMPTY or YYEOF
     or a valid token in external form.  */

  if (yychar == YYEMPTY)
    {
#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Reading a token: ");
#endif
      yychar = YYLEX;
    }

  /* Convert token to internal form (in yychar1) for indexing tables with */

  if (yychar <= 0)		/* This means end of input. */
    {
      yychar1 = 0;
      yychar = YYEOF;		/* Don't call YYLEX any more */

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Now at end of input.\n");
#endif
    }
  else
    {
      yychar1 = YYTRANSLATE(yychar);

#if YYDEBUG != 0
      if (yydebug)
	{
	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
	  /* Give the individual parser a way to print the precise meaning
	     of a token, for further debugging info.  */
#ifdef YYPRINT
	  YYPRINT (stderr, yychar, yylval);
#endif
	  fprintf (stderr, ")\n");
	}
#endif
    }

  yyn += yychar1;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
    goto yydefault;

  yyn = yytable[yyn];

  /* yyn is what to do for this token type in this state.
     Negative => reduce, -yyn is rule number.
     Positive => shift, yyn is new state.
       New state is final state => don't bother to shift,
       just return success.
     0, or most negative number => error.  */

  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrlab;

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif

  /* Discard the token being shifted unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;

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

  /* count tokens shifted since error; after three, turn off error status.  */
  if (yyerrstatus) yyerrstatus--;

  yystate = yyn;
  goto yynewstate;

/* Do the default action for the current state.  */
yydefault:

  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;

/* Do a reduction.  yyn is the number of a rule to reduce with.  */
yyreduce:
  yylen = yyr2[yyn];
  if (yylen > 0)
    yyval = yyvsp[1-yylen]; /* implement default value of the action */

#if YYDEBUG != 0
  if (yydebug)
    {
      int i;

      fprintf (stderr, "Reducing via rule %d (line %d), ",
	       yyn, yyrline[yyn]);

      /* Print the symbols being reduced, and their result.  */
      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
    }
#endif


  switch (yyn) {

case 4:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
{ yyerrok ; return 1; ;
    break;}
case 5:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
{ yyval.d = yyvsp[0].d; ;
    break;}
case 6:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
{ yyval.d = -yyvsp[0].d; ;
    break;}
case 7:
      Msg(PARSER_INFO,"STL file format");
      STL_Surf = Create_Surface(1,MSH_SURF_STL,1);
      STL_Surf->STL = new STL_Data;
      return 1;
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 8:
{
      STL_Surf->STL->Add_Facet( yyvsp[-12].d, yyvsp[-11].d, yyvsp[-10].d,
				yyvsp[-8].d, yyvsp[-7].d, yyvsp[-6].d,
				yyvsp[-4].d, yyvsp[-3].d, yyvsp[-2].d);
      return 1;
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 9:
      Msg(PARSER_INFO,"STL file format read");
      Tree_Add(THEM->Surfaces, &STL_Surf);
      return 1;
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 12:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 13:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 14:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 15:
      Msg(PARSER_INFO,"Step Iso-10303-21 file format");
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 16:
      Msg(PARSER_INFO,"Step Iso-10303-21 file format read");
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 20:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 21:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 22:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 23:
{
        Add_Cartesian_Point((int)yyvsp[-8].d,yyvsp[-4].c,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2]);
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 24:
{
       Add_BSpline_Curve_With_Knots ((int)yyvsp[-22].d, yyvsp[-18].c, (int) yyvsp[-16].d, yyvsp[-14].l,	yyvsp[-6].l, yyvsp[-4].l, 0., 1.);
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 25:
{
      Add_BSpline_Surface_With_Knots ((int)yyvsp[-30].d, yyvsp[-26].c, (int) yyvsp[-24].d, (int) yyvsp[-22].d, yyvsp[-20].l, yyvsp[-10].l,
				      yyvsp[-8].l, yyvsp[-6].l, yyvsp[-4].l, 0., 1., 0., 1. );
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 26:
{
      Add_Edge_Curve ((int)yyvsp[-14].d, yyvsp[-10].c , (int)yyvsp[-8].d , (int)yyvsp[-6].d, (int)yyvsp[-4].d);
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 27:
{
      Add_Face_Outer_Bound((int)yyvsp[-10].d,yyvsp[-6].c,(int)yyvsp[-4].d,yyvsp[-2].i,1);
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 28:
{
      /* La je dois voir la norme ! Face_Bound : trou externe a la surface ! */
      Msg(PARSER_INFO,"Found a face bound");
      Add_Face_Outer_Bound((int)yyvsp[-10].d,yyvsp[-6].c,(int)yyvsp[-4].d,yyvsp[-2].i,0);
    ;
    break;}
case 29:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Oriented_Edge((int)yyvsp[-14].d,yyvsp[-10].c,(int)yyvsp[-4].d,yyvsp[-2].i);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Edge_Loop((int)yyvsp[-8].d,yyvsp[-4].c,yyvsp[-2].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Advanced_Face((int)yyvsp[-12].d,yyvsp[-8].c,yyvsp[-6].l,(int)yyvsp[-4].d,yyvsp[-2].i);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Vertex_Point((int)yyvsp[-8].d,yyvsp[-4].c,(int)yyvsp[-2].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Axis2_Placement3D  ( (int)yyvsp[-12].d, (int)yyvsp[-4].d, (int)yyvsp[-2].d, (int)yyvsp[-6].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Direction((int)yyvsp[-8].d , yyvsp[-4].c, yyvsp[-2].v[0], yyvsp[-2].v[1], yyvsp[-2].v[2]);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Plane((int)yyvsp[-8].d,yyvsp[-4].c,(int)yyvsp[-2].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Line ((int)yyvsp[-10].d, yyvsp[-6].c , (int) yyvsp[-4].d, (int)yyvsp[-2].d);
      Msg(PARSER_INFO,"Found a closed shell");
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Closed_Shell((int)yyvsp[-8].d, yyvsp[-4].c , yyvsp[-2].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Cylinder ((int)yyvsp[-10].d, yyvsp[-6].c , (int)yyvsp[-4].d, yyvsp[-2].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Cone ((int)yyvsp[-12].d, yyvsp[-8].c , (int)yyvsp[-6].d, yyvsp[-4].d,yyvsp[-2].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Torus ((int)yyvsp[-12].d, yyvsp[-8].c , (int)yyvsp[-6].d, yyvsp[-4].d,yyvsp[-2].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Circle((int) yyvsp[-10].d, yyvsp[-6].c, (int) yyvsp[-4].d, yyvsp[-2].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Add_Ellipsis((int) yyvsp[-12].d, yyvsp[-8].c, (int) yyvsp[-6].d, yyvsp[-4].d, yyvsp[-2].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    ;
case 54:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
{
      Msg(PARSER_INFO,"Gmsh file format read");
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    ;
case 55:
case 56:
case 57:
case 58:
case 59:
case 60:
case 61:
case 62:
{ return 1; ;
case 63:
case 64:
case 65:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
{ return 1; ;
    break;}
case 66:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
{ return 1; ;
    break;}
case 67:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 68:
      for(i = 0 ; i<List_Nbr(yyvsp[-2].l) ; i++){
	if(!i){
	  str = strtok(yyvsp[-4].c, "%");
	}
	str = strtok(NULL, "%");
	if(str){
	  sprintf(tmpstring3, tmpstring2, *(double*)List_Pointer(yyvsp[-2].l,i)); 
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Missing %d parameter(s) in Printf format",
		   List_Nbr(yyvsp[-2].l)-i);
      List_Delete(yyvsp[-2].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 69:
      if(!strcmp(yyvsp[-5].c, "View")) EndView(View, 1, yyname, yyvsp[-4].c); 
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 70:
      if(!strcmp(yyvsp[-7].c, "View")) EndView(View, 1, yyname, yyvsp[-6].c);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 71:
      View = BeginView(1); 
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 84:
{ List_Add(View->SP, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 85:
{ List_Add(View->SP, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 86:
      List_Add(View->SP, &yyvsp[-5].d); List_Add(View->SP, &yyvsp[-3].d);
      List_Add(View->SP, &yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 87:
      View->NbSP++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 88:
{ List_Add(View->VP, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 89:
{ List_Add(View->VP, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
case 90:
      List_Add(View->VP, &yyvsp[-5].d); List_Add(View->VP, &yyvsp[-3].d);
      List_Add(View->VP, &yyvsp[-1].d); 
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 91:
      View->NbVP++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 92:
{ List_Add(View->TP, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 93:
{ List_Add(View->TP, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 94:
      List_Add(View->TP, &yyvsp[-5].d); List_Add(View->TP, &yyvsp[-3].d);
      List_Add(View->TP, &yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 95:
      View->NbTP++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 96:
{ List_Add(View->SL, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 97:
{ List_Add(View->SL, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 98:
      List_Add(View->SL, &yyvsp[-11].d); List_Add(View->SL, &yyvsp[-5].d);
      List_Add(View->SL, &yyvsp[-9].d); List_Add(View->SL, &yyvsp[-3].d);
      List_Add(View->SL, &yyvsp[-7].d); List_Add(View->SL, &yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 99:
      View->NbSL++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 100:
{ List_Add(View->VL, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 101:
{ List_Add(View->VL, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 102:
      List_Add(View->VL, &yyvsp[-11].d); List_Add(View->VL, &yyvsp[-5].d);
      List_Add(View->VL, &yyvsp[-9].d); List_Add(View->VL, &yyvsp[-3].d);
      List_Add(View->VL, &yyvsp[-7].d); List_Add(View->VL, &yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 103:
      View->NbVL++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 104:
{ List_Add(View->TL, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 105:
{ List_Add(View->TL, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 106:
      List_Add(View->TL, &yyvsp[-11].d); List_Add(View->TL, &yyvsp[-5].d);
      List_Add(View->TL, &yyvsp[-9].d); List_Add(View->TL, &yyvsp[-3].d);
      List_Add(View->TL, &yyvsp[-7].d); List_Add(View->TL, &yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 107:
      View->NbTL++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 108:
{ List_Add(View->ST, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 109:
{ List_Add(View->ST, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 110:
      List_Add(View->ST, &yyvsp[-17].d); List_Add(View->ST, &yyvsp[-11].d);
      List_Add(View->ST, &yyvsp[-5].d);
      List_Add(View->ST, &yyvsp[-15].d); List_Add(View->ST, &yyvsp[-9].d);
      List_Add(View->ST, &yyvsp[-3].d);
      List_Add(View->ST, &yyvsp[-13].d); List_Add(View->ST, &yyvsp[-7].d);
      List_Add(View->ST, &yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 111:
      View->NbST++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 112:
{ List_Add(View->VT, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 113:
{ List_Add(View->VT, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 114:
      List_Add(View->VT, &yyvsp[-17].d); List_Add(View->VT, &yyvsp[-11].d);
      List_Add(View->VT, &yyvsp[-5].d);
      List_Add(View->VT, &yyvsp[-15].d); List_Add(View->VT, &yyvsp[-9].d);
      List_Add(View->VT, &yyvsp[-3].d);
      List_Add(View->VT, &yyvsp[-13].d); List_Add(View->VT, &yyvsp[-7].d);
      List_Add(View->VT, &yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 115:
      View->NbVT++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 116:
{ List_Add(View->TT, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 117:
{ List_Add(View->TT, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 118:
      List_Add(View->TT, &yyvsp[-17].d); List_Add(View->TT, &yyvsp[-11].d);
      List_Add(View->TT, &yyvsp[-5].d);
      List_Add(View->TT, &yyvsp[-15].d); List_Add(View->TT, &yyvsp[-9].d);
      List_Add(View->TT, &yyvsp[-3].d);
      List_Add(View->TT, &yyvsp[-13].d); List_Add(View->TT, &yyvsp[-7].d);
      List_Add(View->TT, &yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 119:
      View->NbTT++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 120:
{ List_Add(View->SS, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 121:
{ List_Add(View->SS, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 122:
      List_Add(View->SS, &yyvsp[-23].d);  List_Add(View->SS, &yyvsp[-17].d);
      List_Add(View->SS, &yyvsp[-11].d); List_Add(View->SS, &yyvsp[-5].d);
      List_Add(View->SS, &yyvsp[-21].d);  List_Add(View->SS, &yyvsp[-15].d);
      List_Add(View->SS, &yyvsp[-9].d); List_Add(View->SS, &yyvsp[-3].d);
      List_Add(View->SS, &yyvsp[-19].d);  List_Add(View->SS, &yyvsp[-13].d);
      List_Add(View->SS, &yyvsp[-7].d); List_Add(View->SS, &yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 123:
      View->NbSS++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 124:
{ List_Add(View->VS, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 125:
{ List_Add(View->VS, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 126:
      List_Add(View->VS, &yyvsp[-23].d);  List_Add(View->VS, &yyvsp[-17].d);
      List_Add(View->VS, &yyvsp[-11].d); List_Add(View->VS, &yyvsp[-5].d);
      List_Add(View->VS, &yyvsp[-21].d);  List_Add(View->VS, &yyvsp[-15].d);
      List_Add(View->VS, &yyvsp[-9].d); List_Add(View->VS, &yyvsp[-3].d);
      List_Add(View->VS, &yyvsp[-19].d);  List_Add(View->VS, &yyvsp[-13].d);
      List_Add(View->VS, &yyvsp[-7].d); List_Add(View->VS, &yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 127:
      View->NbVS++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 128:
{ List_Add(View->TS, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 129:
{ List_Add(View->TS, &yyvsp[0].d) ; ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 130:
      List_Add(View->TS, &yyvsp[-23].d);  List_Add(View->TS, &yyvsp[-17].d);
      List_Add(View->TS, &yyvsp[-11].d); List_Add(View->TS, &yyvsp[-5].d);
      List_Add(View->TS, &yyvsp[-21].d);  List_Add(View->TS, &yyvsp[-15].d);
      List_Add(View->TS, &yyvsp[-9].d); List_Add(View->TS, &yyvsp[-3].d);
      List_Add(View->TS, &yyvsp[-19].d);  List_Add(View->TS, &yyvsp[-13].d);
      List_Add(View->TS, &yyvsp[-7].d); List_Add(View->TS, &yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 131:
      View->NbTS++ ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 132:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 133:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 134:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 135:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 136:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 137:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 138:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 139:
      if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))){
	TheSymbol.val = List_Create(1,1,sizeof(double));
	if(!yyvsp[-2].i){
	  List_Put(TheSymbol.val, 0, &yyvsp[-1].d);
	  List_Add(Symbol_L, &TheSymbol);
	}
	else
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Unknown variable '%s'", yyvsp[-3].c) ;
	pd = (double*)List_Pointer_Fast(pSymbol->val, 0) ; 
	switch(yyvsp[-2].i){
	case 0 : *pd = yyvsp[-1].d; break ;
	case 1 : *pd += yyvsp[-1].d ; break ;
	case 2 : *pd -= yyvsp[-1].d ; break ;
	case 3 : *pd *= yyvsp[-1].d ; break ;
	case 4 : 
	  if(yyvsp[-1].d) *pd /= yyvsp[-1].d ; 
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  else vyyerror("Division by zero in '%s /= %g'", yyvsp[-3].c, yyvsp[-1].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 140:
      TheSymbol.Name = yyvsp[-6].c;
      if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))){
	TheSymbol.val = List_Create(5,5,sizeof(double));
	if(!yyvsp[-2].i){
	  List_Put(TheSymbol.val, (int)yyvsp[-4].d, &yyvsp[-1].d);
	  List_Add(Symbol_L, &TheSymbol);
	}
	else
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Unknown variable '%s'", yyvsp[-6].c) ;
	if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-4].d))){
	  switch(yyvsp[-2].i){
	  case 0 : *pd = yyvsp[-1].d; break ;
	  case 1 : *pd += yyvsp[-1].d ; break ;
	  case 2 : *pd -= yyvsp[-1].d ; break ;
	  case 3 : *pd *= yyvsp[-1].d ; break ;
	  case 4 : 
	    if(yyvsp[-1].d) *pd /= yyvsp[-1].d ; 
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	    else vyyerror("Division by zero in '%s[%d] /= %g'", yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-1].d);
	    break;
	  }
	}
	else{
	  if(!yyvsp[-2].i)
	    List_Put(pSymbol->val, (int)yyvsp[-4].d, &yyvsp[-1].d);
	  else
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	    vyyerror("Uninitialized variable '%s[%d]'", yyvsp[-6].c, (int)yyvsp[-4].d) ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 141:
{
      if(List_Nbr(yyvsp[-5].l) != List_Nbr(yyvsp[-1].l))
	vyyerror("Incompatible array dimensions in affectation");
      else{
	TheSymbol.Name = yyvsp[-8].c;
	if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))){
	  TheSymbol.val = List_Create(5,5,sizeof(double));
	  if(!yyvsp[-2].i){
	    for(i=0 ; i<List_Nbr(yyvsp[-5].l) ; i++){
	      List_Put(TheSymbol.val, (int)(*(double*)List_Pointer(yyvsp[-5].l,i)),
		       (double*)List_Pointer(yyvsp[-1].l,i));
	    }
	    List_Add(Symbol_L, &TheSymbol);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	    vyyerror("Unknown variable '%s'", yyvsp[-8].c) ;
	}
	else{
	  for(i=0 ; i<List_Nbr(yyvsp[-5].l) ; i++){
	    j = (int)(*(double*)List_Pointer(yyvsp[-5].l,i)) ;
	    d = *(double*)List_Pointer(yyvsp[-1].l,i) ;
	    if((pd = (double*)List_Pointer_Test(pSymbol->val, j))){
	      switch(yyvsp[-2].i){
	      case 0 : *pd = d; break ;
	      case 1 : *pd += d ; break ;
	      case 2 : *pd -= d ; break ;
	      case 3 : *pd *= d ; break ;
	      case 4 : 
		if(yyvsp[-1].l) *pd /= d ; 
Christophe Geuzaine's avatar
Christophe Geuzaine committed
		else vyyerror("Division by zero in '%s[%d] /= %g'", yyvsp[-8].c, j, d);
		break;
	      }
	    }
	    else{
	      if(!yyvsp[-2].i)
		List_Put(pSymbol->val, j, &d);
	      else
Christophe Geuzaine's avatar
Christophe Geuzaine committed
		vyyerror("Uninitialized variable '%s[%d]'", yyvsp[-8].c, j) ;	  
	    }
	  }
	}
      }
      List_Delete(yyvsp[-5].l);
      List_Delete(yyvsp[-1].l);
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 142:
{
      TheSymbol.Name = yyvsp[-5].c;
      if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))){
	TheSymbol.val = List_Create(5,5,sizeof(double));
	List_Copy(yyvsp[-1].l,TheSymbol.val);
	List_Add(Symbol_L, &TheSymbol);
      }
      else{
	List_Reset(pSymbol->val);
	List_Copy(yyvsp[-1].l, pSymbol->val);
      }
      List_Delete(yyvsp[-1].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 143:
      if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols)))
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Unknown variable '%s'", yyvsp[-2].c) ; 
	*(double*)List_Pointer_Fast(pSymbol->val, 0) += yyvsp[-1].i; 
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 144:
      TheSymbol.Name = yyvsp[-5].c ;
      if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols)))
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Unknown variable '%s'", yyvsp[-5].c) ; 
      else{
	if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-3].d)))
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Uninitialized variable '%s[%d]'", yyvsp[-5].c, (int)yyvsp[-3].d) ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 145:
{ 
      if(!(pStrCat = Get_StringOptionCategory(yyvsp[-5].c)))
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Unknown string option class '%s'", yyvsp[-5].c);
	if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-3].c, pStrCat)))
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Unknown string option '%s.%s'", yyvsp[-5].c, yyvsp[-3].c);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 146:
{ 
      if(!(pStrCat = Get_StringOptionCategory(yyvsp[-8].c)))
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Unknown string option class '%s'", yyvsp[-8].c);
	if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-3].c, pStrCat)))
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Unknown string option '%s[%d].%s'", yyvsp[-8].c, (int)yyvsp[-6].d, yyvsp[-3].c);
	  pStrOpt((int)yyvsp[-6].d,GMSH_SET|GMSH_GUI,yyvsp[-1].c) ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 147:
      if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-5].c)))
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Unknown numeric option class '%s'", yyvsp[-5].c);
	if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-3].c, pNumCat)))
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Unknown numeric option '%s.%s'", yyvsp[-5].c, yyvsp[-3].c);
	  switch(yyvsp[-2].i){
	  case 0 : d = yyvsp[-1].d ; break ;
	  case 1 : d = pNumOpt(0,GMSH_GET,0) + yyvsp[-1].d ; break ;
	  case 2 : d = pNumOpt(0,GMSH_GET,0) - yyvsp[-1].d ; break ;
	  case 3 : d = pNumOpt(0,GMSH_GET,0) * yyvsp[-1].d ; break ;
	  case 4 : 
	    if(yyvsp[-1].d) d = pNumOpt(0,GMSH_GET,0) / yyvsp[-1].d ; 
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	    else vyyerror("Division by zero in '%s.%s /= %g'", yyvsp[-5].c, yyvsp[-3].c, yyvsp[-1].d);