Newer
Older

Christophe Geuzaine
committed
case 417:

Christophe Geuzaine
committed
case 418:
{
(yyval.l) = (yyvsp[(3) - (4)].l);
for(int i = 0; i < List_Nbr((yyval.l)); i++){
double *pd = (double*)List_Pointer((yyval.l), i);
(*pd) = - (*pd);

Christophe Geuzaine
committed
case 419:
{
(yyval.l) = (yyvsp[(4) - (5)].l);
for(int i = 0; i < List_Nbr((yyval.l)); i++){
double *pd = (double*)List_Pointer((yyval.l), i);
(*pd) *= (yyvsp[(1) - (5)].d);

Christophe Geuzaine
committed
case 420:
break;

Christophe Geuzaine
committed
case 421:
{
if(!strcmp((yyvsp[(1) - (1)].c), "*") || !strcmp((yyvsp[(1) - (1)].c), "all"))
(yyval.l) = 0;
else{
yyerror("Unknown special string for list replacement");
(yyval.l) = List_Create(2, 1, sizeof(double));
}
break;

Christophe Geuzaine
committed
case 422:
{
(yyval.l) = (yyvsp[(2) - (2)].l);
for(int i = 0; i < List_Nbr((yyval.l)); i++){
double *pd = (double*)List_Pointer((yyval.l), i);
(*pd) = - (*pd);

Christophe Geuzaine
committed
case 423:
{
(yyval.l) = (yyvsp[(3) - (3)].l);
for(int i = 0; i < List_Nbr((yyval.l)); i++){
double *pd = (double*)List_Pointer((yyval.l), i);
(*pd) *= (yyvsp[(1) - (3)].d);

Christophe Geuzaine
committed
case 424:
{
(yyval.l) = List_Create(2, 1, sizeof(double));
for(double d = (yyvsp[(1) - (3)].d); ((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d <= (yyvsp[(3) - (3)].d)) : (d >= (yyvsp[(3) - (3)].d));
((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d += 1.) : (d -= 1.))
List_Add((yyval.l), &d);

Christophe Geuzaine
committed
case 425:
Matti Pellika
committed
if(!(yyvsp[(5) - (5)].d)){ //|| ($1 < $3 && $5 < 0) || ($1 > $3 && $5 > 0)
yymsg(0, "Wrong increment in '%g:%g:%g'", (yyvsp[(1) - (5)].d), (yyvsp[(3) - (5)].d), (yyvsp[(5) - (5)].d));
for(double d = (yyvsp[(1) - (5)].d); ((yyvsp[(5) - (5)].d) > 0) ? (d <= (yyvsp[(3) - (5)].d)) : (d >= (yyvsp[(3) - (5)].d)); d += (yyvsp[(5) - (5)].d))
List_Add((yyval.l), &d);

Christophe Geuzaine
committed
case 426:
// 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
yymsg(0, "Unknown point '%d'", (int)(yyvsp[(3) - (4)].d));
double d = 0.0;
List_Add((yyval.l), &d);
List_Add((yyval.l), &d);
List_Add((yyval.l), &d);
List_Add((yyval.l), &v->Pos.X);
List_Add((yyval.l), &v->Pos.Y);
List_Add((yyval.l), &v->Pos.Z);

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
case 427:

Christophe Geuzaine
committed
{
(yyval.l) = GetAllEntityNumbers(0);

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
case 428:
(yyval.l) = GetAllEntityNumbers(1);

Christophe Geuzaine
committed
case 429:
Matti Pellika
committed
{
(yyval.l) = GetAllEntityNumbers(2);
Matti Pellika
committed
break;

Christophe Geuzaine
committed
case 430:
{
(yyval.l) = GetAllEntityNumbers(3);
;}
break;

Christophe Geuzaine
committed
case 431:
{
(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 432:
{
(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 433:
{
(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 434:
{
(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 435:
{
(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 436:
{
(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 437:
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 438:
{
(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 439:
{
(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 440:
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 441:
{
(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 442:
{
(yyval.l) = List_Create(2, 1, sizeof(double));
List_Add((yyval.l), &((yyvsp[(1) - (1)].d)));

Christophe Geuzaine
committed
case 443:

Christophe Geuzaine
committed
case 444:

Christophe Geuzaine
committed
case 445:
{
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 446:
(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 447:
(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 448:
(yyval.u) = GetColorForString(-1, (yyvsp[(1) - (1)].c), &flag);
if(flag) yymsg(0, "Unknown color '%s'", (yyvsp[(1) - (1)].c));

Christophe Geuzaine
committed
case 449:
unsigned int val = 0;
ColorOption(GMSH_GET, (yyvsp[(1) - (5)].c), 0, (yyvsp[(5) - (5)].c), val);
(yyval.u) = val;

Christophe Geuzaine
committed
case 450:

Christophe Geuzaine
committed
case 451:
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 452:
{
(yyval.l) = List_Create(256, 10, sizeof(unsigned int));
List_Add((yyval.l), &((yyvsp[(1) - (1)].u)));

Christophe Geuzaine
committed
case 453:

Christophe Geuzaine
committed
case 454:

Christophe Geuzaine
committed
case 455:
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 456:
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 457:
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 458:

Christophe Geuzaine
committed
case 459:
(yyval.c) = (char *)Malloc(32 * sizeof(char));
strcpy((yyval.c), ctime(&now));
(yyval.c)[strlen((yyval.c)) - 1] = '\0';

Christophe Geuzaine
committed
case 460:
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 461:
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 462:
(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 463:

Christophe Geuzaine
committed
{
(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));
;}
break;

Christophe Geuzaine
committed
case 464:
(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 465:
(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 466:
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 467:
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 468:
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 469:
{
(yyval.c) = (yyvsp[(3) - (4)].c);
;}
break;

Christophe Geuzaine
committed
case 470:
{
(yyval.c) = (yyvsp[(3) - (4)].c);
;}
break;

Christophe Geuzaine
committed
case 471:
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 472:
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
{
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 473:
{
(yyval.l) = List_Create(20,20,sizeof(char*));
List_Add((yyval.l), &((yyvsp[(1) - (1)].c)));

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

Christophe Geuzaine
committed
case 475:

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));
;}
break;

Christophe Geuzaine
committed
case 476:

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));
;}
break;

Christophe Geuzaine
committed
case 477:

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

Christophe Geuzaine
committed
case 478:

Christophe Geuzaine
committed
{ (yyval.c) = (yyvsp[(1) - (1)].c); ;}
break;
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
{
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
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);