Newer
Older

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
case 455:
/* Line 1787 of yacc.c */
#line 5134 "Gmsh.y"

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
case 456:
/* Line 1787 of yacc.c */
#line 5138 "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
}

Christophe Geuzaine
committed
case 457:
/* Line 1787 of yacc.c */
#line 5153 "Gmsh.y"
{
(yyval.l) = List_Create(256, 10, sizeof(unsigned int));
List_Add((yyval.l), &((yyvsp[(1) - (1)].u)));

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
case 458:
/* Line 1787 of yacc.c */
#line 5158 "Gmsh.y"

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
case 459:
/* Line 1787 of yacc.c */
#line 5165 "Gmsh.y"

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
case 460:
/* Line 1787 of yacc.c */
#line 5169 "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
}

Christophe Geuzaine
committed
case 461:
/* Line 1787 of yacc.c */
#line 5182 "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
}

Christophe Geuzaine
committed
case 462:
/* Line 1787 of yacc.c */
#line 5190 "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
}

Christophe Geuzaine
committed
case 463:
/* Line 1787 of yacc.c */
#line 5201 "Gmsh.y"

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
case 464:
/* Line 1787 of yacc.c */
#line 5205 "Gmsh.y"
(yyval.c) = (char *)Malloc(32 * sizeof(char));
strcpy((yyval.c), ctime(&now));
(yyval.c)[strlen((yyval.c)) - 1] = '\0';

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
case 465:
/* Line 1787 of yacc.c */
#line 5213 "Gmsh.y"
{
std::string action = Msg::GetGmshOnelabAction();
(yyval.c) = (char *)Malloc(action.size() + 1);
strcpy((yyval.c), action.c_str());

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
case 466:
/* Line 1787 of yacc.c */
#line 5219 "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
}

Christophe Geuzaine
committed
case 467:
/* Line 1787 of yacc.c */
#line 5227 "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
}

Christophe Geuzaine
committed
case 468:
/* Line 1787 of yacc.c */
#line 5235 "Gmsh.y"

Christophe Geuzaine
committed
{
int size = 1;
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);
}
List_Delete((yyvsp[(3) - (4)].l));

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
case 469:
/* Line 1787 of yacc.c */
#line 5250 "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
}

Christophe Geuzaine
committed
case 470:
/* Line 1787 of yacc.c */
#line 5264 "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
}

Christophe Geuzaine
committed
case 471:
/* Line 1787 of yacc.c */
#line 5278 "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
}

Christophe Geuzaine
committed
case 472:
/* Line 1787 of yacc.c */
#line 5290 "Gmsh.y"
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
}

Christophe Geuzaine
committed
case 473:
/* Line 1787 of yacc.c */
#line 5306 "Gmsh.y"
if((yyvsp[(3) - (8)].d)){
(yyval.c) = (yyvsp[(5) - (8)].c);
Free((yyvsp[(7) - (8)].c));
}
else{
(yyval.c) = (yyvsp[(7) - (8)].c);
Free((yyvsp[(5) - (8)].c));
}

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
case 474:
/* Line 1787 of yacc.c */
#line 5317 "Gmsh.y"
{
(yyval.c) = (yyvsp[(3) - (4)].c);
}
break;
case 475:
/* Line 1787 of yacc.c */
#line 5321 "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
}

Christophe Geuzaine
committed
/* Line 1787 of yacc.c */
{
std::string tmp = FixRelativePath(gmsh_yyname, (yyvsp[(3) - (4)].c));
(yyval.c) = (char*)Malloc((tmp.size() + 1) * sizeof(char));
strcpy((yyval.c), tmp.c_str());
Free((yyvsp[(3) - (4)].c));

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
/* Line 1787 of yacc.c */

Christophe Geuzaine
committed
{ floatOptions.clear(); charOptions.clear(); }

Christophe Geuzaine
committed
/* Line 1787 of yacc.c */

Christophe Geuzaine
committed
std::string val((yyvsp[(3) - (6)].c));
Msg::ExchangeOnelabParameter("", val, floatOptions, charOptions);
(yyval.c) = (char*)Malloc((val.size() + 1) * sizeof(char));
strcpy((yyval.c), val.c_str());
Free((yyvsp[(3) - (6)].c));

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
/* Line 1787 of yacc.c */
{
(yyval.l) = List_Create(20,20,sizeof(char*));
List_Add((yyval.l), &((yyvsp[(1) - (1)].c)));

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
/* Line 1787 of yacc.c */

Christophe Geuzaine
committed
{ List_Add((yyval.l), &((yyvsp[(3) - (3)].c))); }

Christophe Geuzaine
committed
/* Line 1787 of yacc.c */

Christophe Geuzaine
committed
{
char tmpstr[256];
sprintf(tmpstr, "_%d", (int)(yyvsp[(4) - (5)].d));
(yyval.c) = (char *)Malloc((strlen((yyvsp[(1) - (5)].c))+strlen(tmpstr)+1)*sizeof(char));
strcpy((yyval.c), (yyvsp[(1) - (5)].c)); strcat((yyval.c), tmpstr);
Free((yyvsp[(1) - (5)].c));

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
/* Line 1787 of yacc.c */

Christophe Geuzaine
committed
{
char tmpstr[256];
sprintf(tmpstr, "_%d", (int)(yyvsp[(4) - (5)].d));
(yyval.c) = (char *)Malloc((strlen((yyvsp[(1) - (5)].c))+strlen(tmpstr)+1)*sizeof(char)) ;
strcpy((yyval.c), (yyvsp[(1) - (5)].c)) ; strcat((yyval.c), tmpstr) ;
Free((yyvsp[(1) - (5)].c));

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
/* Line 1787 of yacc.c */

Christophe Geuzaine
committed
{ (yyval.c) = (yyvsp[(1) - (1)].c); }

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
/* Line 1787 of yacc.c */

Christophe Geuzaine
committed
{ (yyval.c) = (yyvsp[(1) - (1)].c); }

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
/* Line 1787 of yacc.c */

Christophe Geuzaine
committed
/* User semantic actions sometimes alter yychar, and that requires
that yytoken be updated with the new translation. We take the
approach of translating immediately before every use of yytoken.
One alternative is translating here after every semantic action,
but that translation would be missed if the semantic action invokes
YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
incorrect destructor might then be invoked immediately. In the
case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */
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:

Christophe Geuzaine
committed
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
#else

Christophe Geuzaine
committed
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
yyssp, yytoken)

Christophe Geuzaine
committed
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
char const *yymsgp = YY_("syntax error");
int yysyntax_error_status;
yysyntax_error_status = YYSYNTAX_ERROR;
if (yysyntax_error_status == 0)
yymsgp = yymsg;
else if (yysyntax_error_status == 1)
{
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
if (!yymsg)
{
yymsg = yymsgbuf;
yymsg_alloc = sizeof yymsgbuf;
yysyntax_error_status = 2;
}
else
{
yysyntax_error_status = YYSYNTAX_ERROR;
yymsgp = yymsg;
}
}
yyerror (yymsgp);
if (yysyntax_error_status == 2)
goto yyexhaustedlab;

Christophe Geuzaine
committed
# undef YYSYNTAX_ERROR
if (yyerrstatus == 3)
{

Christophe Geuzaine
committed
/* 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;
}
{
yydestruct ("Error: discarding",
yytoken, &yylval);
yychar = YYEMPTY;
}

Christophe Geuzaine
committed
/* Else will try to reuse lookahead 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. */

Christophe Geuzaine
committed
if (!yypact_value_is_default (yyn))
{
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);
}

Christophe Geuzaine
committed
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

Christophe Geuzaine
committed
YY_IGNORE_MAYBE_UNINITIALIZED_END
/* 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;

Christophe Geuzaine
committed
#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyexhaustedlab:
yyerror (YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */

Christophe Geuzaine
committed
if (yychar != YYEMPTY)
{
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
yytoken = YYTRANSLATE (yychar);
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 2050 of yacc.c */
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
void assignVariable(const std::string &name, int index, int assignType,
double value)
{
if(!gmsh_yysymbols.count(name)){
if(!assignType){
gmsh_yysymbol &s(gmsh_yysymbols[name]);
s.list = true;
s.value.resize(index + 1, 0.);
s.value[index] = value;
}
else
yymsg(0, "Unknown variable '%s'", name.c_str());
}
else{
gmsh_yysymbol &s(gmsh_yysymbols[name]);
if(s.list){
if((int)s.value.size() < index + 1) s.value.resize(index + 1, 0.);
switch(assignType){
case 0 : s.value[index] = value; break;
case 1 : s.value[index] += value; break;
case 2 : s.value[index] -= value; break;
case 3 : s.value[index] *= value; break;
case 4 :
if(value) s.value[index] /= value;
else yymsg(0, "Division by zero in '%s[%d] /= %g'",
name.c_str(), index, value);
break;
}
}
else
yymsg(0, "Variable '%s' is not a list", name.c_str());
}
}
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
void assignVariables(const std::string &name, List_T *indices, int assignType,
List_T *values)
{
if(List_Nbr(indices) != List_Nbr(values)){
yymsg(0, "Incompatible array dimensions in affectation");
}
else{
if(!gmsh_yysymbols.count(name)){
if(!assignType){
gmsh_yysymbol &s(gmsh_yysymbols[name]);
s.list = true;
for(int i = 0; i < List_Nbr(indices); i++){
int index = (int)(*(double*)List_Pointer(indices, i));
s.value.resize(index + 1, 0.);
s.value[index] = *(double*)List_Pointer(values, i);
}
}
else
yymsg(0, "Unknown variable '%s'", name.c_str());
}
else{
gmsh_yysymbol &s(gmsh_yysymbols[name]);
if(s.list){
for(int i = 0; i < List_Nbr(indices); i++){
int index = (int)(*(double*)List_Pointer(indices, i));
double d = *(double*)List_Pointer(values, i);
if((int)s.value.size() < index + 1) s.value.resize(index + 1, 0.);
switch(assignType){
case 0 : s.value[index] = d; break;
case 1 : s.value[index] += d; break;
case 2 : s.value[index] -= d; break;
case 3 : s.value[index] *= d; break;
case 4 :
if(d) s.value[index] /= d;
else yymsg(0, "Division by zero in '%s[%d] /= %g'", name.c_str(), index, d);
break;
}
}
}
else
yymsg(0, "Variable '%s' is not a list", name.c_str());
}
}
}
void incrementVariable(const std::string &name, int index, double value)
{
if(!gmsh_yysymbols.count(name))
yymsg(0, "Unknown variable '%s'", name.c_str());
else{
gmsh_yysymbol &s(gmsh_yysymbols[name]);
if(s.list){
if((int)s.value.size() < index + 1) s.value.resize(index + 1, 0.);
s.value[index] += value;
}
else
yymsg(0, "Variable '%s' is not a list", name.c_str());
}
}
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

Christophe Geuzaine
committed
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
void PrintParserSymbols(bool help, std::vector<std::string> &vec)
{
if(help){
vec.push_back("//");
vec.push_back("// Numbers");
vec.push_back("//");
}
for(std::map<std::string, gmsh_yysymbol>::iterator it = gmsh_yysymbols.begin();
it != gmsh_yysymbols.end(); it++){
gmsh_yysymbol s(it->second);
std::ostringstream sstream;
sstream << it->first;
if(s.list){
sstream << "[] = {";
for(unsigned int i = 0; i < s.value.size(); i++){
if(i) sstream << ", ";
sstream << s.value[i];
}
sstream << "}";
}
else
sstream << " = " << s.value[0];
sstream << ";";
vec.push_back(sstream.str());
}
if(help){
vec.push_back("//");
vec.push_back("// Strings");
vec.push_back("//");
}
for(std::map<std::string, std::string>::iterator it = gmsh_yystringsymbols.begin();
it != gmsh_yystringsymbols.end(); it++){
vec.push_back(it->first + " = \"" + it->second + "\";");
}
}
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);
}