/* This file is automatically generated by Lemon from input grammar ** source file "xquery.lime". */ /* ** 2000-05-29 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Driver template for the lime parser generator. ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text ** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generated parser ** source file. ** ** The following is the concatenation of all %include directives from the ** input grammar file: */ /************ Begin %include sections from the grammar ************************/ #line 95 "xquery.lime" #include #include #include #include #include #include "xquery_internal.h" #include "xquery_helpers.h" #line 39 "xquery.c" /**************** End of %include directives **********************************/ /* These constants specify the various numeric values for terminal symbols. ***************** Begin token definitions *************************************/ #ifndef SLASH #define SLASH 1 #define DOUBLE_SLASH 2 #define DOT 3 #define DOUBLE_DOT 4 #define AT 5 #define COMMA 6 #define COLON_COLON 7 #define LPAREN 8 #define RPAREN 9 #define LBRACKET 10 #define RBRACKET 11 #define PLUS 12 #define MINUS 13 #define STAR 14 #define PIPE 15 #define EQUALS 16 #define NOT_EQUALS 17 #define LESS_THAN 18 #define LESS_EQUAL 19 #define GREATER_THAN 20 #define GREATER_EQUAL 21 #define SEMICOLON 22 #define LBRACE 23 #define RBRACE 24 #define ASSIGN 25 #define CONCAT_OP 26 #define NODE_PRECEDES 27 #define NODE_FOLLOWS 28 #define KW_OR 29 #define KW_AND 30 #define KW_DIV 31 #define KW_MOD 32 #define KW_EQ 33 #define KW_NE 34 #define KW_LT 35 #define KW_LE 36 #define KW_GT 37 #define KW_GE 38 #define KW_FOR 39 #define KW_LET 40 #define KW_WHERE 41 #define KW_ORDER 42 #define KW_BY 43 #define KW_RETURN 44 #define KW_IN 45 #define KW_AT_WORD 46 #define KW_IF 47 #define KW_THEN 48 #define KW_ELSE 49 #define KW_SOME 50 #define KW_EVERY 51 #define KW_SATISFIES 52 #define KW_IS 53 #define KW_TO 54 #define KW_UNION 55 #define KW_INTERSECT 56 #define KW_EXCEPT 57 #define KW_INSTANCE 58 #define KW_OF 59 #define KW_TREAT 60 #define KW_AS 61 #define KW_CASTABLE 62 #define KW_CAST 63 #define KW_IDIV 64 #define KW_DECLARE 65 #define KW_FUNCTION 66 #define KW_VARIABLE 67 #define KW_NAMESPACE 68 #define KW_DEFAULT 69 #define KW_ELEMENT 70 #define KW_IMPORT 71 #define KW_MODULE 72 #define KW_STABLE 73 #define KW_ATTRIBUTE 74 #define KW_DOCUMENT 75 #define KW_TEXT 76 #define KW_COMMENT 77 #define KW_PI 78 #define KW_ASCENDING 79 #define KW_DESCENDING 80 #define KW_TYPESWITCH 81 #define KW_CASE 82 #define AXIS_ANCESTOR 83 #define AXIS_ANCESTOR_OR_SELF 84 #define AXIS_ATTRIBUTE 85 #define AXIS_CHILD 86 #define AXIS_DESCENDANT 87 #define AXIS_DESCENDANT_OR_SELF 88 #define AXIS_FOLLOWING 89 #define AXIS_FOLLOWING_SIBLING 90 #define AXIS_NAMESPACE 91 #define AXIS_PARENT 92 #define AXIS_PRECEDING 93 #define AXIS_PRECEDING_SIBLING 94 #define AXIS_SELF 95 #define NODE_TYPE_COMMENT 96 #define NODE_TYPE_TEXT 97 #define NODE_TYPE_PI 98 #define NODE_TYPE_NODE 99 #define LITERAL 100 #define NUMBER 101 #define NAME_TEST 102 #define FUNCTION_NAME 103 #define VARIABLE_REF 104 #define LONE_SLASH 105 #define UMINUS 106 #endif /**************** End token definitions ***************************************/ /* The next sections is a series of control #defines. ** various aspects of the generated parser. ** YYCODETYPE is the data type used to store the integer codes ** that represent terminal and non-terminal symbols. ** "unsigned char" is used if there are fewer than ** 256 symbols. Larger types otherwise. ** YYNOCODE is a number of type YYCODETYPE that is not used for ** any terminal or nonterminal symbol. ** YYFALLBACK If defined, this indicates that one or more tokens ** (also known as: "terminal symbols") have fall-back ** values which should be used if the original symbol ** would not parse. This permits keywords to sometimes ** be used as identifiers, for example. ** YYACTIONTYPE is the data type used for "action codes" - numbers ** that indicate what to do in response to the next ** token. ** xqueryParseTOKENTYPE is the data type used for minor type for terminal ** symbols. Background: A "minor type" is a semantic ** value associated with a terminal or non-terminal ** symbols. For example, for an "ID" terminal symbol, ** the minor type might be the name of the identifier. ** Each non-terminal can have a different minor type. ** Terminal symbols all have the same minor type, though. ** This macros defines the minor type for terminal ** symbols. ** YYMINORTYPE is the data type used for all minor types. ** This is typically a union of many types, one of ** which is xqueryParseTOKENTYPE. The entry in the union ** for terminal symbols is called "yy0". ** YYSTACKDEPTH is the maximum depth of the parser's stack. If ** zero the stack is dynamically sized using realloc() ** xqueryParseARG_SDECL A static variable declaration for the %extra_argument ** xqueryParseARG_PDECL A parameter declaration for the %extra_argument ** xqueryParseARG_PARAM Code to pass %extra_argument as a subroutine parameter ** xqueryParseARG_STORE Code to store %extra_argument into yypParser ** xqueryParseARG_FETCH Code to extract %extra_argument from yypParser ** xqueryParseCTX_* As xqueryParseARG_ except for %extra_context ** YYREALLOC Name of the realloc() function to use ** YYFREE Name of the free() function to use ** YYDYNSTACK True if stack space should be extended on heap ** YYERRORSYMBOL is the code number of the error symbol. If not ** defined, then do no error processing. ** YYNSTATE the combined number of states. ** YYNRULE the number of rules in the grammar ** YYNTOKEN Number of terminal symbols ** YY_MAX_SHIFT Maximum value for shift actions ** YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions ** YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions ** YY_ERROR_ACTION The yy_action[] code for syntax error ** YY_ACCEPT_ACTION The yy_action[] code for accept ** YY_NO_ACTION The yy_action[] code for no-op ** YY_MIN_REDUCE Minimum value for reduce actions ** YY_MAX_REDUCE Maximum value for reduce actions ** YY_MIN_DSTRCTR Minimum symbol value that has a destructor ** YY_MAX_DSTRCTR Maximum symbol value that has a destructor */ #ifndef INTERFACE # define INTERFACE 1 #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned char #define YYNOCODE 165 #define YYACTIONTYPE unsigned short int #define xqueryParseTOKENTYPE XQToken typedef union { int yyinit; xqueryParseTOKENTYPE yy0; XPathAxisType yy25; XQNodeList * yy38; XQSortOrder yy46; XQNode * yy196; int yy262; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 #endif #define xqueryParseARG_SDECL XQParseState *pstate; #define xqueryParseARG_PDECL ,XQParseState *pstate #define xqueryParseARG_PARAM ,pstate #define xqueryParseARG_FETCH XQParseState *pstate=yypParser->pstate; #define xqueryParseARG_STORE yypParser->pstate=pstate; #undef YYREALLOC #define YYREALLOC realloc #undef YYFREE #define YYFREE free #undef YYDYNSTACK #define YYDYNSTACK 0 #undef YYSIZELIMIT #define xqueryParseCTX(P) 0 #define xqueryParseCTX_SDECL #define xqueryParseCTX_PDECL #define xqueryParseCTX_PARAM #define xqueryParseCTX_FETCH #define xqueryParseCTX_STORE #undef YYERRORSYMBOL #undef YYERRSYMDT #undef YYFALLBACK #define YYNSTATE 172 #define YYNRULE 160 #define YYNRULE_WITH_ACTION 160 #define YYNTOKEN 107 #define YY_MAX_SHIFT 171 #define YY_MIN_SHIFTREDUCE 292 #define YY_MAX_SHIFTREDUCE 451 #define YY_ERROR_ACTION 452 #define YY_ACCEPT_ACTION 453 #define YY_NO_ACTION 454 #define YY_MIN_REDUCE 455 #define YY_MAX_REDUCE 614 #define YY_MIN_DSTRCTR 0 #define YY_MAX_DSTRCTR 0 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) /* Define the yytestcase() macro to be a no-op if is not already defined ** otherwise. ** ** Applications can choose to define yytestcase() in the %include section ** to a macro that can assist in verifying code coverage. For production ** code the yytestcase() macro should be turned off. But it is useful ** for testing. */ #ifndef yytestcase # define yytestcase(X) #endif /* Macro to determine if stack space has the ability to grow using ** heap memory. */ #if YYSTACKDEPTH<=0 || YYDYNSTACK # define YYGROWABLESTACK 1 #else # define YYGROWABLESTACK 0 #endif /* Guarantee a minimum number of initial stack slots. */ #if YYSTACKDEPTH<=0 # undef YYSTACKDEPTH # define YYSTACKDEPTH 2 /* Need a minimum stack size */ #endif /* Next are the tables used to determine what action to take based on the ** current state and lookahead token. These tables are used to implement ** functions that take a state number and lookahead value and return an ** action integer. ** ** Suppose the action integer is N. Then the action is determined as ** follows ** ** 0 <= N <= YY_MAX_SHIFT Shift N. That is, push the lookahead ** token onto the stack and goto state N. ** ** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then ** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE. ** ** N == YY_ERROR_ACTION A syntax error has occurred. ** ** N == YY_ACCEPT_ACTION The parser accepts its input. ** ** N == YY_NO_ACTION No such action. Denotes unused ** slots in the yy_action[] table. ** ** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE ** and YY_MAX_REDUCE ** ** The action table is constructed as a single large table named yy_action[]. ** Given state S and lookahead X, the action is computed as either: ** ** (A) N = yy_action[ yy_shift_ofst[S] + X ] ** (B) N = yy_default[S] ** ** The (A) formula is preferred. The B formula is used instead if ** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X. ** ** The formulas above are for computing the action when the lookahead is ** a terminal symbol. If the lookahead is a non-terminal (as occurs after ** a reduce action) then the yy_reduce_ofst[] array is used in place of ** the yy_shift_ofst[] array. ** ** The following are the tables generated in this section: ** ** yy_action[] A single table containing all actions. ** yy_lookahead[] A table containing the lookahead for each entry in ** yy_action. Used to detect hash collisions. ** yy_shift_ofst[] For each state, the offset into yy_action for ** shifting terminals. ** yy_reduce_ofst[] For each state, the offset into yy_action for ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ #define YY_ACTTAB_COUNT (2238) static const YYACTIONTYPE yy_action[] = { /* 0 */ 83, 61, 60, 430, 431, 406, 62, 59, 11, 112, /* 10 */ 110, 470, 51, 52, 421, 15, 556, 168, 514, 84, /* 20 */ 89, 87, 537, 106, 98, 548, 71, 551, 558, 97, /* 30 */ 562, 70, 159, 82, 100, 508, 567, 555, 600, 166, /* 40 */ 165, 601, 476, 430, 431, 406, 167, 163, 101, 508, /* 50 */ 69, 68, 64, 63, 421, 91, 548, 71, 551, 558, /* 60 */ 97, 562, 70, 159, 82, 85, 502, 567, 555, 600, /* 70 */ 147, 315, 601, 314, 143, 140, 138, 136, 134, 489, /* 80 */ 490, 491, 74, 410, 419, 415, 407, 408, 418, 413, /* 90 */ 411, 416, 409, 414, 412, 417, 158, 156, 154, 152, /* 100 */ 435, 436, 420, 150, 432, 61, 60, 430, 431, 406, /* 110 */ 340, 341, 11, 434, 58, 57, 51, 52, 421, 166, /* 120 */ 165, 17, 85, 410, 419, 415, 407, 408, 418, 413, /* 130 */ 411, 416, 409, 414, 412, 417, 158, 156, 154, 152, /* 140 */ 26, 130, 420, 166, 165, 92, 562, 70, 159, 82, /* 150 */ 28, 163, 567, 433, 69, 68, 86, 537, 106, 98, /* 160 */ 548, 71, 551, 558, 97, 562, 70, 159, 82, 109, /* 170 */ 28, 567, 555, 600, 147, 427, 601, 56, 143, 140, /* 180 */ 138, 136, 134, 114, 116, 122, 119, 410, 419, 415, /* 190 */ 407, 408, 418, 413, 411, 416, 409, 414, 412, 417, /* 200 */ 158, 156, 154, 152, 435, 436, 420, 150, 432, 61, /* 210 */ 60, 430, 431, 406, 128, 28, 11, 55, 162, 131, /* 220 */ 51, 52, 421, 515, 84, 89, 87, 537, 106, 98, /* 230 */ 548, 71, 551, 558, 97, 562, 70, 159, 82, 48, /* 240 */ 47, 567, 555, 600, 421, 126, 601, 166, 165, 94, /* 250 */ 562, 70, 159, 82, 72, 163, 567, 473, 69, 68, /* 260 */ 88, 537, 106, 98, 548, 71, 551, 558, 97, 562, /* 270 */ 70, 159, 82, 48, 47, 567, 555, 600, 147, 471, /* 280 */ 601, 46, 143, 140, 138, 136, 134, 424, 474, 77, /* 290 */ 111, 410, 419, 415, 407, 408, 418, 413, 411, 416, /* 300 */ 409, 414, 412, 417, 158, 156, 154, 152, 435, 436, /* 310 */ 420, 150, 432, 453, 171, 10, 66, 108, 457, 170, /* 320 */ 481, 483, 65, 488, 490, 491, 158, 156, 154, 152, /* 330 */ 509, 484, 420, 15, 485, 169, 160, 514, 84, 89, /* 340 */ 87, 537, 106, 98, 548, 71, 551, 558, 97, 562, /* 350 */ 70, 159, 82, 79, 28, 567, 555, 600, 592, 80, /* 360 */ 601, 81, 463, 296, 61, 60, 430, 431, 406, 462, /* 370 */ 461, 11, 304, 79, 75, 51, 52, 421, 153, 531, /* 380 */ 89, 87, 537, 106, 98, 548, 71, 551, 558, 97, /* 390 */ 562, 70, 159, 82, 76, 12, 567, 555, 600, 23, /* 400 */ 78, 601, 541, 106, 98, 548, 71, 551, 558, 97, /* 410 */ 562, 70, 159, 82, 67, 113, 567, 555, 600, 24, /* 420 */ 16, 601, 115, 95, 562, 70, 159, 82, 302, 117, /* 430 */ 567, 301, 118, 147, 120, 121, 297, 143, 140, 138, /* 440 */ 136, 134, 13, 1, 125, 449, 410, 419, 415, 407, /* 450 */ 408, 418, 413, 411, 416, 409, 414, 412, 417, 158, /* 460 */ 156, 154, 152, 435, 436, 420, 150, 432, 61, 60, /* 470 */ 430, 431, 406, 2, 18, 11, 19, 129, 3, 133, /* 480 */ 448, 421, 73, 483, 65, 488, 490, 491, 4, 5, /* 490 */ 124, 500, 447, 484, 446, 123, 485, 169, 160, 514, /* 500 */ 84, 89, 87, 537, 106, 98, 548, 71, 551, 558, /* 510 */ 97, 562, 70, 159, 82, 6, 7, 567, 555, 600, /* 520 */ 445, 142, 601, 550, 71, 551, 558, 97, 562, 70, /* 530 */ 159, 82, 444, 28, 567, 555, 600, 147, 8, 601, /* 540 */ 463, 143, 140, 138, 136, 134, 146, 462, 461, 439, /* 550 */ 410, 419, 415, 407, 408, 418, 413, 411, 416, 409, /* 560 */ 414, 412, 417, 158, 156, 154, 152, 435, 436, 420, /* 570 */ 150, 432, 73, 483, 65, 488, 490, 491, 20, 9, /* 580 */ 127, 500, 426, 484, 151, 96, 485, 169, 160, 514, /* 590 */ 84, 89, 87, 537, 106, 98, 548, 71, 551, 558, /* 600 */ 97, 562, 70, 159, 82, 425, 423, 567, 555, 600, /* 610 */ 155, 157, 601, 145, 481, 483, 65, 488, 490, 491, /* 620 */ 422, 405, 30, 21, 14, 484, 22, 164, 485, 169, /* 630 */ 160, 514, 84, 89, 87, 537, 106, 98, 548, 71, /* 640 */ 551, 558, 97, 562, 70, 159, 82, 25, 102, 567, /* 650 */ 555, 600, 29, 27, 601, 132, 145, 481, 483, 65, /* 660 */ 488, 490, 491, 564, 70, 159, 82, 455, 484, 567, /* 670 */ 454, 485, 169, 160, 514, 84, 89, 87, 537, 106, /* 680 */ 98, 548, 71, 551, 558, 97, 562, 70, 159, 82, /* 690 */ 454, 454, 567, 555, 600, 454, 454, 601, 135, 454, /* 700 */ 145, 481, 483, 65, 488, 490, 491, 104, 562, 70, /* 710 */ 159, 82, 484, 454, 567, 485, 169, 160, 514, 84, /* 720 */ 89, 87, 537, 106, 98, 548, 71, 551, 558, 97, /* 730 */ 562, 70, 159, 82, 454, 454, 567, 555, 600, 454, /* 740 */ 454, 601, 137, 145, 481, 483, 65, 488, 490, 491, /* 750 */ 454, 563, 70, 159, 82, 484, 454, 567, 485, 169, /* 760 */ 160, 514, 84, 89, 87, 537, 106, 98, 548, 71, /* 770 */ 551, 558, 97, 562, 70, 159, 82, 454, 454, 567, /* 780 */ 555, 600, 454, 454, 601, 139, 145, 481, 483, 65, /* 790 */ 488, 490, 491, 454, 454, 454, 454, 454, 484, 454, /* 800 */ 454, 485, 169, 160, 514, 84, 89, 87, 537, 106, /* 810 */ 98, 548, 71, 551, 558, 97, 562, 70, 159, 82, /* 820 */ 454, 454, 567, 555, 600, 454, 454, 601, 141, 145, /* 830 */ 481, 483, 65, 488, 490, 491, 454, 454, 454, 454, /* 840 */ 454, 484, 454, 454, 485, 169, 160, 514, 84, 89, /* 850 */ 87, 537, 106, 98, 548, 71, 551, 558, 97, 562, /* 860 */ 70, 159, 82, 454, 454, 567, 555, 600, 454, 454, /* 870 */ 601, 144, 454, 605, 483, 65, 488, 490, 491, 454, /* 880 */ 454, 454, 454, 454, 484, 454, 454, 485, 169, 160, /* 890 */ 514, 84, 89, 87, 537, 106, 98, 548, 71, 551, /* 900 */ 558, 97, 562, 70, 159, 82, 454, 54, 567, 555, /* 910 */ 600, 149, 148, 601, 456, 170, 481, 483, 65, 488, /* 920 */ 490, 491, 454, 454, 53, 49, 454, 484, 454, 454, /* 930 */ 485, 169, 160, 514, 84, 89, 87, 537, 106, 98, /* 940 */ 548, 71, 551, 558, 97, 562, 70, 159, 82, 454, /* 950 */ 454, 567, 555, 600, 454, 454, 601, 50, 93, 481, /* 960 */ 483, 65, 488, 490, 491, 454, 454, 454, 454, 454, /* 970 */ 484, 454, 454, 485, 169, 160, 514, 84, 89, 87, /* 980 */ 537, 106, 98, 548, 71, 551, 558, 97, 562, 70, /* 990 */ 159, 82, 454, 454, 567, 555, 600, 454, 454, 601, /* 1000 */ 454, 90, 481, 483, 65, 488, 490, 491, 454, 454, /* 1010 */ 454, 454, 454, 484, 454, 454, 485, 169, 160, 514, /* 1020 */ 84, 89, 87, 537, 106, 98, 548, 71, 551, 558, /* 1030 */ 97, 562, 70, 159, 82, 454, 454, 567, 555, 600, /* 1040 */ 454, 454, 601, 454, 454, 73, 483, 65, 488, 490, /* 1050 */ 491, 454, 454, 454, 501, 454, 484, 454, 454, 485, /* 1060 */ 169, 160, 514, 84, 89, 87, 537, 106, 98, 548, /* 1070 */ 71, 551, 558, 97, 562, 70, 159, 82, 454, 454, /* 1080 */ 567, 555, 600, 454, 454, 601, 454, 99, 481, 483, /* 1090 */ 65, 488, 490, 491, 454, 454, 454, 454, 454, 484, /* 1100 */ 454, 454, 485, 169, 160, 514, 84, 89, 87, 537, /* 1110 */ 106, 98, 548, 71, 551, 558, 97, 562, 70, 159, /* 1120 */ 82, 454, 454, 567, 555, 600, 454, 454, 601, 454, /* 1130 */ 103, 481, 483, 65, 488, 490, 491, 454, 454, 454, /* 1140 */ 454, 454, 484, 454, 454, 485, 169, 160, 514, 84, /* 1150 */ 89, 87, 537, 106, 98, 548, 71, 551, 558, 97, /* 1160 */ 562, 70, 159, 82, 454, 454, 567, 555, 600, 454, /* 1170 */ 454, 601, 454, 454, 466, 483, 65, 488, 490, 491, /* 1180 */ 454, 454, 454, 454, 454, 484, 454, 454, 485, 169, /* 1190 */ 160, 514, 84, 89, 87, 537, 106, 98, 548, 71, /* 1200 */ 551, 558, 97, 562, 70, 159, 82, 454, 454, 567, /* 1210 */ 555, 600, 454, 454, 601, 454, 454, 495, 483, 65, /* 1220 */ 488, 490, 491, 454, 454, 454, 454, 454, 484, 454, /* 1230 */ 454, 485, 169, 160, 514, 84, 89, 87, 537, 106, /* 1240 */ 98, 548, 71, 551, 558, 97, 562, 70, 159, 82, /* 1250 */ 454, 454, 567, 555, 600, 454, 454, 601, 454, 454, /* 1260 */ 493, 483, 65, 488, 490, 491, 454, 454, 454, 454, /* 1270 */ 454, 484, 454, 454, 485, 169, 160, 514, 84, 89, /* 1280 */ 87, 537, 106, 98, 548, 71, 551, 558, 97, 562, /* 1290 */ 70, 159, 82, 454, 454, 567, 555, 600, 454, 454, /* 1300 */ 601, 454, 454, 510, 483, 65, 488, 490, 491, 454, /* 1310 */ 454, 454, 454, 454, 484, 454, 454, 485, 169, 160, /* 1320 */ 514, 84, 89, 87, 537, 106, 98, 548, 71, 551, /* 1330 */ 558, 97, 562, 70, 159, 82, 454, 454, 567, 555, /* 1340 */ 600, 454, 454, 601, 454, 454, 606, 483, 65, 488, /* 1350 */ 490, 491, 454, 454, 454, 454, 454, 484, 454, 454, /* 1360 */ 485, 169, 160, 514, 84, 89, 87, 537, 106, 98, /* 1370 */ 548, 71, 551, 558, 97, 562, 70, 159, 82, 454, /* 1380 */ 454, 567, 555, 600, 454, 454, 601, 454, 454, 511, /* 1390 */ 483, 65, 488, 490, 491, 454, 454, 454, 454, 454, /* 1400 */ 484, 454, 454, 485, 169, 160, 514, 84, 89, 87, /* 1410 */ 537, 106, 98, 548, 71, 551, 558, 97, 562, 70, /* 1420 */ 159, 82, 454, 454, 567, 555, 600, 454, 454, 601, /* 1430 */ 454, 454, 161, 483, 65, 488, 490, 491, 454, 454, /* 1440 */ 454, 454, 454, 484, 454, 454, 485, 169, 160, 514, /* 1450 */ 84, 89, 87, 537, 106, 98, 548, 71, 551, 558, /* 1460 */ 97, 562, 70, 159, 82, 454, 454, 567, 555, 600, /* 1470 */ 454, 454, 601, 454, 454, 507, 483, 65, 488, 490, /* 1480 */ 491, 454, 454, 454, 454, 454, 484, 454, 454, 485, /* 1490 */ 169, 160, 514, 84, 89, 87, 537, 106, 98, 548, /* 1500 */ 71, 551, 558, 97, 562, 70, 159, 82, 454, 454, /* 1510 */ 567, 555, 600, 454, 454, 601, 454, 454, 506, 483, /* 1520 */ 65, 488, 490, 491, 454, 454, 454, 454, 454, 484, /* 1530 */ 454, 454, 485, 169, 160, 514, 84, 89, 87, 537, /* 1540 */ 106, 98, 548, 71, 551, 558, 97, 562, 70, 159, /* 1550 */ 82, 454, 454, 567, 555, 600, 454, 454, 601, 454, /* 1560 */ 454, 494, 483, 65, 488, 490, 491, 454, 454, 454, /* 1570 */ 454, 454, 484, 454, 454, 485, 169, 160, 514, 84, /* 1580 */ 89, 87, 537, 106, 98, 548, 71, 551, 558, 97, /* 1590 */ 562, 70, 159, 82, 454, 454, 567, 555, 600, 454, /* 1600 */ 454, 601, 454, 454, 492, 483, 65, 488, 490, 491, /* 1610 */ 454, 454, 454, 454, 454, 484, 454, 454, 485, 169, /* 1620 */ 160, 514, 84, 89, 87, 537, 106, 98, 548, 71, /* 1630 */ 551, 558, 97, 562, 70, 159, 82, 454, 454, 567, /* 1640 */ 555, 600, 454, 454, 601, 454, 454, 487, 483, 65, /* 1650 */ 488, 490, 491, 454, 454, 454, 454, 454, 484, 454, /* 1660 */ 454, 485, 169, 160, 514, 84, 89, 87, 537, 106, /* 1670 */ 98, 548, 71, 551, 558, 97, 562, 70, 159, 82, /* 1680 */ 454, 454, 567, 555, 600, 454, 454, 601, 454, 454, /* 1690 */ 482, 483, 65, 488, 490, 491, 454, 454, 454, 454, /* 1700 */ 454, 484, 454, 454, 485, 169, 160, 514, 84, 89, /* 1710 */ 87, 537, 106, 98, 548, 71, 551, 558, 97, 562, /* 1720 */ 70, 159, 82, 454, 454, 567, 555, 600, 454, 454, /* 1730 */ 601, 530, 89, 87, 537, 106, 98, 548, 71, 551, /* 1740 */ 558, 97, 562, 70, 159, 82, 454, 454, 567, 555, /* 1750 */ 600, 454, 454, 601, 529, 89, 87, 537, 106, 98, /* 1760 */ 548, 71, 551, 558, 97, 562, 70, 159, 82, 454, /* 1770 */ 454, 567, 555, 600, 454, 454, 601, 528, 89, 87, /* 1780 */ 537, 106, 98, 548, 71, 551, 558, 97, 562, 70, /* 1790 */ 159, 82, 454, 454, 567, 555, 600, 454, 454, 601, /* 1800 */ 527, 89, 87, 537, 106, 98, 548, 71, 551, 558, /* 1810 */ 97, 562, 70, 159, 82, 454, 454, 567, 555, 600, /* 1820 */ 454, 454, 601, 526, 89, 87, 537, 106, 98, 548, /* 1830 */ 71, 551, 558, 97, 562, 70, 159, 82, 454, 454, /* 1840 */ 567, 555, 600, 454, 454, 601, 525, 89, 87, 537, /* 1850 */ 106, 98, 548, 71, 551, 558, 97, 562, 70, 159, /* 1860 */ 82, 454, 454, 567, 555, 600, 454, 454, 601, 524, /* 1870 */ 89, 87, 537, 106, 98, 548, 71, 551, 558, 97, /* 1880 */ 562, 70, 159, 82, 454, 454, 567, 555, 600, 454, /* 1890 */ 454, 601, 523, 89, 87, 537, 106, 98, 548, 71, /* 1900 */ 551, 558, 97, 562, 70, 159, 82, 454, 454, 567, /* 1910 */ 555, 600, 454, 454, 601, 522, 89, 87, 537, 106, /* 1920 */ 98, 548, 71, 551, 558, 97, 562, 70, 159, 82, /* 1930 */ 454, 454, 567, 555, 600, 454, 454, 601, 521, 89, /* 1940 */ 87, 537, 106, 98, 548, 71, 551, 558, 97, 562, /* 1950 */ 70, 159, 82, 454, 454, 567, 555, 600, 454, 454, /* 1960 */ 601, 520, 89, 87, 537, 106, 98, 548, 71, 551, /* 1970 */ 558, 97, 562, 70, 159, 82, 454, 454, 567, 555, /* 1980 */ 600, 454, 454, 601, 519, 89, 87, 537, 106, 98, /* 1990 */ 548, 71, 551, 558, 97, 562, 70, 159, 82, 454, /* 2000 */ 454, 567, 555, 600, 454, 454, 601, 518, 89, 87, /* 2010 */ 537, 106, 98, 548, 71, 551, 558, 97, 562, 70, /* 2020 */ 159, 82, 454, 454, 567, 555, 600, 454, 454, 601, /* 2030 */ 517, 89, 87, 537, 106, 98, 548, 71, 551, 558, /* 2040 */ 97, 562, 70, 159, 82, 454, 454, 567, 555, 600, /* 2050 */ 454, 454, 601, 107, 87, 537, 106, 98, 548, 71, /* 2060 */ 551, 558, 97, 562, 70, 159, 82, 454, 454, 567, /* 2070 */ 555, 600, 454, 454, 601, 540, 106, 98, 548, 71, /* 2080 */ 551, 558, 97, 562, 70, 159, 82, 454, 454, 567, /* 2090 */ 555, 600, 454, 454, 601, 454, 544, 106, 98, 548, /* 2100 */ 71, 551, 558, 97, 562, 70, 159, 82, 454, 454, /* 2110 */ 567, 555, 600, 454, 454, 601, 543, 106, 98, 548, /* 2120 */ 71, 551, 558, 97, 562, 70, 159, 82, 454, 454, /* 2130 */ 567, 555, 600, 454, 454, 601, 454, 539, 106, 98, /* 2140 */ 548, 71, 551, 558, 97, 562, 70, 159, 82, 454, /* 2150 */ 454, 567, 555, 600, 454, 454, 601, 538, 106, 98, /* 2160 */ 548, 71, 551, 558, 97, 562, 70, 159, 82, 454, /* 2170 */ 454, 567, 555, 600, 454, 454, 601, 45, 44, 43, /* 2180 */ 42, 41, 40, 454, 454, 454, 454, 454, 32, 31, /* 2190 */ 454, 454, 454, 454, 39, 38, 37, 36, 35, 34, /* 2200 */ 454, 454, 454, 105, 548, 71, 551, 558, 97, 562, /* 2210 */ 70, 159, 82, 454, 33, 567, 555, 600, 454, 454, /* 2220 */ 601, 549, 71, 551, 558, 97, 562, 70, 159, 82, /* 2230 */ 454, 454, 567, 555, 600, 454, 454, 601, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 146, 1, 2, 3, 4, 5, 1, 2, 8, 157, /* 10 */ 158, 159, 12, 13, 14, 10, 148, 130, 131, 132, /* 20 */ 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, /* 30 */ 143, 144, 145, 146, 126, 127, 149, 150, 151, 39, /* 40 */ 40, 154, 162, 3, 4, 5, 121, 47, 126, 127, /* 50 */ 50, 51, 1, 2, 14, 137, 138, 139, 140, 141, /* 60 */ 142, 143, 144, 145, 146, 65, 124, 149, 150, 151, /* 70 */ 70, 12, 154, 14, 74, 75, 76, 77, 78, 117, /* 80 */ 118, 119, 120, 83, 84, 85, 86, 87, 88, 89, /* 90 */ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, /* 100 */ 100, 101, 102, 103, 104, 1, 2, 3, 4, 5, /* 110 */ 79, 80, 8, 9, 56, 57, 12, 13, 14, 39, /* 120 */ 40, 41, 65, 83, 84, 85, 86, 87, 88, 89, /* 130 */ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, /* 140 */ 45, 46, 102, 39, 40, 142, 143, 144, 145, 146, /* 150 */ 6, 47, 149, 9, 50, 51, 134, 135, 136, 137, /* 160 */ 138, 139, 140, 141, 142, 143, 144, 145, 146, 104, /* 170 */ 6, 149, 150, 151, 70, 11, 154, 15, 74, 75, /* 180 */ 76, 77, 78, 66, 67, 68, 69, 83, 84, 85, /* 190 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, /* 200 */ 96, 97, 98, 99, 100, 101, 102, 103, 104, 1, /* 210 */ 2, 3, 4, 5, 42, 6, 8, 55, 9, 104, /* 220 */ 12, 13, 14, 131, 132, 133, 134, 135, 136, 137, /* 230 */ 138, 139, 140, 141, 142, 143, 144, 145, 146, 12, /* 240 */ 13, 149, 150, 151, 14, 73, 154, 39, 40, 142, /* 250 */ 143, 144, 145, 146, 102, 47, 149, 161, 50, 51, /* 260 */ 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, /* 270 */ 144, 145, 146, 12, 13, 149, 150, 151, 70, 159, /* 280 */ 154, 54, 74, 75, 76, 77, 78, 9, 161, 61, /* 290 */ 160, 83, 84, 85, 86, 87, 88, 89, 90, 91, /* 300 */ 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, /* 310 */ 102, 103, 104, 107, 108, 109, 110, 111, 112, 113, /* 320 */ 114, 115, 116, 117, 118, 119, 96, 97, 98, 99, /* 330 */ 127, 125, 102, 10, 128, 129, 130, 131, 132, 133, /* 340 */ 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, /* 350 */ 144, 145, 146, 6, 6, 149, 150, 151, 148, 147, /* 360 */ 154, 147, 156, 22, 1, 2, 3, 4, 5, 163, /* 370 */ 164, 8, 24, 6, 61, 12, 13, 14, 100, 132, /* 380 */ 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, /* 390 */ 143, 144, 145, 146, 6, 23, 149, 150, 151, 52, /* 400 */ 9, 154, 135, 136, 137, 138, 139, 140, 141, 142, /* 410 */ 143, 144, 145, 146, 8, 103, 149, 150, 151, 52, /* 420 */ 25, 154, 104, 142, 143, 144, 145, 146, 100, 68, /* 430 */ 149, 100, 70, 70, 16, 102, 22, 74, 75, 76, /* 440 */ 77, 78, 6, 43, 42, 24, 83, 84, 85, 86, /* 450 */ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, /* 460 */ 97, 98, 99, 100, 101, 102, 103, 104, 1, 2, /* 470 */ 3, 4, 5, 43, 45, 8, 45, 104, 23, 102, /* 480 */ 24, 14, 114, 115, 116, 117, 118, 119, 23, 23, /* 490 */ 122, 123, 24, 125, 24, 111, 128, 129, 130, 131, /* 500 */ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, /* 510 */ 142, 143, 144, 145, 146, 23, 23, 149, 150, 151, /* 520 */ 24, 102, 154, 138, 139, 140, 141, 142, 143, 144, /* 530 */ 145, 146, 24, 6, 149, 150, 151, 70, 23, 154, /* 540 */ 156, 74, 75, 76, 77, 78, 102, 163, 164, 9, /* 550 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, /* 560 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, /* 570 */ 103, 104, 114, 115, 116, 117, 118, 119, 6, 8, /* 580 */ 122, 123, 9, 125, 8, 8, 128, 129, 130, 131, /* 590 */ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, /* 600 */ 142, 143, 144, 145, 146, 9, 9, 149, 150, 151, /* 610 */ 8, 8, 154, 113, 114, 115, 116, 117, 118, 119, /* 620 */ 9, 7, 30, 49, 8, 125, 48, 104, 128, 129, /* 630 */ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 640 */ 140, 141, 142, 143, 144, 145, 146, 25, 104, 149, /* 650 */ 150, 151, 29, 44, 154, 155, 113, 114, 115, 116, /* 660 */ 117, 118, 119, 143, 144, 145, 146, 0, 125, 149, /* 670 */ 165, 128, 129, 130, 131, 132, 133, 134, 135, 136, /* 680 */ 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, /* 690 */ 165, 165, 149, 150, 151, 165, 165, 154, 155, 165, /* 700 */ 113, 114, 115, 116, 117, 118, 119, 142, 143, 144, /* 710 */ 145, 146, 125, 165, 149, 128, 129, 130, 131, 132, /* 720 */ 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, /* 730 */ 143, 144, 145, 146, 165, 165, 149, 150, 151, 165, /* 740 */ 165, 154, 155, 113, 114, 115, 116, 117, 118, 119, /* 750 */ 165, 143, 144, 145, 146, 125, 165, 149, 128, 129, /* 760 */ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 770 */ 140, 141, 142, 143, 144, 145, 146, 165, 165, 149, /* 780 */ 150, 151, 165, 165, 154, 155, 113, 114, 115, 116, /* 790 */ 117, 118, 119, 165, 165, 165, 165, 165, 125, 165, /* 800 */ 165, 128, 129, 130, 131, 132, 133, 134, 135, 136, /* 810 */ 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, /* 820 */ 165, 165, 149, 150, 151, 165, 165, 154, 155, 113, /* 830 */ 114, 115, 116, 117, 118, 119, 165, 165, 165, 165, /* 840 */ 165, 125, 165, 165, 128, 129, 130, 131, 132, 133, /* 850 */ 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, /* 860 */ 144, 145, 146, 165, 165, 149, 150, 151, 165, 165, /* 870 */ 154, 155, 165, 114, 115, 116, 117, 118, 119, 165, /* 880 */ 165, 165, 165, 165, 125, 165, 165, 128, 129, 130, /* 890 */ 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, /* 900 */ 141, 142, 143, 144, 145, 146, 165, 14, 149, 150, /* 910 */ 151, 152, 153, 154, 112, 113, 114, 115, 116, 117, /* 920 */ 118, 119, 165, 165, 31, 32, 165, 125, 165, 165, /* 930 */ 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, /* 940 */ 138, 139, 140, 141, 142, 143, 144, 145, 146, 165, /* 950 */ 165, 149, 150, 151, 165, 165, 154, 64, 113, 114, /* 960 */ 115, 116, 117, 118, 119, 165, 165, 165, 165, 165, /* 970 */ 125, 165, 165, 128, 129, 130, 131, 132, 133, 134, /* 980 */ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, /* 990 */ 145, 146, 165, 165, 149, 150, 151, 165, 165, 154, /* 1000 */ 165, 113, 114, 115, 116, 117, 118, 119, 165, 165, /* 1010 */ 165, 165, 165, 125, 165, 165, 128, 129, 130, 131, /* 1020 */ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, /* 1030 */ 142, 143, 144, 145, 146, 165, 165, 149, 150, 151, /* 1040 */ 165, 165, 154, 165, 165, 114, 115, 116, 117, 118, /* 1050 */ 119, 165, 165, 165, 123, 165, 125, 165, 165, 128, /* 1060 */ 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, /* 1070 */ 139, 140, 141, 142, 143, 144, 145, 146, 165, 165, /* 1080 */ 149, 150, 151, 165, 165, 154, 165, 113, 114, 115, /* 1090 */ 116, 117, 118, 119, 165, 165, 165, 165, 165, 125, /* 1100 */ 165, 165, 128, 129, 130, 131, 132, 133, 134, 135, /* 1110 */ 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, /* 1120 */ 146, 165, 165, 149, 150, 151, 165, 165, 154, 165, /* 1130 */ 113, 114, 115, 116, 117, 118, 119, 165, 165, 165, /* 1140 */ 165, 165, 125, 165, 165, 128, 129, 130, 131, 132, /* 1150 */ 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, /* 1160 */ 143, 144, 145, 146, 165, 165, 149, 150, 151, 165, /* 1170 */ 165, 154, 165, 165, 114, 115, 116, 117, 118, 119, /* 1180 */ 165, 165, 165, 165, 165, 125, 165, 165, 128, 129, /* 1190 */ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 1200 */ 140, 141, 142, 143, 144, 145, 146, 165, 165, 149, /* 1210 */ 150, 151, 165, 165, 154, 165, 165, 114, 115, 116, /* 1220 */ 117, 118, 119, 165, 165, 165, 165, 165, 125, 165, /* 1230 */ 165, 128, 129, 130, 131, 132, 133, 134, 135, 136, /* 1240 */ 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, /* 1250 */ 165, 165, 149, 150, 151, 165, 165, 154, 165, 165, /* 1260 */ 114, 115, 116, 117, 118, 119, 165, 165, 165, 165, /* 1270 */ 165, 125, 165, 165, 128, 129, 130, 131, 132, 133, /* 1280 */ 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, /* 1290 */ 144, 145, 146, 165, 165, 149, 150, 151, 165, 165, /* 1300 */ 154, 165, 165, 114, 115, 116, 117, 118, 119, 165, /* 1310 */ 165, 165, 165, 165, 125, 165, 165, 128, 129, 130, /* 1320 */ 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, /* 1330 */ 141, 142, 143, 144, 145, 146, 165, 165, 149, 150, /* 1340 */ 151, 165, 165, 154, 165, 165, 114, 115, 116, 117, /* 1350 */ 118, 119, 165, 165, 165, 165, 165, 125, 165, 165, /* 1360 */ 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, /* 1370 */ 138, 139, 140, 141, 142, 143, 144, 145, 146, 165, /* 1380 */ 165, 149, 150, 151, 165, 165, 154, 165, 165, 114, /* 1390 */ 115, 116, 117, 118, 119, 165, 165, 165, 165, 165, /* 1400 */ 125, 165, 165, 128, 129, 130, 131, 132, 133, 134, /* 1410 */ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, /* 1420 */ 145, 146, 165, 165, 149, 150, 151, 165, 165, 154, /* 1430 */ 165, 165, 114, 115, 116, 117, 118, 119, 165, 165, /* 1440 */ 165, 165, 165, 125, 165, 165, 128, 129, 130, 131, /* 1450 */ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, /* 1460 */ 142, 143, 144, 145, 146, 165, 165, 149, 150, 151, /* 1470 */ 165, 165, 154, 165, 165, 114, 115, 116, 117, 118, /* 1480 */ 119, 165, 165, 165, 165, 165, 125, 165, 165, 128, /* 1490 */ 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, /* 1500 */ 139, 140, 141, 142, 143, 144, 145, 146, 165, 165, /* 1510 */ 149, 150, 151, 165, 165, 154, 165, 165, 114, 115, /* 1520 */ 116, 117, 118, 119, 165, 165, 165, 165, 165, 125, /* 1530 */ 165, 165, 128, 129, 130, 131, 132, 133, 134, 135, /* 1540 */ 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, /* 1550 */ 146, 165, 165, 149, 150, 151, 165, 165, 154, 165, /* 1560 */ 165, 114, 115, 116, 117, 118, 119, 165, 165, 165, /* 1570 */ 165, 165, 125, 165, 165, 128, 129, 130, 131, 132, /* 1580 */ 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, /* 1590 */ 143, 144, 145, 146, 165, 165, 149, 150, 151, 165, /* 1600 */ 165, 154, 165, 165, 114, 115, 116, 117, 118, 119, /* 1610 */ 165, 165, 165, 165, 165, 125, 165, 165, 128, 129, /* 1620 */ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 1630 */ 140, 141, 142, 143, 144, 145, 146, 165, 165, 149, /* 1640 */ 150, 151, 165, 165, 154, 165, 165, 114, 115, 116, /* 1650 */ 117, 118, 119, 165, 165, 165, 165, 165, 125, 165, /* 1660 */ 165, 128, 129, 130, 131, 132, 133, 134, 135, 136, /* 1670 */ 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, /* 1680 */ 165, 165, 149, 150, 151, 165, 165, 154, 165, 165, /* 1690 */ 114, 115, 116, 117, 118, 119, 165, 165, 165, 165, /* 1700 */ 165, 125, 165, 165, 128, 129, 130, 131, 132, 133, /* 1710 */ 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, /* 1720 */ 144, 145, 146, 165, 165, 149, 150, 151, 165, 165, /* 1730 */ 154, 132, 133, 134, 135, 136, 137, 138, 139, 140, /* 1740 */ 141, 142, 143, 144, 145, 146, 165, 165, 149, 150, /* 1750 */ 151, 165, 165, 154, 132, 133, 134, 135, 136, 137, /* 1760 */ 138, 139, 140, 141, 142, 143, 144, 145, 146, 165, /* 1770 */ 165, 149, 150, 151, 165, 165, 154, 132, 133, 134, /* 1780 */ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, /* 1790 */ 145, 146, 165, 165, 149, 150, 151, 165, 165, 154, /* 1800 */ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, /* 1810 */ 142, 143, 144, 145, 146, 165, 165, 149, 150, 151, /* 1820 */ 165, 165, 154, 132, 133, 134, 135, 136, 137, 138, /* 1830 */ 139, 140, 141, 142, 143, 144, 145, 146, 165, 165, /* 1840 */ 149, 150, 151, 165, 165, 154, 132, 133, 134, 135, /* 1850 */ 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, /* 1860 */ 146, 165, 165, 149, 150, 151, 165, 165, 154, 132, /* 1870 */ 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, /* 1880 */ 143, 144, 145, 146, 165, 165, 149, 150, 151, 165, /* 1890 */ 165, 154, 132, 133, 134, 135, 136, 137, 138, 139, /* 1900 */ 140, 141, 142, 143, 144, 145, 146, 165, 165, 149, /* 1910 */ 150, 151, 165, 165, 154, 132, 133, 134, 135, 136, /* 1920 */ 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, /* 1930 */ 165, 165, 149, 150, 151, 165, 165, 154, 132, 133, /* 1940 */ 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, /* 1950 */ 144, 145, 146, 165, 165, 149, 150, 151, 165, 165, /* 1960 */ 154, 132, 133, 134, 135, 136, 137, 138, 139, 140, /* 1970 */ 141, 142, 143, 144, 145, 146, 165, 165, 149, 150, /* 1980 */ 151, 165, 165, 154, 132, 133, 134, 135, 136, 137, /* 1990 */ 138, 139, 140, 141, 142, 143, 144, 145, 146, 165, /* 2000 */ 165, 149, 150, 151, 165, 165, 154, 132, 133, 134, /* 2010 */ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, /* 2020 */ 145, 146, 165, 165, 149, 150, 151, 165, 165, 154, /* 2030 */ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, /* 2040 */ 142, 143, 144, 145, 146, 165, 165, 149, 150, 151, /* 2050 */ 165, 165, 154, 133, 134, 135, 136, 137, 138, 139, /* 2060 */ 140, 141, 142, 143, 144, 145, 146, 165, 165, 149, /* 2070 */ 150, 151, 165, 165, 154, 135, 136, 137, 138, 139, /* 2080 */ 140, 141, 142, 143, 144, 145, 146, 165, 165, 149, /* 2090 */ 150, 151, 165, 165, 154, 165, 135, 136, 137, 138, /* 2100 */ 139, 140, 141, 142, 143, 144, 145, 146, 165, 165, /* 2110 */ 149, 150, 151, 165, 165, 154, 135, 136, 137, 138, /* 2120 */ 139, 140, 141, 142, 143, 144, 145, 146, 165, 165, /* 2130 */ 149, 150, 151, 165, 165, 154, 165, 135, 136, 137, /* 2140 */ 138, 139, 140, 141, 142, 143, 144, 145, 146, 165, /* 2150 */ 165, 149, 150, 151, 165, 165, 154, 135, 136, 137, /* 2160 */ 138, 139, 140, 141, 142, 143, 144, 145, 146, 165, /* 2170 */ 165, 149, 150, 151, 165, 165, 154, 16, 17, 18, /* 2180 */ 19, 20, 21, 165, 165, 165, 165, 165, 27, 28, /* 2190 */ 165, 165, 165, 165, 33, 34, 35, 36, 37, 38, /* 2200 */ 165, 165, 165, 137, 138, 139, 140, 141, 142, 143, /* 2210 */ 144, 145, 146, 165, 53, 149, 150, 151, 165, 165, /* 2220 */ 154, 138, 139, 140, 141, 142, 143, 144, 145, 146, /* 2230 */ 165, 165, 149, 150, 151, 165, 165, 154, 165, 165, /* 2240 */ 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, /* 2250 */ 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, /* 2260 */ 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, /* 2270 */ 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, /* 2280 */ 165, 165, 165, 165, 165, 107, 107, 107, 107, 107, /* 2290 */ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, /* 2300 */ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, /* 2310 */ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, /* 2320 */ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, /* 2330 */ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, /* 2340 */ 107, 107, 107, 107, 107, }; #define YY_SHIFT_COUNT (171) #define YY_SHIFT_MIN (0) #define YY_SHIFT_MAX (2161) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 0, 208, 208, 208, 208, 208, 208, 208, 208, 208, /* 10 */ 208, 104, 208, 208, 208, 208, 208, 208, 208, 208, /* 20 */ 208, 208, 208, 208, 208, 208, 208, 208, 208, 363, /* 30 */ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, /* 40 */ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, /* 50 */ 363, 363, 363, 363, 363, 467, 467, 467, 467, 40, /* 60 */ 40, 40, 40, 40, 40, 80, 57, 65, 115, 115, /* 70 */ 230, 5, 59, 31, 172, 152, 65, 152, 228, 115, /* 80 */ 323, 323, 2238, 2238, 2161, 117, 893, 893, 893, 227, /* 90 */ 348, 58, 51, 144, 51, 51, 278, 51, 58, 209, /* 100 */ 347, 367, 95, 164, 51, 58, 162, 261, 341, 313, /* 110 */ 388, 372, 391, 406, 312, 395, 318, 328, 361, 362, /* 120 */ 331, 418, 333, 414, 436, 400, 402, 436, 430, 429, /* 130 */ 373, 431, 421, 455, 377, 456, 465, 468, 466, 470, /* 140 */ 492, 496, 493, 419, 508, 527, 515, 444, 572, 540, /* 150 */ 571, 573, 576, 596, 577, 597, 602, 611, 603, 614, /* 160 */ 592, 574, 578, 616, 622, 523, 544, 609, 592, 623, /* 170 */ 527, 667, }; #define YY_REDUCE_COUNT (83) #define YY_REDUCE_MIN (-148) #define YY_REDUCE_MAX (2083) static const short yy_reduce_ofst[] = { /* 0 */ 206, 368, 458, 500, 543, 587, 630, 673, 716, 759, /* 10 */ 802, 845, 888, 931, 974, 1017, 1060, 1103, 1146, 1189, /* 20 */ 1232, 1275, 1318, 1361, 1404, 1447, 1490, 1533, 1576, -113, /* 30 */ 92, 247, 1599, 1622, 1645, 1668, 1691, 1714, 1737, 1760, /* 40 */ 1783, 1806, 1829, 1852, 1875, 1898, 1920, 22, 126, 267, /* 50 */ 1940, 1961, 1981, 2002, 2022, -82, 2066, 385, 2083, 3, /* 60 */ 107, 281, 565, 520, 608, -38, 384, -148, -92, -78, /* 70 */ -146, -132, -120, -58, -75, 96, 120, 127, 130, 203, /* 80 */ 210, 210, 212, 214, }; static const YYACTIONTYPE yy_default[] = { /* 0 */ 452, 452, 452, 614, 614, 614, 614, 614, 614, 603, /* 10 */ 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, /* 20 */ 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, /* 30 */ 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, /* 40 */ 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, /* 50 */ 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, /* 60 */ 452, 559, 452, 452, 452, 496, 458, 468, 452, 452, /* 70 */ 452, 552, 479, 505, 499, 452, 452, 452, 475, 452, /* 80 */ 566, 565, 591, 591, 516, 452, 536, 534, 535, 532, /* 90 */ 452, 547, 554, 452, 561, 560, 452, 557, 545, 452, /* 100 */ 452, 452, 452, 452, 553, 546, 542, 533, 452, 472, /* 110 */ 469, 452, 452, 452, 452, 452, 452, 452, 452, 452, /* 120 */ 452, 452, 452, 452, 498, 452, 452, 497, 452, 452, /* 130 */ 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, /* 140 */ 452, 452, 452, 452, 452, 613, 452, 452, 604, 452, /* 150 */ 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, /* 160 */ 512, 452, 452, 452, 452, 452, 452, 452, 513, 486, /* 170 */ 480, 452, }; /********** End of lemon-generated parsing tables *****************************/ /* The next table maps tokens (terminal symbols) into fallback tokens. ** If a construct like the following: ** ** %fallback ID X Y Z. ** ** appears in the grammar, then ID becomes a fallback token for X, Y, ** and Z. Whenever one of the tokens X, Y, or Z is input to the parser ** but it does not parse, the type of the token is changed to ID and ** the parse is retried before an error is thrown. ** ** This feature can be used, for example, to cause some keywords in a language ** to revert to identifiers if they keyword does not apply in the context where ** it appears. */ #ifdef YYFALLBACK static const YYCODETYPE yyFallback[] = { }; #endif /* YYFALLBACK */ /* The following structure represents a single element of the ** parser's stack. Information stored includes: ** ** + The state number for the parser at this level of the stack. ** ** + The value of the token stored at this level of the stack. ** (In other words, the "major" token.) ** ** + The semantic value stored at this level of the stack. This is ** the information used by the action routines in the grammar. ** It is sometimes called the "minor" token. ** ** After the "shift" half of a SHIFTREDUCE action, the stateno field ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ struct yyStackEntry { YYACTIONTYPE stateno; /* The state-number, or reduce action in SHIFTREDUCE */ YYCODETYPE major; /* The major token value. This is the code ** number for the token at this stack level */ YYMINORTYPE minor; /* The user-supplied minor token value. This ** is the value of the token */ }; typedef struct yyStackEntry yyStackEntry; /* The state of the parser is completely contained in an instance of ** the following structure */ struct yyParser { yyStackEntry *yytos; /* Pointer to top element of the stack */ #ifdef YYTRACKMAXSTACKDEPTH int yyhwm; /* High-water mark of the stack */ #endif #ifndef YYNOERRORRECOVERY int yyerrcnt; /* Shifts left before out of the error */ #endif xqueryParseARG_SDECL /* A place to hold %extra_argument */ xqueryParseCTX_SDECL /* A place to hold %extra_context */ yyStackEntry *yystackEnd; /* Last entry in the stack */ yyStackEntry *yystack; /* The parser stack */ yyStackEntry yystk0[YYSTACKDEPTH]; /* Initial stack space */ }; typedef struct yyParser yyParser; #include #ifndef NDEBUG #include static FILE *yyTraceFILE = 0; static char *yyTracePrompt = 0; #endif /* NDEBUG */ #ifndef NDEBUG /* ** Turn parser tracing on by giving a stream to which to write the trace ** and a prompt to preface each trace message. Tracing is turned off ** by making either argument NULL ** ** Inputs: **
    **
  • A FILE* to which trace output should be written. ** If NULL, then tracing is turned off. **
  • A prefix string written at the beginning of every ** line of trace output. If NULL, then tracing is ** turned off. **
** ** Outputs: ** None. */ void xqueryParseTrace(FILE *TraceFILE, char *zTracePrompt){ yyTraceFILE = TraceFILE; yyTracePrompt = zTracePrompt; if( yyTraceFILE==0 ) yyTracePrompt = 0; else if( yyTracePrompt==0 ) yyTraceFILE = 0; } #endif /* NDEBUG */ #if defined(YYCOVERAGE) || !defined(NDEBUG) /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ static const char *const yyTokenName[] = { /* 0 */ "$", /* 1 */ "SLASH", /* 2 */ "DOUBLE_SLASH", /* 3 */ "DOT", /* 4 */ "DOUBLE_DOT", /* 5 */ "AT", /* 6 */ "COMMA", /* 7 */ "COLON_COLON", /* 8 */ "LPAREN", /* 9 */ "RPAREN", /* 10 */ "LBRACKET", /* 11 */ "RBRACKET", /* 12 */ "PLUS", /* 13 */ "MINUS", /* 14 */ "STAR", /* 15 */ "PIPE", /* 16 */ "EQUALS", /* 17 */ "NOT_EQUALS", /* 18 */ "LESS_THAN", /* 19 */ "LESS_EQUAL", /* 20 */ "GREATER_THAN", /* 21 */ "GREATER_EQUAL", /* 22 */ "SEMICOLON", /* 23 */ "LBRACE", /* 24 */ "RBRACE", /* 25 */ "ASSIGN", /* 26 */ "CONCAT_OP", /* 27 */ "NODE_PRECEDES", /* 28 */ "NODE_FOLLOWS", /* 29 */ "KW_OR", /* 30 */ "KW_AND", /* 31 */ "KW_DIV", /* 32 */ "KW_MOD", /* 33 */ "KW_EQ", /* 34 */ "KW_NE", /* 35 */ "KW_LT", /* 36 */ "KW_LE", /* 37 */ "KW_GT", /* 38 */ "KW_GE", /* 39 */ "KW_FOR", /* 40 */ "KW_LET", /* 41 */ "KW_WHERE", /* 42 */ "KW_ORDER", /* 43 */ "KW_BY", /* 44 */ "KW_RETURN", /* 45 */ "KW_IN", /* 46 */ "KW_AT_WORD", /* 47 */ "KW_IF", /* 48 */ "KW_THEN", /* 49 */ "KW_ELSE", /* 50 */ "KW_SOME", /* 51 */ "KW_EVERY", /* 52 */ "KW_SATISFIES", /* 53 */ "KW_IS", /* 54 */ "KW_TO", /* 55 */ "KW_UNION", /* 56 */ "KW_INTERSECT", /* 57 */ "KW_EXCEPT", /* 58 */ "KW_INSTANCE", /* 59 */ "KW_OF", /* 60 */ "KW_TREAT", /* 61 */ "KW_AS", /* 62 */ "KW_CASTABLE", /* 63 */ "KW_CAST", /* 64 */ "KW_IDIV", /* 65 */ "KW_DECLARE", /* 66 */ "KW_FUNCTION", /* 67 */ "KW_VARIABLE", /* 68 */ "KW_NAMESPACE", /* 69 */ "KW_DEFAULT", /* 70 */ "KW_ELEMENT", /* 71 */ "KW_IMPORT", /* 72 */ "KW_MODULE", /* 73 */ "KW_STABLE", /* 74 */ "KW_ATTRIBUTE", /* 75 */ "KW_DOCUMENT", /* 76 */ "KW_TEXT", /* 77 */ "KW_COMMENT", /* 78 */ "KW_PI", /* 79 */ "KW_ASCENDING", /* 80 */ "KW_DESCENDING", /* 81 */ "KW_TYPESWITCH", /* 82 */ "KW_CASE", /* 83 */ "AXIS_ANCESTOR", /* 84 */ "AXIS_ANCESTOR_OR_SELF", /* 85 */ "AXIS_ATTRIBUTE", /* 86 */ "AXIS_CHILD", /* 87 */ "AXIS_DESCENDANT", /* 88 */ "AXIS_DESCENDANT_OR_SELF", /* 89 */ "AXIS_FOLLOWING", /* 90 */ "AXIS_FOLLOWING_SIBLING", /* 91 */ "AXIS_NAMESPACE", /* 92 */ "AXIS_PARENT", /* 93 */ "AXIS_PRECEDING", /* 94 */ "AXIS_PRECEDING_SIBLING", /* 95 */ "AXIS_SELF", /* 96 */ "NODE_TYPE_COMMENT", /* 97 */ "NODE_TYPE_TEXT", /* 98 */ "NODE_TYPE_PI", /* 99 */ "NODE_TYPE_NODE", /* 100 */ "LITERAL", /* 101 */ "NUMBER", /* 102 */ "NAME_TEST", /* 103 */ "FUNCTION_NAME", /* 104 */ "VARIABLE_REF", /* 105 */ "LONE_SLASH", /* 106 */ "UMINUS", /* 107 */ "xquery_top", /* 108 */ "module", /* 109 */ "prolog", /* 110 */ "prolog_decl_list", /* 111 */ "prolog_decl", /* 112 */ "query_body", /* 113 */ "expr", /* 114 */ "expr_single", /* 115 */ "flwor_expr", /* 116 */ "fl_clause_list", /* 117 */ "fl_clause", /* 118 */ "for_clause", /* 119 */ "let_clause", /* 120 */ "opt_where", /* 121 */ "opt_order_by", /* 122 */ "order_spec_list", /* 123 */ "order_spec", /* 124 */ "opt_sort_dir", /* 125 */ "quantified_expr", /* 126 */ "quant_binding_list", /* 127 */ "quant_binding", /* 128 */ "if_expr", /* 129 */ "or_expr", /* 130 */ "and_expr", /* 131 */ "comparison_expr", /* 132 */ "range_expr", /* 133 */ "additive_expr", /* 134 */ "multiplicative_expr", /* 135 */ "unary_expr", /* 136 */ "union_expr", /* 137 */ "intersect_expr", /* 138 */ "path_expr", /* 139 */ "filter_expr", /* 140 */ "location_path", /* 141 */ "absolute_location_path", /* 142 */ "relative_location_path", /* 143 */ "step", /* 144 */ "axis_specifier", /* 145 */ "axis_name", /* 146 */ "node_test", /* 147 */ "predicate_list", /* 148 */ "predicate", /* 149 */ "abbreviated_step", /* 150 */ "primary_expr", /* 151 */ "function_call", /* 152 */ "argument_list", /* 153 */ "arguments", /* 154 */ "computed_constructor", /* 155 */ "opt_enclosed_expr", /* 156 */ "function_decl", /* 157 */ "param_list", /* 158 */ "params", /* 159 */ "param", /* 160 */ "opt_type_decl", /* 161 */ "sequence_type", /* 162 */ "opt_occurrence", /* 163 */ "variable_decl", /* 164 */ "ns_decl", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ #ifndef NDEBUG /* For tracing reduce actions, the names of all rules are required. */ static const char *const yyRuleName[] = { /* 0 */ "xquery_top ::= module", /* 1 */ "module ::= prolog query_body", /* 2 */ "module ::= query_body", /* 3 */ "prolog ::= prolog_decl_list", /* 4 */ "prolog_decl_list ::= prolog_decl SEMICOLON", /* 5 */ "prolog_decl_list ::= prolog_decl_list prolog_decl SEMICOLON", /* 6 */ "prolog_decl ::= ns_decl", /* 7 */ "prolog_decl ::= variable_decl", /* 8 */ "prolog_decl ::= function_decl", /* 9 */ "ns_decl ::= KW_DECLARE KW_NAMESPACE NAME_TEST EQUALS LITERAL", /* 10 */ "ns_decl ::= KW_DECLARE KW_DEFAULT KW_ELEMENT KW_NAMESPACE LITERAL", /* 11 */ "variable_decl ::= KW_DECLARE KW_VARIABLE VARIABLE_REF ASSIGN expr_single", /* 12 */ "function_decl ::= KW_DECLARE KW_FUNCTION FUNCTION_NAME LPAREN param_list RPAREN opt_type_decl LBRACE expr RBRACE", /* 13 */ "param_list ::=", /* 14 */ "param_list ::= params", /* 15 */ "params ::= param", /* 16 */ "params ::= params COMMA param", /* 17 */ "param ::= VARIABLE_REF", /* 18 */ "param ::= VARIABLE_REF KW_AS sequence_type", /* 19 */ "opt_type_decl ::= KW_AS sequence_type", /* 20 */ "opt_type_decl ::=", /* 21 */ "sequence_type ::= NAME_TEST opt_occurrence", /* 22 */ "opt_occurrence ::= STAR", /* 23 */ "opt_occurrence ::= PLUS", /* 24 */ "opt_occurrence ::=", /* 25 */ "query_body ::= expr", /* 26 */ "expr ::= expr_single", /* 27 */ "expr ::= expr COMMA expr_single", /* 28 */ "expr_single ::= flwor_expr", /* 29 */ "expr_single ::= quantified_expr", /* 30 */ "expr_single ::= if_expr", /* 31 */ "expr_single ::= or_expr", /* 32 */ "flwor_expr ::= fl_clause_list opt_where opt_order_by KW_RETURN expr_single", /* 33 */ "fl_clause_list ::= fl_clause", /* 34 */ "fl_clause_list ::= fl_clause_list fl_clause", /* 35 */ "fl_clause ::= for_clause", /* 36 */ "fl_clause ::= let_clause", /* 37 */ "for_clause ::= KW_FOR VARIABLE_REF KW_IN expr_single", /* 38 */ "for_clause ::= KW_FOR VARIABLE_REF KW_AT_WORD VARIABLE_REF KW_IN expr_single", /* 39 */ "let_clause ::= KW_LET VARIABLE_REF ASSIGN expr_single", /* 40 */ "opt_where ::= KW_WHERE expr_single", /* 41 */ "opt_where ::=", /* 42 */ "opt_order_by ::= KW_ORDER KW_BY order_spec_list", /* 43 */ "opt_order_by ::= KW_STABLE KW_ORDER KW_BY order_spec_list", /* 44 */ "opt_order_by ::=", /* 45 */ "order_spec_list ::= order_spec", /* 46 */ "order_spec_list ::= order_spec_list COMMA order_spec", /* 47 */ "order_spec ::= expr_single opt_sort_dir", /* 48 */ "opt_sort_dir ::= KW_ASCENDING", /* 49 */ "opt_sort_dir ::= KW_DESCENDING", /* 50 */ "opt_sort_dir ::=", /* 51 */ "quantified_expr ::= KW_SOME quant_binding_list KW_SATISFIES expr_single", /* 52 */ "quantified_expr ::= KW_EVERY quant_binding_list KW_SATISFIES expr_single", /* 53 */ "quant_binding_list ::= quant_binding", /* 54 */ "quant_binding_list ::= quant_binding_list COMMA quant_binding", /* 55 */ "quant_binding ::= VARIABLE_REF KW_IN expr_single", /* 56 */ "if_expr ::= KW_IF LPAREN expr RPAREN KW_THEN expr_single KW_ELSE expr_single", /* 57 */ "or_expr ::= and_expr", /* 58 */ "or_expr ::= or_expr KW_OR and_expr", /* 59 */ "and_expr ::= comparison_expr", /* 60 */ "and_expr ::= and_expr KW_AND comparison_expr", /* 61 */ "comparison_expr ::= range_expr", /* 62 */ "comparison_expr ::= range_expr EQUALS range_expr", /* 63 */ "comparison_expr ::= range_expr NOT_EQUALS range_expr", /* 64 */ "comparison_expr ::= range_expr LESS_THAN range_expr", /* 65 */ "comparison_expr ::= range_expr LESS_EQUAL range_expr", /* 66 */ "comparison_expr ::= range_expr GREATER_THAN range_expr", /* 67 */ "comparison_expr ::= range_expr GREATER_EQUAL range_expr", /* 68 */ "comparison_expr ::= range_expr KW_EQ range_expr", /* 69 */ "comparison_expr ::= range_expr KW_NE range_expr", /* 70 */ "comparison_expr ::= range_expr KW_LT range_expr", /* 71 */ "comparison_expr ::= range_expr KW_LE range_expr", /* 72 */ "comparison_expr ::= range_expr KW_GT range_expr", /* 73 */ "comparison_expr ::= range_expr KW_GE range_expr", /* 74 */ "comparison_expr ::= range_expr KW_IS range_expr", /* 75 */ "comparison_expr ::= range_expr NODE_PRECEDES range_expr", /* 76 */ "comparison_expr ::= range_expr NODE_FOLLOWS range_expr", /* 77 */ "range_expr ::= additive_expr", /* 78 */ "range_expr ::= additive_expr KW_TO additive_expr", /* 79 */ "additive_expr ::= multiplicative_expr", /* 80 */ "additive_expr ::= additive_expr PLUS multiplicative_expr", /* 81 */ "additive_expr ::= additive_expr MINUS multiplicative_expr", /* 82 */ "multiplicative_expr ::= unary_expr", /* 83 */ "multiplicative_expr ::= multiplicative_expr STAR unary_expr", /* 84 */ "multiplicative_expr ::= multiplicative_expr KW_DIV unary_expr", /* 85 */ "multiplicative_expr ::= multiplicative_expr KW_IDIV unary_expr", /* 86 */ "multiplicative_expr ::= multiplicative_expr KW_MOD unary_expr", /* 87 */ "unary_expr ::= union_expr", /* 88 */ "unary_expr ::= MINUS unary_expr", /* 89 */ "unary_expr ::= PLUS unary_expr", /* 90 */ "union_expr ::= intersect_expr", /* 91 */ "union_expr ::= union_expr PIPE intersect_expr", /* 92 */ "union_expr ::= union_expr KW_UNION intersect_expr", /* 93 */ "intersect_expr ::= path_expr", /* 94 */ "intersect_expr ::= intersect_expr KW_INTERSECT path_expr", /* 95 */ "intersect_expr ::= intersect_expr KW_EXCEPT path_expr", /* 96 */ "path_expr ::= location_path", /* 97 */ "path_expr ::= filter_expr", /* 98 */ "path_expr ::= filter_expr SLASH relative_location_path", /* 99 */ "path_expr ::= filter_expr DOUBLE_SLASH relative_location_path", /* 100 */ "filter_expr ::= primary_expr", /* 101 */ "filter_expr ::= filter_expr predicate", /* 102 */ "location_path ::= relative_location_path", /* 103 */ "location_path ::= absolute_location_path", /* 104 */ "absolute_location_path ::= SLASH", /* 105 */ "absolute_location_path ::= SLASH relative_location_path", /* 106 */ "absolute_location_path ::= DOUBLE_SLASH relative_location_path", /* 107 */ "relative_location_path ::= step", /* 108 */ "relative_location_path ::= relative_location_path SLASH step", /* 109 */ "relative_location_path ::= relative_location_path DOUBLE_SLASH step", /* 110 */ "step ::= axis_specifier node_test predicate_list", /* 111 */ "step ::= node_test predicate_list", /* 112 */ "step ::= abbreviated_step", /* 113 */ "axis_specifier ::= axis_name COLON_COLON", /* 114 */ "axis_specifier ::= AT", /* 115 */ "axis_name ::= AXIS_CHILD", /* 116 */ "axis_name ::= AXIS_DESCENDANT", /* 117 */ "axis_name ::= AXIS_PARENT", /* 118 */ "axis_name ::= AXIS_ANCESTOR", /* 119 */ "axis_name ::= AXIS_FOLLOWING_SIBLING", /* 120 */ "axis_name ::= AXIS_PRECEDING_SIBLING", /* 121 */ "axis_name ::= AXIS_FOLLOWING", /* 122 */ "axis_name ::= AXIS_PRECEDING", /* 123 */ "axis_name ::= AXIS_ATTRIBUTE", /* 124 */ "axis_name ::= AXIS_NAMESPACE", /* 125 */ "axis_name ::= AXIS_SELF", /* 126 */ "axis_name ::= AXIS_DESCENDANT_OR_SELF", /* 127 */ "axis_name ::= AXIS_ANCESTOR_OR_SELF", /* 128 */ "node_test ::= NAME_TEST", /* 129 */ "node_test ::= STAR", /* 130 */ "node_test ::= NODE_TYPE_COMMENT LPAREN RPAREN", /* 131 */ "node_test ::= NODE_TYPE_TEXT LPAREN RPAREN", /* 132 */ "node_test ::= NODE_TYPE_PI LPAREN RPAREN", /* 133 */ "node_test ::= NODE_TYPE_PI LPAREN LITERAL RPAREN", /* 134 */ "node_test ::= NODE_TYPE_NODE LPAREN RPAREN", /* 135 */ "predicate ::= LBRACKET expr RBRACKET", /* 136 */ "predicate_list ::=", /* 137 */ "predicate_list ::= predicate_list predicate", /* 138 */ "abbreviated_step ::= DOT", /* 139 */ "abbreviated_step ::= DOUBLE_DOT", /* 140 */ "primary_expr ::= VARIABLE_REF", /* 141 */ "primary_expr ::= LPAREN expr RPAREN", /* 142 */ "primary_expr ::= LPAREN RPAREN", /* 143 */ "primary_expr ::= LITERAL", /* 144 */ "primary_expr ::= NUMBER", /* 145 */ "primary_expr ::= function_call", /* 146 */ "primary_expr ::= computed_constructor", /* 147 */ "function_call ::= FUNCTION_NAME LPAREN argument_list RPAREN", /* 148 */ "argument_list ::=", /* 149 */ "argument_list ::= arguments", /* 150 */ "arguments ::= expr_single", /* 151 */ "arguments ::= arguments COMMA expr_single", /* 152 */ "computed_constructor ::= KW_ELEMENT NAME_TEST LBRACE opt_enclosed_expr RBRACE", /* 153 */ "computed_constructor ::= KW_ATTRIBUTE NAME_TEST LBRACE opt_enclosed_expr RBRACE", /* 154 */ "computed_constructor ::= KW_DOCUMENT LBRACE opt_enclosed_expr RBRACE", /* 155 */ "computed_constructor ::= KW_TEXT LBRACE opt_enclosed_expr RBRACE", /* 156 */ "computed_constructor ::= KW_COMMENT LBRACE opt_enclosed_expr RBRACE", /* 157 */ "computed_constructor ::= KW_PI NAME_TEST LBRACE opt_enclosed_expr RBRACE", /* 158 */ "opt_enclosed_expr ::= expr", /* 159 */ "opt_enclosed_expr ::=", }; #endif /* NDEBUG */ #if YYGROWABLESTACK /* ** Try to increase the size of the parser stack. Return the number ** of errors. Return 0 on success. */ static int yyGrowStack(yyParser *p){ int oldSize = 1 + (int)(p->yystackEnd - p->yystack); int newSize; int idx; yyStackEntry *pNew; #ifdef YYSIZELIMIT int nLimit = YYSIZELIMIT(xqueryParseCTX(p)); #endif newSize = oldSize*2 + 100; #ifdef YYSIZELIMIT if( newSize>nLimit ){ newSize = nLimit; if( newSize<=oldSize ) return 1; } #endif idx = (int)(p->yytos - p->yystack); if( p->yystack==p->yystk0 ){ pNew = YYREALLOC(0, newSize*sizeof(pNew[0]), xqueryParseCTX(p)); if( pNew==0 ) return 1; memcpy(pNew, p->yystack, oldSize*sizeof(pNew[0])); }else{ pNew = YYREALLOC(p->yystack, newSize*sizeof(pNew[0]), xqueryParseCTX(p)); if( pNew==0 ) return 1; } p->yystack = pNew; p->yytos = &p->yystack[idx]; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n", yyTracePrompt, oldSize, newSize); } #endif p->yystackEnd = &p->yystack[newSize-1]; return 0; } #endif /* YYGROWABLESTACK */ #if !YYGROWABLESTACK /* For builds that do no have a growable stack, yyGrowStack always ** returns an error. */ # define yyGrowStack(X) 1 #endif /* Datatype of the argument to the memory allocated passed as the ** second argument to xqueryParseAlloc() below. This can be changed by ** putting an appropriate #define in the %include section of the input ** grammar. */ #ifndef YYMALLOCARGTYPE # define YYMALLOCARGTYPE size_t #endif /* Initialize a new parser that has already been allocated. */ void xqueryParseInit(void *yypRawParser xqueryParseCTX_PDECL){ yyParser *yypParser = (yyParser*)yypRawParser; xqueryParseCTX_STORE #ifdef YYTRACKMAXSTACKDEPTH yypParser->yyhwm = 0; #endif yypParser->yystack = yypParser->yystk0; yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1]; #ifndef YYNOERRORRECOVERY yypParser->yyerrcnt = -1; #endif yypParser->yytos = yypParser->yystack; yypParser->yystack[0].stateno = 0; yypParser->yystack[0].major = 0; } #ifndef xqueryParse_ENGINEALWAYSONSTACK /* ** This function allocates a new parser. ** The only argument is a pointer to a function which works like ** malloc. ** ** Inputs: ** A pointer to the function used to allocate memory. ** ** Outputs: ** A pointer to a parser. This pointer is used in subsequent calls ** to xqueryParse and xqueryParseFree. */ void *xqueryParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) xqueryParseCTX_PDECL){ yyParser *yypParser; yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); if( yypParser ){ xqueryParseCTX_STORE xqueryParseInit(yypParser xqueryParseCTX_PARAM); } return (void*)yypParser; } #endif /* xqueryParse_ENGINEALWAYSONSTACK */ /* The following function deletes the "minor type" or semantic value ** associated with a symbol. The symbol can be either a terminal ** or nonterminal. "yymajor" is the symbol code, and "yypminor" is ** a pointer to the value to be deleted. The code used to do the ** deletions is derived from the %destructor and/or %token_destructor ** directives of the input grammar. */ static void yy_destructor( yyParser *yypParser, /* The parser */ YYCODETYPE yymajor, /* Type code for object to destroy */ YYMINORTYPE *yypminor /* The object to be destroyed */ ){ xqueryParseARG_FETCH xqueryParseCTX_FETCH switch( yymajor ){ /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a ** reduce or during error processing or when a parser is ** being destroyed before it is finished parsing. ** ** Note: during a reduce, the only symbols destroyed are those ** which appear on the RHS of the rule, but which are *not* used ** inside the C code. */ /********* Begin destructor definitions ***************************************/ /********* End destructor definitions *****************************************/ default: break; /* If no destructor action specified: do nothing */ } } /* ** Pop the parser's stack once. ** ** If there is a destructor routine associated with the token which ** is popped from the stack, then call it. */ static void yy_pop_parser_stack(yyParser *pParser){ yyStackEntry *yytos; assert( pParser->yytos!=0 ); assert( pParser->yytos > pParser->yystack ); yytos = pParser->yytos--; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sPopping %s\n", yyTracePrompt, yyTokenName[yytos->major]); } #endif yy_destructor(pParser, yytos->major, &yytos->minor); } /* ** Clear all secondary memory allocations from the parser */ void xqueryParseFinalize(void *p){ yyParser *pParser = (yyParser*)p; /* In-lined version of calling yy_pop_parser_stack() for each ** element left in the stack */ yyStackEntry *yytos = pParser->yytos; while( yytos>pParser->yystack ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sPopping %s\n", yyTracePrompt, yyTokenName[yytos->major]); } #endif if( yytos->major>=YY_MIN_DSTRCTR ){ yy_destructor(pParser, yytos->major, &yytos->minor); } yytos--; } #if YYGROWABLESTACK if( pParser->yystack!=pParser->yystk0 ){ YYFREE(pParser->yystack, xqueryParseCTX(pParser)); } #endif } #ifndef xqueryParse_ENGINEALWAYSONSTACK /* ** Deallocate and destroy a parser. Destructors are called for ** all stack elements before shutting the parser down. ** ** If the YYPARSEFREENEVERNULL macro exists (for example because it ** is defined in a %include section of the input grammar) then it is ** assumed that the input pointer is never NULL. */ void xqueryParseFree( void *p, /* The parser to be deleted */ void (*freeProc)(void*) /* Function used to reclaim memory */ ){ #ifndef YYPARSEFREENEVERNULL if( p==0 ) return; #endif xqueryParseFinalize(p); (*freeProc)(p); } #endif /* xqueryParse_ENGINEALWAYSONSTACK */ /* ** Return the peak depth of the stack for a parser. */ #ifdef YYTRACKMAXSTACKDEPTH int xqueryParseStackPeak(void *p){ yyParser *pParser = (yyParser*)p; return pParser->yyhwm; } #endif /* This array of booleans keeps track of the parser statement ** coverage. The element yycoverage[X][Y] is set when the parser ** is in state X and has a lookahead token Y. In a well-tested ** systems, every element of this matrix should end up being set. */ #if defined(YYCOVERAGE) static unsigned char yycoverage[YYNSTATE][YYNTOKEN]; #endif /* ** Write into out a description of every state/lookahead combination that ** ** (1) has not been used by the parser, and ** (2) is not a syntax error. ** ** Return the number of missed state/lookahead combinations. */ #if defined(YYCOVERAGE) int xqueryParseCoverage(FILE *out){ int stateno, iLookAhead, i; int nMissed = 0; for(stateno=0; statenoYY_MAX_SHIFT ) return stateno; assert( stateno <= YY_SHIFT_COUNT ); #if defined(YYCOVERAGE) yycoverage[stateno][iLookAhead] = 1; #endif do{ i = yy_shift_ofst[stateno]; assert( i>=0 ); assert( i<=YY_ACTTAB_COUNT ); assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); assert( iLookAhead!=YYNOCODE ); assert( iLookAhead < YYNTOKEN ); i += iLookAhead; assert( i<(int)YY_NLOOKAHEAD ); if( yy_lookahead[i]!=iLookAhead ){ #ifdef YYFALLBACK YYCODETYPE iFallback; /* Fallback token */ assert( iLookAhead %s\n", yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); } #endif assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ iLookAhead = iFallback; continue; } #endif #ifdef YYWILDCARD { int j = i - iLookAhead + YYWILDCARD; assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) ); if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]); } #endif /* NDEBUG */ return yy_action[j]; } } #endif /* YYWILDCARD */ return yy_default[stateno]; }else{ assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) ); return yy_action[i]; } }while(1); } /* ** Find the appropriate action for a parser given the non-terminal ** look-ahead token iLookAhead. */ static YYACTIONTYPE yy_find_reduce_action( YYACTIONTYPE stateno, /* Current state number */ YYCODETYPE iLookAhead /* The look-ahead token */ ){ int i; #ifdef YYERRORSYMBOL if( stateno>YY_REDUCE_COUNT ){ return yy_default[stateno]; } #else assert( stateno<=YY_REDUCE_COUNT ); #endif i = yy_reduce_ofst[stateno]; assert( iLookAhead!=YYNOCODE ); i += iLookAhead; #ifdef YYERRORSYMBOL if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ return yy_default[stateno]; } #else assert( i>=0 && iyytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ /******** End %stack_overflow code ********************************************/ xqueryParseARG_STORE /* Suppress warning about unused %extra_argument var */ xqueryParseCTX_STORE } /* ** Print tracing information for a SHIFT action */ #ifndef NDEBUG static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ if( yyTraceFILE ){ if( yyNewStateyytos->major], yyNewState); }else{ fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n", yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major], yyNewState - YY_MIN_REDUCE); } } } #else # define yyTraceShift(X,Y,Z) #endif /* ** Perform a shift action. */ static void yy_shift( yyParser *yypParser, /* The parser to be shifted */ YYACTIONTYPE yyNewState, /* The new state to shift in */ YYCODETYPE yyMajor, /* The major token to shift in */ xqueryParseTOKENTYPE yyMinor /* The minor token to shift in */ ){ yyStackEntry *yytos; yypParser->yytos++; #ifdef YYTRACKMAXSTACKDEPTH if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ yypParser->yyhwm++; assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) ); } #endif yytos = yypParser->yytos; if( yytos>yypParser->yystackEnd ){ if( yyGrowStack(yypParser) ){ yypParser->yytos--; yyStackOverflow(yypParser); return; } yytos = yypParser->yytos; assert( yytos <= yypParser->yystackEnd ); } if( yyNewState > YY_MAX_SHIFT ){ yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; } yytos->stateno = yyNewState; yytos->major = yyMajor; yytos->minor.yy0 = yyMinor; yyTraceShift(yypParser, yyNewState, "Shift"); } /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { 107, /* (0) xquery_top ::= module */ 108, /* (1) module ::= prolog query_body */ 108, /* (2) module ::= query_body */ 109, /* (3) prolog ::= prolog_decl_list */ 110, /* (4) prolog_decl_list ::= prolog_decl SEMICOLON */ 110, /* (5) prolog_decl_list ::= prolog_decl_list prolog_decl SEMICOLON */ 111, /* (6) prolog_decl ::= ns_decl */ 111, /* (7) prolog_decl ::= variable_decl */ 111, /* (8) prolog_decl ::= function_decl */ 164, /* (9) ns_decl ::= KW_DECLARE KW_NAMESPACE NAME_TEST EQUALS LITERAL */ 164, /* (10) ns_decl ::= KW_DECLARE KW_DEFAULT KW_ELEMENT KW_NAMESPACE LITERAL */ 163, /* (11) variable_decl ::= KW_DECLARE KW_VARIABLE VARIABLE_REF ASSIGN expr_single */ 156, /* (12) function_decl ::= KW_DECLARE KW_FUNCTION FUNCTION_NAME LPAREN param_list RPAREN opt_type_decl LBRACE expr RBRACE */ 157, /* (13) param_list ::= */ 157, /* (14) param_list ::= params */ 158, /* (15) params ::= param */ 158, /* (16) params ::= params COMMA param */ 159, /* (17) param ::= VARIABLE_REF */ 159, /* (18) param ::= VARIABLE_REF KW_AS sequence_type */ 160, /* (19) opt_type_decl ::= KW_AS sequence_type */ 160, /* (20) opt_type_decl ::= */ 161, /* (21) sequence_type ::= NAME_TEST opt_occurrence */ 162, /* (22) opt_occurrence ::= STAR */ 162, /* (23) opt_occurrence ::= PLUS */ 162, /* (24) opt_occurrence ::= */ 112, /* (25) query_body ::= expr */ 113, /* (26) expr ::= expr_single */ 113, /* (27) expr ::= expr COMMA expr_single */ 114, /* (28) expr_single ::= flwor_expr */ 114, /* (29) expr_single ::= quantified_expr */ 114, /* (30) expr_single ::= if_expr */ 114, /* (31) expr_single ::= or_expr */ 115, /* (32) flwor_expr ::= fl_clause_list opt_where opt_order_by KW_RETURN expr_single */ 116, /* (33) fl_clause_list ::= fl_clause */ 116, /* (34) fl_clause_list ::= fl_clause_list fl_clause */ 117, /* (35) fl_clause ::= for_clause */ 117, /* (36) fl_clause ::= let_clause */ 118, /* (37) for_clause ::= KW_FOR VARIABLE_REF KW_IN expr_single */ 118, /* (38) for_clause ::= KW_FOR VARIABLE_REF KW_AT_WORD VARIABLE_REF KW_IN expr_single */ 119, /* (39) let_clause ::= KW_LET VARIABLE_REF ASSIGN expr_single */ 120, /* (40) opt_where ::= KW_WHERE expr_single */ 120, /* (41) opt_where ::= */ 121, /* (42) opt_order_by ::= KW_ORDER KW_BY order_spec_list */ 121, /* (43) opt_order_by ::= KW_STABLE KW_ORDER KW_BY order_spec_list */ 121, /* (44) opt_order_by ::= */ 122, /* (45) order_spec_list ::= order_spec */ 122, /* (46) order_spec_list ::= order_spec_list COMMA order_spec */ 123, /* (47) order_spec ::= expr_single opt_sort_dir */ 124, /* (48) opt_sort_dir ::= KW_ASCENDING */ 124, /* (49) opt_sort_dir ::= KW_DESCENDING */ 124, /* (50) opt_sort_dir ::= */ 125, /* (51) quantified_expr ::= KW_SOME quant_binding_list KW_SATISFIES expr_single */ 125, /* (52) quantified_expr ::= KW_EVERY quant_binding_list KW_SATISFIES expr_single */ 126, /* (53) quant_binding_list ::= quant_binding */ 126, /* (54) quant_binding_list ::= quant_binding_list COMMA quant_binding */ 127, /* (55) quant_binding ::= VARIABLE_REF KW_IN expr_single */ 128, /* (56) if_expr ::= KW_IF LPAREN expr RPAREN KW_THEN expr_single KW_ELSE expr_single */ 129, /* (57) or_expr ::= and_expr */ 129, /* (58) or_expr ::= or_expr KW_OR and_expr */ 130, /* (59) and_expr ::= comparison_expr */ 130, /* (60) and_expr ::= and_expr KW_AND comparison_expr */ 131, /* (61) comparison_expr ::= range_expr */ 131, /* (62) comparison_expr ::= range_expr EQUALS range_expr */ 131, /* (63) comparison_expr ::= range_expr NOT_EQUALS range_expr */ 131, /* (64) comparison_expr ::= range_expr LESS_THAN range_expr */ 131, /* (65) comparison_expr ::= range_expr LESS_EQUAL range_expr */ 131, /* (66) comparison_expr ::= range_expr GREATER_THAN range_expr */ 131, /* (67) comparison_expr ::= range_expr GREATER_EQUAL range_expr */ 131, /* (68) comparison_expr ::= range_expr KW_EQ range_expr */ 131, /* (69) comparison_expr ::= range_expr KW_NE range_expr */ 131, /* (70) comparison_expr ::= range_expr KW_LT range_expr */ 131, /* (71) comparison_expr ::= range_expr KW_LE range_expr */ 131, /* (72) comparison_expr ::= range_expr KW_GT range_expr */ 131, /* (73) comparison_expr ::= range_expr KW_GE range_expr */ 131, /* (74) comparison_expr ::= range_expr KW_IS range_expr */ 131, /* (75) comparison_expr ::= range_expr NODE_PRECEDES range_expr */ 131, /* (76) comparison_expr ::= range_expr NODE_FOLLOWS range_expr */ 132, /* (77) range_expr ::= additive_expr */ 132, /* (78) range_expr ::= additive_expr KW_TO additive_expr */ 133, /* (79) additive_expr ::= multiplicative_expr */ 133, /* (80) additive_expr ::= additive_expr PLUS multiplicative_expr */ 133, /* (81) additive_expr ::= additive_expr MINUS multiplicative_expr */ 134, /* (82) multiplicative_expr ::= unary_expr */ 134, /* (83) multiplicative_expr ::= multiplicative_expr STAR unary_expr */ 134, /* (84) multiplicative_expr ::= multiplicative_expr KW_DIV unary_expr */ 134, /* (85) multiplicative_expr ::= multiplicative_expr KW_IDIV unary_expr */ 134, /* (86) multiplicative_expr ::= multiplicative_expr KW_MOD unary_expr */ 135, /* (87) unary_expr ::= union_expr */ 135, /* (88) unary_expr ::= MINUS unary_expr */ 135, /* (89) unary_expr ::= PLUS unary_expr */ 136, /* (90) union_expr ::= intersect_expr */ 136, /* (91) union_expr ::= union_expr PIPE intersect_expr */ 136, /* (92) union_expr ::= union_expr KW_UNION intersect_expr */ 137, /* (93) intersect_expr ::= path_expr */ 137, /* (94) intersect_expr ::= intersect_expr KW_INTERSECT path_expr */ 137, /* (95) intersect_expr ::= intersect_expr KW_EXCEPT path_expr */ 138, /* (96) path_expr ::= location_path */ 138, /* (97) path_expr ::= filter_expr */ 138, /* (98) path_expr ::= filter_expr SLASH relative_location_path */ 138, /* (99) path_expr ::= filter_expr DOUBLE_SLASH relative_location_path */ 139, /* (100) filter_expr ::= primary_expr */ 139, /* (101) filter_expr ::= filter_expr predicate */ 140, /* (102) location_path ::= relative_location_path */ 140, /* (103) location_path ::= absolute_location_path */ 141, /* (104) absolute_location_path ::= SLASH */ 141, /* (105) absolute_location_path ::= SLASH relative_location_path */ 141, /* (106) absolute_location_path ::= DOUBLE_SLASH relative_location_path */ 142, /* (107) relative_location_path ::= step */ 142, /* (108) relative_location_path ::= relative_location_path SLASH step */ 142, /* (109) relative_location_path ::= relative_location_path DOUBLE_SLASH step */ 143, /* (110) step ::= axis_specifier node_test predicate_list */ 143, /* (111) step ::= node_test predicate_list */ 143, /* (112) step ::= abbreviated_step */ 144, /* (113) axis_specifier ::= axis_name COLON_COLON */ 144, /* (114) axis_specifier ::= AT */ 145, /* (115) axis_name ::= AXIS_CHILD */ 145, /* (116) axis_name ::= AXIS_DESCENDANT */ 145, /* (117) axis_name ::= AXIS_PARENT */ 145, /* (118) axis_name ::= AXIS_ANCESTOR */ 145, /* (119) axis_name ::= AXIS_FOLLOWING_SIBLING */ 145, /* (120) axis_name ::= AXIS_PRECEDING_SIBLING */ 145, /* (121) axis_name ::= AXIS_FOLLOWING */ 145, /* (122) axis_name ::= AXIS_PRECEDING */ 145, /* (123) axis_name ::= AXIS_ATTRIBUTE */ 145, /* (124) axis_name ::= AXIS_NAMESPACE */ 145, /* (125) axis_name ::= AXIS_SELF */ 145, /* (126) axis_name ::= AXIS_DESCENDANT_OR_SELF */ 145, /* (127) axis_name ::= AXIS_ANCESTOR_OR_SELF */ 146, /* (128) node_test ::= NAME_TEST */ 146, /* (129) node_test ::= STAR */ 146, /* (130) node_test ::= NODE_TYPE_COMMENT LPAREN RPAREN */ 146, /* (131) node_test ::= NODE_TYPE_TEXT LPAREN RPAREN */ 146, /* (132) node_test ::= NODE_TYPE_PI LPAREN RPAREN */ 146, /* (133) node_test ::= NODE_TYPE_PI LPAREN LITERAL RPAREN */ 146, /* (134) node_test ::= NODE_TYPE_NODE LPAREN RPAREN */ 148, /* (135) predicate ::= LBRACKET expr RBRACKET */ 147, /* (136) predicate_list ::= */ 147, /* (137) predicate_list ::= predicate_list predicate */ 149, /* (138) abbreviated_step ::= DOT */ 149, /* (139) abbreviated_step ::= DOUBLE_DOT */ 150, /* (140) primary_expr ::= VARIABLE_REF */ 150, /* (141) primary_expr ::= LPAREN expr RPAREN */ 150, /* (142) primary_expr ::= LPAREN RPAREN */ 150, /* (143) primary_expr ::= LITERAL */ 150, /* (144) primary_expr ::= NUMBER */ 150, /* (145) primary_expr ::= function_call */ 150, /* (146) primary_expr ::= computed_constructor */ 151, /* (147) function_call ::= FUNCTION_NAME LPAREN argument_list RPAREN */ 152, /* (148) argument_list ::= */ 152, /* (149) argument_list ::= arguments */ 153, /* (150) arguments ::= expr_single */ 153, /* (151) arguments ::= arguments COMMA expr_single */ 154, /* (152) computed_constructor ::= KW_ELEMENT NAME_TEST LBRACE opt_enclosed_expr RBRACE */ 154, /* (153) computed_constructor ::= KW_ATTRIBUTE NAME_TEST LBRACE opt_enclosed_expr RBRACE */ 154, /* (154) computed_constructor ::= KW_DOCUMENT LBRACE opt_enclosed_expr RBRACE */ 154, /* (155) computed_constructor ::= KW_TEXT LBRACE opt_enclosed_expr RBRACE */ 154, /* (156) computed_constructor ::= KW_COMMENT LBRACE opt_enclosed_expr RBRACE */ 154, /* (157) computed_constructor ::= KW_PI NAME_TEST LBRACE opt_enclosed_expr RBRACE */ 155, /* (158) opt_enclosed_expr ::= expr */ 155, /* (159) opt_enclosed_expr ::= */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number ** of symbols on the right-hand side of that rule. */ static const signed char yyRuleInfoNRhs[] = { -1, /* (0) xquery_top ::= module */ -2, /* (1) module ::= prolog query_body */ -1, /* (2) module ::= query_body */ -1, /* (3) prolog ::= prolog_decl_list */ -2, /* (4) prolog_decl_list ::= prolog_decl SEMICOLON */ -3, /* (5) prolog_decl_list ::= prolog_decl_list prolog_decl SEMICOLON */ -1, /* (6) prolog_decl ::= ns_decl */ -1, /* (7) prolog_decl ::= variable_decl */ -1, /* (8) prolog_decl ::= function_decl */ -5, /* (9) ns_decl ::= KW_DECLARE KW_NAMESPACE NAME_TEST EQUALS LITERAL */ -5, /* (10) ns_decl ::= KW_DECLARE KW_DEFAULT KW_ELEMENT KW_NAMESPACE LITERAL */ -5, /* (11) variable_decl ::= KW_DECLARE KW_VARIABLE VARIABLE_REF ASSIGN expr_single */ -10, /* (12) function_decl ::= KW_DECLARE KW_FUNCTION FUNCTION_NAME LPAREN param_list RPAREN opt_type_decl LBRACE expr RBRACE */ 0, /* (13) param_list ::= */ -1, /* (14) param_list ::= params */ -1, /* (15) params ::= param */ -3, /* (16) params ::= params COMMA param */ -1, /* (17) param ::= VARIABLE_REF */ -3, /* (18) param ::= VARIABLE_REF KW_AS sequence_type */ -2, /* (19) opt_type_decl ::= KW_AS sequence_type */ 0, /* (20) opt_type_decl ::= */ -2, /* (21) sequence_type ::= NAME_TEST opt_occurrence */ -1, /* (22) opt_occurrence ::= STAR */ -1, /* (23) opt_occurrence ::= PLUS */ 0, /* (24) opt_occurrence ::= */ -1, /* (25) query_body ::= expr */ -1, /* (26) expr ::= expr_single */ -3, /* (27) expr ::= expr COMMA expr_single */ -1, /* (28) expr_single ::= flwor_expr */ -1, /* (29) expr_single ::= quantified_expr */ -1, /* (30) expr_single ::= if_expr */ -1, /* (31) expr_single ::= or_expr */ -5, /* (32) flwor_expr ::= fl_clause_list opt_where opt_order_by KW_RETURN expr_single */ -1, /* (33) fl_clause_list ::= fl_clause */ -2, /* (34) fl_clause_list ::= fl_clause_list fl_clause */ -1, /* (35) fl_clause ::= for_clause */ -1, /* (36) fl_clause ::= let_clause */ -4, /* (37) for_clause ::= KW_FOR VARIABLE_REF KW_IN expr_single */ -6, /* (38) for_clause ::= KW_FOR VARIABLE_REF KW_AT_WORD VARIABLE_REF KW_IN expr_single */ -4, /* (39) let_clause ::= KW_LET VARIABLE_REF ASSIGN expr_single */ -2, /* (40) opt_where ::= KW_WHERE expr_single */ 0, /* (41) opt_where ::= */ -3, /* (42) opt_order_by ::= KW_ORDER KW_BY order_spec_list */ -4, /* (43) opt_order_by ::= KW_STABLE KW_ORDER KW_BY order_spec_list */ 0, /* (44) opt_order_by ::= */ -1, /* (45) order_spec_list ::= order_spec */ -3, /* (46) order_spec_list ::= order_spec_list COMMA order_spec */ -2, /* (47) order_spec ::= expr_single opt_sort_dir */ -1, /* (48) opt_sort_dir ::= KW_ASCENDING */ -1, /* (49) opt_sort_dir ::= KW_DESCENDING */ 0, /* (50) opt_sort_dir ::= */ -4, /* (51) quantified_expr ::= KW_SOME quant_binding_list KW_SATISFIES expr_single */ -4, /* (52) quantified_expr ::= KW_EVERY quant_binding_list KW_SATISFIES expr_single */ -1, /* (53) quant_binding_list ::= quant_binding */ -3, /* (54) quant_binding_list ::= quant_binding_list COMMA quant_binding */ -3, /* (55) quant_binding ::= VARIABLE_REF KW_IN expr_single */ -8, /* (56) if_expr ::= KW_IF LPAREN expr RPAREN KW_THEN expr_single KW_ELSE expr_single */ -1, /* (57) or_expr ::= and_expr */ -3, /* (58) or_expr ::= or_expr KW_OR and_expr */ -1, /* (59) and_expr ::= comparison_expr */ -3, /* (60) and_expr ::= and_expr KW_AND comparison_expr */ -1, /* (61) comparison_expr ::= range_expr */ -3, /* (62) comparison_expr ::= range_expr EQUALS range_expr */ -3, /* (63) comparison_expr ::= range_expr NOT_EQUALS range_expr */ -3, /* (64) comparison_expr ::= range_expr LESS_THAN range_expr */ -3, /* (65) comparison_expr ::= range_expr LESS_EQUAL range_expr */ -3, /* (66) comparison_expr ::= range_expr GREATER_THAN range_expr */ -3, /* (67) comparison_expr ::= range_expr GREATER_EQUAL range_expr */ -3, /* (68) comparison_expr ::= range_expr KW_EQ range_expr */ -3, /* (69) comparison_expr ::= range_expr KW_NE range_expr */ -3, /* (70) comparison_expr ::= range_expr KW_LT range_expr */ -3, /* (71) comparison_expr ::= range_expr KW_LE range_expr */ -3, /* (72) comparison_expr ::= range_expr KW_GT range_expr */ -3, /* (73) comparison_expr ::= range_expr KW_GE range_expr */ -3, /* (74) comparison_expr ::= range_expr KW_IS range_expr */ -3, /* (75) comparison_expr ::= range_expr NODE_PRECEDES range_expr */ -3, /* (76) comparison_expr ::= range_expr NODE_FOLLOWS range_expr */ -1, /* (77) range_expr ::= additive_expr */ -3, /* (78) range_expr ::= additive_expr KW_TO additive_expr */ -1, /* (79) additive_expr ::= multiplicative_expr */ -3, /* (80) additive_expr ::= additive_expr PLUS multiplicative_expr */ -3, /* (81) additive_expr ::= additive_expr MINUS multiplicative_expr */ -1, /* (82) multiplicative_expr ::= unary_expr */ -3, /* (83) multiplicative_expr ::= multiplicative_expr STAR unary_expr */ -3, /* (84) multiplicative_expr ::= multiplicative_expr KW_DIV unary_expr */ -3, /* (85) multiplicative_expr ::= multiplicative_expr KW_IDIV unary_expr */ -3, /* (86) multiplicative_expr ::= multiplicative_expr KW_MOD unary_expr */ -1, /* (87) unary_expr ::= union_expr */ -2, /* (88) unary_expr ::= MINUS unary_expr */ -2, /* (89) unary_expr ::= PLUS unary_expr */ -1, /* (90) union_expr ::= intersect_expr */ -3, /* (91) union_expr ::= union_expr PIPE intersect_expr */ -3, /* (92) union_expr ::= union_expr KW_UNION intersect_expr */ -1, /* (93) intersect_expr ::= path_expr */ -3, /* (94) intersect_expr ::= intersect_expr KW_INTERSECT path_expr */ -3, /* (95) intersect_expr ::= intersect_expr KW_EXCEPT path_expr */ -1, /* (96) path_expr ::= location_path */ -1, /* (97) path_expr ::= filter_expr */ -3, /* (98) path_expr ::= filter_expr SLASH relative_location_path */ -3, /* (99) path_expr ::= filter_expr DOUBLE_SLASH relative_location_path */ -1, /* (100) filter_expr ::= primary_expr */ -2, /* (101) filter_expr ::= filter_expr predicate */ -1, /* (102) location_path ::= relative_location_path */ -1, /* (103) location_path ::= absolute_location_path */ -1, /* (104) absolute_location_path ::= SLASH */ -2, /* (105) absolute_location_path ::= SLASH relative_location_path */ -2, /* (106) absolute_location_path ::= DOUBLE_SLASH relative_location_path */ -1, /* (107) relative_location_path ::= step */ -3, /* (108) relative_location_path ::= relative_location_path SLASH step */ -3, /* (109) relative_location_path ::= relative_location_path DOUBLE_SLASH step */ -3, /* (110) step ::= axis_specifier node_test predicate_list */ -2, /* (111) step ::= node_test predicate_list */ -1, /* (112) step ::= abbreviated_step */ -2, /* (113) axis_specifier ::= axis_name COLON_COLON */ -1, /* (114) axis_specifier ::= AT */ -1, /* (115) axis_name ::= AXIS_CHILD */ -1, /* (116) axis_name ::= AXIS_DESCENDANT */ -1, /* (117) axis_name ::= AXIS_PARENT */ -1, /* (118) axis_name ::= AXIS_ANCESTOR */ -1, /* (119) axis_name ::= AXIS_FOLLOWING_SIBLING */ -1, /* (120) axis_name ::= AXIS_PRECEDING_SIBLING */ -1, /* (121) axis_name ::= AXIS_FOLLOWING */ -1, /* (122) axis_name ::= AXIS_PRECEDING */ -1, /* (123) axis_name ::= AXIS_ATTRIBUTE */ -1, /* (124) axis_name ::= AXIS_NAMESPACE */ -1, /* (125) axis_name ::= AXIS_SELF */ -1, /* (126) axis_name ::= AXIS_DESCENDANT_OR_SELF */ -1, /* (127) axis_name ::= AXIS_ANCESTOR_OR_SELF */ -1, /* (128) node_test ::= NAME_TEST */ -1, /* (129) node_test ::= STAR */ -3, /* (130) node_test ::= NODE_TYPE_COMMENT LPAREN RPAREN */ -3, /* (131) node_test ::= NODE_TYPE_TEXT LPAREN RPAREN */ -3, /* (132) node_test ::= NODE_TYPE_PI LPAREN RPAREN */ -4, /* (133) node_test ::= NODE_TYPE_PI LPAREN LITERAL RPAREN */ -3, /* (134) node_test ::= NODE_TYPE_NODE LPAREN RPAREN */ -3, /* (135) predicate ::= LBRACKET expr RBRACKET */ 0, /* (136) predicate_list ::= */ -2, /* (137) predicate_list ::= predicate_list predicate */ -1, /* (138) abbreviated_step ::= DOT */ -1, /* (139) abbreviated_step ::= DOUBLE_DOT */ -1, /* (140) primary_expr ::= VARIABLE_REF */ -3, /* (141) primary_expr ::= LPAREN expr RPAREN */ -2, /* (142) primary_expr ::= LPAREN RPAREN */ -1, /* (143) primary_expr ::= LITERAL */ -1, /* (144) primary_expr ::= NUMBER */ -1, /* (145) primary_expr ::= function_call */ -1, /* (146) primary_expr ::= computed_constructor */ -4, /* (147) function_call ::= FUNCTION_NAME LPAREN argument_list RPAREN */ 0, /* (148) argument_list ::= */ -1, /* (149) argument_list ::= arguments */ -1, /* (150) arguments ::= expr_single */ -3, /* (151) arguments ::= arguments COMMA expr_single */ -5, /* (152) computed_constructor ::= KW_ELEMENT NAME_TEST LBRACE opt_enclosed_expr RBRACE */ -5, /* (153) computed_constructor ::= KW_ATTRIBUTE NAME_TEST LBRACE opt_enclosed_expr RBRACE */ -4, /* (154) computed_constructor ::= KW_DOCUMENT LBRACE opt_enclosed_expr RBRACE */ -4, /* (155) computed_constructor ::= KW_TEXT LBRACE opt_enclosed_expr RBRACE */ -4, /* (156) computed_constructor ::= KW_COMMENT LBRACE opt_enclosed_expr RBRACE */ -5, /* (157) computed_constructor ::= KW_PI NAME_TEST LBRACE opt_enclosed_expr RBRACE */ -1, /* (158) opt_enclosed_expr ::= expr */ 0, /* (159) opt_enclosed_expr ::= */ }; static void yy_accept(yyParser*); /* Forward Declaration */ /* ** Perform a reduce action and the shift that must immediately ** follow the reduce. ** ** The yyLookahead and yyLookaheadToken parameters provide reduce actions ** access to the lookahead token (if any). The yyLookahead will be YYNOCODE ** if the lookahead token has already been consumed. As this procedure is ** only called from one place, optimizing compilers will in-line it, which ** means that the extra parameters have no performance impact. */ static YYACTIONTYPE yy_reduce( yyParser *yypParser, /* The parser */ unsigned int yyruleno, /* Number of the rule by which to reduce */ int yyLookahead, /* Lookahead token, or YYNOCODE if none */ xqueryParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ xqueryParseCTX_PDECL /* %extra_context */ ){ int yygoto; /* The next state */ YYACTIONTYPE yyact; /* The next action */ yyStackEntry *yymsp; /* The top of the parser's stack */ int yysize; /* Amount to pop the stack */ xqueryParseARG_FETCH (void)yyLookahead; (void)yyLookaheadToken; yymsp = yypParser->yytos; switch( yyruleno ){ /* Beginning here are the reduction cases. A typical example ** follows: ** case 0: ** #line ** { ... } // User supplied code ** #line ** break; */ /********** Begin reduce actions **********************************************/ YYMINORTYPE yylhsminor; case 0: /* xquery_top ::= module */ #line 346 "xquery.lime" { yylhsminor.yy196 = yymsp[0].minor.yy196; pstate->result = yymsp[0].minor.yy196; } #line 2103 "xquery.c" yymsp[0].minor.yy196 = yylhsminor.yy196; break; case 1: /* module ::= prolog query_body */ #line 355 "xquery.lime" { yylhsminor.yy196 = xq_make_module(yymsp[-1].minor.yy196, yymsp[0].minor.yy196); } #line 2111 "xquery.c" yymsp[-1].minor.yy196 = yylhsminor.yy196; break; case 2: /* module ::= query_body */ #line 359 "xquery.lime" { yylhsminor.yy196 = xq_make_module(NULL, yymsp[0].minor.yy196); } #line 2119 "xquery.c" yymsp[0].minor.yy196 = yylhsminor.yy196; break; case 3: /* prolog ::= prolog_decl_list */ #line 364 "xquery.lime" { yylhsminor.yy196 = xq_make_prolog(yymsp[0].minor.yy38); } #line 2127 "xquery.c" yymsp[0].minor.yy196 = yylhsminor.yy196; break; case 4: /* prolog_decl_list ::= prolog_decl SEMICOLON */ #line 368 "xquery.lime" { yylhsminor.yy38 = xq_list_make1(yymsp[-1].minor.yy196); } #line 2135 "xquery.c" yymsp[-1].minor.yy38 = yylhsminor.yy38; break; case 5: /* prolog_decl_list ::= prolog_decl_list prolog_decl SEMICOLON */ #line 372 "xquery.lime" { yylhsminor.yy38 = xq_list_append(yymsp[-2].minor.yy38, yymsp[-1].minor.yy196); } #line 2143 "xquery.c" yymsp[-2].minor.yy38 = yylhsminor.yy38; break; case 6: /* prolog_decl ::= ns_decl */ case 7: /* prolog_decl ::= variable_decl */ yytestcase(yyruleno==7); case 8: /* prolog_decl ::= function_decl */ yytestcase(yyruleno==8); case 26: /* expr ::= expr_single */ yytestcase(yyruleno==26); case 28: /* expr_single ::= flwor_expr */ yytestcase(yyruleno==28); case 29: /* expr_single ::= quantified_expr */ yytestcase(yyruleno==29); case 30: /* expr_single ::= if_expr */ yytestcase(yyruleno==30); case 31: /* expr_single ::= or_expr */ yytestcase(yyruleno==31); case 35: /* fl_clause ::= for_clause */ yytestcase(yyruleno==35); case 36: /* fl_clause ::= let_clause */ yytestcase(yyruleno==36); case 57: /* or_expr ::= and_expr */ yytestcase(yyruleno==57); case 59: /* and_expr ::= comparison_expr */ yytestcase(yyruleno==59); case 61: /* comparison_expr ::= range_expr */ yytestcase(yyruleno==61); case 77: /* range_expr ::= additive_expr */ yytestcase(yyruleno==77); case 79: /* additive_expr ::= multiplicative_expr */ yytestcase(yyruleno==79); case 82: /* multiplicative_expr ::= unary_expr */ yytestcase(yyruleno==82); case 87: /* unary_expr ::= union_expr */ yytestcase(yyruleno==87); case 90: /* union_expr ::= intersect_expr */ yytestcase(yyruleno==90); case 93: /* intersect_expr ::= path_expr */ yytestcase(yyruleno==93); case 96: /* path_expr ::= location_path */ yytestcase(yyruleno==96); case 97: /* path_expr ::= filter_expr */ yytestcase(yyruleno==97); case 100: /* filter_expr ::= primary_expr */ yytestcase(yyruleno==100); case 102: /* location_path ::= relative_location_path */ yytestcase(yyruleno==102); case 103: /* location_path ::= absolute_location_path */ yytestcase(yyruleno==103); case 107: /* relative_location_path ::= step */ yytestcase(yyruleno==107); case 112: /* step ::= abbreviated_step */ yytestcase(yyruleno==112); case 145: /* primary_expr ::= function_call */ yytestcase(yyruleno==145); case 146: /* primary_expr ::= computed_constructor */ yytestcase(yyruleno==146); case 158: /* opt_enclosed_expr ::= expr */ yytestcase(yyruleno==158); #line 377 "xquery.lime" { yylhsminor.yy196 = yymsp[0].minor.yy196; } #line 2177 "xquery.c" yymsp[0].minor.yy196 = yylhsminor.yy196; break; case 9: /* ns_decl ::= KW_DECLARE KW_NAMESPACE NAME_TEST EQUALS LITERAL */ #line 382 "xquery.lime" { yymsp[-4].minor.yy196 = xq_make_ns_decl(yymsp[-2].minor.yy0.str.val, yymsp[-2].minor.yy0.str.len, yymsp[0].minor.yy0.str.val, yymsp[0].minor.yy0.str.len); } #line 2185 "xquery.c" break; case 10: /* ns_decl ::= KW_DECLARE KW_DEFAULT KW_ELEMENT KW_NAMESPACE LITERAL */ #line 387 "xquery.lime" { yymsp[-4].minor.yy196 = xq_make_default_ns_decl(yymsp[0].minor.yy0.str.val, yymsp[0].minor.yy0.str.len); } #line 2192 "xquery.c" break; case 11: /* variable_decl ::= KW_DECLARE KW_VARIABLE VARIABLE_REF ASSIGN expr_single */ #line 392 "xquery.lime" { yymsp[-4].minor.yy196 = xq_make_variable_decl(yymsp[-2].minor.yy0.str.val, yymsp[-2].minor.yy0.str.len, NULL, yymsp[0].minor.yy196); } #line 2199 "xquery.c" break; case 12: /* function_decl ::= KW_DECLARE KW_FUNCTION FUNCTION_NAME LPAREN param_list RPAREN opt_type_decl LBRACE expr RBRACE */ #line 397 "xquery.lime" { yymsp[-9].minor.yy196 = xq_make_function_decl(yymsp[-7].minor.yy0.str.val, yymsp[-7].minor.yy0.str.len, yymsp[-5].minor.yy38, yymsp[-3].minor.yy196, yymsp[-1].minor.yy196); } #line 2206 "xquery.c" break; case 13: /* param_list ::= */ case 148: /* argument_list ::= */ yytestcase(yyruleno==148); #line 402 "xquery.lime" { yymsp[1].minor.yy38 = NULL; } #line 2212 "xquery.c" break; case 14: /* param_list ::= params */ case 149: /* argument_list ::= arguments */ yytestcase(yyruleno==149); #line 403 "xquery.lime" { yylhsminor.yy38 = yymsp[0].minor.yy38; } #line 2218 "xquery.c" yymsp[0].minor.yy38 = yylhsminor.yy38; break; case 15: /* params ::= param */ case 45: /* order_spec_list ::= order_spec */ yytestcase(yyruleno==45); case 53: /* quant_binding_list ::= quant_binding */ yytestcase(yyruleno==53); case 150: /* arguments ::= expr_single */ yytestcase(yyruleno==150); #line 405 "xquery.lime" { yylhsminor.yy38 = xq_list_make1(yymsp[0].minor.yy196); } #line 2227 "xquery.c" yymsp[0].minor.yy38 = yylhsminor.yy38; break; case 16: /* params ::= params COMMA param */ #line 406 "xquery.lime" { yylhsminor.yy38 = xq_list_append(yymsp[-2].minor.yy38, yymsp[0].minor.yy196); } #line 2233 "xquery.c" yymsp[-2].minor.yy38 = yylhsminor.yy38; break; case 17: /* param ::= VARIABLE_REF */ #line 408 "xquery.lime" { yylhsminor.yy196 = xq_make_param(yymsp[0].minor.yy0.str.val, yymsp[0].minor.yy0.str.len, NULL); } #line 2241 "xquery.c" yymsp[0].minor.yy196 = yylhsminor.yy196; break; case 18: /* param ::= VARIABLE_REF KW_AS sequence_type */ #line 412 "xquery.lime" { yylhsminor.yy196 = xq_make_param(yymsp[-2].minor.yy0.str.val, yymsp[-2].minor.yy0.str.len, yymsp[0].minor.yy196); } #line 2249 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 19: /* opt_type_decl ::= KW_AS sequence_type */ #line 417 "xquery.lime" { yymsp[-1].minor.yy196 = yymsp[0].minor.yy196; } #line 2255 "xquery.c" break; case 20: /* opt_type_decl ::= */ case 41: /* opt_where ::= */ yytestcase(yyruleno==41); case 44: /* opt_order_by ::= */ yytestcase(yyruleno==44); case 136: /* predicate_list ::= */ yytestcase(yyruleno==136); case 159: /* opt_enclosed_expr ::= */ yytestcase(yyruleno==159); #line 418 "xquery.lime" { yymsp[1].minor.yy196 = NULL; } #line 2264 "xquery.c" break; case 21: /* sequence_type ::= NAME_TEST opt_occurrence */ #line 421 "xquery.lime" { yylhsminor.yy196 = xq_make_sequence_type(yymsp[-1].minor.yy0.str.val, yymsp[-1].minor.yy0.str.len, yymsp[0].minor.yy262); } #line 2271 "xquery.c" yymsp[-1].minor.yy196 = yylhsminor.yy196; break; case 22: /* opt_occurrence ::= STAR */ #line 425 "xquery.lime" { yymsp[0].minor.yy262 = '*'; } #line 2277 "xquery.c" break; case 23: /* opt_occurrence ::= PLUS */ #line 426 "xquery.lime" { yymsp[0].minor.yy262 = '+'; } #line 2282 "xquery.c" break; case 24: /* opt_occurrence ::= */ #line 427 "xquery.lime" { yymsp[1].minor.yy262 = 0; } #line 2287 "xquery.c" break; case 25: /* query_body ::= expr */ #line 430 "xquery.lime" { yylhsminor.yy196 = xq_make_query_body(yymsp[0].minor.yy196); } #line 2294 "xquery.c" yymsp[0].minor.yy196 = yylhsminor.yy196; break; case 27: /* expr ::= expr COMMA expr_single */ #line 437 "xquery.lime" { /* Sequence expression: (a, b, c) */ XQNodeList *items; if (yymsp[-2].minor.yy196->type == XQ_AST_SEQUENCE) { items = yymsp[-2].minor.yy196->value.sequence.items; } else { items = xq_list_make1(yymsp[-2].minor.yy196); } yylhsminor.yy196 = xq_make_sequence(xq_list_append(items, yymsp[0].minor.yy196)); } #line 2309 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 32: /* flwor_expr ::= fl_clause_list opt_where opt_order_by KW_RETURN expr_single */ #line 464 "xquery.lime" { yylhsminor.yy196 = xq_make_flwor(yymsp[-4].minor.yy38, yymsp[-3].minor.yy196, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2317 "xquery.c" yymsp[-4].minor.yy196 = yylhsminor.yy196; break; case 33: /* fl_clause_list ::= fl_clause */ #line 468 "xquery.lime" { yylhsminor.yy38 = xq_list_make1(yymsp[0].minor.yy196); } #line 2325 "xquery.c" yymsp[0].minor.yy38 = yylhsminor.yy38; break; case 34: /* fl_clause_list ::= fl_clause_list fl_clause */ #line 472 "xquery.lime" { yylhsminor.yy38 = xq_list_append(yymsp[-1].minor.yy38, yymsp[0].minor.yy196); } #line 2333 "xquery.c" yymsp[-1].minor.yy38 = yylhsminor.yy38; break; case 37: /* for_clause ::= KW_FOR VARIABLE_REF KW_IN expr_single */ #line 480 "xquery.lime" { yymsp[-3].minor.yy196 = xq_make_for_clause(yymsp[-2].minor.yy0.str.val, yymsp[-2].minor.yy0.str.len, yymsp[0].minor.yy196, NULL, 0); } #line 2341 "xquery.c" break; case 38: /* for_clause ::= KW_FOR VARIABLE_REF KW_AT_WORD VARIABLE_REF KW_IN expr_single */ #line 485 "xquery.lime" { yymsp[-5].minor.yy196 = xq_make_for_clause(yymsp[-4].minor.yy0.str.val, yymsp[-4].minor.yy0.str.len, yymsp[0].minor.yy196, yymsp[-2].minor.yy0.str.val, yymsp[-2].minor.yy0.str.len); } #line 2348 "xquery.c" break; case 39: /* let_clause ::= KW_LET VARIABLE_REF ASSIGN expr_single */ #line 490 "xquery.lime" { yymsp[-3].minor.yy196 = xq_make_let_clause(yymsp[-2].minor.yy0.str.val, yymsp[-2].minor.yy0.str.len, yymsp[0].minor.yy196); } #line 2355 "xquery.c" break; case 40: /* opt_where ::= KW_WHERE expr_single */ #line 495 "xquery.lime" { yymsp[-1].minor.yy196 = xq_make_where_clause(yymsp[0].minor.yy196); } #line 2362 "xquery.c" break; case 42: /* opt_order_by ::= KW_ORDER KW_BY order_spec_list */ #line 501 "xquery.lime" { yymsp[-2].minor.yy196 = xq_make_order_by(yymsp[0].minor.yy38, false); } #line 2369 "xquery.c" break; case 43: /* opt_order_by ::= KW_STABLE KW_ORDER KW_BY order_spec_list */ #line 504 "xquery.lime" { yymsp[-3].minor.yy196 = xq_make_order_by(yymsp[0].minor.yy38, true); } #line 2376 "xquery.c" break; case 46: /* order_spec_list ::= order_spec_list COMMA order_spec */ case 54: /* quant_binding_list ::= quant_binding_list COMMA quant_binding */ yytestcase(yyruleno==54); case 151: /* arguments ::= arguments COMMA expr_single */ yytestcase(yyruleno==151); #line 510 "xquery.lime" { yylhsminor.yy38 = xq_list_append(yymsp[-2].minor.yy38, yymsp[0].minor.yy196); } #line 2385 "xquery.c" yymsp[-2].minor.yy38 = yylhsminor.yy38; break; case 47: /* order_spec ::= expr_single opt_sort_dir */ #line 514 "xquery.lime" { yylhsminor.yy196 = xq_make_order_spec(yymsp[-1].minor.yy196, yymsp[0].minor.yy46); } #line 2393 "xquery.c" yymsp[-1].minor.yy196 = yylhsminor.yy196; break; case 48: /* opt_sort_dir ::= KW_ASCENDING */ #line 518 "xquery.lime" { yymsp[0].minor.yy46 = XQ_SORT_ASCENDING; } #line 2399 "xquery.c" break; case 49: /* opt_sort_dir ::= KW_DESCENDING */ #line 519 "xquery.lime" { yymsp[0].minor.yy46 = XQ_SORT_DESCENDING; } #line 2404 "xquery.c" break; case 50: /* opt_sort_dir ::= */ #line 520 "xquery.lime" { yymsp[1].minor.yy46 = XQ_SORT_ASCENDING; } #line 2409 "xquery.c" break; case 51: /* quantified_expr ::= KW_SOME quant_binding_list KW_SATISFIES expr_single */ #line 529 "xquery.lime" { yymsp[-3].minor.yy196 = xq_make_some_expr(yymsp[-2].minor.yy38, yymsp[0].minor.yy196); } #line 2416 "xquery.c" break; case 52: /* quantified_expr ::= KW_EVERY quant_binding_list KW_SATISFIES expr_single */ #line 533 "xquery.lime" { yymsp[-3].minor.yy196 = xq_make_every_expr(yymsp[-2].minor.yy38, yymsp[0].minor.yy196); } #line 2423 "xquery.c" break; case 55: /* quant_binding ::= VARIABLE_REF KW_IN expr_single */ #line 542 "xquery.lime" { yylhsminor.yy196 = xq_make_quant_binding(yymsp[-2].minor.yy0.str.val, yymsp[-2].minor.yy0.str.len, yymsp[0].minor.yy196); } #line 2430 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 56: /* if_expr ::= KW_IF LPAREN expr RPAREN KW_THEN expr_single KW_ELSE expr_single */ #line 550 "xquery.lime" { yymsp[-7].minor.yy196 = xq_make_if_expr(yymsp[-5].minor.yy196, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2438 "xquery.c" break; case 58: /* or_expr ::= or_expr KW_OR and_expr */ #line 562 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_OR, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2445 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 60: /* and_expr ::= and_expr KW_AND comparison_expr */ #line 568 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_AND, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2453 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 62: /* comparison_expr ::= range_expr EQUALS range_expr */ #line 580 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_GEN_EQ, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2461 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 63: /* comparison_expr ::= range_expr NOT_EQUALS range_expr */ #line 583 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_GEN_NE, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2469 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 64: /* comparison_expr ::= range_expr LESS_THAN range_expr */ #line 586 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_GEN_LT, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2477 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 65: /* comparison_expr ::= range_expr LESS_EQUAL range_expr */ #line 589 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_GEN_LE, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2485 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 66: /* comparison_expr ::= range_expr GREATER_THAN range_expr */ #line 592 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_GEN_GT, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2493 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 67: /* comparison_expr ::= range_expr GREATER_EQUAL range_expr */ #line 595 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_GEN_GE, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2501 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 68: /* comparison_expr ::= range_expr KW_EQ range_expr */ #line 600 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_VAL_EQ, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2509 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 69: /* comparison_expr ::= range_expr KW_NE range_expr */ #line 603 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_VAL_NE, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2517 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 70: /* comparison_expr ::= range_expr KW_LT range_expr */ #line 606 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_VAL_LT, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2525 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 71: /* comparison_expr ::= range_expr KW_LE range_expr */ #line 609 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_VAL_LE, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2533 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 72: /* comparison_expr ::= range_expr KW_GT range_expr */ #line 612 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_VAL_GT, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2541 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 73: /* comparison_expr ::= range_expr KW_GE range_expr */ #line 615 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_VAL_GE, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2549 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 74: /* comparison_expr ::= range_expr KW_IS range_expr */ #line 620 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_IS, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2557 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 75: /* comparison_expr ::= range_expr NODE_PRECEDES range_expr */ #line 623 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_PRECEDES, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2565 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 76: /* comparison_expr ::= range_expr NODE_FOLLOWS range_expr */ #line 626 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_FOLLOWS, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2573 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 78: /* range_expr ::= additive_expr KW_TO additive_expr */ #line 632 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_TO, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2581 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 80: /* additive_expr ::= additive_expr PLUS multiplicative_expr */ #line 638 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_ADD, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2589 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 81: /* additive_expr ::= additive_expr MINUS multiplicative_expr */ #line 641 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_SUB, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2597 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 83: /* multiplicative_expr ::= multiplicative_expr STAR unary_expr */ #line 647 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_MUL, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2605 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 84: /* multiplicative_expr ::= multiplicative_expr KW_DIV unary_expr */ #line 650 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_DIV, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2613 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 85: /* multiplicative_expr ::= multiplicative_expr KW_IDIV unary_expr */ #line 653 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_IDIV, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2621 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 86: /* multiplicative_expr ::= multiplicative_expr KW_MOD unary_expr */ #line 656 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_MOD, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2629 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 88: /* unary_expr ::= MINUS unary_expr */ #line 662 "xquery.lime" { yymsp[-1].minor.yy196 = xq_make_unary(XQ_OP_NEGATE, yymsp[0].minor.yy196); } #line 2637 "xquery.c" break; case 89: /* unary_expr ::= PLUS unary_expr */ #line 665 "xquery.lime" { yymsp[-1].minor.yy196 = xq_make_unary(XQ_OP_POSITIVE, yymsp[0].minor.yy196); } #line 2644 "xquery.c" break; case 91: /* union_expr ::= union_expr PIPE intersect_expr */ case 92: /* union_expr ::= union_expr KW_UNION intersect_expr */ yytestcase(yyruleno==92); #line 671 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_UNION, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2652 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 94: /* intersect_expr ::= intersect_expr KW_INTERSECT path_expr */ #line 680 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_INTERSECT, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2660 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 95: /* intersect_expr ::= intersect_expr KW_EXCEPT path_expr */ #line 683 "xquery.lime" { yylhsminor.yy196 = xq_make_binary(XQ_OP_EXCEPT, yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2668 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 98: /* path_expr ::= filter_expr SLASH relative_location_path */ case 108: /* relative_location_path ::= relative_location_path SLASH step */ yytestcase(yyruleno==108); #line 693 "xquery.lime" { yylhsminor.yy196 = xq_make_path(yymsp[-2].minor.yy196, yymsp[0].minor.yy196); } #line 2677 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 99: /* path_expr ::= filter_expr DOUBLE_SLASH relative_location_path */ case 109: /* relative_location_path ::= relative_location_path DOUBLE_SLASH step */ yytestcase(yyruleno==109); #line 696 "xquery.lime" { XQNode *dsos = xq_make_step(XPATH_AXIS_DESCENDANT_OR_SELF, xq_make_node_type_test(XPATH_NODE_TYPE_NODE), NULL); yylhsminor.yy196 = xq_make_path(yymsp[-2].minor.yy196, xq_make_path(dsos, yymsp[0].minor.yy196)); } #line 2688 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 101: /* filter_expr ::= filter_expr predicate */ #line 704 "xquery.lime" { yylhsminor.yy196 = xq_make_filter(yymsp[-1].minor.yy196, yymsp[0].minor.yy196); } #line 2696 "xquery.c" yymsp[-1].minor.yy196 = yylhsminor.yy196; break; case 104: /* absolute_location_path ::= SLASH */ #line 713 "xquery.lime" { yymsp[0].minor.yy196 = xq_make_root(); } #line 2704 "xquery.c" break; case 105: /* absolute_location_path ::= SLASH relative_location_path */ #line 716 "xquery.lime" { yymsp[-1].minor.yy196 = xq_make_absolute_path(yymsp[0].minor.yy196); } #line 2711 "xquery.c" break; case 106: /* absolute_location_path ::= DOUBLE_SLASH relative_location_path */ #line 719 "xquery.lime" { XQNode *dsos = xq_make_step(XPATH_AXIS_DESCENDANT_OR_SELF, xq_make_node_type_test(XPATH_NODE_TYPE_NODE), NULL); yymsp[-1].minor.yy196 = xq_make_absolute_path(xq_make_path(dsos, yymsp[0].minor.yy196)); } #line 2720 "xquery.c" break; case 110: /* step ::= axis_specifier node_test predicate_list */ #line 737 "xquery.lime" { yylhsminor.yy196 = xq_make_step(yymsp[-2].minor.yy25, yymsp[-1].minor.yy196, yymsp[0].minor.yy196); } #line 2727 "xquery.c" yymsp[-2].minor.yy196 = yylhsminor.yy196; break; case 111: /* step ::= node_test predicate_list */ #line 740 "xquery.lime" { yylhsminor.yy196 = xq_make_step(XPATH_AXIS_CHILD, yymsp[-1].minor.yy196, yymsp[0].minor.yy196); } #line 2735 "xquery.c" yymsp[-1].minor.yy196 = yylhsminor.yy196; break; case 113: /* axis_specifier ::= axis_name COLON_COLON */ #line 746 "xquery.lime" { yylhsminor.yy25 = yymsp[-1].minor.yy25; } #line 2741 "xquery.c" yymsp[-1].minor.yy25 = yylhsminor.yy25; break; case 114: /* axis_specifier ::= AT */ case 123: /* axis_name ::= AXIS_ATTRIBUTE */ yytestcase(yyruleno==123); #line 747 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_ATTRIBUTE; } #line 2748 "xquery.c" break; case 115: /* axis_name ::= AXIS_CHILD */ #line 750 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_CHILD; } #line 2753 "xquery.c" break; case 116: /* axis_name ::= AXIS_DESCENDANT */ #line 751 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_DESCENDANT; } #line 2758 "xquery.c" break; case 117: /* axis_name ::= AXIS_PARENT */ #line 752 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_PARENT; } #line 2763 "xquery.c" break; case 118: /* axis_name ::= AXIS_ANCESTOR */ #line 753 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_ANCESTOR; } #line 2768 "xquery.c" break; case 119: /* axis_name ::= AXIS_FOLLOWING_SIBLING */ #line 754 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_FOLLOWING_SIBLING; } #line 2773 "xquery.c" break; case 120: /* axis_name ::= AXIS_PRECEDING_SIBLING */ #line 755 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_PRECEDING_SIBLING; } #line 2778 "xquery.c" break; case 121: /* axis_name ::= AXIS_FOLLOWING */ #line 756 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_FOLLOWING; } #line 2783 "xquery.c" break; case 122: /* axis_name ::= AXIS_PRECEDING */ #line 757 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_PRECEDING; } #line 2788 "xquery.c" break; case 124: /* axis_name ::= AXIS_NAMESPACE */ #line 759 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_NAMESPACE; } #line 2793 "xquery.c" break; case 125: /* axis_name ::= AXIS_SELF */ #line 760 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_SELF; } #line 2798 "xquery.c" break; case 126: /* axis_name ::= AXIS_DESCENDANT_OR_SELF */ #line 761 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_DESCENDANT_OR_SELF; } #line 2803 "xquery.c" break; case 127: /* axis_name ::= AXIS_ANCESTOR_OR_SELF */ #line 762 "xquery.lime" { yymsp[0].minor.yy25 = XPATH_AXIS_ANCESTOR_OR_SELF; } #line 2808 "xquery.c" break; case 128: /* node_test ::= NAME_TEST */ #line 765 "xquery.lime" { yylhsminor.yy196 = xq_make_name_test(yymsp[0].minor.yy0.str.val, yymsp[0].minor.yy0.str.len); } #line 2815 "xquery.c" yymsp[0].minor.yy196 = yylhsminor.yy196; break; case 129: /* node_test ::= STAR */ #line 768 "xquery.lime" { yymsp[0].minor.yy196 = xq_make_name_test("*", 1); } #line 2823 "xquery.c" break; case 130: /* node_test ::= NODE_TYPE_COMMENT LPAREN RPAREN */ #line 771 "xquery.lime" { yymsp[-2].minor.yy196 = xq_make_node_type_test(XPATH_NODE_TYPE_COMMENT); } #line 2830 "xquery.c" break; case 131: /* node_test ::= NODE_TYPE_TEXT LPAREN RPAREN */ #line 774 "xquery.lime" { yymsp[-2].minor.yy196 = xq_make_node_type_test(XPATH_NODE_TYPE_TEXT); } #line 2837 "xquery.c" break; case 132: /* node_test ::= NODE_TYPE_PI LPAREN RPAREN */ #line 777 "xquery.lime" { yymsp[-2].minor.yy196 = xq_make_node_type_test(XPATH_NODE_TYPE_PI); } #line 2844 "xquery.c" break; case 133: /* node_test ::= NODE_TYPE_PI LPAREN LITERAL RPAREN */ #line 780 "xquery.lime" { yymsp[-3].minor.yy196 = xq_make_pi_test(yymsp[-1].minor.yy0.str.val, yymsp[-1].minor.yy0.str.len); } #line 2851 "xquery.c" break; case 134: /* node_test ::= NODE_TYPE_NODE LPAREN RPAREN */ #line 783 "xquery.lime" { yymsp[-2].minor.yy196 = xq_make_node_type_test(XPATH_NODE_TYPE_NODE); } #line 2858 "xquery.c" break; case 135: /* predicate ::= LBRACKET expr RBRACKET */ case 141: /* primary_expr ::= LPAREN expr RPAREN */ yytestcase(yyruleno==141); #line 788 "xquery.lime" { yymsp[-2].minor.yy196 = yymsp[-1].minor.yy196; } #line 2864 "xquery.c" break; case 137: /* predicate_list ::= predicate_list predicate */ #line 790 "xquery.lime" { yylhsminor.yy196 = xq_append_predicate(yymsp[-1].minor.yy196, yymsp[0].minor.yy196); } #line 2871 "xquery.c" yymsp[-1].minor.yy196 = yylhsminor.yy196; break; case 138: /* abbreviated_step ::= DOT */ #line 795 "xquery.lime" { yymsp[0].minor.yy196 = xq_make_step(XPATH_AXIS_SELF, xq_make_node_type_test(XPATH_NODE_TYPE_NODE), NULL); } #line 2880 "xquery.c" break; case 139: /* abbreviated_step ::= DOUBLE_DOT */ #line 799 "xquery.lime" { yymsp[0].minor.yy196 = xq_make_step(XPATH_AXIS_PARENT, xq_make_node_type_test(XPATH_NODE_TYPE_NODE), NULL); } #line 2888 "xquery.c" break; case 140: /* primary_expr ::= VARIABLE_REF */ #line 808 "xquery.lime" { yylhsminor.yy196 = xq_make_variable_ref(yymsp[0].minor.yy0.str.val, yymsp[0].minor.yy0.str.len); } #line 2895 "xquery.c" yymsp[0].minor.yy196 = yylhsminor.yy196; break; case 142: /* primary_expr ::= LPAREN RPAREN */ #line 812 "xquery.lime" { yymsp[-1].minor.yy196 = xq_make_sequence(NULL); } #line 2901 "xquery.c" break; case 143: /* primary_expr ::= LITERAL */ #line 813 "xquery.lime" { yylhsminor.yy196 = xq_make_literal(yymsp[0].minor.yy0.str.val, yymsp[0].minor.yy0.str.len); } #line 2908 "xquery.c" yymsp[0].minor.yy196 = yylhsminor.yy196; break; case 144: /* primary_expr ::= NUMBER */ #line 816 "xquery.lime" { yylhsminor.yy196 = xq_make_number(yymsp[0].minor.yy0.numval); } #line 2916 "xquery.c" yymsp[0].minor.yy196 = yylhsminor.yy196; break; case 147: /* function_call ::= FUNCTION_NAME LPAREN argument_list RPAREN */ #line 823 "xquery.lime" { yylhsminor.yy196 = xq_make_function_call(yymsp[-3].minor.yy0.str.val, yymsp[-3].minor.yy0.str.len, yymsp[-1].minor.yy38); } #line 2924 "xquery.c" yymsp[-3].minor.yy196 = yylhsminor.yy196; break; case 152: /* computed_constructor ::= KW_ELEMENT NAME_TEST LBRACE opt_enclosed_expr RBRACE */ #line 846 "xquery.lime" { yymsp[-4].minor.yy196 = xq_make_comp_elem(yymsp[-3].minor.yy0.str.val, yymsp[-3].minor.yy0.str.len, yymsp[-1].minor.yy196); } #line 2932 "xquery.c" break; case 153: /* computed_constructor ::= KW_ATTRIBUTE NAME_TEST LBRACE opt_enclosed_expr RBRACE */ #line 850 "xquery.lime" { yymsp[-4].minor.yy196 = xq_make_comp_attr(yymsp[-3].minor.yy0.str.val, yymsp[-3].minor.yy0.str.len, yymsp[-1].minor.yy196); } #line 2939 "xquery.c" break; case 154: /* computed_constructor ::= KW_DOCUMENT LBRACE opt_enclosed_expr RBRACE */ #line 854 "xquery.lime" { yymsp[-3].minor.yy196 = xq_make_comp_doc(yymsp[-1].minor.yy196); } #line 2946 "xquery.c" break; case 155: /* computed_constructor ::= KW_TEXT LBRACE opt_enclosed_expr RBRACE */ #line 858 "xquery.lime" { yymsp[-3].minor.yy196 = xq_make_comp_text(yymsp[-1].minor.yy196); } #line 2953 "xquery.c" break; case 156: /* computed_constructor ::= KW_COMMENT LBRACE opt_enclosed_expr RBRACE */ #line 862 "xquery.lime" { yymsp[-3].minor.yy196 = xq_make_comp_comment(yymsp[-1].minor.yy196); } #line 2960 "xquery.c" break; case 157: /* computed_constructor ::= KW_PI NAME_TEST LBRACE opt_enclosed_expr RBRACE */ #line 866 "xquery.lime" { yymsp[-4].minor.yy196 = xq_make_comp_pi(yymsp[-3].minor.yy0.str.val, yymsp[-3].minor.yy0.str.len, yymsp[-1].minor.yy196); } #line 2967 "xquery.c" break; default: break; /********** End reduce actions ************************************************/ }; assert( yyrulenoYY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) ); /* It is not possible for a REDUCE to be followed by an error */ assert( yyact!=YY_ERROR_ACTION ); yymsp += yysize+1; yypParser->yytos = yymsp; yymsp->stateno = (YYACTIONTYPE)yyact; yymsp->major = (YYCODETYPE)yygoto; yyTraceShift(yypParser, yyact, "... then shift"); return yyact; } /* ** The following code executes when the parse fails */ #ifndef YYNOERRORRECOVERY static void yy_parse_failed( yyParser *yypParser /* The parser */ ){ xqueryParseARG_FETCH xqueryParseCTX_FETCH #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); } #endif while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); /* Here code is inserted which will be executed whenever the ** parser fails */ /************ Begin %parse_failure code ***************************************/ #line 112 "xquery.lime" pstate->error = 1; if (pstate->errMsg == NULL) { pstate->errMsg = "XQuery parse failure"; } #line 3017 "xquery.c" /************ End %parse_failure code *****************************************/ xqueryParseARG_STORE /* Suppress warning about unused %extra_argument variable */ xqueryParseCTX_STORE } #endif /* YYNOERRORRECOVERY */ /* ** The following code executes when a syntax error first occurs. */ static void yy_syntax_error( yyParser *yypParser, /* The parser */ int yymajor, /* The major type of the error token */ xqueryParseTOKENTYPE yyminor /* The minor type of the error token */ ){ xqueryParseARG_FETCH xqueryParseCTX_FETCH #define TOKEN yyminor /************ Begin %syntax_error code ****************************************/ #line 105 "xquery.lime" pstate->error = 1; if (pstate->errMsg == NULL) { pstate->errMsg = "syntax error in XQuery expression"; } #line 3042 "xquery.c" /************ End %syntax_error code ******************************************/ xqueryParseARG_STORE /* Suppress warning about unused %extra_argument variable */ xqueryParseCTX_STORE } /* ** The following is executed when the parser accepts */ static void yy_accept( yyParser *yypParser /* The parser */ ){ xqueryParseARG_FETCH xqueryParseCTX_FETCH #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); } #endif #ifndef YYNOERRORRECOVERY yypParser->yyerrcnt = -1; #endif assert( yypParser->yytos==yypParser->yystack ); /* Here code is inserted which will be executed whenever the ** parser accepts */ /*********** Begin %parse_accept code *****************************************/ /*********** End %parse_accept code *******************************************/ xqueryParseARG_STORE /* Suppress warning about unused %extra_argument variable */ xqueryParseCTX_STORE } /* The main parser program. ** The first argument is a pointer to a structure obtained from ** "xqueryParseAlloc" which describes the current state of the parser. ** The second argument is the major token number. The third is ** the minor token. The fourth optional argument is whatever the ** user wants (and specified in the grammar) and is available for ** use by the action routines. ** ** Inputs: **
    **
  • A pointer to the parser (an opaque structure.) **
  • The major token number. **
  • The minor token number. **
  • An option argument of a grammar-specified type. **
** ** Outputs: ** None. */ void xqueryParse( void *yyp, /* The parser */ int yymajor, /* The major token code number */ xqueryParseTOKENTYPE yyminor /* The value for the token */ xqueryParseARG_PDECL /* Optional %extra_argument parameter */ ){ YYMINORTYPE yyminorunion; YYACTIONTYPE yyact; /* The parser action. */ #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) int yyendofinput; /* True if we are at the end of input */ #endif #ifdef YYERRORSYMBOL int yyerrorhit = 0; /* True if yymajor has invoked an error */ #endif yyParser *yypParser = (yyParser*)yyp; /* The parser */ xqueryParseCTX_FETCH xqueryParseARG_STORE assert( yypParser->yytos!=0 ); #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) yyendofinput = (yymajor==0); #endif yyact = yypParser->yytos->stateno; #ifndef NDEBUG if( yyTraceFILE ){ if( yyact < YY_MIN_REDUCE ){ fprintf(yyTraceFILE,"%sInput '%s' in state %d\n", yyTracePrompt,yyTokenName[yymajor],yyact); }else{ fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n", yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE); } } #endif while(1){ /* Exit by "break" */ assert( yypParser->yytos>=yypParser->yystack ); assert( yyact==yypParser->yytos->stateno ); yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact); if( yyact >= YY_MIN_REDUCE ){ unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */ #ifndef NDEBUG assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ); if( yyTraceFILE ){ int yysize = yyRuleInfoNRhs[yyruleno]; if( yysize ){ fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", yyTracePrompt, yyruleno, yyRuleName[yyruleno], yyrulenoyytos[yysize].stateno); }else{ fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n", yyTracePrompt, yyruleno, yyRuleName[yyruleno], yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ yypParser->yyhwm++; assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)); } #endif if( yypParser->yytos>=yypParser->yystackEnd ){ if( yyGrowStack(yypParser) ){ yyStackOverflow(yypParser); break; } } } yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor xqueryParseCTX_PARAM); }else if( yyact <= YY_MAX_SHIFTREDUCE ){ yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor); #ifndef YYNOERRORRECOVERY yypParser->yyerrcnt--; #endif break; }else if( yyact==YY_ACCEPT_ACTION ){ yypParser->yytos--; yy_accept(yypParser); return; }else{ assert( yyact == YY_ERROR_ACTION ); yyminorunion.yy0 = yyminor; #ifdef YYERRORSYMBOL int yymx; #endif #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); } #endif #ifdef YYERRORSYMBOL /* A syntax error has occurred. ** The response to an error depends upon whether or not the ** grammar defines an error token "ERROR". ** ** This is what we do if the grammar does define ERROR: ** ** * Call the %syntax_error function. ** ** * Begin popping the stack until we enter a state where ** it is legal to shift the error symbol, then shift ** the error symbol. ** ** * Set the error count to three. ** ** * Begin accepting and shifting new tokens. No new error ** processing will occur until three tokens have been ** shifted successfully. ** */ if( yypParser->yyerrcnt<0 ){ yy_syntax_error(yypParser,yymajor,yyminor); } yymx = yypParser->yytos->major; if( yymx==YYERRORSYMBOL || yyerrorhit ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sDiscard input token %s\n", yyTracePrompt,yyTokenName[yymajor]); } #endif yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion); yymajor = YYNOCODE; }else{ while( yypParser->yytos > yypParser->yystack ){ yyact = yy_find_reduce_action(yypParser->yytos->stateno, YYERRORSYMBOL); if( yyact<=YY_MAX_SHIFTREDUCE ) break; yy_pop_parser_stack(yypParser); } if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){ yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yy_parse_failed(yypParser); #ifndef YYNOERRORRECOVERY yypParser->yyerrcnt = -1; #endif yymajor = YYNOCODE; }else if( yymx!=YYERRORSYMBOL ){ yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor); } } yypParser->yyerrcnt = 3; yyerrorhit = 1; if( yymajor==YYNOCODE ) break; yyact = yypParser->yytos->stateno; #elif defined(YYNOERRORRECOVERY) /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to ** do any kind of error recovery. Instead, simply invoke the syntax ** error routine and continue going as if nothing had happened. ** ** Applications can set this macro (for example inside %include) if ** they intend to abandon the parse upon the first syntax error seen. */ yy_syntax_error(yypParser,yymajor, yyminor); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); break; #else /* YYERRORSYMBOL is not defined */ /* This is what we do if the grammar does not define ERROR: ** ** * Report an error message, and throw away the input token. ** ** * If the input token is $, then fail the parse. ** ** As before, subsequent error messages are suppressed until ** three input tokens have been successfully shifted. */ if( yypParser->yyerrcnt<=0 ){ yy_syntax_error(yypParser,yymajor, yyminor); } yypParser->yyerrcnt = 3; yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); if( yyendofinput ){ yy_parse_failed(yypParser); #ifndef YYNOERRORRECOVERY yypParser->yyerrcnt = -1; #endif } break; #endif } } #ifndef NDEBUG if( yyTraceFILE ){ yyStackEntry *i; char cDiv = '['; fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt); for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){ fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]); cDiv = ' '; } fprintf(yyTraceFILE,"]\n"); } #endif return; } /* ** Return the fallback token corresponding to canonical token iToken, or ** 0 if iToken has no fallback. */ int xqueryParseFallback(int iToken){ #ifdef YYFALLBACK assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ); return yyFallback[iToken]; #else (void)iToken; return 0; #endif }