Newer
Older
{ yyval.d = sqrt(yyvsp[-3].d*yyvsp[-3].d+yyvsp[-1].d*yyvsp[-1].d); ;
{ yyval.d = ParUtil::Instance()->rank(); ;
break;}
case 411:
{ yyval.d = ParUtil::Instance()->size(); ;
break;}
case 412:
Symbol TheSymbol;
TheSymbol.Name = yyvsp[0].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[0].c);
yyval.d = 0.;

Christophe Geuzaine
committed
else
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-3].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-3].c);
yyval.d = 0.;
if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-1].d)))
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-3].c, (int)yyvsp[-1].d);
yyval.d = 0.;
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-2].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-2].c);
yyval.d = 0.;
}
else{
yyval.d = List_Nbr(pSymbol->val);
}
;
break;}
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-1].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-1].c);
yyval.d = 0.;

Christophe Geuzaine
committed
else
yyval.d = (*(double*)List_Pointer_Fast(pSymbol->val, 0) += yyvsp[0].i);
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-4].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-4].c);
yyval.d = 0.;
if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-2].d)))
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-4].c, (int)yyvsp[-2].d);
yyval.d = 0.;
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-2].c))){

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-2].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[0].c, pNumCat))){

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown numeric option '%s.%s'", yyvsp[-2].c, yyvsp[0].c);

Christophe Geuzaine
committed
else
yyval.d = pNumOpt(0, GMSH_GET, 0);
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;

Christophe Geuzaine
committed
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-5].c))){

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-5].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[0].c, pNumCat))){

Christophe Geuzaine
committed
yymsg(GERROR, "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);
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-3].c))){

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-3].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-1].c, pNumCat))){

Christophe Geuzaine
committed
yymsg(GERROR, "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);
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;

Christophe Geuzaine
committed
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-6].c))){

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-6].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-1].c, pNumCat))){

Christophe Geuzaine
committed
yymsg(GERROR, "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);
for(int i = 0; i < 5; i++) yyval.v[i] = yyvsp[-2].v[i] - yyvsp[0].v[i];
for(int 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;
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;
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;
yyval.l = List_Create(2, 1, sizeof(List_T*));
List_Add(yyval.l, &(yyvsp[0].l));
{
yyval.l = List_Create(2, 1, sizeof(double));
List_Add(yyval.l, &(yyvsp[0].d));
;
break;}
case 440:
pd = (double*)List_Pointer(yyval.l, i);
(*pd) = - (*pd);
yyval.l = List_Create(2, 1, sizeof(double));
for(double 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.))
List_Add(yyval.l, &d);
if(!yyvsp[0].d || (yyvsp[-4].d < yyvsp[-2].d && yyvsp[0].d < 0) || (yyvsp[-4].d > yyvsp[-2].d && yyvsp[0].d > 0)){
yymsg(GERROR, "Wrong increment in '%g:%g:%g'", yyvsp[-4].d, yyvsp[-2].d, yyvsp[0].d);
List_Add(yyval.l, &(yyvsp[-4].d));
for(double d = yyvsp[-4].d; (yyvsp[0].d > 0) ? (d <= yyvsp[-2].d) : (d >= yyvsp[-2].d); d += yyvsp[0].d)
List_Add(yyval.l, &d);
{
// 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
Vertex *v = FindPoint((int)yyvsp[-1].d, THEM);
yymsg(GERROR, "Unknown point '%d'", (int) yyvsp[-1].d);
double d = 0.0;
List_Add(yyval.l, &d);
List_Add(yyval.l, &d);
List_Add(yyval.l, &d);
}
else{
List_Add(yyval.l, &v->Pos.X);
List_Add(yyval.l, &v->Pos.Y);
List_Add(yyval.l, &v->Pos.Z);
for(int i = 0; i < List_Nbr(yyvsp[0].l); i++){
Shape *s = (Shape*) List_Pointer(yyvsp[0].l, i);
double d = s->Num;
List_Add(yyval.l, &d);
}
for(int i = 0; i < List_Nbr(yyvsp[0].l); i++){
Shape *s = (Shape*) List_Pointer(yyvsp[0].l, i);
double d = s->Num;
List_Add(yyval.l, &d);
}
// FIXME: The syntax for this is ugly: we get double semi-colons
// at the end of the line
for(int i = 0; i < List_Nbr(yyvsp[0].l); i++){
Shape *s = (Shape*) List_Pointer(yyvsp[0].l, i);
double d = s->Num;
List_Add(yyval.l, &d);
}
yyval.l = List_Create(2, 1, sizeof(double));
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-2].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-2].c);
double d = 0.0;
List_Add(yyval.l, &d);
}
else{
for(int 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));
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-2].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-2].c);
double d = 0.0;
for(int i = 0; i < List_Nbr(pSymbol->val); i++){
double d = - *(double*)List_Pointer_Fast(pSymbol->val, i);
List_Add(yyval.l, &d);
yyval.l = List_Create(2, 1, sizeof(double));
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-5].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-5].c);
double d = 0.0;
for(int i = 0; i < List_Nbr(yyvsp[-2].l); i++){
int j = (int)(*(double*)List_Pointer_Fast(yyvsp[-2].l, i));
double *pd;
if((pd = (double*)List_Pointer_Test(pSymbol->val, j)))
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-5].c, j);
yyval.l = List_Create(2, 1, sizeof(double));
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-5].c;
Symbol *pSymbol;
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-5].c);
double d = 0.0;
for(int i = 0; i < List_Nbr(yyvsp[-2].l); i++){
int j = (int)(*(double*)List_Pointer_Fast(yyvsp[-2].l, i));
double *pd;
if((pd = (double*)List_Pointer_Test(pSymbol->val, j))){
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-5].c, j);
}
}
List_Delete(yyvsp[-2].l);
yyval.l = List_Create(2, 1, sizeof(double));
List_Add(yyval.l, &(yyvsp[0].d));
for(int i = 0; i < List_Nbr(yyvsp[0].l); i++){
double d;
List_Read(yyvsp[0].l, i, &d);
List_Add(yyval.l, &d);
}
{
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);
yyval.u = Get_ColorForString(ColorString, -1, yyvsp[0].c, &flag);

Christophe Geuzaine
committed
if(flag) yymsg(GERROR, "Unknown color '%s'", yyvsp[0].c);
unsigned int (*pColOpt)(int num, int action, unsigned int value);
StringXColor *pColCat;
if(!(pColCat = Get_ColorOptionCategory(yyvsp[-4].c))){

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown color option class '%s'", yyvsp[-4].c);

Christophe Geuzaine
committed
if(!(pColOpt = (unsigned int (*) (int, int, unsigned int))Get_ColorOption(yyvsp[0].c, pColCat))){

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown color option '%s.Color.%s'", yyvsp[-4].c, yyvsp[0].c);
GmshColorTable *ct = Get_ColorTable((int)yyvsp[-3].d);

Christophe Geuzaine
committed
if(!ct)

Christophe Geuzaine
committed
yymsg(GERROR, "View[%d] does not exist", (int)yyvsp[-3].d);
yyval.l = List_Create(256, 10, sizeof(unsigned int));
List_Add(yyval.l, &(yyvsp[0].u));
yyval.c = (char *)Malloc((strlen(yyvsp[-3].c)+strlen(yyvsp[-1].c)+1)*sizeof(char));
strcpy(yyval.c, yyvsp[-3].c);
strcat(yyval.c, yyvsp[-1].c);
Free(yyvsp[-3].c);
Free(yyvsp[-1].c);
yyval.c = (char *)Malloc((strlen(yyvsp[-1].c)+1)*sizeof(char));
int i;
yyval.c[i]='\0';
break;
}
}
char tmpstring[1024];
int i = PrintListOfDouble(yyvsp[-3].c, yyvsp[-1].l, tmpstring);

Christophe Geuzaine
committed
yymsg(GERROR, "Too few arguments in Sprintf");
else if(i > 0){
yymsg(GERROR, "%d extra argument%s in Sprintf", i, (i>1)?"s":"");
}
else{
yyval.c = (char*)Malloc((strlen(tmpstring)+1)*sizeof(char));
strcpy(yyval.c, tmpstring);
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-3].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-3].c);
else{
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-1].c, pStrCat)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option '%s.%s'", yyvsp[-3].c, yyvsp[-1].c);
yyval.c = (char*)Malloc((strlen(str)+1)*sizeof(char));
strcpy(yyval.c, str);
}
}
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-6].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-6].c);
else{
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-1].c, pStrCat)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option '%s[%d].%s'", yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-1].c);
yyval.c = (char*)Malloc((strlen(str)+1)*sizeof(char));
strcpy(yyval.c, str);
}
}
/* the action file gets copied in in place of this dollarsign */
#line 543 "/usr/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
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;
}
/* 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
goto yynewstate;
if (! yyerrstatus)
/* If not already recovering from an error, report this error. */
{
++yynerrs;
yyn = yypact[yystate];
{
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)
{
{
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++;
}
}
}
else
}
else
}
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. */
if (yychar == YYEOF)
#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. */
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;
yyerrpop: /* pop the current state because it cannot handle the error token */
short *ssp1 = yyss - 1;
fprintf (stderr, "Error: state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
#endif
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;
}
if (yyn == YYFINAL)
YYACCEPT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting error token, ");
#endif
*++yyvsp = yylval;
yystate = yyn;
goto yynewstate;
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);
}
void DeleteSymbol(void *a, void *b){
Symbol *s = (Symbol*)a;
Free(s->Name);
List_Delete(s->val);
}
int CompareSymbols (const void *a, const void *b){
}
void InitSymbols(void){
if(Symbol_T){
Tree_Action(Symbol_T, DeleteSymbol);
Tree_Delete(Symbol_T);
}
Symbol_T = Tree_Create(sizeof(Symbol), CompareSymbols);
}
int PrintListOfDouble(char *format, List_T *list, char *buffer){
strncpy(buffer, format, j);
buffer[j]='\0';