diff --git a/pbx/ael/ael.tab.c b/pbx/ael/ael.tab.c index 6f4d17566cf02b8a7759984fdeff7f9ff4bf309b..86c7763555609ff590594624467b9161c3246958 100644 --- a/pbx/ael/ael.tab.c +++ b/pbx/ael/ael.tab.c @@ -562,14 +562,14 @@ static const unsigned short int yyrline[] = 288, 289, 292, 295, 295, 300, 300, 305, 321, 341, 342, 348, 349, 354, 362, 363, 367, 373, 373, 378, 379, 379, 382, 383, 384, 385, 386, 387, 385, 390, - 390, 393, 394, 395, 396, 397, 399, 399, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 444, 445, - 450, 455, 460, 465, 470, 477, 480, 483, 488, 493, - 498, 505, 505, 508, 511, 511, 520, 526, 529, 530, - 531, 532, 535, 536, 541, 542, 543, 544, 545, 546, - 549, 550, 555, 556, 559, 560, 563, 564, 567, 568, - 569, 572, 573, 589, 602, 603, 618, 631, 634, 635, - 638, 641 + 390, 393, 394, 395, 396, 397, 400, 400, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 445, 446, + 451, 456, 461, 466, 471, 478, 481, 484, 489, 494, + 499, 506, 506, 509, 512, 512, 522, 528, 531, 532, + 533, 534, 537, 538, 543, 544, 545, 546, 547, 548, + 551, 552, 557, 558, 561, 562, 565, 566, 569, 570, + 571, 574, 575, 591, 604, 605, 620, 633, 636, 637, + 640, 643 }; #endif @@ -2365,109 +2365,110 @@ yyreduce: case 85: #line 397 "ael.y" - { (yyval.pval)= npval(PV_APPLICATION_CALL,(yylsp[-1]).first_line,(yylsp[0]).last_line, (yylsp[-1]).first_column, (yylsp[0]).last_column); - (yyval.pval)->u1.str = (yyvsp[-1].str);;} + { + (yyval.pval)= npval(PV_APPLICATION_CALL,(yylsp[-1]).first_line,(yylsp[0]).last_line, (yylsp[-1]).first_column, (yylsp[0]).last_column); + (yyval.pval)->u1.str = (yyvsp[-1].str);;} break; case 86: -#line 399 "ael.y" +#line 400 "ael.y" {reset_semicount(parseio->scanner);;} break; case 87: -#line 399 "ael.y" +#line 400 "ael.y" { - char *bufx; - int tot=0; - pval *pptr; - (yyval.pval) = npval(PV_VARDEC,(yylsp[-4]).first_line,(yylsp[0]).last_line, (yylsp[-4]).first_column, (yylsp[0]).last_column); - (yyval.pval)->u2.val=(yyvsp[-1].str); - /* rebuild the original string-- this is not an app call, it's an unwrapped vardec, with a func call on the LHS */ - /* string to big to fit in the buffer? */ - tot+=strlen((yyvsp[-4].pval)->u1.str); - for(pptr=(yyvsp[-4].pval)->u2.arglist;pptr;pptr=pptr->next) { - tot+=strlen(pptr->u1.str); - tot++; /* for a sep like a comma */ - } - tot+=4; /* for safety */ - bufx = (char *)malloc(tot); - strcpy(bufx,(yyvsp[-4].pval)->u1.str); - strcat(bufx,"("); - /* XXX need to advance the pointer or the loop is very inefficient */ - for (pptr=(yyvsp[-4].pval)->u2.arglist;pptr;pptr=pptr->next) { - if ( pptr != (yyvsp[-4].pval)->u2.arglist ) - strcat(bufx,","); - strcat(bufx,pptr->u1.str); - } - strcat(bufx,")"); + char *bufx; + int tot=0; + pval *pptr; + (yyval.pval) = npval(PV_VARDEC,(yylsp[-4]).first_line,(yylsp[0]).last_line, (yylsp[-4]).first_column, (yylsp[0]).last_column); + (yyval.pval)->u2.val=(yyvsp[-1].str); + /* rebuild the original string-- this is not an app call, it's an unwrapped vardec, with a func call on the LHS */ + /* string to big to fit in the buffer? */ + tot+=strlen((yyvsp[-4].pval)->u1.str); + for(pptr=(yyvsp[-4].pval)->u2.arglist;pptr;pptr=pptr->next) { + tot+=strlen(pptr->u1.str); + tot++; /* for a sep like a comma */ + } + tot+=4; /* for safety */ + bufx = (char *)malloc(tot); + strcpy(bufx,(yyvsp[-4].pval)->u1.str); + strcat(bufx,"("); + /* XXX need to advance the pointer or the loop is very inefficient */ + for (pptr=(yyvsp[-4].pval)->u2.arglist;pptr;pptr=pptr->next) { + if ( pptr != (yyvsp[-4].pval)->u2.arglist ) + strcat(bufx,","); + strcat(bufx,pptr->u1.str); + } + strcat(bufx,")"); #ifdef AAL_ARGCHECK - if ( !ael_is_funcname((yyvsp[-4].pval)->u1.str) ) - ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Function call? The name %s is not in my internal list of function names\n", - my_file, (yylsp[-4]).first_line, (yylsp[-4]).first_column, (yylsp[-4]).last_column, (yyvsp[-4].pval)->u1.str); + if ( !ael_is_funcname((yyvsp[-4].pval)->u1.str) ) + ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Function call? The name %s is not in my internal list of function names\n", + my_file, (yylsp[-4]).first_line, (yylsp[-4]).first_column, (yylsp[-4]).last_column, (yyvsp[-4].pval)->u1.str); #endif - (yyval.pval)->u1.str = bufx; - destroy_pval((yyvsp[-4].pval)); /* the app call it is not, get rid of that chain */ - prev_word = 0; - ;} + (yyval.pval)->u1.str = bufx; + destroy_pval((yyvsp[-4].pval)); /* the app call it is not, get rid of that chain */ + prev_word = 0; + ;} break; case 88: -#line 432 "ael.y" +#line 433 "ael.y" { (yyval.pval) = npval(PV_BREAK,(yylsp[-1]).first_line,(yylsp[0]).last_line, (yylsp[-1]).first_column, (yylsp[0]).last_column);;} break; case 89: -#line 433 "ael.y" +#line 434 "ael.y" {(yyval.pval) = npval(PV_RETURN,(yylsp[-1]).first_line,(yylsp[0]).last_line, (yylsp[-1]).first_column, (yylsp[0]).last_column);;} break; case 90: -#line 434 "ael.y" +#line 435 "ael.y" {(yyval.pval) = npval(PV_CONTINUE,(yylsp[-1]).first_line,(yylsp[0]).last_line, (yylsp[-1]).first_column, (yylsp[0]).last_column);;} break; case 91: -#line 435 "ael.y" +#line 436 "ael.y" {(yyval.pval)=(yyvsp[-1].pval); (yyval.pval)->u2.statements = (yyvsp[0].pval);(yyval.pval)->endline = (yylsp[0]).last_line; (yyval.pval)->endcol = (yylsp[0]).last_column;;} break; case 92: -#line 436 "ael.y" +#line 437 "ael.y" {(yyval.pval)=(yyvsp[-3].pval); (yyval.pval)->u2.statements = (yyvsp[-2].pval);(yyval.pval)->endline = (yylsp[-2]).last_line; (yyval.pval)->endcol = (yylsp[-2]).last_column; (yyval.pval)->u3.else_statements = (yyvsp[0].pval);;} break; case 93: -#line 437 "ael.y" +#line 438 "ael.y" {(yyval.pval)=(yyvsp[-1].pval); (yyval.pval)->u2.statements = (yyvsp[0].pval);(yyval.pval)->endline = (yylsp[0]).last_line; (yyval.pval)->endcol = (yylsp[0]).last_column;;} break; case 94: -#line 438 "ael.y" +#line 439 "ael.y" {(yyval.pval)=(yyvsp[-3].pval); (yyval.pval)->u2.statements = (yyvsp[-2].pval);(yyval.pval)->endline = (yylsp[-2]).last_line; (yyval.pval)->endcol = (yylsp[-2]).last_column; (yyval.pval)->u3.else_statements = (yyvsp[0].pval);;} break; case 95: -#line 439 "ael.y" +#line 440 "ael.y" {(yyval.pval)=(yyvsp[-1].pval); (yyval.pval)->u2.statements = (yyvsp[0].pval);(yyval.pval)->endline = (yylsp[0]).last_line; (yyval.pval)->endcol = (yylsp[0]).last_column;;} break; case 96: -#line 440 "ael.y" +#line 441 "ael.y" {(yyval.pval)=(yyvsp[-3].pval); (yyval.pval)->u2.statements = (yyvsp[-2].pval);(yyval.pval)->endline = (yylsp[-2]).last_line; (yyval.pval)->endcol = (yylsp[-2]).last_column; (yyval.pval)->u3.else_statements = (yyvsp[0].pval);;} break; case 97: -#line 441 "ael.y" +#line 442 "ael.y" { (yyval.pval)=0; ;} break; case 98: -#line 444 "ael.y" +#line 445 "ael.y" { (yyval.pval) = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.str = (yyvsp[0].str);;} break; case 99: -#line 445 "ael.y" +#line 446 "ael.y" { (yyval.pval)=npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); (yyval.pval)->u1.str = (yyvsp[-2].str); @@ -2476,7 +2477,7 @@ yyreduce: break; case 100: -#line 450 "ael.y" +#line 451 "ael.y" { (yyval.pval)=npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); (yyval.pval)->u1.str = (yyvsp[-2].str); @@ -2485,115 +2486,116 @@ yyreduce: break; case 101: -#line 455 "ael.y" +#line 456 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[-4]).first_line,(yylsp[-4]).last_line, (yylsp[-4]).first_column, (yylsp[-4]).last_column); - (yyval.pval)->u1.str = (yyvsp[-4].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); - (yyval.pval)->next->u1.str = (yyvsp[-2].str); - (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->next->u1.str = (yyvsp[0].str); ;} + (yyval.pval)->u1.str = (yyvsp[-4].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); + (yyval.pval)->next->u1.str = (yyvsp[-2].str); + (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->next->u1.str = (yyvsp[0].str); ;} break; case 102: -#line 460 "ael.y" +#line 461 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[-4]).first_line,(yylsp[-4]).last_line, (yylsp[-4]).first_column, (yylsp[-4]).last_column); - (yyval.pval)->u1.str = (yyvsp[-4].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); - (yyval.pval)->next->u1.str = (yyvsp[-2].str); - (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->next->u1.str = (yyvsp[0].str); ;} + (yyval.pval)->u1.str = (yyvsp[-4].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); + (yyval.pval)->next->u1.str = (yyvsp[-2].str); + (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->next->u1.str = (yyvsp[0].str); ;} break; case 103: -#line 465 "ael.y" +#line 466 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[-4]).first_line,(yylsp[-4]).last_line, (yylsp[-4]).first_column, (yylsp[-4]).last_column); - (yyval.pval)->u1.str = strdup("default"); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); - (yyval.pval)->next->u1.str = (yyvsp[-2].str); - (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->next->u1.str = (yyvsp[0].str); ;} + (yyval.pval)->u1.str = strdup("default"); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); + (yyval.pval)->next->u1.str = (yyvsp[-2].str); + (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->next->u1.str = (yyvsp[0].str); ;} break; case 104: -#line 470 "ael.y" +#line 471 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[-4]).first_line,(yylsp[-4]).last_line, (yylsp[-4]).first_column, (yylsp[-4]).last_column); - (yyval.pval)->u1.str = strdup("default"); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); - (yyval.pval)->next->u1.str = (yyvsp[-2].str); - (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->next->u1.str = (yyvsp[0].str); ;} + (yyval.pval)->u1.str = strdup("default"); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); + (yyval.pval)->next->u1.str = (yyvsp[-2].str); + (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->next->u1.str = (yyvsp[0].str); ;} break; case 105: -#line 477 "ael.y" +#line 478 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->u1.str = (yyvsp[0].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->u1.str = strdup("1");;} + (yyval.pval)->u1.str = (yyvsp[0].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->u1.str = strdup("1");;} break; case 106: -#line 480 "ael.y" +#line 481 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); - (yyval.pval)->u1.str = (yyvsp[-2].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->u1.str = (yyvsp[0].str);;} + (yyval.pval)->u1.str = (yyvsp[-2].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->u1.str = (yyvsp[0].str);;} break; case 107: -#line 483 "ael.y" +#line 484 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[-4]).first_line,(yylsp[-4]).last_line, (yylsp[-4]).first_column, (yylsp[-4]).last_column); - (yyval.pval)->u1.str = (yyvsp[0].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); - (yyval.pval)->next->u1.str = (yyvsp[-4].str); - (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->next->u1.str = (yyvsp[-2].str); ;} + (yyval.pval)->u1.str = (yyvsp[0].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); + (yyval.pval)->next->u1.str = (yyvsp[-4].str); + (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->next->u1.str = (yyvsp[-2].str); ;} break; case 108: -#line 488 "ael.y" +#line 489 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); - (yyval.pval)->u1.str = (yyvsp[0].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->u1.str = (yyvsp[-2].str); - (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->next->u1.str = strdup("1"); ;} + (yyval.pval)->u1.str = (yyvsp[0].str); (yyval.pval)->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->u1.str = (yyvsp[-2].str); + (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->next->u1.str = strdup("1"); ;} break; case 109: -#line 493 "ael.y" +#line 494 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[-4]).first_line,(yylsp[-4]).last_line, (yylsp[-4]).first_column, (yylsp[-4]).last_column); - (yyval.pval)->u1.str = strdup("default"); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); - (yyval.pval)->next->u1.str = (yyvsp[-4].str); - (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->next->u1.str = (yyvsp[-2].str); ;} + (yyval.pval)->u1.str = strdup("default"); (yyval.pval)->next = npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); + (yyval.pval)->next->u1.str = (yyvsp[-4].str); + (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->next->u1.str = (yyvsp[-2].str); ;} break; case 110: -#line 498 "ael.y" +#line 499 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[-2]).first_line,(yylsp[-2]).last_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column); - (yyval.pval)->u1.str = strdup("default"); (yyval.pval)->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->u1.str = (yyvsp[-2].str); - (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); - (yyval.pval)->next->next->u1.str = strdup("1"); ;} + (yyval.pval)->u1.str = strdup("default"); (yyval.pval)->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->u1.str = (yyvsp[-2].str); + (yyval.pval)->next->next = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); + (yyval.pval)->next->next->u1.str = strdup("1"); ;} break; case 111: -#line 505 "ael.y" +#line 506 "ael.y" {reset_argcount(parseio->scanner);;} break; case 112: -#line 506 "ael.y" +#line 507 "ael.y" {(yyval.pval)= npval(PV_MACRO_CALL,(yylsp[-4]).first_line,(yylsp[-3]).last_line, (yylsp[-4]).first_column, (yylsp[-3]).last_column); - (yyval.pval)->u1.str = (yyvsp[-4].str); (yyval.pval)->u2.arglist = (yyvsp[-1].pval);;} + (yyval.pval)->u1.str = (yyvsp[-4].str); (yyval.pval)->u2.arglist = (yyvsp[-1].pval);;} break; case 113: -#line 508 "ael.y" +#line 509 "ael.y" {(yyval.pval)= npval(PV_MACRO_CALL,(yylsp[-2]).first_line,(yylsp[0]).last_line, (yylsp[-2]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.str = (yyvsp[-2].str); ;} break; case 114: -#line 511 "ael.y" +#line 512 "ael.y" {reset_argcount(parseio->scanner);;} break; case 115: -#line 511 "ael.y" - {if (strcasecmp((yyvsp[-2].str),"goto") == 0) { +#line 512 "ael.y" + { + if (strcasecmp((yyvsp[-2].str),"goto") == 0) { (yyval.pval)= npval(PV_GOTO,(yylsp[-2]).first_line,(yylsp[0]).last_line, (yylsp[-2]).first_column, (yylsp[0]).last_column); free((yyvsp[-2].str)); /* won't be using this */ ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Suggestion: Use the goto statement instead of the Goto() application call in AEL.\n", my_file, (yylsp[-2]).first_line, (yylsp[-2]).first_column, (yylsp[-2]).last_column ); @@ -2603,7 +2605,7 @@ yyreduce: break; case 116: -#line 520 "ael.y" +#line 522 "ael.y" {(yyval.pval) = (yyvsp[-2].pval); if( (yyval.pval)->type == PV_GOTO ) (yyval.pval)->u1.list = (yyvsp[-1].pval); @@ -2613,235 +2615,235 @@ yyreduce: break; case 117: -#line 526 "ael.y" +#line 528 "ael.y" {(yyval.pval)=(yyvsp[-1].pval);(yyval.pval)->endline = (yylsp[0]).last_line; (yyval.pval)->endcol = (yylsp[0]).last_column;;} break; case 118: -#line 529 "ael.y" +#line 531 "ael.y" { (yyval.pval)= npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.str = (yyvsp[0].str);;} break; case 119: -#line 530 "ael.y" +#line 532 "ael.y" { (yyval.pval)= npval(PV_WORD,0/*@1.first_line*/,0/*@1.last_line*/,0/* @1.first_column*/, 0/*@1.last_column*/); (yyval.pval)->u1.str = strdup(""); ;} break; case 120: -#line 531 "ael.y" +#line 533 "ael.y" { pval *z = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); (yyval.pval) = (yyvsp[-2].pval); linku1((yyvsp[-2].pval),z); z->u1.str = (yyvsp[0].str);;} break; case 121: -#line 532 "ael.y" +#line 534 "ael.y" { pval *z = npval(PV_WORD,(yylsp[0]).first_line,(yylsp[0]).last_line, (yylsp[0]).first_column, (yylsp[0]).last_column); (yyval.pval) = (yyvsp[-1].pval); linku1((yyvsp[-1].pval),z); z->u1.str = strdup("");;} break; case 122: -#line 535 "ael.y" +#line 537 "ael.y" {(yyval.pval)=(yyvsp[0].pval);;} break; case 123: -#line 536 "ael.y" +#line 538 "ael.y" { if ( (yyvsp[-1].pval) && (yyvsp[0].pval) ) {(yyval.pval)=(yyvsp[-1].pval); linku1((yyval.pval),(yyvsp[0].pval));} else if ( (yyvsp[-1].pval) ) {(yyval.pval)=(yyvsp[-1].pval);} else if ( (yyvsp[0].pval) ) {(yyval.pval)=(yyvsp[0].pval);} ;} break; case 124: -#line 541 "ael.y" +#line 543 "ael.y" {(yyval.pval) = npval(PV_CASE,(yylsp[-3]).first_line,(yylsp[-1]).last_line, (yylsp[-3]).first_column, (yylsp[-1]).last_column); (yyval.pval)->u1.str = (yyvsp[-2].str); (yyval.pval)->u2.statements = (yyvsp[0].pval);;} break; case 125: -#line 542 "ael.y" +#line 544 "ael.y" {(yyval.pval) = npval(PV_DEFAULT,(yylsp[-2]).first_line,(yylsp[0]).last_line, (yylsp[-2]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.str = 0; (yyval.pval)->u2.statements = (yyvsp[0].pval);;} break; case 126: -#line 543 "ael.y" +#line 545 "ael.y" {(yyval.pval) = npval(PV_PATTERN,(yylsp[-3]).first_line,(yylsp[-1]).last_line, (yylsp[-3]).first_column, (yylsp[-1]).last_column); (yyval.pval)->u1.str = (yyvsp[-2].str); (yyval.pval)->u2.statements = (yyvsp[0].pval);;} break; case 127: -#line 544 "ael.y" +#line 546 "ael.y" {(yyval.pval) = npval(PV_CASE,(yylsp[-2]).first_line,(yylsp[0]).last_line, (yylsp[-2]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.str = (yyvsp[-1].str);;} break; case 128: -#line 545 "ael.y" +#line 547 "ael.y" {(yyval.pval) = npval(PV_DEFAULT,(yylsp[-1]).first_line,(yylsp[0]).last_line, (yylsp[-1]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.str = 0;;} break; case 129: -#line 546 "ael.y" +#line 548 "ael.y" {(yyval.pval) = npval(PV_PATTERN,(yylsp[-2]).first_line,(yylsp[0]).last_line, (yylsp[-2]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.str = (yyvsp[-1].str);;} break; case 130: -#line 549 "ael.y" +#line 551 "ael.y" {(yyval.pval) = (yyvsp[0].pval);;} break; case 131: -#line 550 "ael.y" +#line 552 "ael.y" { if ( (yyvsp[-1].pval) && (yyvsp[0].pval) ) {(yyval.pval)=(yyvsp[-1].pval); linku1((yyval.pval),(yyvsp[0].pval));} else if ( (yyvsp[-1].pval) ) {(yyval.pval)=(yyvsp[-1].pval);} else if ( (yyvsp[0].pval) ) {(yyval.pval)=(yyvsp[0].pval);} ;} break; case 132: -#line 555 "ael.y" +#line 557 "ael.y" {(yyval.pval)=(yyvsp[0].pval);;} break; case 133: -#line 556 "ael.y" +#line 558 "ael.y" {(yyval.pval)=npval(PV_CATCH,(yylsp[-4]).first_line,(yylsp[0]).last_line, (yylsp[-4]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.str = (yyvsp[-3].str); (yyval.pval)->u2.statements = (yyvsp[-1].pval);;} break; case 134: -#line 559 "ael.y" +#line 561 "ael.y" {(yyval.pval)= npval(PV_SWITCHES,(yylsp[-3]).first_line,(yylsp[0]).last_line, (yylsp[-3]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.list = (yyvsp[-1].pval); ;} break; case 135: -#line 560 "ael.y" +#line 562 "ael.y" {(yyval.pval)= npval(PV_SWITCHES,(yylsp[-2]).first_line,(yylsp[0]).last_line, (yylsp[-2]).first_column, (yylsp[0]).last_column);;} break; case 136: -#line 563 "ael.y" +#line 565 "ael.y" {(yyval.pval)= npval(PV_ESWITCHES,(yylsp[-3]).first_line,(yylsp[0]).last_line, (yylsp[-3]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.list = (yyvsp[-1].pval); ;} break; case 137: -#line 564 "ael.y" +#line 566 "ael.y" {(yyval.pval)= npval(PV_ESWITCHES,(yylsp[-2]).first_line,(yylsp[0]).last_line, (yylsp[-2]).first_column, (yylsp[0]).last_column); ;} break; case 138: -#line 567 "ael.y" +#line 569 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[0]).last_line, (yylsp[-1]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.str = (yyvsp[-1].str);;} break; case 139: -#line 568 "ael.y" +#line 570 "ael.y" {pval *z = npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[0]).last_line, (yylsp[-1]).first_column, (yylsp[0]).last_column); (yyval.pval)=(yyvsp[-2].pval); z->u1.str = (yyvsp[-1].str); linku1((yyval.pval),z); ;} break; case 140: -#line 569 "ael.y" +#line 571 "ael.y" {(yyval.pval)=(yyvsp[-1].pval);;} break; case 141: -#line 572 "ael.y" +#line 574 "ael.y" {(yyval.pval)=npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[0]).last_line, (yylsp[-1]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.str = (yyvsp[-1].str);;} break; case 142: -#line 573 "ael.y" +#line 575 "ael.y" { - (yyval.pval)=npval(PV_WORD,(yylsp[-13]).first_line,(yylsp[-12]).last_line, (yylsp[-13]).first_column, (yylsp[-12]).last_column); - (yyval.pval)->u1.str = (yyvsp[-13].str); - (yyval.pval)->u2.arglist = npval(PV_WORD,(yylsp[-11]).first_line,(yylsp[-7]).last_line, (yylsp[-11]).first_column, (yylsp[-7]).last_column); - asprintf( &((yyval.pval)->u2.arglist->u1.str), "%s:%s:%s", (yyvsp[-11].str), (yyvsp[-9].str), (yyvsp[-7].str)); - free((yyvsp[-11].str)); - free((yyvsp[-9].str)); - free((yyvsp[-7].str)); - (yyval.pval)->u2.arglist->next = npval(PV_WORD,(yylsp[-5]).first_line,(yylsp[-5]).last_line, (yylsp[-5]).first_column, (yylsp[-5]).last_column); - (yyval.pval)->u2.arglist->next->u1.str = (yyvsp[-5].str); - (yyval.pval)->u2.arglist->next->next = npval(PV_WORD,(yylsp[-3]).first_line,(yylsp[-3]).last_line, (yylsp[-3]).first_column, (yylsp[-3]).last_column); - (yyval.pval)->u2.arglist->next->next->u1.str = (yyvsp[-3].str); - (yyval.pval)->u2.arglist->next->next->next = npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[-1]).last_line, (yylsp[-1]).first_column, (yylsp[-1]).last_column); - (yyval.pval)->u2.arglist->next->next->next->u1.str = (yyvsp[-1].str); - prev_word=0; - ;} + (yyval.pval)=npval(PV_WORD,(yylsp[-13]).first_line,(yylsp[-12]).last_line, (yylsp[-13]).first_column, (yylsp[-12]).last_column); + (yyval.pval)->u1.str = (yyvsp[-13].str); + (yyval.pval)->u2.arglist = npval(PV_WORD,(yylsp[-11]).first_line,(yylsp[-7]).last_line, (yylsp[-11]).first_column, (yylsp[-7]).last_column); + asprintf( &((yyval.pval)->u2.arglist->u1.str), "%s:%s:%s", (yyvsp[-11].str), (yyvsp[-9].str), (yyvsp[-7].str)); + free((yyvsp[-11].str)); + free((yyvsp[-9].str)); + free((yyvsp[-7].str)); + (yyval.pval)->u2.arglist->next = npval(PV_WORD,(yylsp[-5]).first_line,(yylsp[-5]).last_line, (yylsp[-5]).first_column, (yylsp[-5]).last_column); + (yyval.pval)->u2.arglist->next->u1.str = (yyvsp[-5].str); + (yyval.pval)->u2.arglist->next->next = npval(PV_WORD,(yylsp[-3]).first_line,(yylsp[-3]).last_line, (yylsp[-3]).first_column, (yylsp[-3]).last_column); + (yyval.pval)->u2.arglist->next->next->u1.str = (yyvsp[-3].str); + (yyval.pval)->u2.arglist->next->next->next = npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[-1]).last_line, (yylsp[-1]).first_column, (yylsp[-1]).last_column); + (yyval.pval)->u2.arglist->next->next->next->u1.str = (yyvsp[-1].str); + prev_word=0; + ;} break; case 143: -#line 589 "ael.y" +#line 591 "ael.y" { - (yyval.pval)=npval(PV_WORD,(yylsp[-9]).first_line,(yylsp[-8]).last_line, (yylsp[-9]).first_column, (yylsp[-8]).last_column); - (yyval.pval)->u1.str = (yyvsp[-9].str); - (yyval.pval)->u2.arglist = npval(PV_WORD,(yylsp[-7]).first_line,(yylsp[-7]).last_line, (yylsp[-7]).first_column, (yylsp[-7]).last_column); - (yyval.pval)->u2.arglist->u1.str = (yyvsp[-7].str); - (yyval.pval)->u2.arglist->next = npval(PV_WORD,(yylsp[-5]).first_line,(yylsp[-5]).last_line, (yylsp[-5]).first_column, (yylsp[-5]).last_column); - (yyval.pval)->u2.arglist->next->u1.str = (yyvsp[-5].str); - (yyval.pval)->u2.arglist->next->next = npval(PV_WORD,(yylsp[-3]).first_line,(yylsp[-3]).last_line, (yylsp[-3]).first_column, (yylsp[-3]).last_column); - (yyval.pval)->u2.arglist->next->next->u1.str = (yyvsp[-3].str); - (yyval.pval)->u2.arglist->next->next->next = npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[-1]).last_line, (yylsp[-1]).first_column, (yylsp[-1]).last_column); - (yyval.pval)->u2.arglist->next->next->next->u1.str = (yyvsp[-1].str); - prev_word=0; - ;} + (yyval.pval)=npval(PV_WORD,(yylsp[-9]).first_line,(yylsp[-8]).last_line, (yylsp[-9]).first_column, (yylsp[-8]).last_column); + (yyval.pval)->u1.str = (yyvsp[-9].str); + (yyval.pval)->u2.arglist = npval(PV_WORD,(yylsp[-7]).first_line,(yylsp[-7]).last_line, (yylsp[-7]).first_column, (yylsp[-7]).last_column); + (yyval.pval)->u2.arglist->u1.str = (yyvsp[-7].str); + (yyval.pval)->u2.arglist->next = npval(PV_WORD,(yylsp[-5]).first_line,(yylsp[-5]).last_line, (yylsp[-5]).first_column, (yylsp[-5]).last_column); + (yyval.pval)->u2.arglist->next->u1.str = (yyvsp[-5].str); + (yyval.pval)->u2.arglist->next->next = npval(PV_WORD,(yylsp[-3]).first_line,(yylsp[-3]).last_line, (yylsp[-3]).first_column, (yylsp[-3]).last_column); + (yyval.pval)->u2.arglist->next->next->u1.str = (yyvsp[-3].str); + (yyval.pval)->u2.arglist->next->next->next = npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[-1]).last_line, (yylsp[-1]).first_column, (yylsp[-1]).last_column); + (yyval.pval)->u2.arglist->next->next->next->u1.str = (yyvsp[-1].str); + prev_word=0; + ;} break; case 144: -#line 602 "ael.y" +#line 604 "ael.y" {pval *z = npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[0]).last_line, (yylsp[-1]).first_column, (yylsp[0]).last_column); (yyval.pval)=(yyvsp[-2].pval); z->u1.str = (yyvsp[-1].str); linku1((yyval.pval),z); ;} break; case 145: -#line 603 "ael.y" +#line 605 "ael.y" {pval *z = npval(PV_WORD,(yylsp[-13]).first_line,(yylsp[-12]).last_line, (yylsp[-13]).first_column, (yylsp[-12]).last_column); - (yyval.pval)=(yyvsp[-14].pval); z->u1.str = (yyvsp[-13].str); linku1((yyval.pval),z); - z->u2.arglist = npval(PV_WORD,(yylsp[-11]).first_line,(yylsp[-11]).last_line, (yylsp[-11]).first_column, (yylsp[-11]).last_column); - asprintf( &((yyval.pval)->u2.arglist->u1.str), "%s:%s:%s", (yyvsp[-11].str), (yyvsp[-9].str), (yyvsp[-7].str)); - free((yyvsp[-11].str)); - free((yyvsp[-9].str)); - free((yyvsp[-7].str)); - z->u2.arglist->next = npval(PV_WORD,(yylsp[-5]).first_line,(yylsp[-5]).last_line, (yylsp[-5]).first_column, (yylsp[-5]).last_column); - z->u2.arglist->next->u1.str = (yyvsp[-5].str); - z->u2.arglist->next->next = npval(PV_WORD,(yylsp[-3]).first_line,(yylsp[-3]).last_line, (yylsp[-3]).first_column, (yylsp[-3]).last_column); - z->u2.arglist->next->next->u1.str = (yyvsp[-3].str); - z->u2.arglist->next->next->next = npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[-1]).last_line, (yylsp[-1]).first_column, (yylsp[-1]).last_column); - z->u2.arglist->next->next->next->u1.str = (yyvsp[-1].str); - prev_word=0; - ;} + (yyval.pval)=(yyvsp[-14].pval); z->u1.str = (yyvsp[-13].str); linku1((yyval.pval),z); + z->u2.arglist = npval(PV_WORD,(yylsp[-11]).first_line,(yylsp[-11]).last_line, (yylsp[-11]).first_column, (yylsp[-11]).last_column); + asprintf( &((yyval.pval)->u2.arglist->u1.str), "%s:%s:%s", (yyvsp[-11].str), (yyvsp[-9].str), (yyvsp[-7].str)); + free((yyvsp[-11].str)); + free((yyvsp[-9].str)); + free((yyvsp[-7].str)); + z->u2.arglist->next = npval(PV_WORD,(yylsp[-5]).first_line,(yylsp[-5]).last_line, (yylsp[-5]).first_column, (yylsp[-5]).last_column); + z->u2.arglist->next->u1.str = (yyvsp[-5].str); + z->u2.arglist->next->next = npval(PV_WORD,(yylsp[-3]).first_line,(yylsp[-3]).last_line, (yylsp[-3]).first_column, (yylsp[-3]).last_column); + z->u2.arglist->next->next->u1.str = (yyvsp[-3].str); + z->u2.arglist->next->next->next = npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[-1]).last_line, (yylsp[-1]).first_column, (yylsp[-1]).last_column); + z->u2.arglist->next->next->next->u1.str = (yyvsp[-1].str); + prev_word=0; + ;} break; case 146: -#line 619 "ael.y" +#line 621 "ael.y" {pval *z = npval(PV_WORD,(yylsp[-9]).first_line,(yylsp[-9]).last_line, (yylsp[-9]).first_column, (yylsp[-8]).last_column); - (yyval.pval)=(yyvsp[-10].pval); z->u1.str = (yyvsp[-9].str); linku1((yyval.pval),z); - z->u2.arglist = npval(PV_WORD,(yylsp[-7]).first_line,(yylsp[-7]).last_line, (yylsp[-7]).first_column, (yylsp[-7]).last_column); - (yyval.pval)->u2.arglist->u1.str = (yyvsp[-7].str); - z->u2.arglist->next = npval(PV_WORD,(yylsp[-5]).first_line,(yylsp[-5]).last_line, (yylsp[-5]).first_column, (yylsp[-5]).last_column); - z->u2.arglist->next->u1.str = (yyvsp[-5].str); - z->u2.arglist->next->next = npval(PV_WORD,(yylsp[-3]).first_line,(yylsp[-3]).last_line, (yylsp[-3]).first_column, (yylsp[-3]).last_column); - z->u2.arglist->next->next->u1.str = (yyvsp[-3].str); - z->u2.arglist->next->next->next = npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[-1]).last_line, (yylsp[-1]).first_column, (yylsp[-1]).last_column); - z->u2.arglist->next->next->next->u1.str = (yyvsp[-1].str); - prev_word=0; - ;} + (yyval.pval)=(yyvsp[-10].pval); z->u1.str = (yyvsp[-9].str); linku1((yyval.pval),z); + z->u2.arglist = npval(PV_WORD,(yylsp[-7]).first_line,(yylsp[-7]).last_line, (yylsp[-7]).first_column, (yylsp[-7]).last_column); + (yyval.pval)->u2.arglist->u1.str = (yyvsp[-7].str); + z->u2.arglist->next = npval(PV_WORD,(yylsp[-5]).first_line,(yylsp[-5]).last_line, (yylsp[-5]).first_column, (yylsp[-5]).last_column); + z->u2.arglist->next->u1.str = (yyvsp[-5].str); + z->u2.arglist->next->next = npval(PV_WORD,(yylsp[-3]).first_line,(yylsp[-3]).last_line, (yylsp[-3]).first_column, (yylsp[-3]).last_column); + z->u2.arglist->next->next->u1.str = (yyvsp[-3].str); + z->u2.arglist->next->next->next = npval(PV_WORD,(yylsp[-1]).first_line,(yylsp[-1]).last_line, (yylsp[-1]).first_column, (yylsp[-1]).last_column); + z->u2.arglist->next->next->next->u1.str = (yyvsp[-1].str); + prev_word=0; + ;} break; case 147: -#line 631 "ael.y" +#line 633 "ael.y" {(yyval.pval)=(yyvsp[-1].pval);;} break; case 148: -#line 634 "ael.y" +#line 636 "ael.y" { (yyval.str) = (yyvsp[0].str);;} break; case 149: -#line 635 "ael.y" +#line 637 "ael.y" {(yyval.str)=strdup("default");;} break; case 150: -#line 638 "ael.y" +#line 640 "ael.y" { (yyval.pval)= npval(PV_INCLUDES,(yylsp[-3]).first_line,(yylsp[0]).last_line, (yylsp[-3]).first_column, (yylsp[0]).last_column); (yyval.pval)->u1.list = (yyvsp[-1].pval);;} break; case 151: -#line 641 "ael.y" +#line 643 "ael.y" { (yyval.pval)= npval(PV_INCLUDES,(yylsp[-2]).first_line,(yylsp[0]).last_line, (yylsp[-2]).first_column, (yylsp[0]).last_column);;} break; @@ -2851,7 +2853,7 @@ yyreduce: } /* Line 1126 of yacc.c. */ -#line 2855 "ael.tab.c" +#line 2857 "ael.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -3126,7 +3128,7 @@ yyreturn: } -#line 646 "ael.y" +#line 648 "ael.y" static char *token_equivs1[] = diff --git a/pbx/ael/ael.y b/pbx/ael/ael.y index ed556627f338e762b1a4249eeef3175ba7216fca..079efcb0240f721caec1be65231ba1f6502a0371 100644 --- a/pbx/ael/ael.y +++ b/pbx/ael/ael.y @@ -394,41 +394,42 @@ statement : LC statements RC {$$=npval(PV_STATEMENTBLOCK,@1.first_line,@3.last_l | switch_head case_statements RC {$$=$1; $$->u2.statements = $2;$$->endline = @3.last_line; $$->endcol = @3.last_column;} | AMPER macro_call SEMI {$$ = $2;$$->endline = @2.last_line; $$->endcol = @2.last_column;} | application_call SEMI { $$ = $1;$$->endline = @2.last_line; $$->endcol = @2.last_column;} - | word SEMI { $$= npval(PV_APPLICATION_CALL,@1.first_line,@2.last_line, @1.first_column, @2.last_column); - $$->u1.str = $1;} + | word SEMI { + $$= npval(PV_APPLICATION_CALL,@1.first_line,@2.last_line, @1.first_column, @2.last_column); + $$->u1.str = $1;} | application_call EQ {reset_semicount(parseio->scanner);} word SEMI { - char *bufx; - int tot=0; - pval *pptr; - $$ = npval(PV_VARDEC,@1.first_line,@5.last_line, @1.first_column, @5.last_column); - $$->u2.val=$4; - /* rebuild the original string-- this is not an app call, it's an unwrapped vardec, with a func call on the LHS */ - /* string to big to fit in the buffer? */ - tot+=strlen($1->u1.str); - for(pptr=$1->u2.arglist;pptr;pptr=pptr->next) { - tot+=strlen(pptr->u1.str); - tot++; /* for a sep like a comma */ - } - tot+=4; /* for safety */ - bufx = (char *)malloc(tot); - strcpy(bufx,$1->u1.str); - strcat(bufx,"("); - /* XXX need to advance the pointer or the loop is very inefficient */ - for (pptr=$1->u2.arglist;pptr;pptr=pptr->next) { - if ( pptr != $1->u2.arglist ) - strcat(bufx,","); - strcat(bufx,pptr->u1.str); - } - strcat(bufx,")"); + char *bufx; + int tot=0; + pval *pptr; + $$ = npval(PV_VARDEC,@1.first_line,@5.last_line, @1.first_column, @5.last_column); + $$->u2.val=$4; + /* rebuild the original string-- this is not an app call, it's an unwrapped vardec, with a func call on the LHS */ + /* string to big to fit in the buffer? */ + tot+=strlen($1->u1.str); + for(pptr=$1->u2.arglist;pptr;pptr=pptr->next) { + tot+=strlen(pptr->u1.str); + tot++; /* for a sep like a comma */ + } + tot+=4; /* for safety */ + bufx = (char *)malloc(tot); + strcpy(bufx,$1->u1.str); + strcat(bufx,"("); + /* XXX need to advance the pointer or the loop is very inefficient */ + for (pptr=$1->u2.arglist;pptr;pptr=pptr->next) { + if ( pptr != $1->u2.arglist ) + strcat(bufx,","); + strcat(bufx,pptr->u1.str); + } + strcat(bufx,")"); #ifdef AAL_ARGCHECK - if ( !ael_is_funcname($1->u1.str) ) - ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Function call? The name %s is not in my internal list of function names\n", - my_file, @1.first_line, @1.first_column, @1.last_column, $1->u1.str); + if ( !ael_is_funcname($1->u1.str) ) + ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Function call? The name %s is not in my internal list of function names\n", + my_file, @1.first_line, @1.first_column, @1.last_column, $1->u1.str); #endif - $$->u1.str = bufx; - destroy_pval($1); /* the app call it is not, get rid of that chain */ - prev_word = 0; - } + $$->u1.str = bufx; + destroy_pval($1); /* the app call it is not, get rid of that chain */ + prev_word = 0; + } | KW_BREAK SEMI { $$ = npval(PV_BREAK,@1.first_line,@2.last_line, @1.first_column, @2.last_column);} | KW_RETURN SEMI {$$ = npval(PV_RETURN,@1.first_line,@2.last_line, @1.first_column, @2.last_column);} | KW_CONTINUE SEMI {$$ = npval(PV_CONTINUE,@1.first_line,@2.last_line, @1.first_column, @2.last_column);} @@ -453,62 +454,63 @@ target : goto_word { $$ = npval(PV_WORD,@1.first_line,@1.last_line, @1.first_col $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); $$->next->u1.str = $3;} | goto_word BAR goto_word BAR goto_word {$$=npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); - $$->u1.str = $1; $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->next->u1.str = $3; - $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); - $$->next->next->u1.str = $5; } + $$->u1.str = $1; $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->next->u1.str = $3; + $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); + $$->next->next->u1.str = $5; } | goto_word COMMA goto_word COMMA goto_word {$$=npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); - $$->u1.str = $1; $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->next->u1.str = $3; - $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); - $$->next->next->u1.str = $5; } + $$->u1.str = $1; $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->next->u1.str = $3; + $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); + $$->next->next->u1.str = $5; } | KW_DEFAULT BAR goto_word BAR goto_word {$$=npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); - $$->u1.str = strdup("default"); $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->next->u1.str = $3; - $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); - $$->next->next->u1.str = $5; } + $$->u1.str = strdup("default"); $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->next->u1.str = $3; + $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); + $$->next->next->u1.str = $5; } | KW_DEFAULT COMMA goto_word COMMA goto_word {$$=npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); - $$->u1.str = strdup("default"); $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->next->u1.str = $3; - $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); - $$->next->next->u1.str = $5; } + $$->u1.str = strdup("default"); $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->next->u1.str = $3; + $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); + $$->next->next->u1.str = $5; } ; jumptarget : goto_word {$$=npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); - $$->u1.str = $1; $$->next = npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); - $$->next->u1.str = strdup("1");} /* jump extension[,priority][@context] */ + $$->u1.str = $1; $$->next = npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); + $$->next->u1.str = strdup("1");} /* jump extension[,priority][@context] */ | goto_word COMMA goto_word {$$=npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); - $$->u1.str = $1; $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->next->u1.str = $3;} + $$->u1.str = $1; $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->next->u1.str = $3;} | goto_word COMMA word AT word {$$=npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); - $$->u1.str = $5; $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->next->u1.str = $1; - $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); - $$->next->next->u1.str = $3; } + $$->u1.str = $5; $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->next->u1.str = $1; + $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); + $$->next->next->u1.str = $3; } | goto_word AT goto_word {$$=npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); - $$->u1.str = $3; $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->next->u1.str = $1; - $$->next->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->next->next->u1.str = strdup("1"); } + $$->u1.str = $3; $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->next->u1.str = $1; + $$->next->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->next->next->u1.str = strdup("1"); } | goto_word COMMA word AT KW_DEFAULT {$$=npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); - $$->u1.str = strdup("default"); $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->next->u1.str = $1; - $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); - $$->next->next->u1.str = $3; } + $$->u1.str = strdup("default"); $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->next->u1.str = $1; + $$->next->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); + $$->next->next->u1.str = $3; } | goto_word AT KW_DEFAULT {$$=npval(PV_WORD,@1.first_line,@1.last_line, @1.first_column, @1.last_column); - $$->u1.str = strdup("default"); $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->next->u1.str = $1; - $$->next->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->next->next->u1.str = strdup("1"); } + $$->u1.str = strdup("default"); $$->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->next->u1.str = $1; + $$->next->next = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->next->next->u1.str = strdup("1"); } ; macro_call : word LP {reset_argcount(parseio->scanner);} eval_arglist RP - {$$= npval(PV_MACRO_CALL,@1.first_line,@2.last_line, @1.first_column, @2.last_column); - $$->u1.str = $1; $$->u2.arglist = $4;} + {$$= npval(PV_MACRO_CALL,@1.first_line,@2.last_line, @1.first_column, @2.last_column); + $$->u1.str = $1; $$->u2.arglist = $4;} | word LP RP {$$= npval(PV_MACRO_CALL,@1.first_line,@3.last_line, @1.first_column, @3.last_column); $$->u1.str = $1; } ; -application_call_head: word {reset_argcount(parseio->scanner);} LP {if (strcasecmp($1,"goto") == 0) { +application_call_head: word {reset_argcount(parseio->scanner);} LP { + if (strcasecmp($1,"goto") == 0) { $$= npval(PV_GOTO,@1.first_line,@3.last_line, @1.first_column, @3.last_column); free($1); /* won't be using this */ ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Suggestion: Use the goto statement instead of the Goto() application call in AEL.\n", my_file, @1.first_line, @1.first_column, @1.last_column ); @@ -571,63 +573,63 @@ switchlist : word SEMI {$$=npval(PV_WORD,@1.first_line,@2.last_line, @1.first_co includeslist : includedname SEMI {$$=npval(PV_WORD,@1.first_line,@2.last_line, @1.first_column, @2.last_column); $$->u1.str = $1;} | includedname BAR word3_list COLON word3_list COLON word3_list BAR word3_list BAR word3_list BAR word3_list SEMI { - $$=npval(PV_WORD,@1.first_line,@2.last_line, @1.first_column, @2.last_column); - $$->u1.str = $1; - $$->u2.arglist = npval(PV_WORD,@3.first_line,@7.last_line, @3.first_column, @7.last_column); - asprintf( &($$->u2.arglist->u1.str), "%s:%s:%s", $3, $5, $7); - free($3); - free($5); - free($7); - $$->u2.arglist->next = npval(PV_WORD,@9.first_line,@9.last_line, @9.first_column, @9.last_column); - $$->u2.arglist->next->u1.str = $9; - $$->u2.arglist->next->next = npval(PV_WORD,@11.first_line,@11.last_line, @11.first_column, @11.last_column); - $$->u2.arglist->next->next->u1.str = $11; - $$->u2.arglist->next->next->next = npval(PV_WORD,@13.first_line,@13.last_line, @13.first_column, @13.last_column); - $$->u2.arglist->next->next->next->u1.str = $13; - prev_word=0; - } + $$=npval(PV_WORD,@1.first_line,@2.last_line, @1.first_column, @2.last_column); + $$->u1.str = $1; + $$->u2.arglist = npval(PV_WORD,@3.first_line,@7.last_line, @3.first_column, @7.last_column); + asprintf( &($$->u2.arglist->u1.str), "%s:%s:%s", $3, $5, $7); + free($3); + free($5); + free($7); + $$->u2.arglist->next = npval(PV_WORD,@9.first_line,@9.last_line, @9.first_column, @9.last_column); + $$->u2.arglist->next->u1.str = $9; + $$->u2.arglist->next->next = npval(PV_WORD,@11.first_line,@11.last_line, @11.first_column, @11.last_column); + $$->u2.arglist->next->next->u1.str = $11; + $$->u2.arglist->next->next->next = npval(PV_WORD,@13.first_line,@13.last_line, @13.first_column, @13.last_column); + $$->u2.arglist->next->next->next->u1.str = $13; + prev_word=0; + } | includedname BAR word BAR word3_list BAR word3_list BAR word3_list SEMI { - $$=npval(PV_WORD,@1.first_line,@2.last_line, @1.first_column, @2.last_column); - $$->u1.str = $1; - $$->u2.arglist = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); - $$->u2.arglist->u1.str = $3; - $$->u2.arglist->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); - $$->u2.arglist->next->u1.str = $5; - $$->u2.arglist->next->next = npval(PV_WORD,@7.first_line,@7.last_line, @7.first_column, @7.last_column); - $$->u2.arglist->next->next->u1.str = $7; - $$->u2.arglist->next->next->next = npval(PV_WORD,@9.first_line,@9.last_line, @9.first_column, @9.last_column); - $$->u2.arglist->next->next->next->u1.str = $9; - prev_word=0; - } + $$=npval(PV_WORD,@1.first_line,@2.last_line, @1.first_column, @2.last_column); + $$->u1.str = $1; + $$->u2.arglist = npval(PV_WORD,@3.first_line,@3.last_line, @3.first_column, @3.last_column); + $$->u2.arglist->u1.str = $3; + $$->u2.arglist->next = npval(PV_WORD,@5.first_line,@5.last_line, @5.first_column, @5.last_column); + $$->u2.arglist->next->u1.str = $5; + $$->u2.arglist->next->next = npval(PV_WORD,@7.first_line,@7.last_line, @7.first_column, @7.last_column); + $$->u2.arglist->next->next->u1.str = $7; + $$->u2.arglist->next->next->next = npval(PV_WORD,@9.first_line,@9.last_line, @9.first_column, @9.last_column); + $$->u2.arglist->next->next->next->u1.str = $9; + prev_word=0; + } | includeslist includedname SEMI {pval *z = npval(PV_WORD,@2.first_line,@3.last_line, @2.first_column, @3.last_column); $$=$1; z->u1.str = $2; linku1($$,z); } | includeslist includedname BAR word3_list COLON word3_list COLON word3_list BAR word3_list BAR word3_list BAR word3_list SEMI {pval *z = npval(PV_WORD,@2.first_line,@3.last_line, @2.first_column, @3.last_column); - $$=$1; z->u1.str = $2; linku1($$,z); - z->u2.arglist = npval(PV_WORD,@4.first_line,@4.last_line, @4.first_column, @4.last_column); - asprintf( &($$->u2.arglist->u1.str), "%s:%s:%s", $4, $6, $8); - free($4); - free($6); - free($8); - z->u2.arglist->next = npval(PV_WORD,@10.first_line,@10.last_line, @10.first_column, @10.last_column); - z->u2.arglist->next->u1.str = $10; - z->u2.arglist->next->next = npval(PV_WORD,@12.first_line,@12.last_line, @12.first_column, @12.last_column); - z->u2.arglist->next->next->u1.str = $12; - z->u2.arglist->next->next->next = npval(PV_WORD,@14.first_line,@14.last_line, @14.first_column, @14.last_column); - z->u2.arglist->next->next->next->u1.str = $14; - prev_word=0; - } + $$=$1; z->u1.str = $2; linku1($$,z); + z->u2.arglist = npval(PV_WORD,@4.first_line,@4.last_line, @4.first_column, @4.last_column); + asprintf( &($$->u2.arglist->u1.str), "%s:%s:%s", $4, $6, $8); + free($4); + free($6); + free($8); + z->u2.arglist->next = npval(PV_WORD,@10.first_line,@10.last_line, @10.first_column, @10.last_column); + z->u2.arglist->next->u1.str = $10; + z->u2.arglist->next->next = npval(PV_WORD,@12.first_line,@12.last_line, @12.first_column, @12.last_column); + z->u2.arglist->next->next->u1.str = $12; + z->u2.arglist->next->next->next = npval(PV_WORD,@14.first_line,@14.last_line, @14.first_column, @14.last_column); + z->u2.arglist->next->next->next->u1.str = $14; + prev_word=0; + } | includeslist includedname BAR word BAR word3_list BAR word3_list BAR word3_list SEMI - {pval *z = npval(PV_WORD,@2.first_line,@2.last_line, @2.first_column, @3.last_column); - $$=$1; z->u1.str = $2; linku1($$,z); - z->u2.arglist = npval(PV_WORD,@4.first_line,@4.last_line, @4.first_column, @4.last_column); - $$->u2.arglist->u1.str = $4; - z->u2.arglist->next = npval(PV_WORD,@6.first_line,@6.last_line, @6.first_column, @6.last_column); - z->u2.arglist->next->u1.str = $6; - z->u2.arglist->next->next = npval(PV_WORD,@8.first_line,@8.last_line, @8.first_column, @8.last_column); - z->u2.arglist->next->next->u1.str = $8; - z->u2.arglist->next->next->next = npval(PV_WORD,@10.first_line,@10.last_line, @10.first_column, @10.last_column); - z->u2.arglist->next->next->next->u1.str = $10; - prev_word=0; - } + {pval *z = npval(PV_WORD,@2.first_line,@2.last_line, @2.first_column, @3.last_column); + $$=$1; z->u1.str = $2; linku1($$,z); + z->u2.arglist = npval(PV_WORD,@4.first_line,@4.last_line, @4.first_column, @4.last_column); + $$->u2.arglist->u1.str = $4; + z->u2.arglist->next = npval(PV_WORD,@6.first_line,@6.last_line, @6.first_column, @6.last_column); + z->u2.arglist->next->u1.str = $6; + z->u2.arglist->next->next = npval(PV_WORD,@8.first_line,@8.last_line, @8.first_column, @8.last_column); + z->u2.arglist->next->next->u1.str = $8; + z->u2.arglist->next->next->next = npval(PV_WORD,@10.first_line,@10.last_line, @10.first_column, @10.last_column); + z->u2.arglist->next->next->next->u1.str = $10; + prev_word=0; + } | includeslist error {$$=$1;} ;