Newer
Older

Christophe Geuzaine
committed
case 261:
break;}

Christophe Geuzaine
committed
case 262:
break;}

Christophe Geuzaine
committed
case 263:
break;}

Christophe Geuzaine
committed
case 264:
break;}

Christophe Geuzaine
committed
case 265:
break;}

Christophe Geuzaine
committed
case 266:
break;}

Christophe Geuzaine
committed
case 267:
{ yyval.d = atan2(yyvsp[-3].d,yyvsp[-1].d); ;
break;}

Christophe Geuzaine
committed
case 268:
break;}

Christophe Geuzaine
committed
case 269:
break;}

Christophe Geuzaine
committed
case 270:
break;}

Christophe Geuzaine
committed
case 271:
break;}

Christophe Geuzaine
committed
case 272:

Christophe Geuzaine
committed
case 273:

Christophe Geuzaine
committed
case 274:
{ yyval.d = fmod(yyvsp[-3].d,yyvsp[-1].d); ;

Christophe Geuzaine
committed
case 275:
{ yyval.d = fmod(yyvsp[-3].d,yyvsp[-1].d); ;

Christophe Geuzaine
committed
case 276:
{ yyval.d = sqrt(yyvsp[-3].d*yyvsp[-3].d+yyvsp[-1].d*yyvsp[-1].d); ;

Christophe Geuzaine
committed
case 277:
{ yyval.d = yyvsp[-1].d*(double)rand()/(double)RAND_MAX; ;

Christophe Geuzaine
committed
case 278:
{ yyval.d = 3.141592653589793; ;
break;}
case 280:
{
TheSymbol.Name = yyvsp[0].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {

Christophe Geuzaine
committed
else
yyval.d = *(double*)List_Pointer_Fast(pSymbol->val, 0) ;
;
break;}
{
TheSymbol.Name = yyvsp[-3].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
yyval.d = 0. ;
}
else{
if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-1].d)))
yyval.d = *pd ;
else{
vyyerror("Uninitialized variable '%s[%d]'", yyvsp[-3].c, (int)yyvsp[-1].d) ;
yyval.d = 0. ;
}
}
;
break;}
{
TheSymbol.Name = yyvsp[-1].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {

Christophe Geuzaine
committed
else
yyval.d = (*(double*)List_Pointer_Fast(pSymbol->val, 0) += yyvsp[0].i) ;
{
TheSymbol.Name = yyvsp[-4].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
yyval.d = 0. ;
}
else{
if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-2].d)))

Christophe Geuzaine
committed
yyval.d = (*pd += yyvsp[0].i) ;
vyyerror("Uninitialized variable '%s[%d]'", yyvsp[-4].c, (int)yyvsp[-2].d) ;
yyval.d = 0. ;
}
}
;
break;}
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-2].c))){
vyyerror("Unknown numeric option class '%s'", yyvsp[-2].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[0].c, pNumCat))){
vyyerror("Unknown numeric option '%s.%s'", yyvsp[-2].c, yyvsp[0].c);

Christophe Geuzaine
committed
else
yyval.d = pNumOpt(0, GMSH_GET, 0);

Christophe Geuzaine
committed
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-5].c))){
vyyerror("Unknown numeric option class '%s'", yyvsp[-5].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[0].c, pNumCat))){
vyyerror("Unknown numeric option '%s[%d].%s'", yyvsp[-5].c, (int)yyvsp[-3].d, yyvsp[0].c);

Christophe Geuzaine
committed
else
yyval.d = pNumOpt((int)yyvsp[-3].d, GMSH_GET, 0);
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-3].c))){
vyyerror("Unknown numeric option class '%s'", yyvsp[-3].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-1].c, pNumCat))){
vyyerror("Unknown numeric option '%s.%s'", yyvsp[-3].c, yyvsp[-1].c);

Christophe Geuzaine
committed
else
yyval.d = pNumOpt(0, GMSH_SET|GMSH_GUI, pNumOpt(0, GMSH_GET, 0)+yyvsp[0].i);

Christophe Geuzaine
committed
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-6].c))){
vyyerror("Unknown numeric option class '%s'", yyvsp[-6].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-1].c, pNumCat))){
vyyerror("Unknown numeric option '%s[%d].%s'", yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-1].c);

Christophe Geuzaine
committed
else
yyval.d = pNumOpt((int)yyvsp[-4].d, GMSH_SET|GMSH_GUI, pNumOpt((int)yyvsp[-4].d, GMSH_GET, 0)+yyvsp[0].i);
{
yyval.l = List_Create(2,1,sizeof(double)) ;
for(d=yyvsp[-2].d ; (yyvsp[-2].d<yyvsp[0].d)?(d<=yyvsp[0].d):(d>=yyvsp[0].d) ; (yyvsp[-2].d<yyvsp[0].d)?(d+=1.):(d-=1.))
;
break;}
{
yyval.l = List_Create(2,1,sizeof(double)) ;
if(!yyvsp[0].d || (yyvsp[-4].d<yyvsp[-2].d && yyvsp[0].d<0) || (yyvsp[-4].d>yyvsp[-2].d && yyvsp[0].d>0)){
vyyerror("Wrong increment in '%g:%g:%g'", yyvsp[-4].d, yyvsp[-2].d, yyvsp[0].d) ;
}
for(d=yyvsp[-4].d ; (yyvsp[0].d>0)?(d<=yyvsp[-2].d):(d>=yyvsp[-2].d) ; d+=yyvsp[0].d)
;
break;}
{
memcpy(yyval.v, yyvsp[0].v, 5*sizeof(double)) ;
;
break;}
{
for(i=0 ; i<5 ; i++) yyval.v[i] = -yyvsp[0].v[i] ;
{
for(i=0 ; i<5 ; i++) yyval.v[i] = yyvsp[-2].v[i] - yyvsp[0].v[i] ;
;
break;}
{
for(i=0 ; i<5 ; i++) yyval.v[i] = yyvsp[-2].v[i] + yyvsp[0].v[i] ;
yyval.v[0]=yyvsp[-9].d; yyval.v[1]=yyvsp[-7].d; yyval.v[2]=yyvsp[-5].d; yyval.v[3]=yyvsp[-3].d; yyval.v[4]=yyvsp[-1].d;
{
yyval.v[0]=yyvsp[-7].d; yyval.v[1]=yyvsp[-5].d; yyval.v[2]=yyvsp[-3].d; yyval.v[3]=yyvsp[-1].d; yyval.v[4]=1.0;
;
break;}

Christophe Geuzaine
committed
case 297:
yyval.v[0]=yyvsp[-5].d; yyval.v[1]=yyvsp[-3].d; yyval.v[2]=yyvsp[-1].d; yyval.v[3]=0.0; yyval.v[4]=1.0;

Christophe Geuzaine
committed
case 298:
yyval.v[0]=yyvsp[-5].d; yyval.v[1]=yyvsp[-3].d; yyval.v[2]=yyvsp[-1].d; yyval.v[3]=0.0; yyval.v[4]=1.0;

Christophe Geuzaine
committed
case 299:
{
;
break;}

Christophe Geuzaine
committed
case 300:
{
;
break;}

Christophe Geuzaine
committed
case 301:
{
;
break;}

Christophe Geuzaine
committed
case 302:
{
;
break;}

Christophe Geuzaine
committed
case 303:

Christophe Geuzaine
committed
case 304:

Christophe Geuzaine
committed
case 305:

Christophe Geuzaine
committed
case 306:
yyval.l = List_Create(2,1,sizeof(List_T*)) ;
List_Add(yyval.l, &(yyvsp[0].l)) ;

Christophe Geuzaine
committed
case 307:
{
;
break;}
{
yyval.l=yyvsp[-1].l;
for(i=0 ; i<List_Nbr(yyval.l) ; i++){
pd = (double*)List_Pointer(yyval.l, i);
(*pd) = - (*pd);
;
break;}
{
yyval.l = List_Create(2,1,sizeof(double)) ;
;
break;}
{
yyval.l = yyvsp[0].l;
;
break;}
case 313:
{
yyval.l = List_Create(2,1,sizeof(double)) ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
d = 0.0 ;
List_Add(yyval.l, &d);
}
else{
for(i = 0 ; i < List_Nbr(pSymbol->val) ; i++)
List_Add(yyval.l, (double*)List_Pointer_Fast(pSymbol->val, i)) ;
yyval.l = List_Create(2,1,sizeof(double)) ;
TheSymbol.Name = yyvsp[-2].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
for(i = 0 ; i < List_Nbr(pSymbol->val) ; i++){
d = - *(double*)List_Pointer_Fast(pSymbol->val, i);
List_Add(yyval.l, &d) ;
}
{
yyval.l = List_Create(2,1,sizeof(double)) ;
TheSymbol.Name = yyvsp[-5].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
}
else{
for(i = 0 ; i < List_Nbr(yyvsp[-2].l) ; i++){
j = (int)(*(double*)List_Pointer_Fast(yyvsp[-2].l, i));
if((pd = (double*)List_Pointer_Test(pSymbol->val, j)))
List_Add(yyval.l, pd) ;
else
vyyerror("Uninitialized variable '%s[%d]'", yyvsp[-5].c, j) ;
;
break;}
{
yyval.l = List_Create(2,1,sizeof(double)) ;
TheSymbol.Name = yyvsp[-5].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
}
else{
for(i = 0 ; i < List_Nbr(yyvsp[-2].l) ; i++){
j = (int)(*(double*)List_Pointer_Fast(yyvsp[-2].l, i));
if((pd = (double*)List_Pointer_Test(pSymbol->val, j))){
List_Add(yyval.l, &d) ;
}
else
vyyerror("Uninitialized variable '%s[%d]'", yyvsp[-5].c, j) ;
}
}
List_Delete(yyvsp[-2].l);
;
break;}
{
yyval.l = yyvsp[0].l ;
;
break;}
case 318:
{
List_Add(yyval.l, &(yyvsp[0].d)) ;
;
break;}
{
for(i=0 ; i<List_Nbr(yyvsp[0].l) ; i++){
List_Read(yyvsp[0].l, i, &d) ;
List_Add(yyval.l, &d) ;
}
;
break;}
{
TheSymbol.Name = yyvsp[-2].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
}
else{
for(i = 0 ; i < List_Nbr(pSymbol->val) ; i++)
List_Add(yyval.l, (double*)List_Pointer_Fast(pSymbol->val, i)) ;
{
TheSymbol.Name = yyvsp[-2].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
}
else{
for(i = 0 ; i < List_Nbr(pSymbol->val) ; i++){
d = - *(double*)List_Pointer_Fast(pSymbol->val, i);
List_Add(yyval.l, &d) ;
}
}
;
break;}
case 322:
{
TheSymbol.Name = yyvsp[-5].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
}
else{
for(i = 0 ; i < List_Nbr(yyvsp[-2].l) ; i++){
j = (int)(*(double*)List_Pointer_Fast(yyvsp[-2].l, i));
if((pd = (double*)List_Pointer_Test(pSymbol->val, j)))
List_Add(yyval.l, pd) ;
else
vyyerror("Uninitialized variable '%s[%d]'", yyvsp[-5].c, j) ;
{
TheSymbol.Name = yyvsp[-5].c ;
if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) {
}
else{
for(i = 0 ; i < List_Nbr(yyvsp[-2].l) ; i++){
j = (int)(*(double*)List_Pointer_Fast(yyvsp[-2].l, i));
if((pd = (double*)List_Pointer_Test(pSymbol->val, j))){
d = - *pd ;
List_Add(yyval.l, &d) ;
}
else
vyyerror("Uninitialized variable '%s[%d]'", yyvsp[-5].c, j) ;
}
}
List_Delete(yyvsp[-2].l);
;
break;}
{
yyval.u = PACK_COLOR((int)yyvsp[-7].d, (int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d);
;
break;}
{
yyval.u = PACK_COLOR((int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d, 255);
;
break;}
{
yyval.u = Get_ColorForString(ColorString, (int)yyvsp[-1].d, yyvsp[-3].c, &flag);
{
yyval.u = Get_ColorForString(ColorString, -1, yyvsp[0].c, &flag);
if(!(pColCat = Get_ColorOptionCategory(yyvsp[-4].c))){

Christophe Geuzaine
committed
if(!(pColOpt = (unsigned int (*) (int, int, unsigned int))Get_ColorOption(yyvsp[0].c, pColCat))){
vyyerror("Unknown color option '%s.Color.%s'", yyvsp[-4].c, yyvsp[0].c);

Christophe Geuzaine
committed
yyval.u = pColOpt(0,GMSH_GET,0) ;
yyval.l = List_Create(256,10,sizeof(unsigned int)) ;

Christophe Geuzaine
committed
ColorTable *ct = Get_ColorTable((int)yyvsp[-3].d);
if(!ct)
vyyerror("View[%d] does not exist", (int)yyvsp[-3].d);

Christophe Geuzaine
committed
for(i=0 ; i<ct->size ; i++)
yyval.l = List_Create(256,10,sizeof(unsigned int)) ;
List_Add(yyval.l, &(yyvsp[0].u)) ;
{
yyval.c = yyvsp[0].c;
;
break;}
{
yyval.c = yyvsp[-1].c;
;
break;}
for(i = 0 ; i<List_Nbr(yyvsp[-1].l) ; i++){
if(!i){
str = strtok(yyvsp[-3].c, "%");
strcpy(tmpstring, str);
}
str = strtok(NULL, "%");
if(str){
strcpy(tmpstring2, "%");
strcat(tmpstring2, str);
sprintf(tmpstring3, tmpstring2, *(double*)List_Pointer(yyvsp[-1].l,i));
strcat(tmpstring, tmpstring3);
}
else{
yyval.c = (char*)Malloc(strlen(tmpstring)+1);
}
/* the action file gets copied in in place of this dollarsign */
#line 543 "/usr/lib/bison.simple"
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
yyvsp -= yylen;
yyssp -= yylen;
#ifdef YYLSP_NEEDED
yylsp -= yylen;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
*++yyvsp = yyval;
#ifdef YYLSP_NEEDED
yylsp++;
if (yylen == 0)
{
yylsp->first_line = yylloc.first_line;
yylsp->first_column = yylloc.first_column;
yylsp->last_line = (yylsp-1)->last_line;
yylsp->last_column = (yylsp-1)->last_column;
yylsp->text = 0;
}
else
{
yylsp->last_line = (yylsp+yylen-1)->last_line;
yylsp->last_column = (yylsp+yylen-1)->last_column;
}
#endif
/* Now "shift" the result of the reduction.
Determine what state that goes to,
based on the state we popped back to
and the rule number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
yyerrlab: /* here on detecting error */
if (! yyerrstatus)
/* If not already recovering from an error, report this error. */
{
++yynerrs;
#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
int size = 0;
char *msg;
int x, count;
count = 0;
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
if (msg != 0)
{
strcpy(msg, "parse error");
if (count < 5)
{
count = 0;
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
strcat(msg, yytname[x]);
strcat(msg, "'");
count++;
}
}
yyerror(msg);
free(msg);
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
yyerror("parse error");
}
goto yyerrlab1;
yyerrlab1: /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
{
/* if just tried and failed to reuse lookahead token after an error, discard it. */
/* return failure if at end of input */
if (yychar == YYEOF)
YYABORT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token
after shifting the error token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
goto yyerrhandle;
yyerrdefault: /* current state does not do anything special for the error token. */
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
if (yyn) goto yydefault;
#endif
yyerrpop: /* pop the current state because it cannot handle the error token */
if (yyssp == yyss) YYABORT;
yyvsp--;
yystate = *--yyssp;
#ifdef YYLSP_NEEDED
yylsp--;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "Error: state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
yyerrhandle:
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yyerrdefault;
yyn += YYTERROR;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
goto yyerrdefault;
yyn = yytable[yyn];
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrpop;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting error token, ");
#endif
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
yystate = yyn;
goto yynewstate;
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
yyacceptlab:
/* YYACCEPT comes here. */
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 0;
yyabortlab:
/* YYABORT comes here. */
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 1;
}
void InitSymbols(void){
Symbol_L = List_Create(10,1,sizeof(Symbol));
}
void DeleteSymbols(void){
int i;
for(i = 0 ; i < List_Nbr(Symbol_L) ; i++)
List_Delete(((Symbol*)List_Pointer_Fast(Symbol_L,i))->val);
List_Delete(Symbol_L);
}
int CompareSymbols (const void *a, const void *b){
return(strcmp(((Symbol*)a)->Name,((Symbol*)b)->Name));
}
void yyerror(char *s){
Msg(PARSER_ERROR, "'%s', line %d : %s (%s)",yyname,yylineno-1,s,yytext);
yyerrorstate=1;
}
va_list args;
va_start (args, fmt);
vsprintf (tmp, fmt, args);
va_end (args);
Msg(PARSER_ERROR, "'%s', line %d : %s", yyname, yylineno-1, tmp);
yyerrorstate=1;
}