Newer
Older

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
case 423:
#line 4696 "Gmsh.y"
(yyval.l) = GetAllEntityNumbers(1);

Christophe Geuzaine
committed
case 424:
#line 4700 "Gmsh.y"
Matti Pellika
committed
{
(yyval.l) = GetAllEntityNumbers(2);
Matti Pellika
committed
break;

Christophe Geuzaine
committed
case 425:
#line 4704 "Gmsh.y"
{
(yyval.l) = GetAllEntityNumbers(3);
;}
break;

Christophe Geuzaine
committed
case 426:
#line 4708 "Gmsh.y"
{
(yyval.l) = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){
double num;
List_Read((yyvsp[(4) - (5)].l), i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_POINT);
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
int nume;
List_Read(p->Entities, j, &nume);
double d = nume;
List_Add((yyval.l), &d);
}
}
else{
std::map<int, std::vector<GEntity*> > groups[4];
GModel::current()->getPhysicalGroups(groups);
std::map<int, std::vector<GEntity*> >::iterator it = groups[0].find((int)num);
if(it != groups[0].end()){
for(unsigned j = 0; j < it->second.size(); j++){
double d = it->second[j]->tag();
List_Add((yyval.l), &d);
}
}
}
}
List_Delete((yyvsp[(4) - (5)].l));

Christophe Geuzaine
committed
case 427:
#line 4737 "Gmsh.y"
{
(yyval.l) = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){
double num;
List_Read((yyvsp[(4) - (5)].l), i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_LINE);
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
int nume;
List_Read(p->Entities, j, &nume);
double d = nume;
List_Add((yyval.l), &d);
}
}
else{
std::map<int, std::vector<GEntity*> > groups[4];
GModel::current()->getPhysicalGroups(groups);
std::map<int, std::vector<GEntity*> >::iterator it = groups[1].find((int)num);
if(it != groups[1].end()){
for(unsigned j = 0; j < it->second.size(); j++){
double d = it->second[j]->tag();
List_Add((yyval.l), &d);
}
}
}
}
List_Delete((yyvsp[(4) - (5)].l));

Christophe Geuzaine
committed
case 428:
#line 4766 "Gmsh.y"
{
(yyval.l) = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){
double num;
List_Read((yyvsp[(4) - (5)].l), i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_SURFACE);
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
int nume;
List_Read(p->Entities, j, &nume);
double d = nume;
List_Add((yyval.l), &d);
}
}
else{
std::map<int, std::vector<GEntity*> > groups[4];
GModel::current()->getPhysicalGroups(groups);
std::map<int, std::vector<GEntity*> >::iterator it = groups[2].find((int)num);
if(it != groups[2].end()){
for(unsigned j = 0; j < it->second.size(); j++){
double d = it->second[j]->tag();
List_Add((yyval.l), &d);
}
}
}
}
List_Delete((yyvsp[(4) - (5)].l));

Christophe Geuzaine
committed
case 429:
#line 4795 "Gmsh.y"
{
(yyval.l) = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){
double num;
List_Read((yyvsp[(4) - (5)].l), i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_VOLUME);
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
int nume;
List_Read(p->Entities, j, &nume);
double d = nume;
List_Add((yyval.l), &d);
}
}
else{
std::map<int, std::vector<GEntity*> > groups[4];
GModel::current()->getPhysicalGroups(groups);
std::map<int, std::vector<GEntity*> >::iterator it = groups[3].find((int)num);
if(it != groups[3].end()){
for(unsigned j = 0; j < it->second.size(); j++){
double d = it->second[j]->tag();
List_Add((yyval.l), &d);
}
}
}
}
List_Delete((yyvsp[(4) - (5)].l));

Christophe Geuzaine
committed
case 430:
#line 4824 "Gmsh.y"
{
(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
committed
case 431:
#line 4834 "Gmsh.y"
{
(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
committed
case 432:
#line 4844 "Gmsh.y"
if(!gmsh_yysymbols.count((yyvsp[(1) - (3)].c)))
yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (3)].c));
else{
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (3)].c)]);
for(unsigned int i = 0; i < s.value.size(); i++)
List_Add((yyval.l), &s.value[i]);
}

Christophe Geuzaine
committed
case 433:
#line 4857 "Gmsh.y"
{
(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));
else{
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (3)].c)]);
for(unsigned int i = 0; i < s.value.size(); i++)
List_Add((yyval.l), &s.value[i]);
}
Free((yyvsp[(1) - (3)].c));

Christophe Geuzaine
committed
case 434:
#line 4869 "Gmsh.y"
{
(yyval.l) = List_Create(2, 1, sizeof(double));
if(!gmsh_yysymbols.count((yyvsp[(3) - (4)].c)))
yymsg(0, "Unknown variable '%s'", (yyvsp[(3) - (4)].c));
else{
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(3) - (4)].c)]);
for(unsigned int i = 0; i < s.value.size(); i++)
List_Add((yyval.l), &s.value[i]);
}
Free((yyvsp[(3) - (4)].c));

Christophe Geuzaine
committed
case 435:
#line 4881 "Gmsh.y"
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));
yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (6)].c), index);
else
Free((yyvsp[(1) - (6)].c));
List_Delete((yyvsp[(4) - (6)].l));

Christophe Geuzaine
committed
case 436:
#line 4900 "Gmsh.y"
{
(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));
else{
gmsh_yysymbol &s(gmsh_yysymbols[(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)s.value.size() < index + 1)
yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (6)].c), index);
else
List_Add((yyval.l), &s.value[index]);
}
}
Free((yyvsp[(1) - (6)].c));
List_Delete((yyvsp[(4) - (6)].l));

Christophe Geuzaine
committed
case 437:
#line 4921 "Gmsh.y"
{
(yyval.l) = List_Create(2, 1, sizeof(double));
List_Add((yyval.l), &((yyvsp[(1) - (1)].d)));

Christophe Geuzaine
committed
case 438:
#line 4926 "Gmsh.y"

Christophe Geuzaine
committed
case 439:
#line 4930 "Gmsh.y"

Christophe Geuzaine
committed
case 440:
#line 4934 "Gmsh.y"
{
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
committed
case 441:
#line 4946 "Gmsh.y"
(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
committed
case 442:
#line 4950 "Gmsh.y"
(yyval.u) = CTX::instance()->packColor((int)(yyvsp[(2) - (7)].d), (int)(yyvsp[(4) - (7)].d), (int)(yyvsp[(6) - (7)].d), 255);

Christophe Geuzaine
committed
case 443:
#line 4962 "Gmsh.y"
(yyval.u) = GetColorForString(-1, (yyvsp[(1) - (1)].c), &flag);
if(flag) yymsg(0, "Unknown color '%s'", (yyvsp[(1) - (1)].c));

Christophe Geuzaine
committed
case 444:
#line 4969 "Gmsh.y"
unsigned int val = 0;
ColorOption(GMSH_GET, (yyvsp[(1) - (5)].c), 0, (yyvsp[(5) - (5)].c), val);
(yyval.u) = val;

Christophe Geuzaine
committed
case 445:
#line 4979 "Gmsh.y"

Christophe Geuzaine
committed
case 446:
#line 4983 "Gmsh.y"
GmshColorTable *ct = GetColorTable((int)(yyvsp[(3) - (6)].d));

Christophe Geuzaine
committed
if(!ct)
yymsg(0, "View[%d] does not exist", (int)(yyvsp[(3) - (6)].d));
List_Add((yyval.l), &ct->table[i]);

Christophe Geuzaine
committed
case 447:
#line 4998 "Gmsh.y"
{
(yyval.l) = List_Create(256, 10, sizeof(unsigned int));
List_Add((yyval.l), &((yyvsp[(1) - (1)].u)));

Christophe Geuzaine
committed
case 448:
#line 5003 "Gmsh.y"

Christophe Geuzaine
committed
case 449:
#line 5010 "Gmsh.y"

Christophe Geuzaine
committed
case 450:
#line 5014 "Gmsh.y"
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
committed
case 451:
#line 5027 "Gmsh.y"
StringOption(GMSH_GET, (yyvsp[(1) - (3)].c), 0, (yyvsp[(3) - (3)].c), out);
(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));

Christophe Geuzaine
committed
case 452:
#line 5035 "Gmsh.y"
StringOption(GMSH_GET, (yyvsp[(1) - (6)].c), (int)(yyvsp[(3) - (6)].d), (yyvsp[(6) - (6)].c), out);
(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));

Christophe Geuzaine
committed
case 453:
#line 5046 "Gmsh.y"

Christophe Geuzaine
committed
case 454:
#line 5050 "Gmsh.y"
(yyval.c) = (char *)Malloc(32 * sizeof(char));
strcpy((yyval.c), ctime(&now));
(yyval.c)[strlen((yyval.c)) - 1] = '\0';

Christophe Geuzaine
committed
case 455:
#line 5058 "Gmsh.y"
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));

Christophe Geuzaine
committed
case 456:
#line 5066 "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));

Christophe Geuzaine
committed
case 457:
#line 5074 "Gmsh.y"
(yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (6)].c)) + strlen((yyvsp[(5) - (6)].c)) + 1) * sizeof(char));
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
committed
case 458:
#line 5082 "Gmsh.y"
(yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (4)].c)) + 1) * sizeof(char));
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;
}
if(i <= 0) strcpy((yyval.c), (yyvsp[(3) - (4)].c));
Free((yyvsp[(3) - (4)].c));

Christophe Geuzaine
committed
case 459:
#line 5096 "Gmsh.y"
(yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (4)].c)) + 1) * sizeof(char));
for(i = strlen((yyvsp[(3) - (4)].c)) - 1; i >= 0; i--){
if((yyvsp[(3) - (4)].c)[i] == '/' || (yyvsp[(3) - (4)].c)[i] == '\\')
break;
strcpy((yyval.c), (yyvsp[(3) - (4)].c));
strcpy((yyval.c), &(yyvsp[(3) - (4)].c)[i+1]);

Christophe Geuzaine
committed
case 460:
#line 5110 "Gmsh.y"
std::string input = (yyvsp[(3) - (8)].c);
std::string substr_old = (yyvsp[(5) - (8)].c);
std::string substr_new = (yyvsp[(7) - (8)].c);
std::string ret = ReplaceSubString(substr_old, substr_new, input);
(yyval.c) = (char *)Malloc((ret.size() + 1) * sizeof(char));
strcpy((yyval.c), ret.c_str());
Free((yyvsp[(3) - (8)].c));
Free((yyvsp[(5) - (8)].c));
Free((yyvsp[(7) - (8)].c));

Christophe Geuzaine
committed
case 461:
#line 5122 "Gmsh.y"
int size = 0;
for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++)
size += strlen(*(char**)List_Pointer((yyvsp[(3) - (4)].l), i)) + 1;
(yyval.c) = (char*)Malloc(size * sizeof(char));
(yyval.c)[0] = '\0';
for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){
char *s;
List_Read((yyvsp[(3) - (4)].l), i, &s);
strcat((yyval.c), s);
Free(s);
if(i != List_Nbr((yyvsp[(3) - (4)].l)) - 1) strcat((yyval.c), "\n");
}
List_Delete((yyvsp[(3) - (4)].l));

Christophe Geuzaine
committed
case 462:
#line 5139 "Gmsh.y"
int size = 0;
for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++)
size += strlen(*(char**)List_Pointer((yyvsp[(3) - (4)].l), i)) + 1;
(yyval.c) = (char*)Malloc(size * sizeof(char));
(yyval.c)[0] = '\0';
for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){
char *s;
List_Read((yyvsp[(3) - (4)].l), i, &s);
strcat((yyval.c), s);
Free(s);
if(i != List_Nbr((yyvsp[(3) - (4)].l)) - 1) strcat((yyval.c), "\n");
}
List_Delete((yyvsp[(3) - (4)].l));

Christophe Geuzaine
committed
case 463:
#line 5155 "Gmsh.y"
{
(yyval.c) = (yyvsp[(3) - (4)].c);
;}
break;

Christophe Geuzaine
committed
case 464:
#line 5160 "Gmsh.y"
{
(yyval.c) = (yyvsp[(3) - (4)].c);
;}
break;

Christophe Geuzaine
committed
case 465:
#line 5164 "Gmsh.y"
int i = PrintListOfDouble((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].l), tmpstring);
yymsg(0, "Too few arguments in Sprintf");
(yyval.c) = (yyvsp[(3) - (6)].c);
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
committed
case 466:
#line 5184 "Gmsh.y"
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
{
char tmpstring[5000];
int i = PrintListOfDouble((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].l), tmpstring);
if(i < 0){
yymsg(0, "Too few arguments in Sprintf");
(yyval.c) = (yyvsp[(3) - (6)].c);
}
else if(i > 0){
yymsg(0, "%d extra argument%s in Sprintf", i, (i > 1) ? "s" : "");
(yyval.c) = (yyvsp[(3) - (6)].c);
}
else{
(yyval.c) = (char*)Malloc((strlen(tmpstring) + 1) * sizeof(char));
strcpy((yyval.c), tmpstring);
Free((yyvsp[(3) - (6)].c));
}
List_Delete((yyvsp[(5) - (6)].l));
;}
break;

Christophe Geuzaine
committed
case 467:
#line 5206 "Gmsh.y"
{
(yyval.l) = List_Create(20,20,sizeof(char*));
List_Add((yyval.l), &((yyvsp[(1) - (1)].c)));

Christophe Geuzaine
committed
case 468:
#line 5211 "Gmsh.y"
{ List_Add((yyval.l), &((yyvsp[(3) - (3)].c))); ;}

Christophe Geuzaine
committed
#line 10628 "Gmsh.tab.cpp"
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
/* 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 - YYNTOKENS] + *yyssp;
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
goto yynewstate;
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
#else
{
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
{
YYSIZE_T yyalloc = 2 * yysize;
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
yyalloc = YYSTACK_ALLOC_MAXIMUM;
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
if (yymsg)
yymsg_alloc = yyalloc;
else
{
yymsg = yymsgbuf;
yymsg_alloc = sizeof yymsgbuf;
}
}
if (0 < yysize && yysize <= yymsg_alloc)
{
(void) yysyntax_error (yymsg, yystate, yychar);
yyerror (yymsg);
}
else
{
yyerror (YY_("syntax error"));
if (yysize != 0)
goto yyexhaustedlab;
}
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse look-ahead token after an
error, discard it. */
{
/* Return failure if at end of input. */
if (yychar == YYEOF)
YYABORT;
}
{
yydestruct ("Error: discarding",
yytoken, &yylval);
yychar = YYEMPTY;
}
/* Else will try to reuse look-ahead token after shifting the error
/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
/* Pacify compilers like GCC when the user code never invokes
YYERROR and the label yyerrorlab therefore never appears in user
code. */
if (/*CONSTCOND*/ 0)
goto yyerrorlab;
/* Do not reclaim the symbols of the rule which action triggered
this YYERROR. */
YYPOPSTACK (yylen);
yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
yystate = *yyssp;
goto yyerrlab1;
/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
yyerrlab1:
yyerrstatus = 3; /* Each real token shifted decrements this. */
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
{
yyn = yytable[yyn];
if (0 < yyn)
break;
}
}
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
yystos[yystate], yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the error token. */
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
yystate = yyn;
goto yynewstate;
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyexhaustedlab:
yyerror (YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */
if (yychar != YYEOF && yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
YY_STACK_PRINT (yyss, yyssp);
while (yyssp != yyss)
yystos[*yyssp], yyvsp);
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
#if YYERROR_VERBOSE
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
#endif
/* Make sure YYID is used. */
return YYID (yyresult);
}

Christophe Geuzaine
committed
#line 5214 "Gmsh.y"
int PrintListOfDouble(char *format, List_T *list, char *buffer)
{
// if format does not contain formatting characters, dump the list (useful for
// quick debugging of lists)
int numFormats = 0;

Christophe Geuzaine
committed
for(unsigned int i = 0; i < strlen(format); i++)
if(format[i] == '%') numFormats++;
if(!numFormats){
strcpy(buffer, format);
for(int i = 0; i < List_Nbr(list); i++){
double d;
List_Read(list, i, &d);
char tmp[256];
strcat(buffer, tmp);
}
return 0;
}
char tmp1[256], tmp2[256];
int j = 0, k = 0;
buffer[j] = '\0';
while(j < (int)strlen(format) && format[j] != '%') j++;
buffer[j] = '\0';
strcat(buffer, "%");
j++;
strncpy(tmp1, &(format[k]), j-k);
tmp1[j-k] = '\0';
strcat(buffer, tmp2);
return List_Nbr(list) - i;
}
if(j != (int)strlen(format))
return -1;
return 0;
}

Christophe Geuzaine
committed
fullMatrix<double> ListOfListOfDouble2Matrix(List_T *list)
{
int M = List_Nbr(list);
int N = 0;
for(int i = 0; i < M; i++){
List_T *line = *(List_T**)List_Pointer_Fast(list, i);
N = std::max(N, List_Nbr(line));
}
for(int i = 0; i < M; i++){
List_T *line = *(List_T**)List_Pointer_Fast(list, i);
for(int j = 0; j < List_Nbr(line); j++){
double val;
List_Read(line, j, &val);
}
}
for(int i = 0; i < List_Nbr(list); i++)
List_Delete(*(List_T**)List_Pointer(list, i));
List_Delete(list);
return mat;
}
Msg::Error("'%s', line %d : %s (%s)", gmsh_yyname.c_str(), gmsh_yylineno - 1,
s, gmsh_yytext);
}
void yymsg(int level, const char *fmt, ...)
va_list args;
va_start(args, fmt);
vsprintf(tmp, fmt, args);
va_end(args);

Christophe Geuzaine
committed
if(level == 0){
Msg::Error("'%s', line %d : %s", gmsh_yyname.c_str(), gmsh_yylineno - 1, tmp);
gmsh_yyerrorstate++;
}
else
Msg::Warning("'%s', line %d : %s", gmsh_yyname.c_str(), gmsh_yylineno - 1, tmp);
}