Bison Grammar description of AEL2. More...
#include "asterisk.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include "asterisk/logger.h"#include "asterisk/lock.h"#include "asterisk/hashtab.h"#include "asterisk/ael_structs.h"#include "asterisk/utils.h"
Go to the source code of this file.
Data Structures | |
| union | yyalloc |
Defines | |
| #define | AMPER 267 |
| #define | AT 269 |
| #define | BAR 268 |
| #define | COLON 266 |
| #define | COMMA 265 |
| #define | EQ 264 |
| #define | EXTENMARK 280 |
| #define | KW_ABSTRACT 278 |
| #define | KW_BREAK 284 |
| #define | KW_CASE 290 |
| #define | KW_CATCH 293 |
| #define | KW_CONTEXT 258 |
| #define | KW_CONTINUE 285 |
| #define | KW_DEFAULT 292 |
| #define | KW_ELSE 276 |
| #define | KW_ESWITCHES 295 |
| #define | KW_EXTEND 279 |
| #define | KW_FOR 288 |
| #define | KW_GLOBALS 271 |
| #define | KW_GOTO 281 |
| #define | KW_HINT 287 |
| #define | KW_IF 274 |
| #define | KW_IFTIME 275 |
| #define | KW_IGNOREPAT 272 |
| #define | KW_INCLUDES 296 |
| #define | KW_JUMP 282 |
| #define | KW_LOCAL 297 |
| #define | KW_MACRO 270 |
| #define | KW_PATTERN 291 |
| #define | KW_RANDOM 277 |
| #define | KW_REGEXTEN 286 |
| #define | KW_RETURN 283 |
| #define | KW_SWITCH 273 |
| #define | KW_SWITCHES 294 |
| #define | KW_WHILE 289 |
| #define | LC 259 |
| #define | LP 261 |
| #define | RC 260 |
| #define | RP 262 |
| #define | SEMI 263 |
| #define | word 298 |
| #define | YY_REDUCE_PRINT(Rule) |
| #define | YY_STACK_PRINT(Bottom, Top) |
| #define | YY_SYMBOL_PRINT(Title, Type, Value, Location) |
| #define | YYABORT goto yyabortlab |
| #define | YYACCEPT goto yyacceptlab |
| #define | YYBACKUP(Token, Value) |
| #define | YYBISON 1 |
| #define | YYBISON_VERSION "2.3" |
| #define | yychar ael_yychar |
| #define | yyclearin (yychar = YYEMPTY) |
| #define | yydebug ael_yydebug |
| #define | YYDPRINTF(Args) |
| #define | YYEMPTY (-2) |
| #define | YYEOF 0 |
| #define | YYERRCODE 256 |
| #define | yyerrok (yyerrstatus = 0) |
| #define | YYERROR goto yyerrorlab |
| #define | yyerror ael_yyerror |
| #define | YYERROR_VERBOSE 1 |
| #define | YYERROR_VERBOSE 1 |
| #define | YYFAIL goto yyerrlab |
| #define | YYFINAL 17 |
| #define | YYID(n) (n) |
| #define | YYLAST 371 |
| #define | YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) |
| #define | yylex ael_yylex |
| #define | YYLEX_PARAM ((struct parse_io *)parseio)->scanner |
| #define | yylloc ael_yylloc |
| #define | YYLSP_NEEDED 1 |
| #define | yylval ael_yylval |
| #define | YYMAXUTOK 298 |
| #define | yynerrs ael_yynerrs |
| #define | YYNNTS 56 |
| #define | YYNRULES 143 |
| #define | YYNSTATES 283 |
| #define | YYNTOKENS 44 |
| #define | YYPACT_NINF -211 |
| #define | yyparse ael_yyparse |
| #define | YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) |
| #define | YYPURE 1 |
| #define | YYRECOVERING() (!!yyerrstatus) |
| #define | YYRHSLOC(Rhs, K) ((Rhs)[K]) |
| #define | YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
| #define | YYSKELETON_NAME "yacc.c" |
| #define | YYSTACK_BYTES(N) |
| #define | YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) |
| #define | YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
| #define | YYSTACK_RELOCATE(Stack) |
| #define | YYTABLE_NINF -134 |
| #define | YYTERROR 1 |
| #define | YYTRANSLATE(YYX) ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
| #define | YYUNDEFTOK 2 |
| #define | YYUSE(e) ((void) (e)) |
Typedefs | |
| typedef short int | yytype_int16 |
| typedef short int | yytype_int8 |
| typedef unsigned short int | yytype_uint16 |
| typedef unsigned char | yytype_uint8 |
Enumerations | |
| enum | yytokentype { TOK_COMMA = 258, TOK_COLONCOLON = 259, TOK_COND = 260, TOK_OR = 261, TOK_AND = 262, TOK_NE = 263, TOK_LE = 264, TOK_GE = 265, TOK_LT = 266, TOK_GT = 267, TOK_EQ = 268, TOK_MINUS = 269, TOK_PLUS = 270, TOK_MOD = 271, TOK_DIV = 272, TOK_MULT = 273, TOK_COMPL = 274, TOK_TILDETILDE = 275, TOK_EQTILDE = 276, TOK_COLON = 277, TOK_LP = 278, TOK_RP = 279, TOKEN = 280, TOK_COMMA = 258, TOK_COLONCOLON = 259, TOK_COND = 260, TOK_OR = 261, TOK_AND = 262, TOK_NE = 263, TOK_LE = 264, TOK_GE = 265, TOK_LT = 266, TOK_GT = 267, TOK_EQ = 268, TOK_MINUS = 269, TOK_PLUS = 270, TOK_MOD = 271, TOK_DIV = 272, TOK_MULT = 273, TOK_COMPL = 274, TOK_TILDETILDE = 275, TOK_EQTILDE = 276, TOK_COLON = 277, TOK_LP = 278, TOK_RP = 279, TOKEN = 280, KW_CONTEXT = 258, LC = 259, RC = 260, LP = 261, RP = 262, SEMI = 263, EQ = 264, COMMA = 265, COLON = 266, AMPER = 267, BAR = 268, AT = 269, KW_MACRO = 270, KW_GLOBALS = 271, KW_IGNOREPAT = 272, KW_SWITCH = 273, KW_IF = 274, KW_IFTIME = 275, KW_ELSE = 276, KW_RANDOM = 277, KW_ABSTRACT = 278, KW_EXTEND = 279, EXTENMARK = 280, KW_GOTO = 281, KW_JUMP = 282, KW_RETURN = 283, KW_BREAK = 284, KW_CONTINUE = 285, KW_REGEXTEN = 286, KW_HINT = 287, KW_FOR = 288, KW_WHILE = 289, KW_CASE = 290, KW_PATTERN = 291, KW_DEFAULT = 292, KW_CATCH = 293, KW_SWITCHES = 294, KW_ESWITCHES = 295, KW_INCLUDES = 296, KW_LOCAL = 297, word = 298, KW_CONTEXT = 258, LC = 259, RC = 260, LP = 261, RP = 262, SEMI = 263, EQ = 264, COMMA = 265, COLON = 266, AMPER = 267, BAR = 268, AT = 269, KW_MACRO = 270, KW_GLOBALS = 271, KW_IGNOREPAT = 272, KW_SWITCH = 273, KW_IF = 274, KW_IFTIME = 275, KW_ELSE = 276, KW_RANDOM = 277, KW_ABSTRACT = 278, KW_EXTEND = 279, EXTENMARK = 280, KW_GOTO = 281, KW_JUMP = 282, KW_RETURN = 283, KW_BREAK = 284, KW_CONTINUE = 285, KW_REGEXTEN = 286, KW_HINT = 287, KW_FOR = 288, KW_WHILE = 289, KW_CASE = 290, KW_PATTERN = 291, KW_DEFAULT = 292, KW_CATCH = 293, KW_SWITCHES = 294, KW_ESWITCHES = 295, KW_INCLUDES = 296, KW_LOCAL = 297, word = 298 } |
Functions | |
| static char * | ael_token_subst (const char *mess) |
| int | ael_yylex (YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner) |
| pval * | linku1 (pval *head, pval *tail) |
| pval * | npval (pvaltype type, int first_line, int last_line, int first_column, int last_column) |
| static pval * | npval2 (pvaltype type, YYLTYPE *first, YYLTYPE *last) |
| static pval * | nword (char *string, YYLTYPE *pos) |
| void | reset_argcount (yyscan_t yyscanner) |
| void | reset_parencount (yyscan_t yyscanner) |
| void | reset_semicount (yyscan_t yyscanner) |
| static void | set_dads (pval *dad, pval *child_list) |
| static pval * | update_last (pval *, YYLTYPE *) |
| static void | yydestruct (char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct parse_io *parseio) const |
| void | yyerror (YYLTYPE *locp, struct parse_io *parseio, char const *s) |
| int | yyparse (void *YYPARSE_PARAM) |
| int | yyparse () |
| static char * | yystpcpy (char *yydest, const char *yysrc) |
| static YYSIZE_T | yystrlen (char *yystr) const |
| static YYSIZE_T | yysyntax_error (char *yyresult, int yystate, int yychar) |
| static YYSIZE_T | yytnamerr (char *yyres, const char *yystr) |
Variables | |
| struct ast_flags | ast_compat |
| char * | my_file |
| static char * | token_equivs1 [] |
| static char * | token_equivs2 [] |
| static const yytype_uint16 | yycheck [] |
| static const yytype_uint8 | yydefact [] |
| static const yytype_int16 | yydefgoto [] |
| static const yytype_int16 | yypact [] |
| static const yytype_int16 | yypgoto [] |
| static const yytype_uint8 | yyr1 [] |
| static const yytype_uint8 | yyr2 [] |
| static const yytype_uint8 | yystos [] |
| static const yytype_int16 | yytable [] |
| static const char *const | yytname [] |
| static const yytype_uint8 | yytranslate [] |
Bison Grammar description of AEL2.
Definition in file ael.tab.c.
| #define word 298 |
Definition at line 161 of file ael.tab.c.
Referenced by handle_common_options(), handle_queue_pause_member(), handle_t38_options(), and set_insecure_flags().
| #define YYPOPSTACK | ( | N | ) | (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) |
| #define YYSTACK_BYTES | ( | N | ) |
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM)
| #define YYSTACK_FREE | ( | Ptr | ) | do { /* empty */; } while (YYID (0)) |
| #define YYTRANSLATE | ( | YYX | ) | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
| typedef short int yytype_int16 |
| typedef short int yytype_int8 |
| typedef unsigned short int yytype_uint16 |
| typedef unsigned char yytype_uint8 |
| enum yytokentype |
Definition at line 76 of file ael.tab.c.
00076 { 00077 KW_CONTEXT = 258, 00078 LC = 259, 00079 RC = 260, 00080 LP = 261, 00081 RP = 262, 00082 SEMI = 263, 00083 EQ = 264, 00084 COMMA = 265, 00085 COLON = 266, 00086 AMPER = 267, 00087 BAR = 268, 00088 AT = 269, 00089 KW_MACRO = 270, 00090 KW_GLOBALS = 271, 00091 KW_IGNOREPAT = 272, 00092 KW_SWITCH = 273, 00093 KW_IF = 274, 00094 KW_IFTIME = 275, 00095 KW_ELSE = 276, 00096 KW_RANDOM = 277, 00097 KW_ABSTRACT = 278, 00098 KW_EXTEND = 279, 00099 EXTENMARK = 280, 00100 KW_GOTO = 281, 00101 KW_JUMP = 282, 00102 KW_RETURN = 283, 00103 KW_BREAK = 284, 00104 KW_CONTINUE = 285, 00105 KW_REGEXTEN = 286, 00106 KW_HINT = 287, 00107 KW_FOR = 288, 00108 KW_WHILE = 289, 00109 KW_CASE = 290, 00110 KW_PATTERN = 291, 00111 KW_DEFAULT = 292, 00112 KW_CATCH = 293, 00113 KW_SWITCHES = 294, 00114 KW_ESWITCHES = 295, 00115 KW_INCLUDES = 296, 00116 KW_LOCAL = 297, 00117 word = 298 00118 };
| static char * ael_token_subst | ( | const char * | mess | ) | [static] |
Definition at line 3409 of file ael.tab.c.
References calloc, len(), and s.
Referenced by yyerror().
03410 { 03411 /* calc a length, malloc, fill, and return; yyerror had better free it! */ 03412 int len=0,i; 03413 const char *p; 03414 char *res, *s,*t; 03415 int token_equivs_entries = sizeof(token_equivs1)/sizeof(char*); 03416 03417 for (p=mess; *p; p++) { 03418 for (i=0; i<token_equivs_entries; i++) { 03419 if ( strncmp(p,token_equivs1[i],strlen(token_equivs1[i])) == 0 ) 03420 { 03421 len+=strlen(token_equivs2[i])+2; 03422 p += strlen(token_equivs1[i])-1; 03423 break; 03424 } 03425 } 03426 len++; 03427 } 03428 res = calloc(1, len+1); 03429 res[0] = 0; 03430 s = res; 03431 for (p=mess; *p;) { 03432 int found = 0; 03433 for (i=0; i<token_equivs_entries; i++) { 03434 if ( strncmp(p,token_equivs1[i],strlen(token_equivs1[i])) == 0 ) { 03435 *s++ = '\''; 03436 for (t=token_equivs2[i]; *t;) { 03437 *s++ = *t++; 03438 } 03439 *s++ = '\''; 03440 p += strlen(token_equivs1[i]); 03441 found = 1; 03442 break; 03443 } 03444 } 03445 if( !found ) 03446 *s++ = *p++; 03447 } 03448 *s++ = 0; 03449 return res; 03450 }
| int ael_yylex | ( | YYSTYPE * | yylval_param, | |
| YYLTYPE * | yylloc_param, | |||
| void * | yyscanner | |||
| ) |
Definition at line 5798 of file pval.c.
References pval::next, pval::prev, and pval::u1_last.
05799 { 05800 if (!head) 05801 return tail; 05802 if (tail) { 05803 if (!head->next) { 05804 head->next = tail; 05805 } else { 05806 head->u1_last->next = tail; 05807 } 05808 head->u1_last = tail; 05809 tail->prev = head; /* the dad link only points to containers */ 05810 } 05811 return head; 05812 }
| pval* npval | ( | pvaltype | type, | |
| int | first_line, | |||
| int | last_line, | |||
| int | first_column, | |||
| int | last_column | |||
| ) | [read] |
Definition at line 3464 of file ael.tab.c.
References calloc, pval::endcol, pval::endline, pval::filename, pval::startcol, pval::startline, strdup, and pval::type.
| static pval * nword | ( | char * | string, | |
| YYLTYPE * | pos | |||
| ) | [static] |
Definition at line 3483 of file ael.tab.c.
References pval::endcol, and pval::endline.
Referenced by yyparse().
| static void yydestruct | ( | char * | yymsg, | |
| int | yytype, | |||
| YYSTYPE * | yyvaluep, | |||
| YYLTYPE * | yylocationp, | |||
| struct parse_io * | parseio | |||
| ) | const [static] |
Definition at line 1461 of file ael.tab.c.
References destroy_pval(), free, prev_word, YY_SYMBOL_PRINT, and YYUSE.
Referenced by yyparse().
01468 { 01469 YYUSE (yyvaluep); 01470 YYUSE (yylocationp); 01471 YYUSE (parseio); 01472 01473 if (!yymsg) 01474 yymsg = "Deleting"; 01475 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 01476 01477 switch (yytype) 01478 { 01479 case 43: /* "word" */ 01480 #line 183 "ael.y" 01481 { free((yyvaluep->str));}; 01482 #line 1483 "ael.tab.c" 01483 break; 01484 case 46: /* "objects" */ 01485 #line 170 "ael.y" 01486 { 01487 destroy_pval((yyvaluep->pval)); 01488 prev_word=0; 01489 }; 01490 #line 1491 "ael.tab.c" 01491 break; 01492 case 47: /* "object" */ 01493 #line 170 "ael.y" 01494 { 01495 destroy_pval((yyvaluep->pval)); 01496 prev_word=0; 01497 }; 01498 #line 1499 "ael.tab.c" 01499 break; 01500 case 48: /* "context_name" */ 01501 #line 183 "ael.y" 01502 { free((yyvaluep->str));}; 01503 #line 1504 "ael.tab.c" 01504 break; 01505 case 49: /* "context" */ 01506 #line 170 "ael.y" 01507 { 01508 destroy_pval((yyvaluep->pval)); 01509 prev_word=0; 01510 }; 01511 #line 1512 "ael.tab.c" 01512 break; 01513 case 51: /* "macro" */ 01514 #line 170 "ael.y" 01515 { 01516 destroy_pval((yyvaluep->pval)); 01517 prev_word=0; 01518 }; 01519 #line 1520 "ael.tab.c" 01520 break; 01521 case 52: /* "globals" */ 01522 #line 170 "ael.y" 01523 { 01524 destroy_pval((yyvaluep->pval)); 01525 prev_word=0; 01526 }; 01527 #line 1528 "ael.tab.c" 01528 break; 01529 case 53: /* "global_statements" */ 01530 #line 170 "ael.y" 01531 { 01532 destroy_pval((yyvaluep->pval)); 01533 prev_word=0; 01534 }; 01535 #line 1536 "ael.tab.c" 01536 break; 01537 case 54: /* "assignment" */ 01538 #line 170 "ael.y" 01539 { 01540 destroy_pval((yyvaluep->pval)); 01541 prev_word=0; 01542 }; 01543 #line 1544 "ael.tab.c" 01544 break; 01545 case 56: /* "local_assignment" */ 01546 #line 170 "ael.y" 01547 { 01548 destroy_pval((yyvaluep->pval)); 01549 prev_word=0; 01550 }; 01551 #line 1552 "ael.tab.c" 01552 break; 01553 case 58: /* "arglist" */ 01554 #line 170 "ael.y" 01555 { 01556 destroy_pval((yyvaluep->pval)); 01557 prev_word=0; 01558 }; 01559 #line 1560 "ael.tab.c" 01560 break; 01561 case 59: /* "elements" */ 01562 #line 170 "ael.y" 01563 { 01564 destroy_pval((yyvaluep->pval)); 01565 prev_word=0; 01566 }; 01567 #line 1568 "ael.tab.c" 01568 break; 01569 case 60: /* "element" */ 01570 #line 170 "ael.y" 01571 { 01572 destroy_pval((yyvaluep->pval)); 01573 prev_word=0; 01574 }; 01575 #line 1576 "ael.tab.c" 01576 break; 01577 case 61: /* "ignorepat" */ 01578 #line 170 "ael.y" 01579 { 01580 destroy_pval((yyvaluep->pval)); 01581 prev_word=0; 01582 }; 01583 #line 1584 "ael.tab.c" 01584 break; 01585 case 62: /* "extension" */ 01586 #line 170 "ael.y" 01587 { 01588 destroy_pval((yyvaluep->pval)); 01589 prev_word=0; 01590 }; 01591 #line 1592 "ael.tab.c" 01592 break; 01593 case 63: /* "statements" */ 01594 #line 170 "ael.y" 01595 { 01596 destroy_pval((yyvaluep->pval)); 01597 prev_word=0; 01598 }; 01599 #line 1600 "ael.tab.c" 01600 break; 01601 case 64: /* "timerange" */ 01602 #line 183 "ael.y" 01603 { free((yyvaluep->str));}; 01604 #line 1605 "ael.tab.c" 01605 break; 01606 case 65: /* "timespec" */ 01607 #line 170 "ael.y" 01608 { 01609 destroy_pval((yyvaluep->pval)); 01610 prev_word=0; 01611 }; 01612 #line 1613 "ael.tab.c" 01613 break; 01614 case 66: /* "test_expr" */ 01615 #line 183 "ael.y" 01616 { free((yyvaluep->str));}; 01617 #line 1618 "ael.tab.c" 01618 break; 01619 case 68: /* "if_like_head" */ 01620 #line 170 "ael.y" 01621 { 01622 destroy_pval((yyvaluep->pval)); 01623 prev_word=0; 01624 }; 01625 #line 1626 "ael.tab.c" 01626 break; 01627 case 69: /* "word_list" */ 01628 #line 183 "ael.y" 01629 { free((yyvaluep->str));}; 01630 #line 1631 "ael.tab.c" 01631 break; 01632 case 71: /* "word3_list" */ 01633 #line 183 "ael.y" 01634 { free((yyvaluep->str));}; 01635 #line 1636 "ael.tab.c" 01636 break; 01637 case 72: /* "goto_word" */ 01638 #line 183 "ael.y" 01639 { free((yyvaluep->str));}; 01640 #line 1641 "ael.tab.c" 01641 break; 01642 case 73: /* "switch_statement" */ 01643 #line 170 "ael.y" 01644 { 01645 destroy_pval((yyvaluep->pval)); 01646 prev_word=0; 01647 }; 01648 #line 1649 "ael.tab.c" 01649 break; 01650 case 74: /* "statement" */ 01651 #line 170 "ael.y" 01652 { 01653 destroy_pval((yyvaluep->pval)); 01654 prev_word=0; 01655 }; 01656 #line 1657 "ael.tab.c" 01657 break; 01658 case 79: /* "opt_else" */ 01659 #line 170 "ael.y" 01660 { 01661 destroy_pval((yyvaluep->pval)); 01662 prev_word=0; 01663 }; 01664 #line 1665 "ael.tab.c" 01665 break; 01666 case 80: /* "target" */ 01667 #line 170 "ael.y" 01668 { 01669 destroy_pval((yyvaluep->pval)); 01670 prev_word=0; 01671 }; 01672 #line 1673 "ael.tab.c" 01673 break; 01674 case 81: /* "opt_pri" */ 01675 #line 183 "ael.y" 01676 { free((yyvaluep->str));}; 01677 #line 1678 "ael.tab.c" 01678 break; 01679 case 82: /* "jumptarget" */ 01680 #line 170 "ael.y" 01681 { 01682 destroy_pval((yyvaluep->pval)); 01683 prev_word=0; 01684 }; 01685 #line 1686 "ael.tab.c" 01686 break; 01687 case 83: /* "macro_call" */ 01688 #line 170 "ael.y" 01689 { 01690 destroy_pval((yyvaluep->pval)); 01691 prev_word=0; 01692 }; 01693 #line 1694 "ael.tab.c" 01694 break; 01695 case 85: /* "application_call_head" */ 01696 #line 170 "ael.y" 01697 { 01698 destroy_pval((yyvaluep->pval)); 01699 prev_word=0; 01700 }; 01701 #line 1702 "ael.tab.c" 01702 break; 01703 case 87: /* "application_call" */ 01704 #line 170 "ael.y" 01705 { 01706 destroy_pval((yyvaluep->pval)); 01707 prev_word=0; 01708 }; 01709 #line 1710 "ael.tab.c" 01710 break; 01711 case 88: /* "opt_word" */ 01712 #line 183 "ael.y" 01713 { free((yyvaluep->str));}; 01714 #line 1715 "ael.tab.c" 01715 break; 01716 case 89: /* "eval_arglist" */ 01717 #line 170 "ael.y" 01718 { 01719 destroy_pval((yyvaluep->pval)); 01720 prev_word=0; 01721 }; 01722 #line 1723 "ael.tab.c" 01723 break; 01724 case 90: /* "case_statements" */ 01725 #line 170 "ael.y" 01726 { 01727 destroy_pval((yyvaluep->pval)); 01728 prev_word=0; 01729 }; 01730 #line 1731 "ael.tab.c" 01731 break; 01732 case 91: /* "case_statement" */ 01733 #line 170 "ael.y" 01734 { 01735 destroy_pval((yyvaluep->pval)); 01736 prev_word=0; 01737 }; 01738 #line 1739 "ael.tab.c" 01739 break; 01740 case 92: /* "macro_statements" */ 01741 #line 170 "ael.y" 01742 { 01743 destroy_pval((yyvaluep->pval)); 01744 prev_word=0; 01745 }; 01746 #line 1747 "ael.tab.c" 01747 break; 01748 case 93: /* "macro_statement" */ 01749 #line 170 "ael.y" 01750 { 01751 destroy_pval((yyvaluep->pval)); 01752 prev_word=0; 01753 }; 01754 #line 1755 "ael.tab.c" 01755 break; 01756 case 94: /* "switches" */ 01757 #line 170 "ael.y" 01758 { 01759 destroy_pval((yyvaluep->pval)); 01760 prev_word=0; 01761 }; 01762 #line 1763 "ael.tab.c" 01763 break; 01764 case 95: /* "eswitches" */ 01765 #line 170 "ael.y" 01766 { 01767 destroy_pval((yyvaluep->pval)); 01768 prev_word=0; 01769 }; 01770 #line 1771 "ael.tab.c" 01771 break; 01772 case 96: /* "switchlist" */ 01773 #line 170 "ael.y" 01774 { 01775 destroy_pval((yyvaluep->pval)); 01776 prev_word=0; 01777 }; 01778 #line 1779 "ael.tab.c" 01779 break; 01780 case 97: /* "included_entry" */ 01781 #line 170 "ael.y" 01782 { 01783 destroy_pval((yyvaluep->pval)); 01784 prev_word=0; 01785 }; 01786 #line 1787 "ael.tab.c" 01787 break; 01788 case 98: /* "includeslist" */ 01789 #line 170 "ael.y" 01790 { 01791 destroy_pval((yyvaluep->pval)); 01792 prev_word=0; 01793 }; 01794 #line 1795 "ael.tab.c" 01795 break; 01796 case 99: /* "includes" */ 01797 #line 170 "ael.y" 01798 { 01799 destroy_pval((yyvaluep->pval)); 01800 prev_word=0; 01801 }; 01802 #line 1803 "ael.tab.c" 01803 break; 01804 01805 default: 01806 break; 01807 } 01808 }
| void yyerror | ( | YYLTYPE * | locp, | |
| struct parse_io * | parseio, | |||
| char const * | s | |||
| ) |
Definition at line 3452 of file ael.tab.c.
References ael_token_subst(), ast_log(), free, LOG_ERROR, and parse_io::syntax_error_count.
03453 { 03454 char *s2 = ael_token_subst((char *)s); 03455 if (locp->first_line == locp->last_line) { 03456 ast_log(LOG_ERROR, "==== File: %s, Line %d, Cols: %d-%d: Error: %s\n", my_file, locp->first_line, locp->first_column, locp->last_column, s2); 03457 } else { 03458 ast_log(LOG_ERROR, "==== File: %s, Line %d Col %d to Line %d Col %d: Error: %s\n", my_file, locp->first_line, locp->first_column, locp->last_line, locp->last_column, s2); 03459 } 03460 free(s2); 03461 parseio->syntax_error_count++; 03462 }
| int yyparse | ( | void * | YYPARSE_PARAM | ) |
Definition at line 1843 of file ael.tab.c.
References pval::arglist, asprintf, ast_log(), calloc, destroy_pval(), pval::for_init, free, linku1(), pval::list, LOG_WARNING, malloc, pval::next, npval(), npval2(), nword(), prev_word, PV_APPLICATION_CALL, PV_BREAK, PV_CASE, PV_CATCH, PV_CONTEXT, PV_CONTINUE, PV_DEFAULT, PV_ESWITCHES, PV_EXTENSION, PV_FOR, PV_GLOBALS, PV_GOTO, PV_IF, PV_IFTIME, PV_IGNOREPAT, PV_INCLUDES, PV_LABEL, PV_LOCALVARDEC, PV_MACRO, PV_MACRO_CALL, PV_PATTERN, PV_RANDOM, PV_RETURN, PV_STATEMENTBLOCK, PV_SWITCH, PV_SWITCHES, PV_VARDEC, PV_WHILE, PV_WORD, reset_argcount(), reset_parencount(), reset_semicount(), set_dads(), pval::statements, pval::str, str, strdup, pval::u1, pval::u2, update_last(), pval::val, YY_, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yychar, yydestruct(), YYDPRINTF, YYEMPTY, YYEOF, yyerror, YYFINAL, YYID, YYINITDEPTH, YYLAST, YYLEX, yylloc, YYLLOC_DEFAULT, YYLTYPE, yylval, YYMAXDEPTH, yynerrs, YYNTOKENS, YYPACT_NINF, YYPOPSTACK, YYSIZE_T, YYSTACK_ALLOC, YYSTACK_ALLOC_MAXIMUM, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, yysyntax_error(), YYTABLE_NINF, YYTERROR, and YYTRANSLATE.
01857 { 01858 /* The look-ahead symbol. */ 01859 int yychar; 01860 01861 /* The semantic value of the look-ahead symbol. */ 01862 YYSTYPE yylval; 01863 01864 /* Number of syntax errors so far. */ 01865 int yynerrs; 01866 /* Location data for the look-ahead symbol. */ 01867 YYLTYPE yylloc; 01868 01869 int yystate; 01870 int yyn; 01871 int yyresult; 01872 /* Number of tokens to shift before error messages enabled. */ 01873 int yyerrstatus; 01874 /* Look-ahead token as an internal (translated) token number. */ 01875 int yytoken = 0; 01876 #if YYERROR_VERBOSE 01877 /* Buffer for error messages, and its allocated size. */ 01878 char yymsgbuf[128]; 01879 char *yymsg = yymsgbuf; 01880 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 01881 #endif 01882 01883 /* Three stacks and their tools: 01884 `yyss': related to states, 01885 `yyvs': related to semantic values, 01886 `yyls': related to locations. 01887 01888 Refer to the stacks thru separate pointers, to allow yyoverflow 01889 to reallocate them elsewhere. */ 01890 01891 /* The state stack. */ 01892 yytype_int16 yyssa[YYINITDEPTH]; 01893 yytype_int16 *yyss = yyssa; 01894 yytype_int16 *yyssp; 01895 01896 /* The semantic value stack. */ 01897 YYSTYPE yyvsa[YYINITDEPTH]; 01898 YYSTYPE *yyvs = yyvsa; 01899 YYSTYPE *yyvsp; 01900 01901 /* The location stack. */ 01902 YYLTYPE yylsa[YYINITDEPTH]; 01903 YYLTYPE *yyls = yylsa; 01904 YYLTYPE *yylsp; 01905 /* The locations where the error started and ended. */ 01906 YYLTYPE yyerror_range[2]; 01907 01908 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) 01909 01910 YYSIZE_T yystacksize = YYINITDEPTH; 01911 01912 /* The variables used to return semantic value and location from the 01913 action routines. */ 01914 YYSTYPE yyval; 01915 YYLTYPE yyloc; 01916 01917 /* The number of symbols on the RHS of the reduced rule. 01918 Keep to zero when no symbol should be popped. */ 01919 int yylen = 0; 01920 01921 YYDPRINTF ((stderr, "Starting parse\n")); 01922 01923 yystate = 0; 01924 yyerrstatus = 0; 01925 yynerrs = 0; 01926 yychar = YYEMPTY; /* Cause a token to be read. */ 01927 01928 /* Initialize stack pointers. 01929 Waste one element of value and location stack 01930 so that they stay on the same level as the state stack. 01931 The wasted elements are never initialized. */ 01932 01933 yyssp = yyss; 01934 yyvsp = yyvs; 01935 yylsp = yyls; 01936 #if YYLTYPE_IS_TRIVIAL 01937 /* Initialize the default location before parsing starts. */ 01938 yylloc.first_line = yylloc.last_line = 1; 01939 yylloc.first_column = yylloc.last_column = 0; 01940 #endif 01941 01942 goto yysetstate; 01943 01944 /*------------------------------------------------------------. 01945 | yynewstate -- Push a new state, which is found in yystate. | 01946 `------------------------------------------------------------*/ 01947 yynewstate: 01948 /* In all cases, when you get here, the value and location stacks 01949 have just been pushed. So pushing a state here evens the stacks. */ 01950 yyssp++; 01951 01952 yysetstate: 01953 *yyssp = yystate; 01954 01955 if (yyss + yystacksize - 1 <= yyssp) 01956 { 01957 /* Get the current used size of the three stacks, in elements. */ 01958 YYSIZE_T yysize = yyssp - yyss + 1; 01959 01960 #ifdef yyoverflow 01961 { 01962 /* Give user a chance to reallocate the stack. Use copies of 01963 these so that the &'s don't force the real ones into 01964 memory. */ 01965 YYSTYPE *yyvs1 = yyvs; 01966 yytype_int16 *yyss1 = yyss; 01967 YYLTYPE *yyls1 = yyls; 01968 01969 /* Each stack pointer address is followed by the size of the 01970 data in use in that stack, in bytes. This used to be a 01971 conditional around just the two extra args, but that might 01972 be undefined if yyoverflow is a macro. */ 01973 yyoverflow (YY_("memory exhausted"), 01974 &yyss1, yysize * sizeof (*yyssp), 01975 &yyvs1, yysize * sizeof (*yyvsp), 01976 &yyls1, yysize * sizeof (*yylsp), 01977 &yystacksize); 01978 yyls = yyls1; 01979 yyss = yyss1; 01980 yyvs = yyvs1; 01981 } 01982 #else /* no yyoverflow */ 01983 # ifndef YYSTACK_RELOCATE 01984 goto yyexhaustedlab; 01985 # else 01986 /* Extend the stack our own way. */ 01987 if (YYMAXDEPTH <= yystacksize) 01988 goto yyexhaustedlab; 01989 yystacksize *= 2; 01990 if (YYMAXDEPTH < yystacksize) 01991 yystacksize = YYMAXDEPTH; 01992 01993 { 01994 yytype_int16 *yyss1 = yyss; 01995 union yyalloc *yyptr = 01996 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 01997 if (! yyptr) 01998 goto yyexhaustedlab; 01999 YYSTACK_RELOCATE (yyss); 02000 YYSTACK_RELOCATE (yyvs); 02001 YYSTACK_RELOCATE (yyls); 02002 # undef YYSTACK_RELOCATE 02003 if (yyss1 != yyssa) 02004 YYSTACK_FREE (yyss1); 02005 } 02006 # endif 02007 #endif /* no yyoverflow */ 02008 02009 yyssp = yyss + yysize - 1; 02010 yyvsp = yyvs + yysize - 1; 02011 yylsp = yyls + yysize - 1; 02012 02013 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 02014 (unsigned long int) yystacksize)); 02015 02016 if (yyss + yystacksize - 1 <= yyssp) 02017 YYABORT; 02018 } 02019 02020 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 02021 02022 goto yybackup; 02023 02024 /*-----------. 02025 | yybackup. | 02026 `-----------*/ 02027 yybackup: 02028 02029 /* Do appropriate processing given the current state. Read a 02030 look-ahead token if we need one and don't already have one. */ 02031 02032 /* First try to decide what to do without reference to look-ahead token. */ 02033 yyn = yypact[yystate]; 02034 if (yyn == YYPACT_NINF) 02035 goto yydefault; 02036 02037 /* Not known => get a look-ahead token if don't already have one. */ 02038 02039 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ 02040 if (yychar == YYEMPTY) 02041 { 02042 YYDPRINTF ((stderr, "Reading a token: ")); 02043 yychar = YYLEX; 02044 } 02045 02046 if (yychar <= YYEOF) 02047 { 02048 yychar = yytoken = YYEOF; 02049 YYDPRINTF ((stderr, "Now at end of input.\n")); 02050 } 02051 else 02052 { 02053 yytoken = YYTRANSLATE (yychar); 02054 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 02055 } 02056 02057 /* If the proper action on seeing token YYTOKEN is to reduce or to 02058 detect an error, take that action. */ 02059 yyn += yytoken; 02060 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 02061 goto yydefault; 02062 yyn = yytable[yyn]; 02063 if (yyn <= 0) 02064 { 02065 if (yyn == 0 || yyn == YYTABLE_NINF) 02066 goto yyerrlab; 02067 yyn = -yyn; 02068 goto yyreduce; 02069 } 02070 02071 if (yyn == YYFINAL) 02072 YYACCEPT; 02073 02074 /* Count tokens shifted since error; after three, turn off error 02075 status. */ 02076 if (yyerrstatus) 02077 yyerrstatus--; 02078 02079 /* Shift the look-ahead token. */ 02080 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 02081 02082 /* Discard the shifted token unless it is eof. */ 02083 if (yychar != YYEOF) 02084 yychar = YYEMPTY; 02085 02086 yystate = yyn; 02087 *++yyvsp = yylval; 02088 *++yylsp = yylloc; 02089 goto yynewstate; 02090 02091 02092 /*-----------------------------------------------------------. 02093 | yydefault -- do the default action for the current state. | 02094 `-----------------------------------------------------------*/ 02095 yydefault: 02096 yyn = yydefact[yystate]; 02097 if (yyn == 0) 02098 goto yyerrlab; 02099 goto yyreduce; 02100 02101 02102 /*-----------------------------. 02103 | yyreduce -- Do a reduction. | 02104 `-----------------------------*/ 02105 yyreduce: 02106 /* yyn is the number of a rule to reduce with. */ 02107 yylen = yyr2[yyn]; 02108 02109 /* If YYLEN is nonzero, implement the default value of the action: 02110 `$$ = $1'. 02111 02112 Otherwise, the following line sets YYVAL to garbage. 02113 This behavior is undocumented and Bison 02114 users should not rely upon it. Assigning to YYVAL 02115 unconditionally makes the parser a bit smaller, and it avoids a 02116 GCC warning that YYVAL may be used uninitialized. */ 02117 yyval = yyvsp[1-yylen]; 02118 02119 /* Default location. */ 02120 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); 02121 YY_REDUCE_PRINT (yyn); 02122 switch (yyn) 02123 { 02124 case 2: 02125 #line 191 "ael.y" 02126 { (yyval.pval) = parseio->pval = (yyvsp[(1) - (1)].pval); ;} 02127 break; 02128 02129 case 3: 02130 #line 194 "ael.y" 02131 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 02132 break; 02133 02134 case 4: 02135 #line 195 "ael.y" 02136 { (yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;} 02137 break; 02138 02139 case 5: 02140 #line 196 "ael.y" 02141 {(yyval.pval)=(yyvsp[(1) - (2)].pval);;} 02142 break; 02143 02144 case 6: 02145 #line 199 "ael.y" 02146 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 02147 break; 02148 02149 case 7: 02150 #line 200 "ael.y" 02151 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 02152 break; 02153 02154 case 8: 02155 #line 201 "ael.y" 02156 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 02157 break; 02158 02159 case 9: 02160 #line 202 "ael.y" 02161 {(yyval.pval)=0;/* allow older docs to be read */;} 02162 break; 02163 02164 case 10: 02165 #line 205 "ael.y" 02166 { (yyval.str) = (yyvsp[(1) - (1)].str); ;} 02167 break; 02168 02169 case 11: 02170 #line 206 "ael.y" 02171 { (yyval.str) = strdup("default"); ;} 02172 break; 02173 02174 case 12: 02175 #line 209 "ael.y" 02176 { 02177 (yyval.pval) = npval2(PV_CONTEXT, &(yylsp[(1) - (6)]), &(yylsp[(6) - (6)])); 02178 (yyval.pval)->u1.str = (yyvsp[(3) - (6)].str); 02179 (yyval.pval)->u2.statements = (yyvsp[(5) - (6)].pval); 02180 set_dads((yyval.pval),(yyvsp[(5) - (6)].pval)); 02181 (yyval.pval)->u3.abstract = (yyvsp[(1) - (6)].intval);;} 02182 break; 02183 02184 case 13: 02185 #line 218 "ael.y" 02186 { (yyval.intval) = 1; ;} 02187 break; 02188 02189 case 14: 02190 #line 219 "ael.y" 02191 { (yyval.intval) = 0; ;} 02192 break; 02193 02194 case 15: 02195 #line 220 "ael.y" 02196 { (yyval.intval) = 2; ;} 02197 break; 02198 02199 case 16: 02200 #line 221 "ael.y" 02201 { (yyval.intval)=3; ;} 02202 break; 02203 02204 case 17: 02205 #line 222 "ael.y" 02206 { (yyval.intval)=3; ;} 02207 break; 02208 02209 case 18: 02210 #line 225 "ael.y" 02211 { 02212 (yyval.pval) = npval2(PV_MACRO, &(yylsp[(1) - (8)]), &(yylsp[(8) - (8)])); 02213 (yyval.pval)->u1.str = (yyvsp[(2) - (8)].str); (yyval.pval)->u2.arglist = (yyvsp[(4) - (8)].pval); (yyval.pval)->u3.macro_statements = (yyvsp[(7) - (8)].pval); 02214 set_dads((yyval.pval),(yyvsp[(7) - (8)].pval));;} 02215 break; 02216 02217 case 19: 02218 #line 231 "ael.y" 02219 { 02220 (yyval.pval) = npval2(PV_GLOBALS, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)])); 02221 (yyval.pval)->u1.statements = (yyvsp[(3) - (4)].pval); 02222 set_dads((yyval.pval),(yyvsp[(3) - (4)].pval));;} 02223 break; 02224 02225 case 20: 02226 #line 237 "ael.y" 02227 { (yyval.pval) = NULL; ;} 02228 break; 02229 02230 case 21: 02231 #line 238 "ael.y" 02232 {(yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;} 02233 break; 02234 02235 case 22: 02236 #line 239 "ael.y" 02237 {(yyval.pval)=(yyvsp[(2) - (2)].pval);;} 02238 break; 02239 02240 case 23: 02241 #line 242 "ael.y" 02242 { reset_semicount(parseio->scanner); ;} 02243 break; 02244 02245 case 24: 02246 #line 242 "ael.y" 02247 { 02248 (yyval.pval) = npval2(PV_VARDEC, &(yylsp[(1) - (5)]), &(yylsp[(5) - (5)])); 02249 (yyval.pval)->u1.str = (yyvsp[(1) - (5)].str); 02250 (yyval.pval)->u2.val = (yyvsp[(4) - (5)].str); ;} 02251 break; 02252 02253 case 25: 02254 #line 248 "ael.y" 02255 { reset_semicount(parseio->scanner); ;} 02256 break; 02257 02258 case 26: 02259 #line 248 "ael.y" 02260 { 02261 (yyval.pval) = npval2(PV_LOCALVARDEC, &(yylsp[(1) - (6)]), &(yylsp[(6) - (6)])); 02262 (yyval.pval)->u1.str = (yyvsp[(2) - (6)].str); 02263 (yyval.pval)->u2.val = (yyvsp[(5) - (6)].str); ;} 02264 break; 02265 02266 case 27: 02267 #line 255 "ael.y" 02268 { (yyval.pval) = NULL; ;} 02269 break; 02270 02271 case 28: 02272 #line 256 "ael.y" 02273 { (yyval.pval) = nword((yyvsp[(1) - (1)].str), &(yylsp[(1) - (1)])); ;} 02274 break; 02275 02276 case 29: 02277 #line 257 "ael.y" 02278 { (yyval.pval) = linku1((yyvsp[(1) - (3)].pval), nword((yyvsp[(3) - (3)].str), &(yylsp[(3) - (3)]))); ;} 02279 break; 02280 02281 case 30: 02282 #line 258 "ael.y" 02283 {(yyval.pval)=(yyvsp[(1) - (2)].pval);;} 02284 break; 02285 02286 case 31: 02287 #line 261 "ael.y" 02288 {(yyval.pval)=0;;} 02289 break; 02290 02291 case 32: 02292 #line 262 "ael.y" 02293 { (yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;} 02294 break; 02295 02296 case 33: 02297 #line 263 "ael.y" 02298 { (yyval.pval)=(yyvsp[(2) - (2)].pval);;} 02299 break; 02300 02301 case 34: 02302 #line 266 "ael.y" 02303 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 02304 break; 02305 02306 case 35: 02307 #line 267 "ael.y" 02308 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 02309 break; 02310 02311 case 36: 02312 #line 268 "ael.y" 02313 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 02314 break; 02315 02316 case 37: 02317 #line 269 "ael.y" 02318 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 02319 break; 02320 02321 case 38: 02322 #line 270 "ael.y" 02323 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 02324 break; 02325 02326 case 39: 02327 #line 271 "ael.y" 02328 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 02329 break; 02330 02331 case 40: 02332 #line 272 "ael.y" 02333 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 02334 break; 02335 02336 case 41: 02337 #line 273 "ael.y" 02338 {free((yyvsp[(1) - (2)].str)); (yyval.pval)=0;;} 02339 break; 02340 02341 case 42: 02342 #line 274 "ael.y" 02343 {(yyval.pval)=0;/* allow older docs to be read */;} 02344 break; 02345 02346 case 43: 02347 #line 277 "ael.y" 02348 { 02349 (yyval.pval) = npval2(PV_IGNOREPAT, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)])); 02350 (yyval.pval)->u1.str = (yyvsp[(3) - (4)].str);;} 02351 break; 02352 02353 case 44: 02354 #line 282 "ael.y" 02355 { 02356 (yyval.pval) = npval2(PV_EXTENSION, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)])); 02357 (yyval.pval)->u1.str = (yyvsp[(1) - (3)].str); 02358 (yyval.pval)->u2.statements = (yyvsp[(3) - (3)].pval); set_dads((yyval.pval),(yyvsp[(3) - (3)].pval));;} 02359 break; 02360 02361 case 45: 02362 #line 286 "ael.y" 02363 { 02364 (yyval.pval) = npval2(PV_EXTENSION, &(yylsp[(1) - (5)]), &(yylsp[(3) - (5)])); 02365 (yyval.pval)->u1.str = malloc(strlen((yyvsp[(1) - (5)].str))+strlen((yyvsp[(3) - (5)].str))+2); 02366 strcpy((yyval.pval)->u1.str,(yyvsp[(1) - (5)].str)); 02367 strcat((yyval.pval)->u1.str,"@"); 02368 strcat((yyval.pval)->u1.str,(yyvsp[(3) - (5)].str)); 02369 free((yyvsp[(1) - (5)].str)); 02370 (yyval.pval)->u2.statements = (yyvsp[(5) - (5)].pval); set_dads((yyval.pval),(yyvsp[(5) - (5)].pval));;} 02371 break; 02372 02373 case 46: 02374 #line 294 "ael.y" 02375 { 02376 (yyval.pval) = npval2(PV_EXTENSION, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)])); 02377 (yyval.pval)->u1.str = (yyvsp[(2) - (4)].str); 02378 (yyval.pval)->u2.statements = (yyvsp[(4) - (4)].pval); set_dads((yyval.pval),(yyvsp[(4) - (4)].pval)); 02379 (yyval.pval)->u4.regexten=1;;} 02380 break; 02381 02382 case 47: 02383 #line 299 "ael.y" 02384 { 02385 (yyval.pval) = npval2(PV_EXTENSION, &(yylsp[(1) - (7)]), &(yylsp[(7) - (7)])); 02386 (yyval.pval)->u1.str = (yyvsp[(5) - (7)].str); 02387 (yyval.pval)->u2.statements = (yyvsp[(7) - (7)].pval); set_dads((yyval.pval),(yyvsp[(7) - (7)].pval)); 02388 (yyval.pval)->u3.hints = (yyvsp[(3) - (7)].str);;} 02389 break; 02390 02391 case 48: 02392 #line 304 "ael.y" 02393 { 02394 (yyval.pval) = npval2(PV_EXTENSION, &(yylsp[(1) - (8)]), &(yylsp[(8) - (8)])); 02395 (yyval.pval)->u1.str = (yyvsp[(6) - (8)].str); 02396 (yyval.pval)->u2.statements = (yyvsp[(8) - (8)].pval); set_dads((yyval.pval),(yyvsp[(8) - (8)].pval)); 02397 (yyval.pval)->u4.regexten=1; 02398 (yyval.pval)->u3.hints = (yyvsp[(4) - (8)].str);;} 02399 break; 02400 02401 case 49: 02402 #line 313 "ael.y" 02403 { (yyval.pval) = NULL; ;} 02404 break; 02405 02406 case 50: 02407 #line 314 "ael.y" 02408 { (yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;} 02409 break; 02410 02411 case 51: 02412 #line 315 "ael.y" 02413 {(yyval.pval)=(yyvsp[(2) - (2)].pval);;} 02414 break; 02415 02416 case 52: 02417 #line 321 "ael.y" 02418 { 02419 if (asprintf(&(yyval.str), "%s:%s:%s", (yyvsp[(1) - (5)].str), (yyvsp[(3) - (5)].str), (yyvsp[(5) - (5)].str)) < 0) { 02420 ast_log(LOG_WARNING, "asprintf() failed\n"); 02421 (yyval.str) = NULL; 02422 } else { 02423 free((yyvsp[(1) - (5)].str)); 02424 free((yyvsp[(3) - (5)].str)); 02425 free((yyvsp[(5) - (5)].str)); 02426 } 02427 ;} 02428 break; 02429 02430 case 53: 02431 #line 331 "ael.y" 02432 { (yyval.str) = (yyvsp[(1) - (1)].str); ;} 02433 break; 02434 02435 case 54: 02436 #line 335 "ael.y" 02437 { 02438 (yyval.pval) = nword((yyvsp[(1) - (7)].str), &(yylsp[(1) - (7)])); 02439 (yyval.pval)->next = nword((yyvsp[(3) - (7)].str), &(yylsp[(3) - (7)])); 02440 (yyval.pval)->next->next = nword((yyvsp[(5) - (7)].str), &(yylsp[(5) - (7)])); 02441 (yyval.pval)->next->next->next = nword((yyvsp[(7) - (7)].str), &(yylsp[(7) - (7)])); ;} 02442 break; 02443 02444 case 55: 02445 #line 343 "ael.y" 02446 { reset_parencount(parseio->scanner); ;} 02447 break; 02448 02449 case 56: 02450 #line 343 "ael.y" 02451 { (yyval.str) = (yyvsp[(3) - (4)].str); ;} 02452 break; 02453 02454 case 57: 02455 #line 347 "ael.y" 02456 { 02457 (yyval.pval)= npval2(PV_IF, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)])); 02458 (yyval.pval)->u1.str = (yyvsp[(2) - (2)].str); ;} 02459 break; 02460 02461 case 58: 02462 #line 350 "ael.y" 02463 { 02464 (yyval.pval) = npval2(PV_RANDOM, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)])); 02465 (yyval.pval)->u1.str=(yyvsp[(2) - (2)].str);;} 02466 break; 02467 02468 case 59: 02469 #line 353 "ael.y" 02470 { 02471 (yyval.pval) = npval2(PV_IFTIME, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)])); 02472 (yyval.pval)->u1.list = (yyvsp[(3) - (4)].pval); 02473 prev_word = 0; ;} 02474 break; 02475 02476 case 60: 02477 #line 364 "ael.y" 02478 { (yyval.str) = (yyvsp[(1) - (1)].str);;} 02479 break; 02480 02481 case 61: 02482 #line 365 "ael.y" 02483 { 02484 if (asprintf(&((yyval.str)), "%s%s", (yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str)) < 0) { 02485 ast_log(LOG_WARNING, "asprintf() failed\n"); 02486 (yyval.str) = NULL; 02487 } else { 02488 free((yyvsp[(1) - (2)].str)); 02489 free((yyvsp[(2) - (2)].str)); 02490 prev_word = (yyval.str); 02491 } 02492 ;} 02493 break; 02494 02495 case 62: 02496 #line 377 "ael.y" 02497 { (yyval.str) = (yyvsp[(1) - (1)].str); ;} 02498 break; 02499 02500 case 63: 02501 #line 378 "ael.y" 02502 { 02503 if (asprintf(&((yyval.str)), "%s %s", (yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str)) < 0) { 02504 ast_log(LOG_WARNING, "asprintf() failed\n"); 02505 (yyval.str) = NULL; 02506 } else { 02507 free((yyvsp[(1) - (2)].str)); 02508 free((yyvsp[(2) - (2)].str)); 02509 } 02510 ;} 02511 break; 02512 02513 case 64: 02514 #line 387 "ael.y" 02515 { 02516 if (asprintf(&((yyval.str)), "%s:%s", (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str)) < 0) { 02517 ast_log(LOG_WARNING, "asprintf() failed\n"); 02518 (yyval.str) = NULL; 02519 } else { 02520 free((yyvsp[(1) - (3)].str)); 02521 free((yyvsp[(3) - (3)].str)); 02522 } 02523 ;} 02524 break; 02525 02526 case 65: 02527 #line 396 "ael.y" 02528 { /* there are often '&' in hints */ 02529 if (asprintf(&((yyval.str)), "%s&%s", (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str)) < 0) { 02530 ast_log(LOG_WARNING, "asprintf() failed\n"); 02531 (yyval.str) = NULL; 02532 } else { 02533 free((yyvsp[(1) - (3)].str)); 02534 free((yyvsp[(3) - (3)].str)); 02535 } 02536 ;} 02537 break; 02538 02539 case 66: 02540 #line 405 "ael.y" 02541 { 02542 if (asprintf(&((yyval.str)), "%s@%s", (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str)) < 0) { 02543 ast_log(LOG_WARNING, "asprintf() failed\n"); 02544 (yyval.str) = NULL; 02545 } else { 02546 free((yyvsp[(1) - (3)].str)); 02547 free((yyvsp[(3) - (3)].str)); 02548 } 02549 ;} 02550 break; 02551 02552 case 67: 02553 #line 416 "ael.y" 02554 { (yyval.str) = (yyvsp[(1) - (1)].str);;} 02555 break; 02556 02557 case 68: 02558 #line 417 "ael.y" 02559 { 02560 if (asprintf(&((yyval.str)), "%s%s", (yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str)) < 0) { 02561 ast_log(LOG_WARNING, "asprintf() failed\n"); 02562 (yyval.str) = NULL; 02563 } else { 02564 free((yyvsp[(1) - (2)].str)); 02565 free((yyvsp[(2) - (2)].str)); 02566 prev_word = (yyval.str); 02567 } 02568 ;} 02569 break; 02570 02571 case 69: 02572 #line 427 "ael.y" 02573 { 02574 if (asprintf(&((yyval.str)), "%s%s%s", (yyvsp[(1) - (3)].str), (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str)) < 0) { 02575 ast_log(LOG_WARNING, "asprintf() failed\n"); 02576 (yyval.str) = NULL; 02577 } else { 02578 free((yyvsp[(1) - (3)].str)); 02579 free((yyvsp[(2) - (3)].str)); 02580 free((yyvsp[(3) - (3)].str)); 02581 prev_word=(yyval.str); 02582 } 02583 ;} 02584 break; 02585 02586 case 70: 02587 #line 440 "ael.y" 02588 { (yyval.str) = (yyvsp[(1) - (1)].str);;} 02589 break; 02590 02591 case 71: 02592 #line 441 "ael.y" 02593 { 02594 if (asprintf(&((yyval.str)), "%s%s", (yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str)) < 0) { 02595 ast_log(LOG_WARNING, "asprintf() failed\n"); 02596 (yyval.str) = NULL; 02597 } else { 02598 free((yyvsp[(1) - (2)].str)); 02599 free((yyvsp[(2) - (2)].str)); 02600 } 02601 ;} 02602 break; 02603 02604 case 72: 02605 #line 450 "ael.y" 02606 { 02607 if (asprintf(&((yyval.str)), "%s:%s", (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str)) < 0) { 02608 ast_log(LOG_WARNING, "asprintf() failed\n"); 02609 (yyval.str) = NULL; 02610 } else { 02611 free((yyvsp[(1) - (3)].str)); 02612 free((yyvsp[(3) - (3)].str)); 02613 } 02614 ;} 02615 break; 02616 02617 case 73: 02618 #line 461 "ael.y" 02619 { 02620 (yyval.pval) = npval2(PV_SWITCH, &(yylsp[(1) - (5)]), &(yylsp[(5) - (5)])); 02621 (yyval.pval)->u1.str = (yyvsp[(2) - (5)].str); 02622 (yyval.pval)->u2.statements = (yyvsp[(4) - (5)].pval); set_dads((yyval.pval),(yyvsp[(4) - (5)].pval));;} 02623 break; 02624 02625 case 74: 02626 #line 470 "ael.y" 02627 { 02628 (yyval.pval) = npval2(PV_STATEMENTBLOCK, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)])); 02629 (yyval.pval)->u1.list = (yyvsp[(2) - (3)].pval); set_dads((yyval.pval),(yyvsp[(2) - (3)].pval));;} 02630 break; 02631 02632 case 75: 02633 #line 473 "ael.y" 02634 { (yyval.pval) = (yyvsp[(1) - (1)].pval); ;} 02635 break; 02636 02637 case 76: 02638 #line 474 "ael.y" 02639 { (yyval.pval) = (yyvsp[(1) - (1)].pval); ;} 02640 break; 02641 02642 case 77: 02643 #line 475 "ael.y" 02644 { 02645 (yyval.pval) = npval2(PV_GOTO, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)])); 02646 (yyval.pval)->u1.list = (yyvsp[(2) - (3)].pval);;} 02647 break; 02648 02649 case 78: 02650 #line 478 "ael.y" 02651 { 02652 (yyval.pval) = npval2(PV_GOTO, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)])); 02653 (yyval.pval)->u1.list = (yyvsp[(2) - (3)].pval);;} 02654 break; 02655 02656 case 79: 02657 #line 481 "ael.y" 02658 { 02659 (yyval.pval) = npval2(PV_LABEL, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)])); 02660 (yyval.pval)->u1.str = (yyvsp[(1) - (2)].str); ;} 02661 break; 02662 02663 case 80: 02664 #line 484 "ael.y" 02665 {reset_semicount(parseio->scanner);;} 02666 break; 02667 02668 case 81: 02669 #line 485 "ael.y" 02670 {reset_semicount(parseio->scanner);;} 02671 break; 02672 02673 case 82: 02674 #line 486 "ael.y" 02675 {reset_parencount(parseio->scanner);;} 02676 break; 02677 02678 case 83: 02679 #line 486 "ael.y" 02680 { /* XXX word_list maybe ? */ 02681 (yyval.pval) = npval2(PV_FOR, &(yylsp[(1) - (12)]), &(yylsp[(12) - (12)])); 02682 (yyval.pval)->u1.for_init = (yyvsp[(4) - (12)].str); 02683 (yyval.pval)->u2.for_test=(yyvsp[(7) - (12)].str); 02684 (yyval.pval)->u3.for_inc = (yyvsp[(10) - (12)].str); 02685 (yyval.pval)->u4.for_statements = (yyvsp[(12) - (12)].pval); set_dads((yyval.pval),(yyvsp[(12) - (12)].pval));;} 02686 break; 02687 02688 case 84: 02689 #line 492 "ael.y" 02690 { 02691 (yyval.pval) = npval2(PV_WHILE, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)])); 02692 (yyval.pval)->u1.str = (yyvsp[(2) - (3)].str); 02693 (yyval.pval)->u2.statements = (yyvsp[(3) - (3)].pval); set_dads((yyval.pval),(yyvsp[(3) - (3)].pval));;} 02694 break; 02695 02696 case 85: 02697 #line 496 "ael.y" 02698 { (yyval.pval) = (yyvsp[(1) - (1)].pval); ;} 02699 break; 02700 02701 case 86: 02702 #line 497 "ael.y" 02703 { (yyval.pval) = update_last((yyvsp[(2) - (3)].pval), &(yylsp[(2) - (3)])); ;} 02704 break; 02705 02706 case 87: 02707 #line 498 "ael.y" 02708 { (yyval.pval) = update_last((yyvsp[(1) - (2)].pval), &(yylsp[(2) - (2)])); ;} 02709 break; 02710 02711 case 88: 02712 #line 499 "ael.y" 02713 { 02714 (yyval.pval)= npval2(PV_APPLICATION_CALL, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)])); 02715 (yyval.pval)->u1.str = (yyvsp[(1) - (2)].str);;} 02716 break; 02717 02718 case 89: 02719 #line 502 "ael.y" 02720 {reset_semicount(parseio->scanner);;} 02721 break; 02722 02723 case 90: 02724 #line 502 "ael.y" 02725 { 02726 char *bufx; 02727 int tot=0; 02728 pval *pptr; 02729 (yyval.pval) = npval2(PV_VARDEC, &(yylsp[(1) - (5)]), &(yylsp[(5) - (5)])); 02730 (yyval.pval)->u2.val=(yyvsp[(4) - (5)].str); 02731 /* rebuild the original string-- this is not an app call, it's an unwrapped vardec, with a func call on the LHS */ 02732 /* string to big to fit in the buffer? */ 02733 tot+=strlen((yyvsp[(1) - (5)].pval)->u1.str); 02734 for(pptr=(yyvsp[(1) - (5)].pval)->u2.arglist;pptr;pptr=pptr->next) { 02735 tot+=strlen(pptr->u1.str); 02736 tot++; /* for a sep like a comma */ 02737 } 02738 tot+=4; /* for safety */ 02739 bufx = calloc(1, tot); 02740 strcpy(bufx,(yyvsp[(1) - (5)].pval)->u1.str); 02741 strcat(bufx,"("); 02742 /* XXX need to advance the pointer or the loop is very inefficient */ 02743 for (pptr=(yyvsp[(1) - (5)].pval)->u2.arglist;pptr;pptr=pptr->next) { 02744 if ( pptr != (yyvsp[(1) - (5)].pval)->u2.arglist ) 02745 strcat(bufx,","); 02746 strcat(bufx,pptr->u1.str); 02747 } 02748 strcat(bufx,")"); 02749 #ifdef AAL_ARGCHECK 02750 if ( !ael_is_funcname((yyvsp[(1) - (5)].pval)->u1.str) ) 02751 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", 02752 my_file, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column, (yylsp[(1) - (5)]).last_column, (yyvsp[(1) - (5)].pval)->u1.str); 02753 #endif 02754 (yyval.pval)->u1.str = bufx; 02755 destroy_pval((yyvsp[(1) - (5)].pval)); /* the app call it is not, get rid of that chain */ 02756 prev_word = 0; 02757 ;} 02758 break; 02759 02760 case 91: 02761 #line 535 "ael.y" 02762 { (yyval.pval) = npval2(PV_BREAK, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)])); ;} 02763 break; 02764 02765 case 92: 02766 #line 536 "ael.y" 02767 { (yyval.pval) = npval2(PV_RETURN, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)])); ;} 02768 break; 02769 02770 case 93: 02771 #line 537 "ael.y" 02772 { (yyval.pval) = npval2(PV_CONTINUE, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)])); ;} 02773 break; 02774 02775 case 94: 02776 #line 538 "ael.y" 02777 { 02778 (yyval.pval) = update_last((yyvsp[(1) - (3)].pval), &(yylsp[(2) - (3)])); 02779 (yyval.pval)->u2.statements = (yyvsp[(2) - (3)].pval); set_dads((yyval.pval),(yyvsp[(2) - (3)].pval)); 02780 (yyval.pval)->u3.else_statements = (yyvsp[(3) - (3)].pval);set_dads((yyval.pval),(yyvsp[(3) - (3)].pval));;} 02781 break; 02782 02783 case 95: 02784 #line 542 "ael.y" 02785 { (yyval.pval)=0; ;} 02786 break; 02787 02788 case 96: 02789 #line 545 "ael.y" 02790 { (yyval.pval) = (yyvsp[(2) - (2)].pval); ;} 02791 break; 02792 02793 case 97: 02794 #line 546 "ael.y" 02795 { (yyval.pval) = NULL ; ;} 02796 break; 02797 02798 case 98: 02799 #line 549 "ael.y" 02800 { (yyval.pval) = nword((yyvsp[(1) - (1)].str), &(yylsp[(1) - (1)])); ;} 02801 break; 02802 02803 case 99: 02804 #line 550 "ael.y" 02805 { 02806 (yyval.pval) = nword((yyvsp[(1) - (3)].str), &(yylsp[(1) - (3)])); 02807 (yyval.pval)->next = nword((yyvsp[(3) - (3)].str), &(yylsp[(3) - (3)])); ;} 02808 break; 02809 02810 case 100: 02811 #line 553 "ael.y" 02812 { 02813 (yyval.pval) = nword((yyvsp[(1) - (3)].str), &(yylsp[(1) - (3)])); 02814 (yyval.pval)->next = nword((yyvsp[(3) - (3)].str), &(yylsp[(3) - (3)])); ;} 02815 break; 02816 02817 case 101: 02818 #line 556 "ael.y" 02819 { 02820 (yyval.pval) = nword((yyvsp[(1) - (5)].str), &(yylsp[(1) - (5)])); 02821 (yyval.pval)->next = nword((yyvsp[(3) - (5)].str), &(yylsp[(3) - (5)])); 02822 (yyval.pval)->next->next = nword((yyvsp[(5) - (5)].str), &(yylsp[(5) - (5)])); ;} 02823 break; 02824 02825 case 102: 02826 #line 560 "ael.y" 02827 { 02828 (yyval.pval) = nword((yyvsp[(1) - (5)].str), &(yylsp[(1) - (5)])); 02829 (yyval.pval)->next = nword((yyvsp[(3) - (5)].str), &(yylsp[(3) - (5)])); 02830 (yyval.pval)->next->next = nword((yyvsp[(5) - (5)].str), &(yylsp[(5) - (5)])); ;} 02831 break; 02832 02833 case 103: 02834 #line 564 "ael.y" 02835 { 02836 (yyval.pval) = nword(strdup("default"), &(yylsp[(1) - (5)])); 02837 (yyval.pval)->next = nword((yyvsp[(3) - (5)].str), &(yylsp[(3) - (5)])); 02838 (yyval.pval)->next->next = nword((yyvsp[(5) - (5)].str), &(yylsp[(5) - (5)])); ;} 02839 break; 02840 02841 case 104: 02842 #line 568 "ael.y" 02843 { 02844 (yyval.pval) = nword(strdup("default"), &(yylsp[(1) - (5)])); 02845 (yyval.pval)->next = nword((yyvsp[(3) - (5)].str), &(yylsp[(3) - (5)])); 02846 (yyval.pval)->next->next = nword((yyvsp[(5) - (5)].str), &(yylsp[(5) - (5)])); ;} 02847 break; 02848 02849 case 105: 02850 #line 574 "ael.y" 02851 { (yyval.str) = strdup("1"); ;} 02852 break; 02853 02854 case 106: 02855 #line 575 "ael.y" 02856 { (yyval.str) = (yyvsp[(2) - (2)].str); ;} 02857 break; 02858 02859 case 107: 02860 #line 579 "ael.y" 02861 { /* ext[, pri] default 1 */ 02862 (yyval.pval) = nword((yyvsp[(1) - (2)].str), &(yylsp[(1) - (2)])); 02863 (yyval.pval)->next = nword((yyvsp[(2) - (2)].str), &(yylsp[(2) - (2)])); ;} 02864 break; 02865 02866 case 108: 02867 #line 582 "ael.y" 02868 { /* context, ext, pri */ 02869 (yyval.pval) = nword((yyvsp[(4) - (4)].str), &(yylsp[(4) - (4)])); 02870 (yyval.pval)->next = nword((yyvsp[(1) - (4)].str), &(yylsp[(1) - (4)])); 02871 (yyval.pval)->next->next = nword((yyvsp[(2) - (4)].str), &(yylsp[(2) - (4)])); ;} 02872 break; 02873 02874 case 109: 02875 #line 588 "ael.y" 02876 {reset_argcount(parseio->scanner);;} 02877 break; 02878 02879 case 110: 02880 #line 588 "ael.y" 02881 { 02882 /* XXX original code had @2 but i think we need @5 */ 02883 (yyval.pval) = npval2(PV_MACRO_CALL, &(yylsp[(1) - (5)]), &(yylsp[(5) - (5)])); 02884 (yyval.pval)->u1.str = (yyvsp[(1) - (5)].str); 02885 (yyval.pval)->u2.arglist = (yyvsp[(4) - (5)].pval);;} 02886 break; 02887 02888 case 111: 02889 #line 593 "ael.y" 02890 { 02891 (yyval.pval)= npval2(PV_MACRO_CALL, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)])); 02892 (yyval.pval)->u1.str = (yyvsp[(1) - (3)].str); ;} 02893 break; 02894 02895 case 112: 02896 #line 601 "ael.y" 02897 {reset_argcount(parseio->scanner);;} 02898 break; 02899 02900 case 113: 02901 #line 601 "ael.y" 02902 { 02903 if (strcasecmp((yyvsp[(1) - (3)].str),"goto") == 0) { 02904 (yyval.pval) = npval2(PV_GOTO, &(yylsp[(1) - (3)]), &(yylsp[(2) - (3)])); 02905 free((yyvsp[(1) - (3)].str)); /* won't be using this */ 02906 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[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yylsp[(1) - (3)]).last_column ); 02907 } else { 02908 (yyval.pval)= npval2(PV_APPLICATION_CALL, &(yylsp[(1) - (3)]), &(yylsp[(2) - (3)])); 02909 (yyval.pval)->u1.str = (yyvsp[(1) - (3)].str); 02910 } ;} 02911 break; 02912 02913 case 114: 02914 #line 612 "ael.y" 02915 { 02916 (yyval.pval) = update_last((yyvsp[(1) - (3)].pval), &(yylsp[(3) - (3)])); 02917 if( (yyval.pval)->type == PV_GOTO ) 02918 (yyval.pval)->u1.list = (yyvsp[(2) - (3)].pval); 02919 else 02920 (yyval.pval)->u2.arglist = (yyvsp[(2) - (3)].pval); 02921 ;} 02922 break; 02923 02924 case 115: 02925 #line 619 "ael.y" 02926 { (yyval.pval) = update_last((yyvsp[(1) - (2)].pval), &(yylsp[(2) - (2)])); ;} 02927 break; 02928 02929 case 116: 02930 #line 622 "ael.y" 02931 { (yyval.str) = (yyvsp[(1) - (1)].str) ;} 02932 break; 02933 02934 case 117: 02935 #line 623 "ael.y" 02936 { (yyval.str) = strdup(""); ;} 02937 break; 02938 02939 case 118: 02940 #line 626 "ael.y" 02941 { (yyval.pval) = nword((yyvsp[(1) - (1)].str), &(yylsp[(1) - (1)])); ;} 02942 break; 02943 02944 case 119: 02945 #line 627 "ael.y" 02946 { 02947 (yyval.pval)= npval(PV_WORD,0/*@1.first_line*/,0/*@1.last_line*/,0/* @1.first_column*/, 0/*@1.last_column*/); 02948 (yyval.pval)->u1.str = strdup(""); ;} 02949 break; 02950 02951 case 120: 02952 #line 630 "ael.y" 02953 { (yyval.pval) = linku1((yyvsp[(1) - (3)].pval), nword((yyvsp[(3) - (3)].str), &(yylsp[(3) - (3)]))); ;} 02954 break; 02955 02956 case 121: 02957 #line 633 "ael.y" 02958 { (yyval.pval) = NULL; ;} 02959 break; 02960 02961 case 122: 02962 #line 634 "ael.y" 02963 { (yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;} 02964 break; 02965 02966 case 123: 02967 #line 637 "ael.y" 02968 { 02969 (yyval.pval) = npval2(PV_CASE, &(yylsp[(1) - (4)]), &(yylsp[(3) - (4)])); /* XXX 3 or 4 ? */ 02970 (yyval.pval)->u1.str = (yyvsp[(2) - (4)].str); 02971 (yyval.pval)->u2.statements = (yyvsp[(4) - (4)].pval); set_dads((yyval.pval),(yyvsp[(4) - (4)].pval));;} 02972 break; 02973 02974 case 124: 02975 #line 641 "ael.y" 02976 { 02977 (yyval.pval) = npval2(PV_DEFAULT, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)])); 02978 (yyval.pval)->u1.str = NULL; 02979 (yyval.pval)->u2.statements = (yyvsp[(3) - (3)].pval);set_dads((yyval.pval),(yyvsp[(3) - (3)].pval));;} 02980 break; 02981 02982 case 125: 02983 #line 645 "ael.y" 02984 { 02985 (yyval.pval) = npval2(PV_PATTERN, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)])); /* XXX@3 or @4 ? */ 02986 (yyval.pval)->u1.str = (yyvsp[(2) - (4)].str); 02987 (yyval.pval)->u2.statements = (yyvsp[(4) - (4)].pval);set_dads((yyval.pval),(yyvsp[(4) - (4)].pval));;} 02988 break; 02989 02990 case 126: 02991 #line 651 "ael.y" 02992 { (yyval.pval) = NULL; ;} 02993 break; 02994 02995 case 127: 02996 #line 652 "ael.y" 02997 { (yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;} 02998 break; 02999 03000 case 128: 03001 #line 655 "ael.y" 03002 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;} 03003 break; 03004 03005 case 129: 03006 #line 656 "ael.y" 03007 { (yyval.pval)=(yyvsp[(1) - (1)].pval);;} 03008 break; 03009 03010 case 130: 03011 #line 657 "ael.y" 03012 { 03013 (yyval.pval) = npval2(PV_CATCH, &(yylsp[(1) - (5)]), &(yylsp[(5) - (5)])); 03014 (yyval.pval)->u1.str = (yyvsp[(2) - (5)].str); 03015 (yyval.pval)->u2.statements = (yyvsp[(4) - (5)].pval); set_dads((yyval.pval),(yyvsp[(4) - (5)].pval));;} 03016 break; 03017 03018 case 131: 03019 #line 663 "ael.y" 03020 { 03021 (yyval.pval) = npval2(PV_SWITCHES, &(yylsp[(1) - (4)]), &(yylsp[(2) - (4)])); 03022 (yyval.pval)->u1.list = (yyvsp[(3) - (4)].pval); set_dads((yyval.pval),(yyvsp[(3) - (4)].pval));;} 03023 break; 03024 03025 case 132: 03026 #line 668 "ael.y" 03027 { 03028 (yyval.pval) = npval2(PV_ESWITCHES, &(yylsp[(1) - (4)]), &(yylsp[(2) - (4)])); 03029 (yyval.pval)->u1.list = (yyvsp[(3) - (4)].pval); set_dads((yyval.pval),(yyvsp[(3) - (4)].pval));;} 03030 break; 03031 03032 case 133: 03033 #line 673 "ael.y" 03034 { (yyval.pval) = NULL; ;} 03035 break; 03036 03037 case 134: 03038 #line 674 "ael.y" 03039 { (yyval.pval) = linku1((yyvsp[(1) - (3)].pval),nword((yyvsp[(2) - (3)].str), &(yylsp[(2) - (3)]))); ;} 03040 break; 03041 03042 case 135: 03043 #line 675 "ael.y" 03044 { 03045 char *x; 03046 if (asprintf(&x,"%s@%s", (yyvsp[(2) - (5)].str), (yyvsp[(4) - (5)].str)) < 0) { 03047 ast_log(LOG_WARNING, "asprintf() failed\n"); 03048 (yyval.pval) = NULL; 03049 } else { 03050 free((yyvsp[(2) - (5)].str)); 03051 free((yyvsp[(4) - (5)].str)); 03052 (yyval.pval) = linku1((yyvsp[(1) - (5)].pval),nword(x, &(yylsp[(2) - (5)]))); 03053 } 03054 ;} 03055 break; 03056 03057 case 136: 03058 #line 686 "ael.y" 03059 {(yyval.pval)=(yyvsp[(2) - (2)].pval);;} 03060 break; 03061 03062 case 137: 03063 #line 689 "ael.y" 03064 { (yyval.pval) = nword((yyvsp[(1) - (1)].str), &(yylsp[(1) - (1)])); ;} 03065 break; 03066 03067 case 138: 03068 #line 690 "ael.y" 03069 { 03070 (yyval.pval) = nword((yyvsp[(1) - (3)].str), &(yylsp[(1) - (3)])); 03071 (yyval.pval)->u2.arglist = (yyvsp[(3) - (3)].pval); 03072 prev_word=0; /* XXX sure ? */ ;} 03073 break; 03074 03075 case 139: 03076 #line 697 "ael.y" 03077 { (yyval.pval) = (yyvsp[(1) - (2)].pval); ;} 03078 break; 03079 03080 case 140: 03081 #line 698 "ael.y" 03082 { (yyval.pval) = linku1((yyvsp[(1) - (3)].pval), (yyvsp[(2) - (3)].pval)); ;} 03083 break; 03084 03085 case 141: 03086 #line 699 "ael.y" 03087 {(yyval.pval)=(yyvsp[(1) - (2)].pval);;} 03088 break; 03089 03090 case 142: 03091 #line 702 "ael.y" 03092 { 03093 (yyval.pval) = npval2(PV_INCLUDES, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)])); 03094 (yyval.pval)->u1.list = (yyvsp[(3) - (4)].pval);set_dads((yyval.pval),(yyvsp[(3) - (4)].pval));;} 03095 break; 03096 03097 case 143: 03098 #line 705 "ael.y" 03099 { 03100 (yyval.pval) = npval2(PV_INCLUDES, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)]));;} 03101 break; 03102 03103 03104 /* Line 1267 of yacc.c. */ 03105 #line 3106 "ael.tab.c" 03106 default: break; 03107 } 03108 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 03109 03110 YYPOPSTACK (yylen); 03111 yylen = 0; 03112 YY_STACK_PRINT (yyss, yyssp); 03113 03114 *++yyvsp = yyval; 03115 *++yylsp = yyloc; 03116 03117 /* Now `shift' the result of the reduction. Determine what state 03118 that goes to, based on the state we popped back to and the rule 03119 number reduced by. */ 03120 03121 yyn = yyr1[yyn]; 03122 03123 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 03124 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 03125 yystate = yytable[yystate]; 03126 else 03127 yystate = yydefgoto[yyn - YYNTOKENS]; 03128 03129 goto yynewstate; 03130 03131 03132 /*------------------------------------. 03133 | yyerrlab -- here on detecting error | 03134 `------------------------------------*/ 03135 yyerrlab: 03136 /* If not already recovering from an error, report this error. */ 03137 if (!yyerrstatus) 03138 { 03139 ++yynerrs; 03140 #if ! YYERROR_VERBOSE 03141 yyerror (&yylloc, parseio, YY_("syntax error")); 03142 #else 03143 { 03144 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); 03145 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) 03146 { 03147 YYSIZE_T yyalloc = 2 * yysize; 03148 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) 03149 yyalloc = YYSTACK_ALLOC_MAXIMUM; 03150 if (yymsg != yymsgbuf) 03151 YYSTACK_FREE (yymsg); 03152 yymsg = (char *) YYSTACK_ALLOC (yyalloc); 03153 if (yymsg) 03154 yymsg_alloc = yyalloc; 03155 else 03156 { 03157 yymsg = yymsgbuf; 03158 yymsg_alloc = sizeof yymsgbuf; 03159 } 03160 } 03161 03162 if (0 < yysize && yysize <= yymsg_alloc) 03163 { 03164 (void) yysyntax_error (yymsg, yystate, yychar); 03165 yyerror (&yylloc, parseio, yymsg); 03166 } 03167 else 03168 { 03169 yyerror (&yylloc, parseio, YY_("syntax error")); 03170 if (yysize != 0) 03171 goto yyexhaustedlab; 03172 } 03173 } 03174 #endif 03175 } 03176 03177 yyerror_range[0] = yylloc; 03178 03179 if (yyerrstatus == 3) 03180 { 03181 /* If just tried and failed to reuse look-ahead token after an 03182 error, discard it. */ 03183 03184 if (yychar <= YYEOF) 03185 { 03186 /* Return failure if at end of input. */ 03187 if (yychar == YYEOF) 03188 YYABORT; 03189 } 03190 else 03191 { 03192 yydestruct ("Error: discarding", 03193 yytoken, &yylval, &yylloc, parseio); 03194 yychar = YYEMPTY; 03195 } 03196 } 03197 03198 /* Else will try to reuse look-ahead token after shifting the error 03199 token. */ 03200 goto yyerrlab1; 03201 03202 03203 /*---------------------------------------------------. 03204 | yyerrorlab -- error raised explicitly by YYERROR. | 03205 `---------------------------------------------------*/ 03206 yyerrorlab: 03207 03208 /* Pacify compilers like GCC when the user code never invokes 03209 YYERROR and the label yyerrorlab therefore never appears in user 03210 code. */ 03211 if (/*CONSTCOND*/ 0) 03212 goto yyerrorlab; 03213 03214 yyerror_range[0] = yylsp[1-yylen]; 03215 /* Do not reclaim the symbols of the rule which action triggered 03216 this YYERROR. */ 03217 YYPOPSTACK (yylen); 03218 yylen = 0; 03219 YY_STACK_PRINT (yyss, yyssp); 03220 yystate = *yyssp; 03221 goto yyerrlab1; 03222 03223 03224 /*-------------------------------------------------------------. 03225 | yyerrlab1 -- common code for both syntax error and YYERROR. | 03226 `-------------------------------------------------------------*/ 03227 yyerrlab1: 03228 yyerrstatus = 3; /* Each real token shifted decrements this. */ 03229 03230 for (;;) 03231 { 03232 yyn = yypact[yystate]; 03233 if (yyn != YYPACT_NINF) 03234 { 03235 yyn += YYTERROR; 03236 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 03237 { 03238 yyn = yytable[yyn]; 03239 if (0 < yyn) 03240 break; 03241 } 03242 } 03243 03244 /* Pop the current state because it cannot handle the error token. */ 03245 if (yyssp == yyss) 03246 YYABORT; 03247 03248 yyerror_range[0] = *yylsp; 03249 yydestruct ("Error: popping", 03250 yystos[yystate], yyvsp, yylsp, parseio); 03251 YYPOPSTACK (1); 03252 yystate = *yyssp; 03253 YY_STACK_PRINT (yyss, yyssp); 03254 } 03255 03256 if (yyn == YYFINAL) 03257 YYACCEPT; 03258 03259 *++yyvsp = yylval; 03260 03261 yyerror_range[1] = yylloc; 03262 /* Using YYLLOC is tempting, but would change the location of 03263 the look-ahead. YYLOC is available though. */ 03264 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); 03265 *++yylsp = yyloc; 03266 03267 /* Shift the error token. */ 03268 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 03269 03270 yystate = yyn; 03271 goto yynewstate; 03272 03273 03274 /*-------------------------------------. 03275 | yyacceptlab -- YYACCEPT comes here. | 03276 `-------------------------------------*/ 03277 yyacceptlab: 03278 yyresult = 0; 03279 goto yyreturn; 03280 03281 /*-----------------------------------. 03282 | yyabortlab -- YYABORT comes here. | 03283 `-----------------------------------*/ 03284 yyabortlab: 03285 yyresult = 1; 03286 goto yyreturn; 03287 03288 #ifndef yyoverflow 03289 /*-------------------------------------------------. 03290 | yyexhaustedlab -- memory exhaustion comes here. | 03291 `-------------------------------------------------*/ 03292 yyexhaustedlab: 03293 yyerror (&yylloc, parseio, YY_("memory exhausted")); 03294 yyresult = 2; 03295 /* Fall through. */ 03296 #endif 03297 03298 yyreturn: 03299 if (yychar != YYEOF && yychar != YYEMPTY) 03300 yydestruct ("Cleanup: discarding lookahead", 03301 yytoken, &yylval, &yylloc, parseio); 03302 /* Do not reclaim the symbols of the rule which action triggered 03303 this YYABORT or YYACCEPT. */ 03304 YYPOPSTACK (yylen); 03305 YY_STACK_PRINT (yyss, yyssp); 03306 while (yyssp != yyss) 03307 { 03308 yydestruct ("Cleanup: popping", 03309 yystos[*yyssp], yyvsp, yylsp, parseio); 03310 YYPOPSTACK (1); 03311 } 03312 #ifndef yyoverflow 03313 if (yyss != yyssa) 03314 YYSTACK_FREE (yyss); 03315 #endif 03316 #if YYERROR_VERBOSE 03317 if (yymsg != yymsgbuf) 03318 YYSTACK_FREE (yymsg); 03319 #endif 03320 /* Make sure YYID is used. */ 03321 return YYID (yyresult); 03322 }
| int yyparse | ( | ) |
| static char* yystpcpy | ( | char * | yydest, | |
| const char * | yysrc | |||
| ) | [static] |
Definition at line 1276 of file ael.tab.c.
Referenced by yysyntax_error(), and yytnamerr().
| static YYSIZE_T yystrlen | ( | char * | yystr | ) | const [static] |
Definition at line 1252 of file ael.tab.c.
References YYSIZE_T.
Referenced by yysyntax_error(), and yytnamerr().
01255 { 01256 YYSIZE_T yylen; 01257 for (yylen = 0; yystr[yylen]; yylen++) 01258 continue; 01259 return yylen; 01260 }
| static YYSIZE_T yysyntax_error | ( | char * | yyresult, | |
| int | yystate, | |||
| int | yychar | |||
| ) | [static] |
Definition at line 1348 of file ael.tab.c.
References YY_, YYLAST, YYNTOKENS, YYPACT_NINF, YYSIZE_MAXIMUM, YYSIZE_T, yystpcpy(), yystrlen(), YYTERROR, yytnamerr(), and YYTRANSLATE.
Referenced by yyparse().
01349 { 01350 int yyn = yypact[yystate]; 01351 01352 if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) 01353 return 0; 01354 else 01355 { 01356 int yytype = YYTRANSLATE (yychar); 01357 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 01358 YYSIZE_T yysize = yysize0; 01359 YYSIZE_T yysize1; 01360 int yysize_overflow = 0; 01361 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 01362 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 01363 int yyx; 01364 01365 # if 0 01366 /* This is so xgettext sees the translatable formats that are 01367 constructed on the fly. */ 01368 YY_("syntax error, unexpected %s"); 01369 YY_("syntax error, unexpected %s, expecting %s"); 01370 YY_("syntax error, unexpected %s, expecting %s or %s"); 01371 YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 01372 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 01373 # endif 01374 char *yyfmt; 01375 char const *yyf; 01376 static char const yyunexpected[] = "syntax error, unexpected %s"; 01377 static char const yyexpecting[] = ", expecting %s"; 01378 static char const yyor[] = " or %s"; 01379 char yyformat[sizeof yyunexpected 01380 + sizeof yyexpecting - 1 01381 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 01382 * (sizeof yyor - 1))]; 01383 char const *yyprefix = yyexpecting; 01384 01385 /* Start YYX at -YYN if negative to avoid negative indexes in 01386 YYCHECK. */ 01387 int yyxbegin = yyn < 0 ? -yyn : 0; 01388 01389 /* Stay within bounds of both yycheck and yytname. */ 01390 int yychecklim = YYLAST - yyn + 1; 01391 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 01392 int yycount = 1; 01393 01394 yyarg[0] = yytname[yytype]; 01395 yyfmt = yystpcpy (yyformat, yyunexpected); 01396 01397 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 01398 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 01399 { 01400 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 01401 { 01402 yycount = 1; 01403 yysize = yysize0; 01404 yyformat[sizeof yyunexpected - 1] = '\0'; 01405 break; 01406 } 01407 yyarg[yycount++] = yytname[yyx]; 01408 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 01409 yysize_overflow |= (yysize1 < yysize); 01410 yysize = yysize1; 01411 yyfmt = yystpcpy (yyfmt, yyprefix); 01412 yyprefix = yyor; 01413 } 01414 01415 yyf = YY_(yyformat); 01416 yysize1 = yysize + yystrlen (yyf); 01417 yysize_overflow |= (yysize1 < yysize); 01418 yysize = yysize1; 01419 01420 if (yysize_overflow) 01421 return YYSIZE_MAXIMUM; 01422 01423 if (yyresult) 01424 { 01425 /* Avoid sprintf, as that infringes on the user's name space. 01426 Don't have undefined behavior even if the translation 01427 produced a string with the wrong number of "%s"s. */ 01428 char *yyp = yyresult; 01429 int yyi = 0; 01430 while ((*yyp = *yyf) != '\0') 01431 { 01432 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) 01433 { 01434 yyp += yytnamerr (yyp, yyarg[yyi++]); 01435 yyf += 2; 01436 } 01437 else 01438 { 01439 yyp++; 01440 yyf++; 01441 } 01442 } 01443 } 01444 return yysize; 01445 } 01446 }
| static YYSIZE_T yytnamerr | ( | char * | yyres, | |
| const char * | yystr | |||
| ) | [static] |
Definition at line 1301 of file ael.tab.c.
References YYSIZE_T, yystpcpy(), and yystrlen().
Referenced by yysyntax_error().
01302 { 01303 if (*yystr == '"') 01304 { 01305 YYSIZE_T yyn = 0; 01306 char const *yyp = yystr; 01307 01308 for (;;) 01309 switch (*++yyp) 01310 { 01311 case '\'': 01312 case ',': 01313 goto do_not_strip_quotes; 01314 01315 case '\\': 01316 if (*++yyp != '\\') 01317 goto do_not_strip_quotes; 01318 /* Fall through. */ 01319 default: 01320 if (yyres) 01321 yyres[yyn] = *yyp; 01322 yyn++; 01323 break; 01324 01325 case '"': 01326 if (yyres) 01327 yyres[yyn] = '\0'; 01328 return yyn; 01329 } 01330 do_not_strip_quotes: ; 01331 } 01332 01333 if (! yyres) 01334 return yystrlen (yystr); 01335 01336 return yystpcpy (yyres, yystr) - yyres; 01337 }
char* token_equivs1[] [static] |
char* token_equivs2[] [static] |
const yytype_uint16 yycheck[] [static] |
const yytype_uint8 yydefact[] [static] |
const yytype_int16 yydefgoto[] [static] |
const yytype_int16 yypact[] [static] |
const yytype_int16 yypgoto[] [static] |
const yytype_uint8 yyr1[] [static] |
const yytype_uint8 yyr2[] [static] |
const yytype_uint8 yystos[] [static] |
const yytype_int16 yytable[] [static] |
const yytype_uint8 yytranslate[] [static] |
1.6.2