/* A Bison parser, made from XPath2Parser.y by GNU bison 1.35. */ #define YYBISON 1 /* Identify Bison output. */ #define yyparse XPathyyparse #define yylex XPathyylex #define yyerror XPathyyerror #define yylval XPathyylval #define yychar XPathyychar #define yydebug XPathyydebug #define yynerrs XPathyynerrs # define _QUESTION_ 257 # define _LBRACK_ 258 # define _RBRACK_ 259 # define _PLUS_ 260 # define _MINUS_ 261 # define _STAR_ 262 # define _NCNAME_COLON_STAR_ 263 # define _STAR_COLON_NCNAME_ 264 # define _DOT_ 265 # define _DOT_DOT_ 266 # define _STRING_LITERAL_ 267 # define _SLASH_ 268 # define _SLASHSLASH_ 269 # define _AXIS_CHILD_ 270 # define _AXIS_DESCENDANT_ 271 # define _AXIS_PARENT_ 272 # define _AXIS_ATTRIBUTE_ 273 # define _AXIS_SELF_ 274 # define _AXIS_DESCENDANT_OR_SELF_ 275 # define _AXIS_ANCESTOR_ 276 # define _AXIS_FOLLOWING_SIBLING_ 277 # define _AXIS_PRECEDING_SIBLING_ 278 # define _AXIS_FOLLOWING_ 279 # define _AXIS_PRECEDING_ 280 # define _AXIS_NAMESPACE_ 281 # define _AXIS_ANCESTOR_OR_SELF_ 282 # define _AT_ 283 # define _CAST_AS_ 284 # define _TREAT_AS_ 285 # define _FOR_ 286 # define _SOME_ 287 # define _EVERY_ 288 # define _COMMA_ 289 # define _LPAR_ 290 # define _TEXT_LPAR_ 291 # define _COMMENT_LPAR_ 292 # define _NODE_LPAR_ 293 # define _PROCESSING_INSTRUCTION_LPAR_ 294 # define _ELEMENT_LPAR_ 295 # define _ATTRIBUTE_LPAR_ 296 # define _DOCUMENT_NODE_LPAR_ 297 # define _IF_LPAR_ 298 # define _QNAME_LPAR_ 299 # define _RPAR_ 300 # define _MULTIPLY_ 301 # define _DIV_ 302 # define _INTEGER_DIV_ 303 # define _MOD_ 304 # define _AND_ 305 # define _OR_ 306 # define _RETURN_ 307 # define _THEN_ 308 # define _ELSE_ 309 # define _TO_ 310 # define _UNION_ 311 # define _INTERSECT_ 312 # define _EXCEPT_ 313 # define _EQUALS_ 314 # define _IS_ 315 # define _NOT_EQUALS_ 316 # define _LT_EQUALS_ 317 # define _GT_EQUALS_ 318 # define _LT_ 319 # define _GT_ 320 # define _VERTICAL_BAR_ 321 # define _LT_LT_ 322 # define _GT_GT_ 323 # define _FORTRAN_EQ_ 324 # define _FORTRAN_NE_ 325 # define _FORTRAN_GT_ 326 # define _FORTRAN_GE_ 327 # define _FORTRAN_LT_ 328 # define _FORTRAN_LE_ 329 # define _IN_ 330 # define _SATISFIES_ 331 # define _ITEM_ 332 # define _EMPTY_ 333 # define _INSTANCE_OF_ 334 # define _CASTABLE_AS_ 335 # define _NILLABLE_ 336 # define _VARNAME_ 337 # define _SCHEMA_CONTEXT_STEP_ 338 # define _TYPE_QNAME_STEP_ 339 # define _QNAME_ 340 # define _NCNAME_ 341 # define _INTEGER_LITERAL_ 342 # define _DECIMAL_LITERAL_ 343 # define _DOUBLE_LITERAL_ 344 #line 1 "XPath2Parser.y" #include "../config/pathan_config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../lexer/XPath2Lexer.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../items/impl/ATStringOrDerivedImpl.hpp" #include #include #include #include #include #define YYPARSE_PARAM parm #define YYLEX_PARAM parm #define YYERROR_VERBOSE inline VectorOfDataItems packageArgs(DataItem *arg1Impl, DataItem *arg2Impl, XPath2MemoryManager* memMgr); void importStep(NavStepImpl *step1, NavStepImpl *step2); void yyerror(const char* s); #include "XPath2ParserControl.hpp" #include "../exceptions/XPathParseException.hpp" #define YYDEBUG 1 #ifndef YYDEBUG # define YYDEBUG 0 #endif #define YYFINAL 266 #define YYFLAG -32768 #define YYNTBASE 91 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ #define YYTRANSLATE(x) ((unsigned)(x) <= 344 ? yytranslate[x] : 159) /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90 }; #if YYDEBUG static const short yyprhs[] = { 0, 0, 1, 3, 7, 9, 11, 13, 15, 17, 21, 24, 29, 34, 40, 44, 52, 54, 58, 60, 64, 66, 70, 72, 76, 78, 82, 84, 88, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138, 142, 146, 150, 152, 156, 158, 162, 166, 168, 172, 176, 180, 184, 186, 189, 192, 194, 198, 202, 204, 208, 212, 214, 216, 219, 222, 224, 226, 230, 234, 236, 238, 241, 244, 247, 249, 251, 253, 255, 257, 259, 261, 262, 267, 270, 272, 275, 277, 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, 320, 322, 324, 326, 328, 330, 332, 334, 338, 341, 344, 348, 350, 354, 356, 359, 362, 364, 366, 368, 370, 372, 374, 376, 378, 380, 382, 384, 386, 388, 393, 396, 400, 406, 413, 418, 421, 425, 431, 433, 435, 437, 439, 441, 443, 445, 447, 449, 453, 457, 460, 463, 467, 470, 473, 476, 479, 481, 483, 484, 487, 489, 491, 493 }; static const short yyrhs[] = { -1, 92, 0, 92, 35, 93, 0, 93, 0, 94, 0, 96, 0, 98, 0, 99, 0, 95, 53, 93, 0, 32, 97, 0, 33, 97, 77, 93, 0, 34, 97, 77, 93, 0, 97, 35, 83, 76, 93, 0, 83, 76, 93, 0, 44, 92, 46, 54, 93, 55, 93, 0, 100, 0, 99, 52, 100, 0, 101, 0, 100, 51, 101, 0, 102, 0, 102, 80, 137, 0, 103, 0, 103, 31, 137, 0, 104, 0, 104, 81, 136, 0, 105, 0, 105, 30, 136, 0, 106, 0, 106, 60, 106, 0, 106, 62, 106, 0, 106, 65, 106, 0, 106, 63, 106, 0, 106, 66, 106, 0, 106, 64, 106, 0, 106, 70, 106, 0, 106, 71, 106, 0, 106, 74, 106, 0, 106, 75, 106, 0, 106, 72, 106, 0, 106, 73, 106, 0, 106, 61, 106, 0, 106, 68, 106, 0, 106, 69, 106, 0, 107, 0, 107, 56, 107, 0, 108, 0, 107, 6, 108, 0, 107, 7, 108, 0, 109, 0, 108, 47, 109, 0, 108, 48, 109, 0, 108, 49, 109, 0, 108, 50, 109, 0, 110, 0, 7, 109, 0, 6, 109, 0, 111, 0, 110, 57, 111, 0, 110, 67, 111, 0, 112, 0, 111, 58, 112, 0, 111, 59, 112, 0, 113, 0, 14, 0, 14, 114, 0, 15, 114, 0, 114, 0, 115, 0, 114, 14, 115, 0, 114, 15, 115, 0, 116, 0, 117, 0, 122, 121, 0, 123, 121, 0, 119, 121, 0, 11, 0, 131, 0, 120, 0, 133, 0, 118, 0, 134, 0, 83, 0, 0, 121, 4, 92, 5, 0, 126, 128, 0, 124, 0, 127, 128, 0, 125, 0, 29, 128, 0, 128, 0, 12, 0, 16, 0, 17, 0, 19, 0, 20, 0, 21, 0, 23, 0, 25, 0, 27, 0, 18, 0, 22, 0, 24, 0, 26, 0, 28, 0, 140, 0, 129, 0, 158, 0, 130, 0, 8, 0, 9, 0, 10, 0, 132, 0, 13, 0, 88, 0, 89, 0, 90, 0, 36, 92, 46, 0, 36, 46, 0, 45, 46, 0, 45, 135, 46, 0, 93, 0, 135, 35, 93, 0, 138, 0, 138, 3, 0, 139, 157, 0, 139, 0, 79, 0, 158, 0, 138, 0, 140, 0, 78, 0, 150, 0, 141, 0, 142, 0, 149, 0, 151, 0, 152, 0, 153, 0, 41, 154, 143, 46, 0, 41, 46, 0, 41, 146, 46, 0, 41, 146, 35, 148, 46, 0, 41, 146, 35, 148, 82, 46, 0, 42, 154, 144, 46, 0, 42, 46, 0, 42, 147, 46, 0, 42, 147, 35, 148, 46, 0, 158, 0, 158, 0, 158, 0, 143, 0, 8, 0, 144, 0, 8, 0, 145, 0, 8, 0, 40, 13, 46, 0, 40, 87, 46, 0, 40, 46, 0, 43, 46, 0, 43, 141, 46, 0, 38, 46, 0, 37, 46, 0, 39, 46, 0, 155, 156, 0, 84, 0, 85, 0, 0, 156, 84, 0, 8, 0, 6, 0, 3, 0, 86, 0 }; #endif #if YYDEBUG /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const short yyrline[] = { 0, 276, 285, 291, 307, 313, 321, 324, 327, 333, 344, 354, 363, 370, 378, 388, 402, 411, 427, 436, 454, 463, 469, 477, 483, 492, 498, 506, 512, 529, 533, 537, 541, 545, 549, 553, 557, 561, 565, 569, 573, 577, 581, 585, 595, 604, 612, 621, 625, 632, 641, 645, 649, 653, 660, 669, 675, 685, 694, 698, 705, 714, 718, 725, 738, 749, 766, 789, 798, 807, 824, 852, 860, 865, 876, 884, 897, 908, 917, 921, 925, 929, 935, 948, 956, 965, 979, 985, 999, 1005, 1020, 1040, 1056, 1075, 1081, 1087, 1093, 1099, 1105, 1111, 1120, 1135, 1141, 1147, 1153, 1162, 1171, 1177, 1194, 1201, 1213, 1223, 1234, 1245, 1258, 1275, 1286, 1300, 1315, 1322, 1342, 1359, 1373, 1380, 1392, 1402, 1414, 1421, 1427, 1438, 1446, 1450, 1455, 1469, 1472, 1475, 1478, 1481, 1484, 1491, 1501, 1506, 1511, 1516, 1527, 1539, 1544, 1549, 1557, 1566, 1575, 1585, 1592, 1598, 1605, 1611, 1618, 1624, 1636, 1643, 1652, 1662, 1673, 1687, 1701, 1716, 1728, 1739, 1747, 1755, 1763, 1772, 1776, 1782 }; #endif #if (YYDEBUG) || defined YYERROR_VERBOSE /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ static const char *const yytname[] = { "$", "error", "$undefined.", "_QUESTION_", "_LBRACK_", "_RBRACK_", "_PLUS_", "_MINUS_", "_STAR_", "_NCNAME_COLON_STAR_", "_STAR_COLON_NCNAME_", "_DOT_", "_DOT_DOT_", "_STRING_LITERAL_", "_SLASH_", "_SLASHSLASH_", "_AXIS_CHILD_", "_AXIS_DESCENDANT_", "_AXIS_PARENT_", "_AXIS_ATTRIBUTE_", "_AXIS_SELF_", "_AXIS_DESCENDANT_OR_SELF_", "_AXIS_ANCESTOR_", "_AXIS_FOLLOWING_SIBLING_", "_AXIS_PRECEDING_SIBLING_", "_AXIS_FOLLOWING_", "_AXIS_PRECEDING_", "_AXIS_NAMESPACE_", "_AXIS_ANCESTOR_OR_SELF_", "_AT_", "_CAST_AS_", "_TREAT_AS_", "_FOR_", "_SOME_", "_EVERY_", "_COMMA_", "_LPAR_", "_TEXT_LPAR_", "_COMMENT_LPAR_", "_NODE_LPAR_", "_PROCESSING_INSTRUCTION_LPAR_", "_ELEMENT_LPAR_", "_ATTRIBUTE_LPAR_", "_DOCUMENT_NODE_LPAR_", "_IF_LPAR_", "_QNAME_LPAR_", "_RPAR_", "_MULTIPLY_", "_DIV_", "_INTEGER_DIV_", "_MOD_", "_AND_", "_OR_", "_RETURN_", "_THEN_", "_ELSE_", "_TO_", "_UNION_", "_INTERSECT_", "_EXCEPT_", "_EQUALS_", "_IS_", "_NOT_EQUALS_", "_LT_EQUALS_", "_GT_EQUALS_", "_LT_", "_GT_", "_VERTICAL_BAR_", "_LT_LT_", "_GT_GT_", "_FORTRAN_EQ_", "_FORTRAN_NE_", "_FORTRAN_GT_", "_FORTRAN_GE_", "_FORTRAN_LT_", "_FORTRAN_LE_", "_IN_", "_SATISFIES_", "_ITEM_", "_EMPTY_", "_INSTANCE_OF_", "_CASTABLE_AS_", "_NILLABLE_", "_VARNAME_", "_SCHEMA_CONTEXT_STEP_", "_TYPE_QNAME_STEP_", "_QNAME_", "_NCNAME_", "_INTEGER_LITERAL_", "_DECIMAL_LITERAL_", "_DOUBLE_LITERAL_", "_XPath", "_Expr", "_ExprSingle", "_ForExpr", "_SimpleForClause", "_QuantifiedExpr", "_VariableBindingList", "_IfExpr", "_OrExpr", "_AndExpr", "_InstanceOfExpr", "_TreatExpr", "_CastableExpr", "_CastExpr", "_ComparisonExpr", "_RangeExpr", "_AdditiveExpr", "_MultiplicativeExpr", "_UnaryExpr", "_UnionExpr", "_IntersectExceptExpr", "_ValueExpr", "_PathExpr", "_RelativePathExpr", "_StepExpr", "_AxisStep", "_FilterStep", "_ContextItemExpr", "_PrimaryExpr", "_VarRef", "_Predicates", "_ForwardStep", "_ReverseStep", "_AbbreviatedForwardStep", "_AbbreviatedReverseStep", "_ForwardAxis", "_ReverseAxis", "_NodeTest", "_NameTest", "_Wildcard", "_Literal", "_NumericLiteral", "_ParenthesizedExpr", "_FunctionCall", "_ArgumentList", "_SingleType", "_SequenceType", "_AtomicType", "_ItemType", "_KindTest", "_ElementTest", "_AttributeTest", "_ElementName", "_AttributeName", "_TypeName", "_ElementNameOrWildcard", "_AttribNameOrWildcard", "_TypeNameOrWildcard", "_ProcessingInstructionTest", "_DocumentTest", "_CommentTest", "_TextTest", "_AnyKindTest", "_SchemaContextPath", "_SchemaGlobalContext", "_SchemaContextSteps", "_OccurrenceIndicator", "_QName", 0 }; #endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const short yyr1[] = { 0, 91, 91, 92, 92, 93, 93, 93, 93, 94, 95, 96, 96, 97, 97, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 106, 106, 107, 107, 107, 108, 108, 108, 108, 108, 109, 109, 109, 110, 110, 110, 111, 111, 111, 112, 113, 113, 113, 113, 114, 114, 114, 115, 115, 116, 116, 117, 118, 119, 119, 119, 119, 119, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 126, 126, 126, 126, 126, 126, 126, 126, 127, 127, 127, 127, 127, 128, 128, 129, 129, 130, 130, 130, 131, 131, 132, 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 137, 138, 139, 139, 139, 140, 140, 140, 140, 140, 140, 140, 141, 141, 141, 141, 141, 142, 142, 142, 142, 143, 144, 145, 146, 146, 147, 147, 148, 148, 149, 149, 149, 150, 150, 151, 152, 153, 154, 155, 155, 156, 156, 157, 157, 157, 158 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const short yyr2[] = { 0, 0, 1, 3, 1, 1, 1, 1, 1, 3, 2, 4, 4, 5, 3, 7, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 3, 3, 1, 2, 2, 1, 3, 3, 1, 3, 3, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 4, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, 3, 1, 3, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 2, 3, 5, 6, 4, 2, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 1, 0, 2, 1, 1, 1, 1 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const short yydefact[] = { 1, 0, 0, 109, 110, 111, 76, 91, 113, 64, 0, 92, 93, 100, 94, 95, 96, 101, 97, 102, 98, 103, 99, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 173, 114, 115, 116, 2, 4, 5, 0, 6, 7, 8, 16, 18, 20, 22, 24, 26, 28, 44, 46, 49, 54, 57, 60, 63, 67, 68, 71, 72, 80, 83, 78, 83, 83, 86, 88, 0, 0, 90, 106, 108, 77, 112, 79, 81, 105, 133, 134, 135, 132, 136, 137, 138, 107, 56, 55, 65, 66, 89, 0, 10, 0, 0, 118, 0, 163, 162, 164, 0, 159, 0, 152, 140, 166, 167, 151, 0, 0, 168, 148, 154, 145, 153, 0, 0, 149, 160, 0, 0, 119, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 73, 74, 85, 87, 0, 0, 0, 0, 117, 157, 158, 0, 141, 0, 165, 0, 146, 0, 161, 0, 0, 120, 3, 9, 17, 19, 131, 127, 21, 129, 126, 130, 128, 23, 25, 123, 27, 29, 41, 30, 32, 34, 31, 33, 42, 43, 35, 36, 39, 40, 37, 38, 47, 48, 45, 50, 51, 52, 53, 58, 59, 61, 62, 69, 70, 0, 14, 0, 11, 12, 156, 155, 0, 150, 139, 169, 0, 144, 0, 122, 172, 171, 170, 125, 124, 0, 0, 142, 0, 147, 0, 84, 13, 143, 0, 15, 0, 0, 0 }; static const short yydefgoto[] = { 264, 43, 44, 45, 46, 47, 99, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 167, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 130, 202, 196, 197, 198, 84, 85, 86, 114, 121, 239, 115, 122, 240, 87, 88, 89, 90, 91, 116, 117, 182, 251, 92 }; static const short yypact[] = { 241, 326, 326,-32768,-32768,-32768,-32768,-32768,-32768, 448, 448,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768, 64, -71, -71, -71, 10, 21, 24, 39, 45, 32, 37, -35, 241, 156,-32768,-32768, -32768,-32768,-32768, 53,-32768,-32768, 62,-32768,-32768, 40, 85,-32768, 63, 115, 71, 119, 158, 7, 77,-32768, 20, 55,-32768,-32768, 105,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768, 64, 64,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768, 105, 105,-32768, 80, 170, -20, 31,-32768, 25,-32768,-32768,-32768, 145,-32768, 161, -32768,-32768,-32768,-32768,-32768, 29, 124,-32768,-32768,-32768, -32768,-32768, 30, 124,-32768,-32768, 162, 33,-32768,-32768, 34, 241, 241, 326, 326, 461, 461, 124, 124, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 365, 365, 365, 365, 448, 448, 207, 207, 207, -32768,-32768, 241, 129, 241, 241,-32768,-32768,-32768, -4, -32768, 167, 130, -4,-32768, 169,-32768, 180, 241,-32768, -32768,-32768, 85,-32768,-32768,-32768,-32768,-32768, 78,-32768, -32768,-32768,-32768, 213,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 77, 77, 122,-32768,-32768,-32768,-32768, 55, 55,-32768, -32768,-32768,-32768, 241,-32768, 159,-32768,-32768,-32768,-32768, -41,-32768,-32768,-32768, 190,-32768, 241,-32768,-32768,-32768, -32768,-32768,-32768, 54, 241,-32768, 191,-32768, 183,-32768, -32768,-32768, 241,-32768, 240, 243,-32768 }; static const short yypgoto[] = { -32768, -27, -37,-32768,-32768,-32768, 104,-32768,-32768, 108, 137,-32768,-32768,-32768,-32768, 148, 116, -21, 1,-32768, -22, -19,-32768, 132, -18,-32768,-32768,-32768,-32768,-32768, 83,-32768,-32768,-32768,-32768,-32768,-32768, -14,-32768,-32768, -32768,-32768,-32768,-32768,-32768, 138, 166, 49,-32768, 68, 268,-32768, 188, 182,-32768,-32768,-32768, 123,-32768,-32768, -32768,-32768,-32768, 273,-32768,-32768,-32768, -26 }; #define YYLAST 547 static const short yytable[] = { 129, 103, 93, 94, 238, 255, 33, 118, 124, 127, 97, 125, 98, 154, 155, 173, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 110, 256, 25, 26, 27, 119, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 102, 174, 107, 259, 131, 170, 171, 156, 179, 183, 173, 104, 131, 188, 105, 176, 3, 4, 5, 180, 184, 161, 111, 187, 189, 248, 39, 120, 249, 106, 250, 162, 131, 131, 118, 108, 133, 38, 190, 191, 39, 124, 40, 41, 42, 29, 30, 31, 32, 33, 34, 35, 175, 200, 200, 200, 200, 163, 164, 132, 112, 113, 39, 165, 166, 112, 113, 39, 157, 158, 159, 160, 154, 155, 100, 101, 109, 220, 221, 234, 134, 236, 237, 227, 228, 95, 96, 135, 229, 230, 136, 231, 232, 138, 39, 247, 137, 241, 168, 169, 172, 241, 223, 224, 225, 226, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 203, 203, 25, 26, 27, 177, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 128, 199, 199, 173, 253, 178, 186, 258, 39, 233, 235, 242, 243, 245, 252, 260, 139, 140, 141, 142, 143, 144, 145, 263, 146, 147, 148, 149, 150, 151, 152, 153, 246, 254, 257, 261, 262, 38, 265, 192, 39, 266, 40, 41, 42, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 193, 222, 25, 26, 27, 204, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 201, 126, 181, 185, 244, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 39, 0, 40, 41, 42, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 28, 29, 30, 31, 32, 33, 34, 35, 0, 37, 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 28, 29, 30, 31, 32, 33, 34, 35, 38, 37, 0, 39, 0, 40, 41, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 39, 0, 40, 41, 42, 3, 4, 5, 6, 7, 8, 0, 0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 28, 29, 30, 31, 32, 33, 34, 35, 0, 37, 0, 0, 0, 0, 29, 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 39, 0, 40, 41, 42, 194, 195, 0, 0, 0, 0, 0, 0, 39 }; static const short yycheck[] = { 37, 28, 1, 2, 8, 46, 41, 33, 34, 36, 24, 46, 83, 6, 7, 35, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 8, 82, 32, 33, 34, 8, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 77, 13, 5, 35, 75, 76, 56, 35, 35, 35, 46, 35, 35, 46, 46, 8, 9, 10, 46, 46, 57, 46, 46, 46, 3, 86, 46, 6, 46, 8, 67, 35, 35, 116, 46, 52, 83, 131, 132, 86, 123, 88, 89, 90, 37, 38, 39, 40, 41, 42, 43, 77, 135, 136, 137, 138, 58, 59, 53, 84, 85, 86, 14, 15, 84, 85, 86, 47, 48, 49, 50, 6, 7, 26, 27, 87, 154, 155, 172, 51, 174, 175, 161, 162, 9, 10, 80, 163, 164, 31, 165, 166, 30, 86, 188, 81, 179, 71, 72, 76, 183, 157, 158, 159, 160, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 137, 138, 32, 33, 34, 46, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 135, 136, 35, 233, 46, 46, 246, 86, 4, 83, 46, 84, 46, 3, 254, 60, 61, 62, 63, 64, 65, 66, 262, 68, 69, 70, 71, 72, 73, 74, 75, 54, 76, 46, 46, 55, 83, 0, 133, 86, 0, 88, 89, 90, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 134, 156, 32, 33, 34, 138, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 136, 35, 116, 123, 183, 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 83, -1, -1, 86, -1, 88, 89, 90, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, 36, 37, 38, 39, 40, 41, 42, 43, -1, 45, -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, 36, 37, 38, 39, 40, 41, 42, 43, 83, 45, -1, 86, -1, 88, 89, 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 83, -1, -1, 86, -1, 88, 89, 90, 8, 9, 10, 11, 12, 13, -1, -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, 36, 37, 38, 39, 40, 41, 42, 43, -1, 45, -1, -1, -1, -1, 37, 38, 39, 40, 41, 42, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 83, -1, -1, 86, -1, 88, 89, 90, 78, 79, -1, -1, -1, -1, -1, -1, 86 }; #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/local/share/bison/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; # if YYLSP_NEEDED YYLTYPE yyls; # endif }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # if YYLSP_NEEDED # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAX) # else # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAX) # endif /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). When YYLLOC_DEFAULT is run, CURRENT is set the location of the first token. By default, to implement support for ranges, extend its range to the last symbol. */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #if YYPURE # if YYLSP_NEEDED # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) # else # define YYLEX yylex (&yylval, &yylloc) # endif # else /* !YYLSP_NEEDED */ # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) # else # define YYLEX yylex (&yylval) # endif # endif /* !YYLSP_NEEDED */ #else /* !YYPURE */ # define YYLEX yylex () #endif /* !YYPURE */ /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int PATHAN_EXPORT yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #ifdef YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif #line 315 "/usr/local/share/bison/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM # define YYPARSE_PARAM_DECL # else # define YYPARSE_PARAM_ARG YYPARSE_PARAM # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; # endif #else /* !YYPARSE_PARAM */ # define YYPARSE_PARAM_ARG # define YYPARSE_PARAM_DECL #endif /* !YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ # ifdef YYPARSE_PARAM int yyparse (void *); # else int yyparse (void); # endif #endif /* YY_DECL_VARIABLES -- depending whether we use a pure parser, variables are global, or local to YYPARSE. */ #define YY_DECL_NON_LSP_VARIABLES \ /* The lookahead symbol. */ \ int yychar; \ \ /* The semantic value of the lookahead symbol. */ \ YYSTYPE yylval; \ \ /* Number of parse errors so far. */ \ int yynerrs; #if YYLSP_NEEDED # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES \ \ /* Location data for the lookahead symbol. */ \ YYLTYPE yylloc; #else # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES #endif /* If nonreentrant, generate the variables here. */ #if !YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ int yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { /* If reentrant, generate the variables here. */ #if YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yychar1 = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #if YYLSP_NEEDED /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #endif #if YYLSP_NEEDED # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else # define YYPOPSTACK (yyvsp--, yyssp--) #endif YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYLSP_NEEDED YYLTYPE yyloc; #endif /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; #if YYLSP_NEEDED yylsp = yyls; #endif goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ # if YYLSP_NEEDED YYLTYPE *yyls1 = yyls; /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyls = yyls1; # else yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); # endif yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) goto yyoverflowlab; yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # if YYLSP_NEEDED YYSTACK_RELOCATE (yyls); # endif # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; #if YYLSP_NEEDED yylsp = yyls + yysize - 1; #endif YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyssp >= yyss + yystacksize - 1) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yychar1 = YYTRANSLATE (yychar); #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { YYFPRINTF (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ # ifdef YYPRINT YYPRINT (stderr, yychar, yylval); # endif YYFPRINTF (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to the semantic value of the lookahead token. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; #if YYLSP_NEEDED /* Similarly for the default location. Let the user run additional commands if for instance locations are ranges. */ yyloc = yylsp[1-yylen]; YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); #endif #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { int yyi; YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 1: #line 281 "XPath2Parser.y" { ((XPathParserControl *)parm)->result = new (((XPathParserControl *)parm)->memMgr) DataItemSequence(((XPathParserControl *)parm)->memMgr); } break; case 2: #line 285 "XPath2Parser.y" { ((XPathParserControl *)parm)->result = yyvsp[0].dataItemImpl; } break; case 3: #line 296 "XPath2Parser.y" { if(yyvsp[-2].dataItemImpl->getType()==DataItem::PARENTHESIZED) yyval.dataItemImpl = yyvsp[-2].dataItemImpl; else { DataItemParenthesizedExpr *dis = new (((XPathParserControl *)parm)->memMgr) DataItemParenthesizedExpr(((XPathParserControl *)parm)->memMgr); dis->addItem(yyvsp[-2].dataItemImpl); yyval.dataItemImpl = dis; } ((DataItemParenthesizedExpr *)yyval.dataItemImpl)->addItem(yyvsp[0].dataItemImpl); } break; case 4: #line 307 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 5: #line 318 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 6: #line 321 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 7: #line 324 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 8: #line 327 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 9: #line 338 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) DataItemFor(yyvsp[-2].variableBinding, yyvsp[0].dataItemImpl, ((XPathParserControl *)parm)->memMgr); } break; case 10: #line 349 "XPath2Parser.y" { yyval.variableBinding = yyvsp[0].variableBinding; } break; case 11: #line 359 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) DataItemQuantifiedExpr(DataItemQuantifiedExpr::some, yyvsp[-2].variableBinding, yyvsp[0].dataItemImpl, ((XPathParserControl *)parm)->memMgr); } break; case 12: #line 363 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) DataItemQuantifiedExpr(DataItemQuantifiedExpr::every, yyvsp[-2].variableBinding, yyvsp[0].dataItemImpl, ((XPathParserControl *)parm)->memMgr); } break; case 13: #line 371 "XPath2Parser.y" { VariableBinding* bind=new (((XPathParserControl *)parm)->memMgr) VariableBinding(((XPathParserControl *)parm)->memMgr->getPooledString(yyvsp[-2].wString), yyvsp[0].dataItemImpl); yyvsp[-4].variableBinding->push_back(bind); yyval.variableBinding = yyvsp[-4].variableBinding; delete yyvsp[-2].wString; } break; case 14: #line 378 "XPath2Parser.y" { yyval.variableBinding = new (((XPathParserControl *)parm)->memMgr) VectorOfBindings(PathanAllocator((((XPathParserControl *)parm)->memMgr))); VariableBinding* bind=new (((XPathParserControl *)parm)->memMgr) VariableBinding(((XPathParserControl *)parm)->memMgr->getPooledString(yyvsp[-2].wString), yyvsp[0].dataItemImpl); yyval.variableBinding->push_back(bind); delete yyvsp[-2].wString; } break; case 15: #line 393 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) DataItemIf(yyvsp[-5].dataItemImpl, yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl, ((XPathParserControl *)parm)->memMgr); } break; case 16: #line 407 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 17: #line 411 "XPath2Parser.y" { if(yyvsp[-2].dataItemImpl->getType() == DataItem::OPERATOR && (static_cast(yyvsp[-2].dataItemImpl))->getOperatorName() == Or::name) { Or* pOr = static_cast(yyvsp[-2].dataItemImpl); pOr->addArgument(yyvsp[0].dataItemImpl); yyval.dataItemImpl = yyvsp[-2].dataItemImpl; } else { DataItemImpl *dii = new (((XPathParserControl *)parm)->memMgr) Or(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl, ((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); yyval.dataItemImpl = dii; } } break; case 18: #line 432 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 19: #line 436 "XPath2Parser.y" { if(yyvsp[-2].dataItemImpl->getType() == DataItem::OPERATOR && (static_cast(yyvsp[-2].dataItemImpl))->getOperatorName() == And::name) { And* pAnd = static_cast(yyvsp[-2].dataItemImpl); pAnd->addArgument(yyvsp[0].dataItemImpl); yyval.dataItemImpl = yyvsp[-2].dataItemImpl; } else { DataItemImpl *dii = new (((XPathParserControl *)parm)->memMgr) And(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl, ((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); yyval.dataItemImpl = dii; } } break; case 20: #line 459 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 21: #line 463 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) DataItemInstanceOf(yyvsp[-2].dataItemImpl, yyvsp[0].sequenceType, ((XPathParserControl *)parm)->memMgr); } break; case 22: #line 474 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 23: #line 477 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) DataItemTreatAs(yyvsp[-2].dataItemImpl, yyvsp[0].sequenceType, ((XPathParserControl *)parm)->memMgr); } break; case 24: #line 488 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 25: #line 492 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) DataItemCastableAs(yyvsp[-2].dataItemImpl, yyvsp[0].sequenceType,((XPathParserControl *)parm)->memMgr); } break; case 26: #line 503 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 27: #line 506 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) DataItemCastAs(yyvsp[-2].dataItemImpl, yyvsp[0].sequenceType,((XPathParserControl *)parm)->memMgr); } break; case 28: #line 525 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 29: #line 529 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) GeneralComp(GeneralComp::EQUAL,packageArgs(yyvsp[-2].dataItemImpl,yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr),((XPathParserControl *)parm)->memMgr); } break; case 30: #line 533 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) GeneralComp(GeneralComp::NOT_EQUAL,packageArgs(yyvsp[-2].dataItemImpl,yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr),((XPathParserControl *)parm)->memMgr); } break; case 31: #line 537 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) GeneralComp(GeneralComp::LESS_THAN,packageArgs(yyvsp[-2].dataItemImpl,yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr),((XPathParserControl *)parm)->memMgr); } break; case 32: #line 541 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) GeneralComp(GeneralComp::LESS_THAN_EQUAL,packageArgs(yyvsp[-2].dataItemImpl,yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr),((XPathParserControl *)parm)->memMgr); } break; case 33: #line 545 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) GeneralComp(GeneralComp::GREATER_THAN,packageArgs(yyvsp[-2].dataItemImpl,yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr),((XPathParserControl *)parm)->memMgr); } break; case 34: #line 549 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) GeneralComp(GeneralComp::GREATER_THAN_EQUAL,packageArgs(yyvsp[-2].dataItemImpl,yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr),((XPathParserControl *)parm)->memMgr); } break; case 35: #line 553 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) Equals(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 36: #line 557 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) NotEquals(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 37: #line 561 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) LessThan(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 38: #line 565 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) LessThanEqual(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 39: #line 569 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) GreaterThan(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 40: #line 573 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) GreaterThanEqual(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 41: #line 577 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) NodeComparison(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 42: #line 581 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) OrderComparison(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), true, ((XPathParserControl *)parm)->memMgr); } break; case 43: #line 585 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) OrderComparison(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), false, ((XPathParserControl *)parm)->memMgr); } break; case 44: #line 600 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 45: #line 604 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) Range(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 46: #line 617 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 47: #line 621 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) Plus(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 48: #line 625 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) Minus(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 49: #line 637 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 50: #line 641 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) Multiply(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 51: #line 645 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) Divide(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 52: #line 649 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) IntegerDivide(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 53: #line 653 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) Mod(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 54: #line 665 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 55: #line 669 "XPath2Parser.y" { VectorOfDataItems args(PathanAllocator(((XPathParserControl *)parm)->memMgr)); args.push_back(yyvsp[0].dataItemImpl); yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) UnaryMinus(args, ((XPathParserControl *)parm)->memMgr); } break; case 56: #line 675 "XPath2Parser.y" { //no need to do anything with unary plus yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 57: #line 690 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 58: #line 694 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) Union(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 59: #line 698 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) Union(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 60: #line 710 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 61: #line 714 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) Intersect(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 62: #line 718 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) Except(packageArgs(yyvsp[-2].dataItemImpl, yyvsp[0].dataItemImpl,((XPathParserControl *)parm)->memMgr), ((XPathParserControl *)parm)->memMgr); } break; case 63: #line 731 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 64: #line 743 "XPath2Parser.y" { DataItemNav *nav = new (((XPathParserControl *)parm)->memMgr) DataItemNav(((XPathParserControl *)parm)->memMgr); nav->setGotoRootFirst(true); yyval.dataItemImpl = nav; } break; case 65: #line 749 "XPath2Parser.y" { // Optimization: if the _RelativePathExpr is already a DataItemNav, simply set the "go to root" flag if(yyvsp[0].dataItemImpl->getType()==DataItem::NAVIGATION) { ((DataItemNav*)yyvsp[0].dataItemImpl)->setGotoRootFirst(true); yyval.dataItemImpl = yyvsp[0].dataItemImpl; } else { DataItemNav *nav = new (((XPathParserControl *)parm)->memMgr) DataItemNav(((XPathParserControl *)parm)->memMgr); nav->setGotoRootFirst(true); nav->addStep(yyvsp[0].dataItemImpl); yyval.dataItemImpl = nav; } } break; case 66: #line 766 "XPath2Parser.y" { DescendantOrSelfAxis *step = new (((XPathParserControl *)parm)->memMgr) DescendantOrSelfAxis(); step->setTypeWildcard(); step->setNameWildcard(); step->setNamespaceWildcard(); // Optimization: if the _RelativePathExpr is already a DataItemNav, simply add the new step as the first one if(yyvsp[0].dataItemImpl->getType()==DataItem::NAVIGATION) { ((DataItemNav*)yyvsp[0].dataItemImpl)->setGotoRootFirst(true); ((DataItemNav*)yyvsp[0].dataItemImpl)->addStepFront(new (((XPathParserControl *)parm)->memMgr) DataItemStep(step, ((XPathParserControl *)parm)->memMgr)); yyval.dataItemImpl = yyvsp[0].dataItemImpl; } else { DataItemNav *newNavigation = new (((XPathParserControl *)parm)->memMgr) DataItemNav(((XPathParserControl *)parm)->memMgr); newNavigation->setGotoRootFirst(true); newNavigation->addStep(step); newNavigation->addStep(yyvsp[0].dataItemImpl); yyval.dataItemImpl = newNavigation; } } break; case 67: #line 789 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 68: #line 803 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 69: #line 807 "XPath2Parser.y" { // Optimization: if the _RelativePathExpr is already a DataItemNav, simply add the new step if(yyvsp[-2].dataItemImpl->getType()==DataItem::NAVIGATION) { ((DataItemNav*)yyvsp[-2].dataItemImpl)->addStep(yyvsp[0].dataItemImpl); yyval.dataItemImpl = yyvsp[-2].dataItemImpl; } else { DataItemNav *nav = new (((XPathParserControl *)parm)->memMgr) DataItemNav(((XPathParserControl *)parm)->memMgr); nav->addStep(yyvsp[-2].dataItemImpl); nav->addStep(yyvsp[0].dataItemImpl); yyval.dataItemImpl = nav; } } break; case 70: #line 824 "XPath2Parser.y" { DescendantOrSelfAxis *step = new (((XPathParserControl *)parm)->memMgr) DescendantOrSelfAxis(); step->setTypeWildcard(); step->setNameWildcard(); step->setNamespaceWildcard(); // Optimization: if the _RelativePathExpr is already a DataItemNav, simply add the new step if(yyvsp[-2].dataItemImpl->getType()==DataItem::NAVIGATION) { ((DataItemNav*)yyvsp[-2].dataItemImpl)->addStep(step); ((DataItemNav*)yyvsp[-2].dataItemImpl)->addStep(yyvsp[0].dataItemImpl); yyval.dataItemImpl = yyvsp[-2].dataItemImpl; } else { DataItemNav *nav = new (((XPathParserControl *)parm)->memMgr) DataItemNav(((XPathParserControl *)parm)->memMgr); nav->addStep(yyvsp[-2].dataItemImpl); nav->addStep(step); nav->addStep(yyvsp[0].dataItemImpl); yyval.dataItemImpl = nav; } } break; case 71: #line 857 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 72: #line 860 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 73: #line 870 "XPath2Parser.y" { DataItemStep *step = new (((XPathParserControl *)parm)->memMgr) DataItemStep(yyvsp[-1].navStep, ((XPathParserControl *)parm)->memMgr); step->addPredicates(*yyvsp[0].dataItemStore); delete yyvsp[0].dataItemStore; yyval.dataItemImpl = step; } break; case 74: #line 876 "XPath2Parser.y" { DataItemStep *step = new (((XPathParserControl *)parm)->memMgr) DataItemStep(yyvsp[-1].navStep, ((XPathParserControl *)parm)->memMgr); step->addPredicates(*yyvsp[0].dataItemStore); delete yyvsp[0].dataItemStore; yyval.dataItemImpl = step; } break; case 75: #line 889 "XPath2Parser.y" { yyvsp[-1].dataItemImpl->addPredicates(*yyvsp[0].dataItemStore); delete yyvsp[0].dataItemStore; yyval.dataItemImpl = yyvsp[-1].dataItemImpl; } break; case 76: #line 902 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) DataItemContextItem(((XPathParserControl *)parm)->memMgr); } break; case 77: #line 913 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 78: #line 917 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 79: #line 921 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 80: #line 925 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 81: #line 929 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 82: #line 940 "XPath2Parser.y" { DataItemVariable *var = new (((XPathParserControl *)parm)->memMgr) DataItemVariable(yyvsp[0].wString, ((XPathParserControl *)parm)->memMgr); delete yyvsp[0].wString; yyval.dataItemImpl = var; } break; case 83: #line 953 "XPath2Parser.y" { yyval.dataItemStore = new VectorOfDataItems(PathanAllocator(((XPathParserControl *)parm)->memMgr)); } break; case 84: #line 956 "XPath2Parser.y" { yyvsp[-3].dataItemStore->push_back(yyvsp[-1].dataItemImpl); yyval.dataItemStore = yyvsp[-3].dataItemStore; } break; case 85: #line 971 "XPath2Parser.y" { importStep(yyvsp[-1].navStep, yyvsp[0].navStep); if(yyvsp[0].navStep->getTypeSet()) { yyvsp[-1].navStep->setNodeType(yyvsp[0].navStep->getNodeType()); } yyval.navStep = yyvsp[-1].navStep; } break; case 86: #line 979 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 87: #line 991 "XPath2Parser.y" { importStep(yyvsp[-1].navStep, yyvsp[0].navStep); if(yyvsp[0].navStep->getTypeSet()) { yyvsp[-1].navStep->setNodeType(yyvsp[0].navStep->getNodeType()); } yyval.navStep = yyvsp[-1].navStep; } break; case 88: #line 999 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 89: #line 1010 "XPath2Parser.y" { AttributeAxis *at = new (((XPathParserControl *)parm)->memMgr) AttributeAxis; if(yyvsp[0].navStep->getTypeSet()) at->setNodeType(yyvsp[0].navStep->getNodeType()); else at->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ATTRIBUTE_NODE); importStep(at, yyvsp[0].navStep); yyval.navStep = at; } break; case 90: #line 1020 "XPath2Parser.y" { NavStepImpl *result; SequenceType::ItemType *itemtype = yyvsp[0].navStep->getType(); if(itemtype != 0 && itemtype->getItemTestType() == SequenceType::ItemType::TEST_ATTRIBUTE) { result = new (((XPathParserControl *)parm)->memMgr) AttributeAxis; } else { result = new (((XPathParserControl *)parm)->memMgr) ChildAxis; } if(yyvsp[0].navStep->getTypeSet()) result->setNodeType(yyvsp[0].navStep->getNodeType()); else result->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ELEMENT_NODE); importStep(result, yyvsp[0].navStep); yyval.navStep = result; } break; case 91: #line 1045 "XPath2Parser.y" { ParentAxis *step = new (((XPathParserControl *)parm)->memMgr) ParentAxis; step->setNameWildcard(); step->setNamespaceWildcard(); step->setTypeWildcard(); yyval.navStep = step; } break; case 92: #line 1069 "XPath2Parser.y" { ChildAxis *step = new (((XPathParserControl *)parm)->memMgr) ChildAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ELEMENT_NODE); yyval.navStep = step; } break; case 93: #line 1075 "XPath2Parser.y" { DescendantAxis *step = new (((XPathParserControl *)parm)->memMgr) DescendantAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ELEMENT_NODE); yyval.navStep = step; } break; case 94: #line 1081 "XPath2Parser.y" { AttributeAxis *step = new (((XPathParserControl *)parm)->memMgr) AttributeAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ATTRIBUTE_NODE); yyval.navStep = step; } break; case 95: #line 1087 "XPath2Parser.y" { SelfAxis *step = new (((XPathParserControl *)parm)->memMgr) SelfAxis(); step->setNodeType(XERCES_CPP_NAMESPACE::DOMNode::ELEMENT_NODE); yyval.navStep = step; } break; case 96: #line 1093 "XPath2Parser.y" { DescendantOrSelfAxis *step = new (((XPathParserControl *)parm)->memMgr) DescendantOrSelfAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ELEMENT_NODE); yyval.navStep = step; } break; case 97: #line 1099 "XPath2Parser.y" { FollowingSiblingAxis *step = new (((XPathParserControl *)parm)->memMgr) FollowingSiblingAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ELEMENT_NODE); yyval.navStep = step; } break; case 98: #line 1105 "XPath2Parser.y" { FollowingAxis *step = new (((XPathParserControl *)parm)->memMgr) FollowingAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ELEMENT_NODE); yyval.navStep = step; } break; case 99: #line 1111 "XPath2Parser.y" { NamespaceAxis *step = new (((XPathParserControl *)parm)->memMgr) NamespaceAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMXPathNamespace::XPATH_NAMESPACE_NODE); yyval.navStep = step; } break; case 100: #line 1129 "XPath2Parser.y" { ParentAxis *step = new (((XPathParserControl *)parm)->memMgr) ParentAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ELEMENT_NODE); yyval.navStep = step; } break; case 101: #line 1135 "XPath2Parser.y" { AncestorAxis *step = new (((XPathParserControl *)parm)->memMgr) AncestorAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ELEMENT_NODE); yyval.navStep = step; } break; case 102: #line 1141 "XPath2Parser.y" { PrecedingSiblingAxis *step = new (((XPathParserControl *)parm)->memMgr) PrecedingSiblingAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ELEMENT_NODE); yyval.navStep = step; } break; case 103: #line 1147 "XPath2Parser.y" { PrecedingAxis *step = new (((XPathParserControl *)parm)->memMgr) PrecedingAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ELEMENT_NODE); yyval.navStep = step; } break; case 104: #line 1153 "XPath2Parser.y" { AncestorOrSelfAxis *step = new (((XPathParserControl *)parm)->memMgr) AncestorOrSelfAxis(); step->setNodeType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ELEMENT_NODE); yyval.navStep = step; } break; case 105: #line 1167 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 106: #line 1171 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 107: #line 1182 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); if(yyvsp[0].qName->getPrefix() == NULL) step->setNodeName(yyvsp[0].qName->getName()); else { step->setNodeName(yyvsp[0].qName->getName()); const XMLCh *uri = ((XPathParserControl *)parm)->context->getUriBoundToPrefix(yyvsp[0].qName->getPrefix()); step->setNodeUri(uri); } yyval.navStep = step; } break; case 108: #line 1194 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 109: #line 1206 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setNameWildcard(); step->setNamespaceWildcard(); yyval.navStep = step; } break; case 110: #line 1213 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setNameWildcard(); const XMLCh* uri = ((XPathParserControl *)parm)->context->getUriBoundToPrefix(yyvsp[0].wString); step->setNodeUri(uri); yyval.navStep = step; delete yyvsp[0].wString; } break; case 111: #line 1223 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setNodeName(((XPathParserControl *)parm)->memMgr->getPooledString(yyvsp[0].wString)); step->setNamespaceWildcard(); yyval.navStep = step; delete yyvsp[0].wString; } break; case 112: #line 1241 "XPath2Parser.y" { yyval.dataItemImpl = yyvsp[0].dataItemImpl; } break; case 113: #line 1245 "XPath2Parser.y" { ATStringOrDerived *s = new (((XPathParserControl *)parm)->memMgr) ATStringOrDerivedImpl( XERCES_CPP_NAMESPACE_QUALIFIER SchemaSymbols::fgURI_SCHEMAFORSCHEMA, XERCES_CPP_NAMESPACE_QUALIFIER SchemaSymbols::fgDT_STRING, yyvsp[0].wString, ((XPathParserControl *)parm)->memMgr, ((XPathParserControl *)parm)->context); DataItemLiteral *str_val = new (((XPathParserControl *)parm)->memMgr) DataItemLiteral(s, ((XPathParserControl *)parm)->memMgr); yyval.dataItemImpl = str_val; delete yyvsp[0].wString; } break; case 114: #line 1264 "XPath2Parser.y" { ATDecimalOrDerived* xsi = new (((XPathParserControl *)parm)->memMgr) ATDecimalOrDerivedImpl( XERCES_CPP_NAMESPACE_QUALIFIER SchemaSymbols::fgURI_SCHEMAFORSCHEMA, XERCES_CPP_NAMESPACE_QUALIFIER SchemaSymbols::fgDT_INTEGER, yyvsp[0].wString, ((XPathParserControl *)parm)->memMgr, ((XPathParserControl *)parm)->context); delete yyvsp[0].wString; DataItemLiteral *did = new (((XPathParserControl *)parm)->memMgr) DataItemLiteral(xsi, ((XPathParserControl *)parm)->memMgr); yyval.dataItemImpl = did; } break; case 115: #line 1275 "XPath2Parser.y" { ATDecimalOrDerived* xsd = new (((XPathParserControl *)parm)->memMgr) ATDecimalOrDerivedImpl( XERCES_CPP_NAMESPACE_QUALIFIER SchemaSymbols::fgURI_SCHEMAFORSCHEMA, XERCES_CPP_NAMESPACE_QUALIFIER SchemaSymbols::fgDT_DECIMAL, yyvsp[0].wString, ((XPathParserControl *)parm)->memMgr, ((XPathParserControl *)parm)->context); delete yyvsp[0].wString; DataItemLiteral *did = new (((XPathParserControl *)parm)->memMgr) DataItemLiteral(xsd, ((XPathParserControl *)parm)->memMgr); yyval.dataItemImpl = did; } break; case 116: #line 1286 "XPath2Parser.y" { ATDoubleOrDerived* xsd = new (((XPathParserControl *)parm)->memMgr) ATDoubleOrDerivedImpl( XERCES_CPP_NAMESPACE_QUALIFIER SchemaSymbols::fgURI_SCHEMAFORSCHEMA, XERCES_CPP_NAMESPACE_QUALIFIER SchemaSymbols::fgDT_DOUBLE, yyvsp[0].wString, ((XPathParserControl *)parm)->memMgr, ((XPathParserControl *)parm)->context); delete yyvsp[0].wString; DataItemLiteral *did = new (((XPathParserControl *)parm)->memMgr) DataItemLiteral(xsd, ((XPathParserControl *)parm)->memMgr); yyval.dataItemImpl = did; } break; case 117: #line 1305 "XPath2Parser.y" { if(yyvsp[-1].dataItemImpl->getType()!=DataItem::PARENTHESIZED) { DataItemParenthesizedExpr *dis = new (((XPathParserControl *)parm)->memMgr) DataItemParenthesizedExpr(((XPathParserControl *)parm)->memMgr); dis->addItem(yyvsp[-1].dataItemImpl); yyval.dataItemImpl = dis; } else yyval.dataItemImpl = yyvsp[-1].dataItemImpl; } break; case 118: #line 1315 "XPath2Parser.y" { yyval.dataItemImpl = new (((XPathParserControl *)parm)->memMgr) DataItemSequence(((XPathParserControl *)parm)->memMgr); } break; case 119: #line 1327 "XPath2Parser.y" { QualifiedName *qname = new (((XPathParserControl *)parm)->memMgr) QualifiedName(yyvsp[-1].wString, ((XPathParserControl *)parm)->memMgr); delete yyvsp[-1].wString; VectorOfDataItems tmp(PathanAllocator(((XPathParserControl *)parm)->memMgr)); DataItem* functionImpl = ((XPathParserControl*)parm)->context->lookUpFunction(qname->getPrefix(), qname->getName(), tmp); if( functionImpl == NULL) { XERCES_CPP_NAMESPACE_QUALIFIER XMLBuffer buf(1023, ((XPathParserControl *)parm)->memMgr); buf.set(X("Function '")); buf.append(qname->getFullName(((XPathParserControl *)parm)->memMgr)); buf.append(X("' is undefined")); DSLthrow(XPathParseException, X("XPath2Parser.y"), buf.getRawBuffer()); } yyval.dataItemImpl = functionImpl; } break; case 120: #line 1342 "XPath2Parser.y" { QualifiedName *qname = new (((XPathParserControl *)parm)->memMgr) QualifiedName(yyvsp[-2].wString, ((XPathParserControl *)parm)->memMgr); delete yyvsp[-2].wString; DataItem* functionImpl = ((XPathParserControl*)parm)->context->lookUpFunction(qname->getPrefix(), qname->getName(), *yyvsp[-1].dataItemStore); if( functionImpl == NULL) { XERCES_CPP_NAMESPACE_QUALIFIER XMLBuffer buf(1023, ((XPathParserControl *)parm)->memMgr); buf.set(X("Function '")); buf.append(qname->getFullName(((XPathParserControl *)parm)->memMgr)); buf.append(X("' is undefined")); DSLthrow(XPathParseException, X("XPath2Parser.y"), buf.getRawBuffer()); } yyval.dataItemImpl = functionImpl; delete yyvsp[-1].dataItemStore; } break; case 121: #line 1368 "XPath2Parser.y" { yyval.dataItemStore = new VectorOfDataItems(PathanAllocator(((XPathParserControl *)parm)->memMgr)); yyval.dataItemStore->push_back(yyvsp[0].dataItemImpl); } break; case 122: #line 1373 "XPath2Parser.y" { yyvsp[-2].dataItemStore->push_back(yyvsp[0].dataItemImpl); yyval.dataItemStore = yyvsp[-2].dataItemStore; } break; case 123: #line 1385 "XPath2Parser.y" { SequenceType* seq=new (((XPathParserControl *)parm)->memMgr) SequenceType(); seq->setItemType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ATOMIC_TYPE, NULL, yyvsp[0].qName)); seq->setOccurrence(SequenceType::EXACTLY_ONE); yyval.sequenceType = seq; } break; case 124: #line 1392 "XPath2Parser.y" { SequenceType* seq=new (((XPathParserControl *)parm)->memMgr) SequenceType(); seq->setItemType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ATOMIC_TYPE, NULL, yyvsp[-1].qName)); seq->setOccurrence(SequenceType::QUESTION_MARK); yyval.sequenceType = seq; } break; case 125: #line 1407 "XPath2Parser.y" { SequenceType* seq=new (((XPathParserControl *)parm)->memMgr) SequenceType(); seq->setItemType(yyvsp[-1].itemType); seq->setOccurrence(yyvsp[0].occurrence); yyval.sequenceType = seq; } break; case 126: #line 1414 "XPath2Parser.y" { SequenceType* seq=new (((XPathParserControl *)parm)->memMgr) SequenceType(); seq->setItemType(yyvsp[0].itemType); seq->setOccurrence(SequenceType::EXACTLY_ONE); yyval.sequenceType = seq; } break; case 127: #line 1421 "XPath2Parser.y" { yyval.sequenceType = new (((XPathParserControl *)parm)->memMgr) SequenceType(); } break; case 128: #line 1432 "XPath2Parser.y" { yyval.qName = yyvsp[0].qName; } break; case 129: #line 1443 "XPath2Parser.y" { yyval.itemType = new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ATOMIC_TYPE, NULL, yyvsp[0].qName); } break; case 130: #line 1446 "XPath2Parser.y" { yyval.itemType = yyvsp[0].navStep->getType(); yyvsp[0].navStep->setType(NULL); } break; case 131: #line 1450 "XPath2Parser.y" { yyval.itemType = new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ANYTHING); } break; case 132: #line 1466 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 133: #line 1469 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 134: #line 1472 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 135: #line 1475 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 136: #line 1478 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 137: #line 1481 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 138: #line 1484 "XPath2Parser.y" { yyval.navStep = yyvsp[0].navStep; } break; case 139: #line 1496 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ELEMENT, yyvsp[-1].qName, yyvsp[-2].schemaContext)); yyval.navStep = step; } break; case 140: #line 1501 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ELEMENT)); yyval.navStep = step; } break; case 141: #line 1506 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ELEMENT, yyvsp[-1].qName)); yyval.navStep = step; } break; case 142: #line 1511 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ELEMENT, yyvsp[-3].qName, yyvsp[-1].qName)); yyval.navStep = step; } break; case 143: #line 1516 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); SequenceType::ItemType* pType=new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ELEMENT, yyvsp[-4].qName, yyvsp[-2].qName); pType->setAllowNilled(true); step->setType(pType); yyval.navStep = step; } break; case 144: #line 1533 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ATTRIBUTE, yyvsp[-1].qName, yyvsp[-2].schemaContext)); yyval.navStep = step; } break; case 145: #line 1539 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ATTRIBUTE)); yyval.navStep = step; } break; case 146: #line 1544 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ATTRIBUTE, yyvsp[-1].qName)); yyval.navStep = step; } break; case 147: #line 1549 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_ATTRIBUTE, yyvsp[-3].qName, yyvsp[-1].qName)); yyval.navStep = step; } break; case 148: #line 1561 "XPath2Parser.y" { yyval.qName = yyvsp[0].qName; } break; case 149: #line 1570 "XPath2Parser.y" { yyval.qName = yyvsp[0].qName; } break; case 150: #line 1579 "XPath2Parser.y" { yyval.qName = yyvsp[0].qName; } break; case 151: #line 1589 "XPath2Parser.y" { yyval.qName = yyvsp[0].qName; } break; case 152: #line 1592 "XPath2Parser.y" { yyval.qName=NULL; } break; case 153: #line 1602 "XPath2Parser.y" { yyval.qName = yyvsp[0].qName; } break; case 154: #line 1605 "XPath2Parser.y" { yyval.qName=NULL; } break; case 155: #line 1615 "XPath2Parser.y" { yyval.qName = yyvsp[0].qName; } break; case 156: #line 1618 "XPath2Parser.y" { yyval.qName=NULL; } break; case 157: #line 1629 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_PI)); step->setNodeName(yyvsp[-1].wString); yyval.navStep = step; delete yyvsp[-1].wString; } break; case 158: #line 1636 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_PI)); step->setNodeName(yyvsp[-1].wString); yyval.navStep = step; delete yyvsp[-1].wString; } break; case 159: #line 1643 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_PI)); yyval.navStep = step; } break; case 160: #line 1657 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_DOCUMENT)); yyval.navStep = step; } break; case 161: #line 1662 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); SequenceType::ItemType* elemTest=yyvsp[-1].navStep->getType(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_DOCUMENT,elemTest->getName(),elemTest->getType())); elemTest->setName(NULL); elemTest->setType(NULL); yyval.navStep = step; } break; case 162: #line 1678 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_COMMENT)); yyval.navStep = step; } break; case 163: #line 1692 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_TEXT)); yyval.navStep = step; } break; case 164: #line 1706 "XPath2Parser.y" { NavStepImpl *step = new (((XPathParserControl *)parm)->memMgr) NavStepImpl(); step->setType(new (((XPathParserControl *)parm)->memMgr) SequenceType::ItemType(SequenceType::ItemType::TEST_NODE)); yyval.navStep = step; } break; case 165: #line 1721 "XPath2Parser.y" { yyval.schemaContext = yyvsp[-1].schemaContext; yyval.schemaContext->_steps=yyvsp[0].qNameList; } break; case 166: #line 1733 "XPath2Parser.y" { yyval.schemaContext = new (((XPathParserControl *)parm)->memMgr) SchemaType; yyval.schemaContext->_rootIsType=false; yyval.schemaContext->_root=new (((XPathParserControl *)parm)->memMgr) QualifiedName(yyvsp[0].wString, ((XPathParserControl *)parm)->memMgr); } break; case 167: #line 1739 "XPath2Parser.y" { yyval.schemaContext = new (((XPathParserControl *)parm)->memMgr) SchemaType; yyval.schemaContext->_rootIsType=true; yyval.schemaContext->_root=new (((XPathParserControl *)parm)->memMgr) QualifiedName(yyvsp[0].wString, ((XPathParserControl *)parm)->memMgr); } break; case 168: #line 1752 "XPath2Parser.y" { yyval.qNameList = new (((XPathParserControl *)parm)->memMgr) VectorOfQualifiedNames(PathanAllocator(((XPathParserControl *)parm)->memMgr)); } break; case 169: #line 1755 "XPath2Parser.y" { yyval.qNameList = yyvsp[-1].qNameList; yyval.qNameList->push_back(new (((XPathParserControl *)parm)->memMgr) QualifiedName(yyvsp[0].wString, ((XPathParserControl *)parm)->memMgr)); delete yyvsp[0].wString; } break; case 170: #line 1768 "XPath2Parser.y" { yyval.occurrence = SequenceType::STAR; } break; case 171: #line 1772 "XPath2Parser.y" { yyval.occurrence = SequenceType::PLUS; } break; case 172: #line 1776 "XPath2Parser.y" { yyval.occurrence = SequenceType::QUESTION_MARK; } break; case 173: #line 1784 "XPath2Parser.y" { QualifiedName *qn = new (((XPathParserControl *)parm)->memMgr) QualifiedName(yyvsp[0].wString, ((XPathParserControl *)parm)->memMgr); delete yyvsp[0].wString; yyval.qName = qn; } break; } #line 705 "/usr/local/share/bison/bison.simple" yyvsp -= yylen; yyssp -= yylen; #if YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif *++yyvsp = yyval; #if YYLSP_NEEDED *++yylsp = yyloc; #endif /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { YYSIZE_T yysize = 0; char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("parse error, unexpected ") + 1; yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "parse error, unexpected "); yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("parse error; also virtual memory exhausted"); } else #endif /* defined (YYERROR_VERBOSE) */ yyerror ("parse error"); } goto yyerrlab1; /*--------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action | `--------------------------------------------------*/ yyerrlab1: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; YYDPRINTF ((stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1])); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; /*-------------------------------------------------------------------. | yyerrdefault -- current state does not do anything special for the | | error token. | `-------------------------------------------------------------------*/ yyerrdefault: #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ /* If its default is to accept any token, ok. Otherwise pop it. */ yyn = yydefact[yystate]; if (yyn) goto yydefault; #endif /*---------------------------------------------------------------. | yyerrpop -- pop the current state because it cannot handle the | | error token | `---------------------------------------------------------------*/ yyerrpop: if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #if YYLSP_NEEDED yylsp--; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "Error: state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif /*--------------. | yyerrhandle. | `--------------*/ yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; /*---------------------------------------------. | yyoverflowab -- parser overflow comes here. | `---------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 1792 "XPath2Parser.y" void yyerror(const char *s) { DSLthrow(XPathParseException, X("XPath2Parser.y"), X(s)); } inline VectorOfDataItems packageArgs(DataItem *arg1Impl, DataItem *arg2Impl, XPath2MemoryManager* memMgr) { VectorOfDataItems args=VectorOfDataItems(2,(DataItem*)NULL,PathanAllocator(memMgr)); args[0]=arg1Impl; args[1]=arg2Impl; return args; } //imports the data in step 2 into step1 void importStep(NavStepImpl *step1, NavStepImpl *step2) { step1->setNodeUri(step2->getNodeUri()); step1->setNodeName(step2->getNodeName()); step1->setType(step2->getType()); step2->setType(NULL); if(step2->getNameWildcard()) { step1->setNameWildcard(); } if(step2->getNamespaceWildcard()) { step1->setNamespaceWildcard(); } if(step2->getTypeWildcard()) { step1->setTypeWildcard(); } }