Newer
Older
/*----------.
| yyparse. |
`----------*/
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM)
# else
int yyparse (YYPARSE_PARAM)
void *YYPARSE_PARAM;
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
yyparse (void)
#else
int
yyparse ()
#endif
#endif
register int yystate;
register int yyn;
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
/* Look-ahead token as an internal (translated) token number. */
int yytoken = 0;
/* Three stacks and their tools:
`yyss': related to states,
`yyvs': related to semantic values,
`yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
short int yyssa[YYINITDEPTH];
short int *yyss = yyssa;
register short int *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
/* When reducing, the number of symbols on the RHS of the reduced
rule. */
int yylen;
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyvsp = yyvs;
goto yysetstate;
/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate. |
`------------------------------------------------------------*/
yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks.
*/
yyssp++;
yysetstate:
*yyssp = yystate;
if (yyss + yystacksize - 1 <= yyssp)
{
/* Get the current used size of the three stacks, in elements. */
#ifdef yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
YYSTYPE *yyvs1 = yyvs;
short int *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow ("parser stack overflow",
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
yyss = yyss1;
yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
goto yyoverflowlab;
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyoverflowlab;
yystacksize *= 2;
yystacksize = YYMAXDEPTH;
{
short int *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyoverflowlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
goto yybackup;
/*-----------.
| yybackup. |
`-----------*/
yybackup:
/* Do appropriate processing given the current state. */
/* Read a look-ahead token if we need one and don't already have one. */
/* yyresume: */
/* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate];
goto yydefault;
/* Not known => get a look-ahead token if don't already have one. */
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
yychar = YYLEX;
}
{
yychar = yytoken = YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
else
{
yytoken = YYTRANSLATE (yychar);
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
detect an error, take that action. */
yyn += yytoken;
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
goto yydefault;
yyn = yytable[yyn];
{
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the look-ahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
yystate = yyn;
goto yynewstate;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
/*-----------------------------.
| yyreduce -- Do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
`$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
users should not rely upon it. Assigning to YYVAL
unconditionally makes the parser a bit smaller, and it avoids a
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
case 3:
{ yyerrok; return 1; ;}
break;
case 6:
{ return 1; ;}
break;
case 7:
{ return 1; ;}
break;
case 8:
{ return 1; ;}
break;
case 9:
{ return 1; ;}
break;
case 10:
{ List_Delete((yyvsp[0].l)); return 1; ;}
break;
case 11:
{ List_Delete((yyvsp[0].l)); return 1; ;}
break;
case 12:
{ return 1; ;}
break;
case 13:
{ return 1; ;}
break;
case 14:
{ return 1; ;}
break;
case 15:
{ List_Delete((yyvsp[0].l)); return 1; ;}
break;
case 16:
{ return 1; ;}
break;
case 17:
{ return 1; ;}
break;
case 18:
{ return 1; ;}
break;
case 19:
{ return 1; ;}
break;
case 20:
{
Msg(DIRECT, (yyvsp[-2].c));
Free((yyvsp[-2].c));
;}
break;
case 21:
int i = PrintListOfDouble((yyvsp[-4].c), (yyvsp[-2].l), tmpstring);
if(i < 0)
yymsg(GERROR, "Too few arguments in Printf");
else if(i > 0)
yymsg(GERROR, "%d extra argument%s in Printf", i, (i>1)?"s":"");
else
Msg(DIRECT, tmpstring);
Free((yyvsp[-4].c));
List_Delete((yyvsp[-2].l));
;}
break;
case 22:
{
if(!strcmp((yyvsp[-5].c), "View") && !CheckViewErrorFlags(View)){
EndView(View, 0, yyname, (yyvsp[-4].c));
}
Free((yyvsp[-5].c)); Free((yyvsp[-4].c));
;}
break;
case 23:
{
if(!strcmp((yyvsp[-7].c), "View") && !CheckViewErrorFlags(View)){
EndView(View, 0, yyname, (yyvsp[-6].c));
Free((yyvsp[-7].c)); Free((yyvsp[-6].c)); Free((yyvsp[-5].c));
;}
break;
case 24:
View = BeginView(1);
for(int i = 0; i < VIEW_NB_ELEMENT_TYPES; i++){
ViewErrorFlags[i] = 0;
}
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
;}
break;
case 31:
#line 230 "Gmsh.y"
{ ViewCoord[ViewCoordIdx] = (yyvsp[0].d); ViewCoordIdx++; ;}
break;
case 32:
#line 232 "Gmsh.y"
{ ViewCoord[ViewCoordIdx] = (yyvsp[0].d); ViewCoordIdx++; ;}
break;
case 33:
#line 237 "Gmsh.y"
{ if(ViewValueList) List_Add(ViewValueList, &(yyvsp[0].d)); ;}
break;
case 34:
#line 239 "Gmsh.y"
{ if(ViewValueList) List_Add(ViewValueList, &(yyvsp[0].d)); ;}
break;
case 35:
#line 244 "Gmsh.y"
{
if(!strcmp((yyvsp[0].c), "SP")){
ViewElementIdx = 0; ViewNumNodes = 1; ViewNumComp = 1;
ViewValueList = View->SP; ViewNumList = &View->NbSP;
}
else if(!strcmp((yyvsp[0].c), "VP")){
ViewElementIdx = 1; ViewNumNodes = 1; ViewNumComp = 3;
ViewValueList = View->VP; ViewNumList = &View->NbVP;
}
else if(!strcmp((yyvsp[0].c), "TP")){
ViewElementIdx = 2; ViewNumNodes = 1; ViewNumComp = 9;
ViewValueList = View->TP; ViewNumList = &View->NbTP;
}
else if(!strcmp((yyvsp[0].c), "SL")){
ViewElementIdx = 3; ViewNumNodes = 2; ViewNumComp = 1;
ViewValueList = View->SL; ViewNumList = &View->NbSL;
}
else if(!strcmp((yyvsp[0].c), "VL")){
ViewElementIdx = 4; ViewNumNodes = 2; ViewNumComp = 3;
ViewValueList = View->VL; ViewNumList = &View->NbVL;
}
else if(!strcmp((yyvsp[0].c), "TL")){
ViewElementIdx = 5; ViewNumNodes = 2; ViewNumComp = 9;
ViewValueList = View->TL; ViewNumList = &View->NbTL;
}
else if(!strcmp((yyvsp[0].c), "ST")){
ViewElementIdx = 6; ViewNumNodes = 3; ViewNumComp = 1;
ViewValueList = View->ST; ViewNumList = &View->NbST;
}
else if(!strcmp((yyvsp[0].c), "VT")){
ViewElementIdx = 7; ViewNumNodes = 3; ViewNumComp = 3;
ViewValueList = View->VT; ViewNumList = &View->NbVT;
}
else if(!strcmp((yyvsp[0].c), "TT")){
ViewElementIdx = 8; ViewNumNodes = 3; ViewNumComp = 9;
ViewValueList = View->TT; ViewNumList = &View->NbTT;
}
else if(!strcmp((yyvsp[0].c), "SQ")){
ViewElementIdx = 9; ViewNumNodes = 4; ViewNumComp = 1;
ViewValueList = View->SQ; ViewNumList = &View->NbSQ;
}
else if(!strcmp((yyvsp[0].c), "VQ")){
ViewElementIdx = 10; ViewNumNodes = 4; ViewNumComp = 3;
ViewValueList = View->VQ; ViewNumList = &View->NbVQ;
}
else if(!strcmp((yyvsp[0].c), "TQ")){
ViewElementIdx = 11; ViewNumNodes = 4; ViewNumComp = 9;
ViewValueList = View->TQ; ViewNumList = &View->NbTQ;
}
else if(!strcmp((yyvsp[0].c), "SS")){
ViewElementIdx = 12; ViewNumNodes = 4; ViewNumComp = 1;
ViewValueList = View->SS; ViewNumList = &View->NbSS;
}
else if(!strcmp((yyvsp[0].c), "VS")){
ViewElementIdx = 13; ViewNumNodes = 4; ViewNumComp = 3;
ViewValueList = View->VS; ViewNumList = &View->NbVS;
}
else if(!strcmp((yyvsp[0].c), "TS")){
ViewElementIdx = 14; ViewNumNodes = 4; ViewNumComp = 9;
ViewValueList = View->TS; ViewNumList = &View->NbTS;
}
else if(!strcmp((yyvsp[0].c), "SH")){
ViewElementIdx = 15; ViewNumNodes = 8; ViewNumComp = 1;
ViewValueList = View->SH; ViewNumList = &View->NbSH;
}
else if(!strcmp((yyvsp[0].c), "VH")){
ViewElementIdx = 16; ViewNumNodes = 8; ViewNumComp = 3;
ViewValueList = View->VH; ViewNumList = &View->NbVH;
}
else if(!strcmp((yyvsp[0].c), "TH")){
ViewElementIdx = 17; ViewNumNodes = 8; ViewNumComp = 9;
ViewValueList = View->TH; ViewNumList = &View->NbTH;
}
else if(!strcmp((yyvsp[0].c), "SI")){
ViewElementIdx = 18; ViewNumNodes = 6; ViewNumComp = 1;
ViewValueList = View->SI; ViewNumList = &View->NbSI;
}
else if(!strcmp((yyvsp[0].c), "VI")){
ViewElementIdx = 19; ViewNumNodes = 6; ViewNumComp = 3;
ViewValueList = View->VI; ViewNumList = &View->NbVI;
}
else if(!strcmp((yyvsp[0].c), "TI")){
ViewElementIdx = 20; ViewNumNodes = 6; ViewNumComp = 9;
ViewValueList = View->TI; ViewNumList = &View->NbTI;
}
else if(!strcmp((yyvsp[0].c), "SY")){
ViewElementIdx = 21; ViewNumNodes = 5; ViewNumComp = 1;
ViewValueList = View->SY; ViewNumList = &View->NbSY;
}
else if(!strcmp((yyvsp[0].c), "VY")){
ViewElementIdx = 22; ViewNumNodes = 5; ViewNumComp = 3;
ViewValueList = View->VY; ViewNumList = &View->NbVY;
}
else if(!strcmp((yyvsp[0].c), "TY")){
ViewElementIdx = 23; ViewNumNodes = 5; ViewNumComp = 9;
ViewValueList = View->TY; ViewNumList = &View->NbTY;
}
else if(!strcmp((yyvsp[0].c), "SL2")){
ViewElementIdx = 3; ViewNumNodes = 3; ViewNumComp = 1;
ViewValueList = View->SL2; ViewNumList = &View->NbSL2;
}
else if(!strcmp((yyvsp[0].c), "VL2")){
ViewElementIdx = 4; ViewNumNodes = 3; ViewNumComp = 3;
ViewValueList = View->VL2; ViewNumList = &View->NbVL2;
}
else if(!strcmp((yyvsp[0].c), "TL2")){
ViewElementIdx = 5; ViewNumNodes = 3; ViewNumComp = 9;
ViewValueList = View->TL2; ViewNumList = &View->NbTL2;
}
else if(!strcmp((yyvsp[0].c), "ST2")){
ViewElementIdx = 6; ViewNumNodes = 6; ViewNumComp = 1;
ViewValueList = View->ST2; ViewNumList = &View->NbST2;
}
else if(!strcmp((yyvsp[0].c), "VT2")){
ViewElementIdx = 7; ViewNumNodes = 6; ViewNumComp = 3;
ViewValueList = View->VT2; ViewNumList = &View->NbVT2;
}
else if(!strcmp((yyvsp[0].c), "TT2")){
ViewElementIdx = 8; ViewNumNodes = 6; ViewNumComp = 9;
ViewValueList = View->TT2; ViewNumList = &View->NbTT2;
}
else if(!strcmp((yyvsp[0].c), "SQ2")){
ViewElementIdx = 9; ViewNumNodes = 9; ViewNumComp = 1;
ViewValueList = View->SQ2; ViewNumList = &View->NbSQ2;
}
else if(!strcmp((yyvsp[0].c), "VQ2")){
ViewElementIdx = 10; ViewNumNodes = 9; ViewNumComp = 3;
ViewValueList = View->VQ2; ViewNumList = &View->NbVQ2;
}
else if(!strcmp((yyvsp[0].c), "TQ2")){
ViewElementIdx = 11; ViewNumNodes = 9; ViewNumComp = 9;
ViewValueList = View->TQ2; ViewNumList = &View->NbTQ2;
}
else if(!strcmp((yyvsp[0].c), "SS2")){
ViewElementIdx = 12; ViewNumNodes = 10; ViewNumComp = 1;
ViewValueList = View->SS2; ViewNumList = &View->NbSS2;
}
else if(!strcmp((yyvsp[0].c), "VS2")){
ViewElementIdx = 13; ViewNumNodes = 10; ViewNumComp = 3;
ViewValueList = View->VS2; ViewNumList = &View->NbVS2;
}
else if(!strcmp((yyvsp[0].c), "TS2")){
ViewElementIdx = 14; ViewNumNodes = 10; ViewNumComp = 9;
ViewValueList = View->TS2; ViewNumList = &View->NbTS2;
}
else if(!strcmp((yyvsp[0].c), "SH2")){
ViewElementIdx = 15; ViewNumNodes = 27; ViewNumComp = 1;
ViewValueList = View->SH2; ViewNumList = &View->NbSH2;
}
else if(!strcmp((yyvsp[0].c), "VH2")){
ViewElementIdx = 16; ViewNumNodes = 27; ViewNumComp = 3;
ViewValueList = View->VH2; ViewNumList = &View->NbVH2;
}
else if(!strcmp((yyvsp[0].c), "TH2")){
ViewElementIdx = 17; ViewNumNodes = 27; ViewNumComp = 9;
ViewValueList = View->TH2; ViewNumList = &View->NbTH2;
}
else if(!strcmp((yyvsp[0].c), "SI2")){
ViewElementIdx = 18; ViewNumNodes = 18; ViewNumComp = 1;
ViewValueList = View->SI2; ViewNumList = &View->NbSI2;
}
else if(!strcmp((yyvsp[0].c), "VI2")){
ViewElementIdx = 19; ViewNumNodes = 18; ViewNumComp = 3;
ViewValueList = View->VI2; ViewNumList = &View->NbVI2;
}
else if(!strcmp((yyvsp[0].c), "TI2")){
ViewElementIdx = 20; ViewNumNodes = 18; ViewNumComp = 9;
ViewValueList = View->TI2; ViewNumList = &View->NbTI2;
}
else if(!strcmp((yyvsp[0].c), "SY2")){
ViewElementIdx = 21; ViewNumNodes = 14; ViewNumComp = 1;
ViewValueList = View->SY2; ViewNumList = &View->NbSY2;
}
else if(!strcmp((yyvsp[0].c), "VY2")){
ViewElementIdx = 22; ViewNumNodes = 14; ViewNumComp = 3;
ViewValueList = View->VY2; ViewNumList = &View->NbVY2;
}
else if(!strcmp((yyvsp[0].c), "TY2")){
ViewElementIdx = 23; ViewNumNodes = 14; ViewNumComp = 9;
ViewValueList = View->TY2; ViewNumList = &View->NbTY2;
}
else{
yymsg(GERROR, "Unknown element type '%s'", (yyvsp[0].c));
ViewElementIdx = -1; ViewNumNodes = 0; ViewNumComp = 0;
ViewValueList = NULL; ViewNumList = NULL;
}
;}
break;
case 36:
#line 434 "Gmsh.y"
{
if(ViewValueList){
if(ViewCoordIdx != 3 * ViewNumNodes){
yymsg(GERROR, "Wrong number of node coordinates (%d != %d)",
ViewCoordIdx, 3 * ViewNumNodes);
double d = 0;
for(int i = 0; i < 3 * ViewNumNodes; i++)
List_Add(ViewValueList, &d);
}
else{
for(int i = 0; i < 3; i++)
for(int j = 0; j < ViewNumNodes; j++)
List_Add(ViewValueList, &ViewCoord[3*j+i]);
}
ViewNumListTmp = List_Nbr(ViewValueList);
}
;}
break;
case 37:
#line 452 "Gmsh.y"
{
if(ViewValueList){
if((List_Nbr(ViewValueList) - ViewNumListTmp) % (ViewNumComp * ViewNumNodes))
ViewErrorFlags[ViewElementIdx]++;
(*ViewNumList)++;
}
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
;}
break;
case 38:
#line 463 "Gmsh.y"
{
for(int i = 0; i < (int)strlen((yyvsp[0].c))+1; i++) List_Add(View->T2C, &(yyvsp[0].c)[i]);
Free((yyvsp[0].c));
;}
break;
case 39:
#line 468 "Gmsh.y"
{
for(int i = 0; i < (int)strlen((yyvsp[0].c))+1; i++) List_Add(View->T2C, &(yyvsp[0].c)[i]);
Free((yyvsp[0].c));
;}
break;
case 40:
#line 476 "Gmsh.y"
{
List_Add(View->T2D, &(yyvsp[-5].d)); List_Add(View->T2D, &(yyvsp[-3].d));
List_Add(View->T2D, &(yyvsp[-1].d));
;}
break;
case 41:
#line 483 "Gmsh.y"
{
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
;}
break;
case 42:
#line 490 "Gmsh.y"
{
for(int i = 0; i < (int)strlen((yyvsp[0].c))+1; i++) List_Add(View->T3C, &(yyvsp[0].c)[i]);
Free((yyvsp[0].c));
;}
break;
case 43:
#line 495 "Gmsh.y"
{
for(int i = 0; i < (int)strlen((yyvsp[0].c))+1; i++) List_Add(View->T3C, &(yyvsp[0].c)[i]);
Free((yyvsp[0].c));
;}
break;
case 44:
#line 503 "Gmsh.y"
{
List_Add(View->T3D, &(yyvsp[-7].d)); List_Add(View->T3D, &(yyvsp[-5].d));
List_Add(View->T3D, &(yyvsp[-3].d)); List_Add(View->T3D, &(yyvsp[-1].d));
;}
break;
case 45:
#line 510 "Gmsh.y"
{
;}
break;
case 46:
#line 518 "Gmsh.y"
{
View->adaptive = new Adaptive_Post_View(View, (yyvsp[-5].l), (yyvsp[-2].l));
;}
break;
case 47:
#line 525 "Gmsh.y"
{
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
;}
break;
case 48:
#line 529 "Gmsh.y"
{
;}
break;
case 49:
#line 533 "Gmsh.y"
{
View->Grains [(int)(yyvsp[-3].d)] = (yyvsp[-1].l);
;}
break;
case 50:
#line 541 "Gmsh.y"
{ (yyval.i) = 0; ;}
break;
case 51:
#line 542 "Gmsh.y"
{ (yyval.i) = 1; ;}
break;
case 52:
{ (yyval.i) = 2; ;}
break;
case 53:
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
{ (yyval.i) = 3; ;}
break;
case 54:
#line 545 "Gmsh.y"
{ (yyval.i) = 4; ;}
break;
case 55:
#line 549 "Gmsh.y"
{ (yyval.i) = 1; ;}
break;
case 56:
#line 550 "Gmsh.y"
{ (yyval.i) = -1; ;}
break;
case 57:
#line 558 "Gmsh.y"
{
List_Put(TheSymbol.val, 0, &(yyvsp[-1].d));

Christophe Geuzaine
committed
}
yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-3].c));
Free((yyvsp[-3].c));
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;

Christophe Geuzaine
committed
case 4 :
if((yyvsp[-1].d)) *pd /= (yyvsp[-1].d);
else yymsg(GERROR, "Division by zero in '%s /= %g'", (yyvsp[-3].c), (yyvsp[-1].d));

Christophe Geuzaine
committed
break;
}
;}
break;
case 58:
#line 589 "Gmsh.y"
{
List_Put(TheSymbol.val, (int)(yyvsp[-4].d), &(yyvsp[-1].d));

Christophe Geuzaine
committed
}
yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-6].c));
Free((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;

Christophe Geuzaine
committed
case 4 :
if((yyvsp[-1].d)) *pd /= (yyvsp[-1].d);
else yymsg(GERROR, "Division by zero in '%s[%d] /= %g'", (yyvsp[-6].c), (int)(yyvsp[-4].d), (yyvsp[-1].d));

Christophe Geuzaine
committed
break;
}
}
else{
if(!(yyvsp[-2].i))
List_Put(pSymbol->val, (int)(yyvsp[-4].d), &(yyvsp[-1].d));

Christophe Geuzaine
committed
else
yymsg(GERROR, "Uninitialized variable '%s[%d]'", (yyvsp[-6].c), (int)(yyvsp[-4].d));

Christophe Geuzaine
committed
}
;}
break;
case 59:
#line 628 "Gmsh.y"
{
if(List_Nbr((yyvsp[-5].l)) != List_Nbr((yyvsp[-1].l))){

Christophe Geuzaine
committed
yymsg(GERROR, "Incompatible array dimensions in affectation");
for(int 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));
yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-8].c));
Free((yyvsp[-8].c));
for(int i = 0; i < List_Nbr((yyvsp[-5].l)); i++){
int j = (int)(*(double*)List_Pointer((yyvsp[-5].l), i));
double d = *(double*)List_Pointer((yyvsp[-1].l), i);
if((pd = (double*)List_Pointer_Test(pSymbol->val, j))){
case 0 : *pd = d; break;
case 1 : *pd += d; break;
case 2 : *pd -= d; break;
case 3 : *pd *= d; break;
if((yyvsp[-1].l)) *pd /= d;
else yymsg(GERROR, "Division by zero in '%s[%d] /= %g'", (yyvsp[-8].c), j, d);
List_Put(pSymbol->val, j, &d);
else
yymsg(GERROR, "Uninitialized variable '%s[%d]'", (yyvsp[-8].c), j);
List_Delete((yyvsp[-5].l));
List_Delete((yyvsp[-1].l));
;}
break;
case 60:
#line 682 "Gmsh.y"
{
if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))){
TheSymbol.val = List_Create(5, 5, sizeof(double));
List_Copy((yyvsp[-1].l), TheSymbol.val);
}
else{
List_Reset(pSymbol->val);
List_Copy((yyvsp[-1].l), pSymbol->val);
Free((yyvsp[-5].c));
}
List_Delete((yyvsp[-1].l));
;}
break;
case 61:
#line 699 "Gmsh.y"
{
Symbol *pSymbol;
if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))){
TheSymbol.val = List_Create(5, 5, sizeof(double));
List_Copy((yyvsp[-1].l), TheSymbol.val);
for(int i = 0; i < List_Nbr((yyvsp[-1].l)); i++)
List_Add(pSymbol->val, List_Pointer((yyvsp[-1].l), i));
Free((yyvsp[-5].c));
}
List_Delete((yyvsp[-1].l));
;}
break;
case 62:
#line 717 "Gmsh.y"
{
yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-2].c));
*(double*)List_Pointer_Fast(pSymbol->val, 0) += (yyvsp[-1].i);
Free((yyvsp[-2].c));
;}
break;
case 63:
#line 728 "Gmsh.y"
{
yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-5].c));
if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)(yyvsp[-3].d))))
*pd += (yyvsp[-1].i);
yymsg(GERROR, "Uninitialized variable '%s[%d]'", (yyvsp[-5].c), (int)(yyvsp[-3].d));
}
Free((yyvsp[-5].c));
;}
break;
case 64:
#line 747 "Gmsh.y"
{
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;
if(!(pStrCat = Get_StringOptionCategory((yyvsp[-5].c))))
yymsg(GERROR, "Unknown string option class '%s'", (yyvsp[-5].c));
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption((yyvsp[-3].c), pStrCat)))
yymsg(GERROR, "Unknown string option '%s.%s'", (yyvsp[-5].c), (yyvsp[-3].c));
pStrOpt(0, GMSH_SET|GMSH_GUI, (yyvsp[-1].c));
}
Free((yyvsp[-5].c)); Free((yyvsp[-3].c)); //FIXME: somtimes leak $5
;}
break;
case 65:
#line 761 "Gmsh.y"
{
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;
if(!(pStrCat = Get_StringOptionCategory((yyvsp[-8].c))))