From: <wol...@us...> - 2011-02-28 19:47:04
|
Revision: 13875 http://exist.svn.sourceforge.net/exist/?rev=13875&view=rev Author: wolfgang_m Date: 2011-02-28 19:46:55 +0000 (Mon, 28 Feb 2011) Log Message: ----------- [performance] Faster sequence constructors in XQuery: old code parsed (1, 2, 3) into (1, (2, 3)). Processing this recursively eventually caused a stack overflow and was slow. Modified Paths: -------------- trunk/eXist/src/org/exist/xquery/parser/DeclScanner.java trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.java trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.txt trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java trunk/eXist/src/org/exist/xquery/parser/XQueryTokenTypes.java trunk/eXist/src/org/exist/xquery/parser/XQueryTokenTypes.txt trunk/eXist/src/org/exist/xquery/parser/XQueryTreeParser.java trunk/eXist/src/org/exist/xquery/parser/XQueryTreeParserTokenTypes.java trunk/eXist/src/org/exist/xquery/parser/XQueryTreeParserTokenTypes.txt Modified: trunk/eXist/src/org/exist/xquery/parser/DeclScanner.java =================================================================== --- trunk/eXist/src/org/exist/xquery/parser/DeclScanner.java 2011-02-28 19:45:04 UTC (rev 13874) +++ trunk/eXist/src/org/exist/xquery/parser/DeclScanner.java 2011-02-28 19:46:55 UTC (rev 13875) @@ -146,6 +146,7 @@ "COMP_DOC_CONSTRUCTOR", "PRAGMA", "GTEQ", + "SEQUENCE", "\"xpointer\"", "opening parenthesis '('", "closing parenthesis ')'", Modified: trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.java =================================================================== --- trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.java 2011-02-28 19:45:04 UTC (rev 13874) +++ trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.java 2011-02-28 19:46:55 UTC (rev 13875) @@ -53,178 +53,179 @@ int COMP_DOC_CONSTRUCTOR = 47; int PRAGMA = 48; int GTEQ = 49; - int LITERAL_xpointer = 50; - int LPAREN = 51; - int RPAREN = 52; - int NCNAME = 53; - int LITERAL_xquery = 54; - int LITERAL_version = 55; - int SEMICOLON = 56; - int LITERAL_module = 57; - int LITERAL_namespace = 58; - int EQ = 59; - int STRING_LITERAL = 60; - int LITERAL_declare = 61; - int LITERAL_default = 62; - // "boundary-space" = 63 - int LITERAL_ordering = 64; - int LITERAL_construction = 65; - // "base-uri" = 66 - // "copy-namespaces" = 67 - int LITERAL_option = 68; - int LITERAL_function = 69; - int LITERAL_variable = 70; - int LITERAL_import = 71; - int LITERAL_encoding = 72; - int LITERAL_collation = 73; - int LITERAL_element = 74; - int LITERAL_order = 75; - int LITERAL_empty = 76; - int LITERAL_greatest = 77; - int LITERAL_least = 78; - int LITERAL_preserve = 79; - int LITERAL_strip = 80; - int LITERAL_ordered = 81; - int LITERAL_unordered = 82; - int COMMA = 83; - // "no-preserve" = 84 - int LITERAL_inherit = 85; - // "no-inherit" = 86 - int DOLLAR = 87; - int LCURLY = 88; - int RCURLY = 89; - int COLON = 90; - int LITERAL_external = 91; - int LITERAL_schema = 92; - int LITERAL_as = 93; - int LITERAL_at = 94; - // "empty-sequence" = 95 - int QUESTION = 96; - int STAR = 97; - int PLUS = 98; - int LITERAL_item = 99; - int LITERAL_for = 100; - int LITERAL_let = 101; - int LITERAL_some = 102; - int LITERAL_every = 103; - int LITERAL_if = 104; - int LITERAL_typeswitch = 105; - int LITERAL_update = 106; - int LITERAL_replace = 107; - int LITERAL_value = 108; - int LITERAL_insert = 109; - int LITERAL_delete = 110; - int LITERAL_rename = 111; - int LITERAL_with = 112; - int LITERAL_into = 113; - int LITERAL_preceding = 114; - int LITERAL_following = 115; - int LITERAL_where = 116; - int LITERAL_return = 117; - int LITERAL_in = 118; - int LITERAL_by = 119; - int LITERAL_stable = 120; - int LITERAL_ascending = 121; - int LITERAL_descending = 122; - int LITERAL_group = 123; - int LITERAL_satisfies = 124; - int LITERAL_case = 125; - int LITERAL_then = 126; - int LITERAL_else = 127; - int LITERAL_or = 128; - int LITERAL_and = 129; - int LITERAL_instance = 130; - int LITERAL_of = 131; - int LITERAL_treat = 132; - int LITERAL_castable = 133; - int LITERAL_cast = 134; - int BEFORE = 135; - int AFTER = 136; - int LITERAL_eq = 137; - int LITERAL_ne = 138; - int LITERAL_lt = 139; - int LITERAL_le = 140; - int LITERAL_gt = 141; - int LITERAL_ge = 142; - int GT = 143; - int NEQ = 144; - int LT = 145; - int LTEQ = 146; - int LITERAL_is = 147; - int LITERAL_isnot = 148; - int ANDEQ = 149; - int OREQ = 150; - int LITERAL_to = 151; - int MINUS = 152; - int LITERAL_div = 153; - int LITERAL_idiv = 154; - int LITERAL_mod = 155; - int PRAGMA_START = 156; - int PRAGMA_END = 157; - int LITERAL_union = 158; - int UNION = 159; - int LITERAL_intersect = 160; - int LITERAL_except = 161; - int SLASH = 162; - int DSLASH = 163; - int LITERAL_text = 164; - int LITERAL_node = 165; - int LITERAL_attribute = 166; - int LITERAL_comment = 167; - // "processing-instruction" = 168 - // "document-node" = 169 - int LITERAL_document = 170; - int SELF = 171; - int XML_COMMENT = 172; - int XML_PI = 173; - int LPPAREN = 174; - int RPPAREN = 175; - int AT = 176; - int PARENT = 177; - int LITERAL_child = 178; - int LITERAL_self = 179; - int LITERAL_descendant = 180; - // "descendant-or-self" = 181 - // "following-sibling" = 182 - int LITERAL_parent = 183; - int LITERAL_ancestor = 184; - // "ancestor-or-self" = 185 - // "preceding-sibling" = 186 - int DOUBLE_LITERAL = 187; - int DECIMAL_LITERAL = 188; - int INTEGER_LITERAL = 189; - // "schema-element" = 190 - int END_TAG_START = 191; - int QUOT = 192; - int APOS = 193; - int QUOT_ATTRIBUTE_CONTENT = 194; - int ESCAPE_QUOT = 195; - int APOS_ATTRIBUTE_CONTENT = 196; - int ESCAPE_APOS = 197; - int ELEMENT_CONTENT = 198; - int XML_COMMENT_END = 199; - int XML_PI_END = 200; - int XML_CDATA = 201; - int LITERAL_collection = 202; - int LITERAL_validate = 203; - int XML_PI_START = 204; - int XML_CDATA_START = 205; - int XML_CDATA_END = 206; - int LETTER = 207; - int DIGITS = 208; - int HEX_DIGITS = 209; - int NMSTART = 210; - int NMCHAR = 211; - int WS = 212; - int EXPR_COMMENT = 213; - int PREDEFINED_ENTITY_REF = 214; - int CHAR_REF = 215; - int S = 216; - int NEXT_TOKEN = 217; - int CHAR = 218; - int BASECHAR = 219; - int IDEOGRAPHIC = 220; - int COMBINING_CHAR = 221; - int DIGIT = 222; - int EXTENDER = 223; + int SEQUENCE = 50; + int LITERAL_xpointer = 51; + int LPAREN = 52; + int RPAREN = 53; + int NCNAME = 54; + int LITERAL_xquery = 55; + int LITERAL_version = 56; + int SEMICOLON = 57; + int LITERAL_module = 58; + int LITERAL_namespace = 59; + int EQ = 60; + int STRING_LITERAL = 61; + int LITERAL_declare = 62; + int LITERAL_default = 63; + // "boundary-space" = 64 + int LITERAL_ordering = 65; + int LITERAL_construction = 66; + // "base-uri" = 67 + // "copy-namespaces" = 68 + int LITERAL_option = 69; + int LITERAL_function = 70; + int LITERAL_variable = 71; + int LITERAL_import = 72; + int LITERAL_encoding = 73; + int LITERAL_collation = 74; + int LITERAL_element = 75; + int LITERAL_order = 76; + int LITERAL_empty = 77; + int LITERAL_greatest = 78; + int LITERAL_least = 79; + int LITERAL_preserve = 80; + int LITERAL_strip = 81; + int LITERAL_ordered = 82; + int LITERAL_unordered = 83; + int COMMA = 84; + // "no-preserve" = 85 + int LITERAL_inherit = 86; + // "no-inherit" = 87 + int DOLLAR = 88; + int LCURLY = 89; + int RCURLY = 90; + int COLON = 91; + int LITERAL_external = 92; + int LITERAL_schema = 93; + int LITERAL_as = 94; + int LITERAL_at = 95; + // "empty-sequence" = 96 + int QUESTION = 97; + int STAR = 98; + int PLUS = 99; + int LITERAL_item = 100; + int LITERAL_for = 101; + int LITERAL_let = 102; + int LITERAL_some = 103; + int LITERAL_every = 104; + int LITERAL_if = 105; + int LITERAL_typeswitch = 106; + int LITERAL_update = 107; + int LITERAL_replace = 108; + int LITERAL_value = 109; + int LITERAL_insert = 110; + int LITERAL_delete = 111; + int LITERAL_rename = 112; + int LITERAL_with = 113; + int LITERAL_into = 114; + int LITERAL_preceding = 115; + int LITERAL_following = 116; + int LITERAL_where = 117; + int LITERAL_return = 118; + int LITERAL_in = 119; + int LITERAL_by = 120; + int LITERAL_stable = 121; + int LITERAL_ascending = 122; + int LITERAL_descending = 123; + int LITERAL_group = 124; + int LITERAL_satisfies = 125; + int LITERAL_case = 126; + int LITERAL_then = 127; + int LITERAL_else = 128; + int LITERAL_or = 129; + int LITERAL_and = 130; + int LITERAL_instance = 131; + int LITERAL_of = 132; + int LITERAL_treat = 133; + int LITERAL_castable = 134; + int LITERAL_cast = 135; + int BEFORE = 136; + int AFTER = 137; + int LITERAL_eq = 138; + int LITERAL_ne = 139; + int LITERAL_lt = 140; + int LITERAL_le = 141; + int LITERAL_gt = 142; + int LITERAL_ge = 143; + int GT = 144; + int NEQ = 145; + int LT = 146; + int LTEQ = 147; + int LITERAL_is = 148; + int LITERAL_isnot = 149; + int ANDEQ = 150; + int OREQ = 151; + int LITERAL_to = 152; + int MINUS = 153; + int LITERAL_div = 154; + int LITERAL_idiv = 155; + int LITERAL_mod = 156; + int PRAGMA_START = 157; + int PRAGMA_END = 158; + int LITERAL_union = 159; + int UNION = 160; + int LITERAL_intersect = 161; + int LITERAL_except = 162; + int SLASH = 163; + int DSLASH = 164; + int LITERAL_text = 165; + int LITERAL_node = 166; + int LITERAL_attribute = 167; + int LITERAL_comment = 168; + // "processing-instruction" = 169 + // "document-node" = 170 + int LITERAL_document = 171; + int SELF = 172; + int XML_COMMENT = 173; + int XML_PI = 174; + int LPPAREN = 175; + int RPPAREN = 176; + int AT = 177; + int PARENT = 178; + int LITERAL_child = 179; + int LITERAL_self = 180; + int LITERAL_descendant = 181; + // "descendant-or-self" = 182 + // "following-sibling" = 183 + int LITERAL_parent = 184; + int LITERAL_ancestor = 185; + // "ancestor-or-self" = 186 + // "preceding-sibling" = 187 + int DOUBLE_LITERAL = 188; + int DECIMAL_LITERAL = 189; + int INTEGER_LITERAL = 190; + // "schema-element" = 191 + int END_TAG_START = 192; + int QUOT = 193; + int APOS = 194; + int QUOT_ATTRIBUTE_CONTENT = 195; + int ESCAPE_QUOT = 196; + int APOS_ATTRIBUTE_CONTENT = 197; + int ESCAPE_APOS = 198; + int ELEMENT_CONTENT = 199; + int XML_COMMENT_END = 200; + int XML_PI_END = 201; + int XML_CDATA = 202; + int LITERAL_collection = 203; + int LITERAL_validate = 204; + int XML_PI_START = 205; + int XML_CDATA_START = 206; + int XML_CDATA_END = 207; + int LETTER = 208; + int DIGITS = 209; + int HEX_DIGITS = 210; + int NMSTART = 211; + int NMCHAR = 212; + int WS = 213; + int EXPR_COMMENT = 214; + int PREDEFINED_ENTITY_REF = 215; + int CHAR_REF = 216; + int S = 217; + int NEXT_TOKEN = 218; + int CHAR = 219; + int BASECHAR = 220; + int IDEOGRAPHIC = 221; + int COMBINING_CHAR = 222; + int DIGIT = 223; + int EXTENDER = 224; } Modified: trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.txt =================================================================== --- trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.txt 2011-02-28 19:45:04 UTC (rev 13874) +++ trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.txt 2011-02-28 19:46:55 UTC (rev 13875) @@ -46,177 +46,178 @@ COMP_DOC_CONSTRUCTOR=47 PRAGMA=48 GTEQ=49 -LITERAL_xpointer="xpointer"=50 -LPAREN("opening parenthesis '('")=51 -RPAREN("closing parenthesis ')'")=52 -NCNAME("name")=53 -LITERAL_xquery="xquery"=54 -LITERAL_version="version"=55 -SEMICOLON("semicolon ';'")=56 -LITERAL_module="module"=57 -LITERAL_namespace="namespace"=58 -EQ("=")=59 -STRING_LITERAL("string literal")=60 -LITERAL_declare="declare"=61 -LITERAL_default="default"=62 -"boundary-space"=63 -LITERAL_ordering="ordering"=64 -LITERAL_construction="construction"=65 -"base-uri"=66 -"copy-namespaces"=67 -LITERAL_option="option"=68 -LITERAL_function="function"=69 -LITERAL_variable="variable"=70 -LITERAL_import="import"=71 -LITERAL_encoding="encoding"=72 -LITERAL_collation="collation"=73 -LITERAL_element="element"=74 -LITERAL_order="order"=75 -LITERAL_empty="empty"=76 -LITERAL_greatest="greatest"=77 -LITERAL_least="least"=78 -LITERAL_preserve="preserve"=79 -LITERAL_strip="strip"=80 -LITERAL_ordered="ordered"=81 -LITERAL_unordered="unordered"=82 -COMMA=83 -"no-preserve"=84 -LITERAL_inherit="inherit"=85 -"no-inherit"=86 -DOLLAR("dollar sign '$'")=87 -LCURLY("opening curly brace '{'")=88 -RCURLY("closing curly brace '}'")=89 -COLON=90 -LITERAL_external="external"=91 -LITERAL_schema="schema"=92 -LITERAL_as="as"=93 -LITERAL_at="at"=94 -"empty-sequence"=95 -QUESTION("question mark '?'")=96 -STAR("wildcard '*'")=97 -PLUS("+")=98 -LITERAL_item="item"=99 -LITERAL_for="for"=100 -LITERAL_let="let"=101 -LITERAL_some="some"=102 -LITERAL_every="every"=103 -LITERAL_if="if"=104 -LITERAL_typeswitch="typeswitch"=105 -LITERAL_update="update"=106 -LITERAL_replace="replace"=107 -LITERAL_value="value"=108 -LITERAL_insert="insert"=109 -LITERAL_delete="delete"=110 -LITERAL_rename="rename"=111 -LITERAL_with="with"=112 -LITERAL_into="into"=113 -LITERAL_preceding="preceding"=114 -LITERAL_following="following"=115 -LITERAL_where="where"=116 -LITERAL_return="return"=117 -LITERAL_in="in"=118 -LITERAL_by="by"=119 -LITERAL_stable="stable"=120 -LITERAL_ascending="ascending"=121 -LITERAL_descending="descending"=122 -LITERAL_group="group"=123 -LITERAL_satisfies="satisfies"=124 -LITERAL_case="case"=125 -LITERAL_then="then"=126 -LITERAL_else="else"=127 -LITERAL_or="or"=128 -LITERAL_and="and"=129 -LITERAL_instance="instance"=130 -LITERAL_of="of"=131 -LITERAL_treat="treat"=132 -LITERAL_castable="castable"=133 -LITERAL_cast="cast"=134 -BEFORE=135 -AFTER=136 -LITERAL_eq="eq"=137 -LITERAL_ne="ne"=138 -LITERAL_lt="lt"=139 -LITERAL_le="le"=140 -LITERAL_gt="gt"=141 -LITERAL_ge="ge"=142 -GT(">")=143 -NEQ("!=")=144 -LT("<")=145 -LTEQ("<=")=146 -LITERAL_is="is"=147 -LITERAL_isnot="isnot"=148 -ANDEQ("fulltext operator '&='")=149 -OREQ("fulltext operator '|='")=150 -LITERAL_to="to"=151 -MINUS("-")=152 -LITERAL_div="div"=153 -LITERAL_idiv="idiv"=154 -LITERAL_mod="mod"=155 -PRAGMA_START=156 -PRAGMA_END("pragma expression")=157 -LITERAL_union="union"=158 -UNION("union")=159 -LITERAL_intersect="intersect"=160 -LITERAL_except="except"=161 -SLASH("single slash '/'")=162 -DSLASH("double slash '//'")=163 -LITERAL_text="text"=164 -LITERAL_node="node"=165 -LITERAL_attribute="attribute"=166 -LITERAL_comment="comment"=167 -"processing-instruction"=168 -"document-node"=169 -LITERAL_document="document"=170 -SELF(".")=171 -XML_COMMENT("XML comment")=172 -XML_PI("processing instruction")=173 -LPPAREN("opening brace '['")=174 -RPPAREN("closing brace ']'")=175 -AT("@ char")=176 -PARENT("..")=177 -LITERAL_child="child"=178 -LITERAL_self="self"=179 -LITERAL_descendant="descendant"=180 -"descendant-or-self"=181 -"following-sibling"=182 -LITERAL_parent="parent"=183 -LITERAL_ancestor="ancestor"=184 -"ancestor-or-self"=185 -"preceding-sibling"=186 -DOUBLE_LITERAL=187 -DECIMAL_LITERAL=188 -INTEGER_LITERAL=189 -"schema-element"=190 -END_TAG_START("XML end tag")=191 -QUOT("double quote '\"'")=192 -APOS("single quote '")=193 -QUOT_ATTRIBUTE_CONTENT=194 -ESCAPE_QUOT=195 -APOS_ATTRIBUTE_CONTENT=196 -ESCAPE_APOS=197 -ELEMENT_CONTENT=198 -XML_COMMENT_END("end of XML comment")=199 -XML_PI_END("end of processing instruction")=200 -XML_CDATA("CDATA section")=201 -LITERAL_collection="collection"=202 -LITERAL_validate="validate"=203 -XML_PI_START("start of processing instruction")=204 -XML_CDATA_START("CDATA section start")=205 -XML_CDATA_END("end of CDATA section")=206 -LETTER=207 -DIGITS=208 -HEX_DIGITS=209 -NMSTART=210 -NMCHAR=211 -WS=212 -EXPR_COMMENT("XQuery comment")=213 -PREDEFINED_ENTITY_REF=214 -CHAR_REF=215 -S=216 -NEXT_TOKEN=217 -CHAR=218 -BASECHAR=219 -IDEOGRAPHIC=220 -COMBINING_CHAR=221 -DIGIT=222 -EXTENDER=223 +SEQUENCE=50 +LITERAL_xpointer="xpointer"=51 +LPAREN("opening parenthesis '('")=52 +RPAREN("closing parenthesis ')'")=53 +NCNAME("name")=54 +LITERAL_xquery="xquery"=55 +LITERAL_version="version"=56 +SEMICOLON("semicolon ';'")=57 +LITERAL_module="module"=58 +LITERAL_namespace="namespace"=59 +EQ("=")=60 +STRING_LITERAL("string literal")=61 +LITERAL_declare="declare"=62 +LITERAL_default="default"=63 +"boundary-space"=64 +LITERAL_ordering="ordering"=65 +LITERAL_construction="construction"=66 +"base-uri"=67 +"copy-namespaces"=68 +LITERAL_option="option"=69 +LITERAL_function="function"=70 +LITERAL_variable="variable"=71 +LITERAL_import="import"=72 +LITERAL_encoding="encoding"=73 +LITERAL_collation="collation"=74 +LITERAL_element="element"=75 +LITERAL_order="order"=76 +LITERAL_empty="empty"=77 +LITERAL_greatest="greatest"=78 +LITERAL_least="least"=79 +LITERAL_preserve="preserve"=80 +LITERAL_strip="strip"=81 +LITERAL_ordered="ordered"=82 +LITERAL_unordered="unordered"=83 +COMMA=84 +"no-preserve"=85 +LITERAL_inherit="inherit"=86 +"no-inherit"=87 +DOLLAR("dollar sign '$'")=88 +LCURLY("opening curly brace '{'")=89 +RCURLY("closing curly brace '}'")=90 +COLON=91 +LITERAL_external="external"=92 +LITERAL_schema="schema"=93 +LITERAL_as="as"=94 +LITERAL_at="at"=95 +"empty-sequence"=96 +QUESTION("question mark '?'")=97 +STAR("wildcard '*'")=98 +PLUS("+")=99 +LITERAL_item="item"=100 +LITERAL_for="for"=101 +LITERAL_let="let"=102 +LITERAL_some="some"=103 +LITERAL_every="every"=104 +LITERAL_if="if"=105 +LITERAL_typeswitch="typeswitch"=106 +LITERAL_update="update"=107 +LITERAL_replace="replace"=108 +LITERAL_value="value"=109 +LITERAL_insert="insert"=110 +LITERAL_delete="delete"=111 +LITERAL_rename="rename"=112 +LITERAL_with="with"=113 +LITERAL_into="into"=114 +LITERAL_preceding="preceding"=115 +LITERAL_following="following"=116 +LITERAL_where="where"=117 +LITERAL_return="return"=118 +LITERAL_in="in"=119 +LITERAL_by="by"=120 +LITERAL_stable="stable"=121 +LITERAL_ascending="ascending"=122 +LITERAL_descending="descending"=123 +LITERAL_group="group"=124 +LITERAL_satisfies="satisfies"=125 +LITERAL_case="case"=126 +LITERAL_then="then"=127 +LITERAL_else="else"=128 +LITERAL_or="or"=129 +LITERAL_and="and"=130 +LITERAL_instance="instance"=131 +LITERAL_of="of"=132 +LITERAL_treat="treat"=133 +LITERAL_castable="castable"=134 +LITERAL_cast="cast"=135 +BEFORE=136 +AFTER=137 +LITERAL_eq="eq"=138 +LITERAL_ne="ne"=139 +LITERAL_lt="lt"=140 +LITERAL_le="le"=141 +LITERAL_gt="gt"=142 +LITERAL_ge="ge"=143 +GT(">")=144 +NEQ("!=")=145 +LT("<")=146 +LTEQ("<=")=147 +LITERAL_is="is"=148 +LITERAL_isnot="isnot"=149 +ANDEQ("fulltext operator '&='")=150 +OREQ("fulltext operator '|='")=151 +LITERAL_to="to"=152 +MINUS("-")=153 +LITERAL_div="div"=154 +LITERAL_idiv="idiv"=155 +LITERAL_mod="mod"=156 +PRAGMA_START=157 +PRAGMA_END("pragma expression")=158 +LITERAL_union="union"=159 +UNION("union")=160 +LITERAL_intersect="intersect"=161 +LITERAL_except="except"=162 +SLASH("single slash '/'")=163 +DSLASH("double slash '//'")=164 +LITERAL_text="text"=165 +LITERAL_node="node"=166 +LITERAL_attribute="attribute"=167 +LITERAL_comment="comment"=168 +"processing-instruction"=169 +"document-node"=170 +LITERAL_document="document"=171 +SELF(".")=172 +XML_COMMENT("XML comment")=173 +XML_PI("processing instruction")=174 +LPPAREN("opening brace '['")=175 +RPPAREN("closing brace ']'")=176 +AT("@ char")=177 +PARENT("..")=178 +LITERAL_child="child"=179 +LITERAL_self="self"=180 +LITERAL_descendant="descendant"=181 +"descendant-or-self"=182 +"following-sibling"=183 +LITERAL_parent="parent"=184 +LITERAL_ancestor="ancestor"=185 +"ancestor-or-self"=186 +"preceding-sibling"=187 +DOUBLE_LITERAL=188 +DECIMAL_LITERAL=189 +INTEGER_LITERAL=190 +"schema-element"=191 +END_TAG_START("XML end tag")=192 +QUOT("double quote '\"'")=193 +APOS("single quote '")=194 +QUOT_ATTRIBUTE_CONTENT=195 +ESCAPE_QUOT=196 +APOS_ATTRIBUTE_CONTENT=197 +ESCAPE_APOS=198 +ELEMENT_CONTENT=199 +XML_COMMENT_END("end of XML comment")=200 +XML_PI_END("end of processing instruction")=201 +XML_CDATA("CDATA section")=202 +LITERAL_collection="collection"=203 +LITERAL_validate="validate"=204 +XML_PI_START("start of processing instruction")=205 +XML_CDATA_START("CDATA section start")=206 +XML_CDATA_END("end of CDATA section")=207 +LETTER=208 +DIGITS=209 +HEX_DIGITS=210 +NMSTART=211 +NMCHAR=212 +WS=213 +EXPR_COMMENT("XQuery comment")=214 +PREDEFINED_ENTITY_REF=215 +CHAR_REF=216 +S=217 +NEXT_TOKEN=218 +CHAR=219 +BASECHAR=220 +IDEOGRAPHIC=221 +COMBINING_CHAR=222 +DIGIT=223 +EXTENDER=224 Modified: trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java =================================================================== --- trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java 2011-02-28 19:45:04 UTC (rev 13874) +++ trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java 2011-02-28 19:46:55 UTC (rev 13875) @@ -89,111 +89,111 @@ caseSensitiveLiterals = true; setCaseSensitive(true); literals = new Hashtable(); - literals.put(new ANTLRHashString("treat", this), new Integer(132)); - literals.put(new ANTLRHashString("typeswitch", this), new Integer(105)); - literals.put(new ANTLRHashString("copy-namespaces", this), new Integer(67)); - literals.put(new ANTLRHashString("xpointer", this), new Integer(50)); - literals.put(new ANTLRHashString("namespace", this), new Integer(58)); - literals.put(new ANTLRHashString("no-preserve", this), new Integer(84)); - literals.put(new ANTLRHashString("comment", this), new Integer(167)); - literals.put(new ANTLRHashString("case", this), new Integer(125)); - literals.put(new ANTLRHashString("option", this), new Integer(68)); - literals.put(new ANTLRHashString("delete", this), new Integer(110)); - literals.put(new ANTLRHashString("ne", this), new Integer(138)); - literals.put(new ANTLRHashString("validate", this), new Integer(203)); - literals.put(new ANTLRHashString("le", this), new Integer(140)); - literals.put(new ANTLRHashString("greatest", this), new Integer(77)); - literals.put(new ANTLRHashString("ancestor-or-self", this), new Integer(185)); - literals.put(new ANTLRHashString("descendant-or-self", this), new Integer(181)); - literals.put(new ANTLRHashString("insert", this), new Integer(109)); - literals.put(new ANTLRHashString("variable", this), new Integer(70)); - literals.put(new ANTLRHashString("where", this), new Integer(116)); - literals.put(new ANTLRHashString("stable", this), new Integer(120)); - literals.put(new ANTLRHashString("construction", this), new Integer(65)); - literals.put(new ANTLRHashString("then", this), new Integer(126)); - literals.put(new ANTLRHashString("preceding", this), new Integer(114)); - literals.put(new ANTLRHashString("document-node", this), new Integer(169)); - literals.put(new ANTLRHashString("collation", this), new Integer(73)); - literals.put(new ANTLRHashString("to", this), new Integer(151)); - literals.put(new ANTLRHashString("and", this), new Integer(129)); - literals.put(new ANTLRHashString("module", this), new Integer(57)); - literals.put(new ANTLRHashString("strip", this), new Integer(80)); - literals.put(new ANTLRHashString("return", this), new Integer(117)); - literals.put(new ANTLRHashString("inherit", this), new Integer(85)); - literals.put(new ANTLRHashString("schema", this), new Integer(92)); - literals.put(new ANTLRHashString("external", this), new Integer(91)); - literals.put(new ANTLRHashString("unordered", this), new Integer(82)); - literals.put(new ANTLRHashString("ordered", this), new Integer(81)); - literals.put(new ANTLRHashString("mod", this), new Integer(155)); - literals.put(new ANTLRHashString("following", this), new Integer(115)); - literals.put(new ANTLRHashString("except", this), new Integer(161)); - literals.put(new ANTLRHashString("text", this), new Integer(164)); - literals.put(new ANTLRHashString("preserve", this), new Integer(79)); - literals.put(new ANTLRHashString("function", this), new Integer(69)); - literals.put(new ANTLRHashString("with", this), new Integer(112)); - literals.put(new ANTLRHashString("gt", this), new Integer(141)); - literals.put(new ANTLRHashString("preceding-sibling", this), new Integer(186)); - literals.put(new ANTLRHashString("intersect", this), new Integer(160)); - literals.put(new ANTLRHashString("version", this), new Integer(55)); - literals.put(new ANTLRHashString("at", this), new Integer(94)); - literals.put(new ANTLRHashString("of", this), new Integer(131)); - literals.put(new ANTLRHashString("is", this), new Integer(147)); - literals.put(new ANTLRHashString("empty-sequence", this), new Integer(95)); - literals.put(new ANTLRHashString("or", this), new Integer(128)); - literals.put(new ANTLRHashString("if", this), new Integer(104)); - literals.put(new ANTLRHashString("least", this), new Integer(78)); - literals.put(new ANTLRHashString("as", this), new Integer(93)); - literals.put(new ANTLRHashString("by", this), new Integer(119)); - literals.put(new ANTLRHashString("union", this), new Integer(158)); - literals.put(new ANTLRHashString("order", this), new Integer(75)); - literals.put(new ANTLRHashString("xquery", this), new Integer(54)); - literals.put(new ANTLRHashString("following-sibling", this), new Integer(182)); - literals.put(new ANTLRHashString("node", this), new Integer(165)); - literals.put(new ANTLRHashString("collection", this), new Integer(202)); - literals.put(new ANTLRHashString("some", this), new Integer(102)); - literals.put(new ANTLRHashString("ge", this), new Integer(142)); - literals.put(new ANTLRHashString("declare", this), new Integer(61)); - literals.put(new ANTLRHashString("for", this), new Integer(100)); - literals.put(new ANTLRHashString("ascending", this), new Integer(121)); - literals.put(new ANTLRHashString("isnot", this), new Integer(148)); - literals.put(new ANTLRHashString("eq", this), new Integer(137)); - literals.put(new ANTLRHashString("element", this), new Integer(74)); - literals.put(new ANTLRHashString("default", this), new Integer(62)); - literals.put(new ANTLRHashString("descending", this), new Integer(122)); - literals.put(new ANTLRHashString("castable", this), new Integer(133)); - literals.put(new ANTLRHashString("idiv", this), new Integer(154)); - literals.put(new ANTLRHashString("boundary-space", this), new Integer(63)); - literals.put(new ANTLRHashString("ancestor", this), new Integer(184)); - literals.put(new ANTLRHashString("ordering", this), new Integer(64)); - literals.put(new ANTLRHashString("instance", this), new Integer(130)); - literals.put(new ANTLRHashString("replace", this), new Integer(107)); - literals.put(new ANTLRHashString("no-inherit", this), new Integer(86)); - literals.put(new ANTLRHashString("attribute", this), new Integer(166)); - literals.put(new ANTLRHashString("empty", this), new Integer(76)); - literals.put(new ANTLRHashString("cast", this), new Integer(134)); - literals.put(new ANTLRHashString("value", this), new Integer(108)); - literals.put(new ANTLRHashString("encoding", this), new Integer(72)); - literals.put(new ANTLRHashString("schema-element", this), new Integer(190)); - literals.put(new ANTLRHashString("into", this), new Integer(113)); - literals.put(new ANTLRHashString("rename", this), new Integer(111)); - literals.put(new ANTLRHashString("else", this), new Integer(127)); - literals.put(new ANTLRHashString("import", this), new Integer(71)); - literals.put(new ANTLRHashString("lt", this), new Integer(139)); - literals.put(new ANTLRHashString("document", this), new Integer(170)); - literals.put(new ANTLRHashString("self", this), new Integer(179)); - literals.put(new ANTLRHashString("in", this), new Integer(118)); - literals.put(new ANTLRHashString("let", this), new Integer(101)); - literals.put(new ANTLRHashString("base-uri", this), new Integer(66)); - literals.put(new ANTLRHashString("processing-instruction", this), new Integer(168)); - literals.put(new ANTLRHashString("parent", this), new Integer(183)); - literals.put(new ANTLRHashString("descendant", this), new Integer(180)); - literals.put(new ANTLRHashString("update", this), new Integer(106)); - literals.put(new ANTLRHashString("every", this), new Integer(103)); - literals.put(new ANTLRHashString("group", this), new Integer(123)); - literals.put(new ANTLRHashString("satisfies", this), new Integer(124)); - literals.put(new ANTLRHashString("div", this), new Integer(153)); - literals.put(new ANTLRHashString("item", this), new Integer(99)); - literals.put(new ANTLRHashString("child", this), new Integer(178)); + literals.put(new ANTLRHashString("treat", this), new Integer(133)); + literals.put(new ANTLRHashString("typeswitch", this), new Integer(106)); + literals.put(new ANTLRHashString("copy-namespaces", this), new Integer(68)); + literals.put(new ANTLRHashString("xpointer", this), new Integer(51)); + literals.put(new ANTLRHashString("namespace", this), new Integer(59)); + literals.put(new ANTLRHashString("no-preserve", this), new Integer(85)); + literals.put(new ANTLRHashString("comment", this), new Integer(168)); + literals.put(new ANTLRHashString("case", this), new Integer(126)); + literals.put(new ANTLRHashString("option", this), new Integer(69)); + literals.put(new ANTLRHashString("delete", this), new Integer(111)); + literals.put(new ANTLRHashString("ne", this), new Integer(139)); + literals.put(new ANTLRHashString("validate", this), new Integer(204)); + literals.put(new ANTLRHashString("le", this), new Integer(141)); + literals.put(new ANTLRHashString("greatest", this), new Integer(78)); + literals.put(new ANTLRHashString("ancestor-or-self", this), new Integer(186)); + literals.put(new ANTLRHashString("descendant-or-self", this), new Integer(182)); + literals.put(new ANTLRHashString("insert", this), new Integer(110)); + literals.put(new ANTLRHashString("variable", this), new Integer(71)); + literals.put(new ANTLRHashString("where", this), new Integer(117)); + literals.put(new ANTLRHashString("stable", this), new Integer(121)); + literals.put(new ANTLRHashString("construction", this), new Integer(66)); + literals.put(new ANTLRHashString("then", this), new Integer(127)); + literals.put(new ANTLRHashString("preceding", this), new Integer(115)); + literals.put(new ANTLRHashString("document-node", this), new Integer(170)); + literals.put(new ANTLRHashString("collation", this), new Integer(74)); + literals.put(new ANTLRHashString("to", this), new Integer(152)); + literals.put(new ANTLRHashString("and", this), new Integer(130)); + literals.put(new ANTLRHashString("module", this), new Integer(58)); + literals.put(new ANTLRHashString("strip", this), new Integer(81)); + literals.put(new ANTLRHashString("return", this), new Integer(118)); + literals.put(new ANTLRHashString("inherit", this), new Integer(86)); + literals.put(new ANTLRHashString("schema", this), new Integer(93)); + literals.put(new ANTLRHashString("external", this), new Integer(92)); + literals.put(new ANTLRHashString("unordered", this), new Integer(83)); + literals.put(new ANTLRHashString("ordered", this), new Integer(82)); + literals.put(new ANTLRHashString("mod", this), new Integer(156)); + literals.put(new ANTLRHashString("following", this), new Integer(116)); + literals.put(new ANTLRHashString("except", this), new Integer(162)); + literals.put(new ANTLRHashString("text", this), new Integer(165)); + literals.put(new ANTLRHashString("preserve", this), new Integer(80)); + literals.put(new ANTLRHashString("function", this), new Integer(70)); + literals.put(new ANTLRHashString("with", this), new Integer(113)); + literals.put(new ANTLRHashString("gt", this), new Integer(142)); + literals.put(new ANTLRHashString("preceding-sibling", this), new Integer(187)); + literals.put(new ANTLRHashString("intersect", this), new Integer(161)); + literals.put(new ANTLRHashString("version", this), new Integer(56)); + literals.put(new ANTLRHashString("at", this), new Integer(95)); + literals.put(new ANTLRHashString("of", this), new Integer(132)); + literals.put(new ANTLRHashString("is", this), new Integer(148)); + literals.put(new ANTLRHashString("empty-sequence", this), new Integer(96)); + literals.put(new ANTLRHashString("or", this), new Integer(129)); + literals.put(new ANTLRHashString("if", this), new Integer(105)); + literals.put(new ANTLRHashString("least", this), new Integer(79)); + literals.put(new ANTLRHashString("as", this), new Integer(94)); + literals.put(new ANTLRHashString("by", this), new Integer(120)); + literals.put(new ANTLRHashString("union", this), new Integer(159)); + literals.put(new ANTLRHashString("order", this), new Integer(76)); + literals.put(new ANTLRHashString("xquery", this), new Integer(55)); + literals.put(new ANTLRHashString("following-sibling", this), new Integer(183)); + literals.put(new ANTLRHashString("node", this), new Integer(166)); + literals.put(new ANTLRHashString("collection", this), new Integer(203)); + literals.put(new ANTLRHashString("some", this), new Integer(103)); + literals.put(new ANTLRHashString("ge", this), new Integer(143)); + literals.put(new ANTLRHashString("declare", this), new Integer(62)); + literals.put(new ANTLRHashString("for", this), new Integer(101)); + literals.put(new ANTLRHashString("ascending", this), new Integer(122)); + literals.put(new ANTLRHashString("isnot", this), new Integer(149)); + literals.put(new ANTLRHashString("eq", this), new Integer(138)); + literals.put(new ANTLRHashString("element", this), new Integer(75)); + literals.put(new ANTLRHashString("default", this), new Integer(63)); + literals.put(new ANTLRHashString("descending", this), new Integer(123)); + literals.put(new ANTLRHashString("castable", this), new Integer(134)); + literals.put(new ANTLRHashString("idiv", this), new Integer(155)); + literals.put(new ANTLRHashString("boundary-space", this), new Integer(64)); + literals.put(new ANTLRHashString("ancestor", this), new Integer(185)); + literals.put(new ANTLRHashString("ordering", this), new Integer(65)); + literals.put(new ANTLRHashString("instance", this), new Integer(131)); + literals.put(new ANTLRHashString("replace", this), new Integer(108)); + literals.put(new ANTLRHashString("no-inherit", this), new Integer(87)); + literals.put(new ANTLRHashString("attribute", this), new Integer(167)); + literals.put(new ANTLRHashString("empty", this), new Integer(77)); + literals.put(new ANTLRHashString("cast", this), new Integer(135)); + literals.put(new ANTLRHashString("value", this), new Integer(109)); + literals.put(new ANTLRHashString("encoding", this), new Integer(73)); + literals.put(new ANTLRHashString("schema-element", this), new Integer(191)); + literals.put(new ANTLRHashString("into", this), new Integer(114)); + literals.put(new ANTLRHashString("rename", this), new Integer(112)); + literals.put(new ANTLRHashString("else", this), new Integer(128)); + literals.put(new ANTLRHashString("import", this), new Integer(72)); + literals.put(new ANTLRHashString("lt", this), new Integer(140)); + literals.put(new ANTLRHashString("document", this), new Integer(171)); + literals.put(new ANTLRHashString("self", this), new Integer(180)); + literals.put(new ANTLRHashString("in", this), new Integer(119)); + literals.put(new ANTLRHashString("let", this), new Integer(102)); + literals.put(new ANTLRHashString("base-uri", this), new Integer(67)); + literals.put(new ANTLRHashString("processing-instruction", this), new Integer(169)); + literals.put(new ANTLRHashString("parent", this), new Integer(184)); + literals.put(new ANTLRHashString("descendant", this), new Integer(181)); + literals.put(new ANTLRHashString("update", this), new Integer(107)); + literals.put(new ANTLRHashString("every", this), new Integer(104)); + literals.put(new ANTLRHashString("group", this), new Integer(124)); + literals.put(new ANTLRHashString("satisfies", this), new Integer(125)); + literals.put(new ANTLRHashString("div", this), new Integer(154)); + literals.put(new ANTLRHashString("item", this), new Integer(100)); + literals.put(new ANTLRHashString("child", this), new Integer(179)); } public Token nextToken() throws TokenStreamException { Modified: trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java =================================================================== --- trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java 2011-02-28 19:45:04 UTC (rev 13874) +++ trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java 2011-02-28 19:46:55 UTC (rev 13875) @@ -317,6 +317,10 @@ tmp46_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp46_AST); match(GTEQ); + org.exist.xquery.parser.XQueryAST tmp47_AST = null; + tmp47_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp47_AST); + match(SEQUENCE); imaginaryTokenDefinitions_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root; returnAST = imaginaryTokenDefinitions_AST; } @@ -333,9 +337,9 @@ switch ( LA(1)) { case LITERAL_xpointer: { - org.exist.xquery.parser.XQueryAST tmp47_AST = null; - tmp47_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp47_AST); + org.exist.xquery.parser.XQueryAST tmp48_AST = null; + tmp48_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp48_AST); match(LITERAL_xpointer); match(LPAREN); expr(); @@ -383,6 +387,7 @@ returnAST = null; ASTPair currentAST = new ASTPair(); org.exist.xquery.parser.XQueryAST expr_AST = null; + boolean isSequence = false; exprSingle(); astFactory.addASTChild(currentAST, returnAST); @@ -390,12 +395,12 @@ _loop107: do { if ((LA(1)==COMMA)) { - org.exist.xquery.parser.XQueryAST tmp50_AST = null; - tmp50_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp50_AST); match(COMMA); exprSingle(); astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + isSequence = true; + } } else { break _loop107; @@ -403,6 +408,17 @@ } while (true); } + if ( inputState.guessing==0 ) { + expr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root; + + if (isSequence) + expr_AST = (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(SEQUENCE,"sequence")).add(expr_AST)); + + currentAST.root = expr_AST; + currentAST.child = expr_AST!=null &&expr_AST.getFirstChild()!=null ? + expr_AST.getFirstChild() : expr_AST; + currentAST.advanceChildToEnd(); + } expr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root; returnAST = expr_AST; } @@ -427,9 +443,9 @@ } } - org.exist.xquery.parser.XQueryAST tmp51_AST = null; - tmp51_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp51_AST); + org.exist.xquery.parser.XQueryAST tmp52_AST = null; + tmp52_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp52_AST); match(Token.EOF_TYPE); xpath_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root; } @@ -533,13 +549,13 @@ Token enc = null; org.exist.xquery.parser.XQueryAST enc_AST = null; - org.exist.xquery.parser.XQueryAST tmp53_AST = null; - tmp53_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp53_AST); - match(LITERAL_xquery); org.exist.xquery.parser.XQueryAST tmp54_AST = null; tmp54_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp54_AST); + match(LITERAL_xquery); + org.exist.xquery.parser.XQueryAST tmp55_AST = null; + tmp55_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp55_AST); match(LITERAL_version); v = LT(1); v_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(v); @@ -612,10 +628,10 @@ case STRING_LITERAL: case LITERAL_declare: case LITERAL_default: - case 63: + case 64: case LITERAL_ordering: case LITERAL_construction: - case 66: + case 67: case LITERAL_option: case LITERAL_function: case LITERAL_variable: @@ -629,9 +645,9 @@ case LITERAL_strip: case LITERAL_ordered: case LITERAL_unordered: - case 84: + case 85: case LITERAL_inherit: - case 86: + case 87: case DOLLAR: case LITERAL_external: case LITERAL_schema: @@ -693,8 +709,8 @@ case LITERAL_node: case LITERAL_attribute: case LITERAL_comment: - case 168: case 169: + case 170: case LITERAL_document: case SELF: case XML_COMMENT: @@ -704,12 +720,12 @@ case LITERAL_child: case LITERAL_self: case LITERAL_descendant: - case 181: case 182: + case 183: case LITERAL_parent: case LITERAL_ancestor: - case 185: case 186: + case 187: case DOUBLE_LITERAL: case DECIMAL_LITERAL: case INTEGER_LITERAL: @@ -767,9 +783,9 @@ match(LITERAL_default); break; } - case 63: + case 64: { - match(63); + match(64); break; } case LITERAL_ordering: @@ -782,14 +798,14 @@ match(LITERAL_construction); break; } - case 66: + case 67: { - match(66); + match(67); break; } - case 67: + case 68: { - match(67); + match(68); break; } case LITERAL_namespace: @@ -1092,26 +1108,26 @@ } case LITERAL_order: { - org.exist.xquery.parser.XQueryAST tmp68_AST = null; - tmp68_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp68_AST); + org.exist.xquery.parser.XQueryAST tmp69_AST = null; + tmp69_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp69_AST); match(LITERAL_order); match(LITERAL_empty); { switch ( LA(1)) { case LITERAL_greatest: { - org.exist.xquery.parser.XQueryAST tmp70_AST = null; - tmp70_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp70_AST); + org.exist.xquery.parser.XQueryAST tmp71_AST = null; + tmp71_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp71_AST); match(LITERAL_greatest); break; } case LITERAL_least: { - org.exist.xquery.parser.XQueryAST tmp71_AST = null; - tmp71_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp71_AST); + org.exist.xquery.parser.XQueryAST tmp72_AST = null; + tmp72_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp72_AST); match(LITERAL_least); break; } @@ -1139,7 +1155,7 @@ try { { match(LITERAL_declare); - match(63); + match(64); } } catch (RecognitionException pe) { @@ -1150,25 +1166,25 @@ } if ( synPredMatched41 ) { match(LITERAL_declare); - org.exist.xquery.parser.XQueryAST tmp73_AST = null; - tmp73_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp73_AST); - match(63); + org.exist.xquery.parser.XQueryAST tmp74_AST = null; + tmp74_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp74_AST); + match(64); { switch ( LA(1)) { case LITERAL_preserve: { - org.exist.xquery.parser.XQueryAST tmp74_AST = null; - tmp74_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp74_AST); + org.exist.xquery.parser.XQueryAST tmp75_AST = null; + tmp75_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp75_AST); match(LITERAL_preserve); break; } case LITERAL_strip: { - org.exist.xquery.parser.XQueryAST tmp75_AST = null; - tmp75_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp75_AST); + org.exist.xquery.parser.XQueryAST tmp76_AST = null; + tmp76_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp76_AST); match(LITERAL_strip); break; } @@ -1188,7 +1204,7 @@ try { { match(LITERAL_declare); - match(66); + match(67); } } catch (RecognitionException pe) { @@ -1199,13 +1215,13 @@ } if ( synPredMatched44 ) { match(LITERAL_declare); - org.exist.xquery.parser.XQueryAST tmp77_AST = null; - tmp77_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp77_AST); - match(66); org.exist.xquery.parser.XQueryAST tmp78_AST = null; tmp78_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp78_AST); + astFactory.makeASTRoot(currentAST, tmp78_AST); + match(67); + org.exist.xquery.parser.XQueryAST tmp79_AST = null; + tmp79_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp79_AST); match(STRING_LITERAL); } else { @@ -1228,25 +1244,25 @@ } if ( synPredMatched46 ) { match(LITERAL_declare); - org.exist.xquery.parser.XQueryAST tmp80_AST = null; - tmp80_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp80_AST); + org.exist.xquery.parser.XQueryAST tmp81_AST = null; + tmp81_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp81_AST); match(LITERAL_ordering); { switch ( LA(1)) { case LITERAL_ordered: { - org.exist.xquery.parser.XQueryAST tmp81_AST = null; - tmp81_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp81_AST); + org.exist.xquery.parser.XQueryAST tmp82_AST = null; + tmp82_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp82_AST); match(LITERAL_ordered); break; } case LITERAL_unordered: { - org.exist.xquery.parser.XQueryAST tmp82_AST = null; - tmp82_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp82_AST); + org.exist.xquery.parser.XQueryAST tmp83_AST = null; + tmp83_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp83_AST); match(LITERAL_unordered); break; } @@ -1277,25 +1293,25 @@ } if ( synPredMatched49 ) { match(LITERAL_declare); - org.exist.xquery.parser.XQueryAST tmp84_AST = null; - tmp84_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp84_AST); + org.exist.xquery.parser.XQueryAST tmp85_AST = null; + tmp85_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp85_AST); match(LITERAL_construction); { switch ( LA(1)) { case LITERAL_preserve: { - org.exist.xquery.parser.XQueryAST tmp85_AST = null; - tmp85_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp85_AST); + org.exist.xquery.parser.XQueryAST tmp86_AST = null; + tmp86_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp86_AST); match(LITERAL_preserve); break; } case LITERAL_strip: { - org.exist.xquery.parser.XQueryAST tmp86_AST = null; - tmp86_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp86_AST); + org.exist.xquery.parser.XQueryAST tmp87_AST = null; + tmp87_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp87_AST); match(LITERAL_strip); break; } @@ -1315,7 +1331,7 @@ try { { match(LITERAL_declare); - match(67); + match(68); } } catch (RecognitionException pe) { @@ -1326,10 +1342,10 @@ } if ( synPredMatched52 ) { match(LITERAL_declare); - org.exist.xquery.parser.XQueryAST tmp88_AST = null; - tmp88_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp88_AST); - match(67); + org.exist.xquery.parser.XQueryAST tmp89_AST = null; + tmp89_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp89_AST); + match(68); preserveMode(); astFactory.addASTChild(currentAST, returnAST); match(COMMA); @@ -1385,9 +1401,9 @@ opt_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(opt); match(LITERAL_option); qn=qName(); - org.exist.xquery.parser.XQueryAST tmp90_AST = null; - tmp90_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp90_AST); + org.exist.xquery.parser.XQueryAST tmp91_AST = null; + tmp91_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp91_AST); match(STRING_LITERAL); if ( inputState.guessing==0 ) { optionDecl_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root; @@ -1468,9 +1484,9 @@ } case LITERAL_external: { - org.exist.xquery.parser.XQueryAST tmp94_AST = null; - tmp94_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp94_AST); + org.exist.xquery.parser.XQueryAST tmp95_AST = null; + tmp95_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp95_AST); match(LITERAL_external); break; } @@ -1567,9 +1583,9 @@ } case LITERAL_external: { - org.exist.xquery.parser.XQueryAST tmp101_AST = null; - tmp101_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp101_AST); + org.exist.xquery.parser.XQueryAST tmp102_AST = null; + tmp102_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp102_AST); match(LITERAL_external); break; } @@ -1624,9 +1640,9 @@ } } } - org.exist.xquery.parser.XQueryAST tmp103_AST = null; - tmp103_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp103_AST); + org.exist.xquery.parser.XQueryAST tmp104_AST = null; + tmp104_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp104_AST); match(STRING_LITERAL); { switch ( LA(1)) { @@ -1693,9 +1709,9 @@ } } } - org.exist.xquery.parser.XQueryAST tmp105_AST = null; - tmp105_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp105_AST); + org.exist.xquery.parser.XQueryAST tmp106_AST = null; + tmp106_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp106_AST); match(STRING_LITERAL); { switch ( LA(1)) { @@ -1740,18 +1756,18 @@ switch ( LA(1)) { case LITERAL_preserve: { - org.exist.xquery.parser.XQueryAST tmp106_AST = null; - tmp106_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp106_AST); + org.exist.xquery.parser.XQueryAST tmp107_AST = null; + tmp107_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp107_AST); match(LITERAL_preserve); break; } - case 84: + case 85: { - org.exist.xquery.parser.XQueryAST tmp107_AST = null; - tmp107_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp107_AST); - match(84); + org.exist.xquery.parser.XQueryAST tmp108_AST = null; + tmp108_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp108_AST); + match(85); break; } default: @@ -1774,18 +1790,18 @@ switch ( LA(1)) { case LITERAL_inherit: { - org.exist.xquery.parser.XQueryAST tmp108_AST = null; - tmp108_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp108_AST); + org.exist.xquery.parser.XQueryAST tmp109_AST = null; + tmp109_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp109_AST); match(LITERAL_inherit); break; } - case 86: + case 87: { - org.exist.xquery.parser.XQueryAST tmp109_AST = null; - tmp109_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp109_AST); - match(86); + org.exist.xquery.parser.XQueryAST tmp110_AST = null; + tmp110_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp110_AST); + match(87); break; } default: @@ -1813,9 +1829,9 @@ decl_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(decl); astFactory.addASTChild(currentAST, decl_AST); match(LITERAL_declare); - org.exist.xquery.parser.XQueryAST tmp110_AST = null; - tmp110_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp110_AST); + org.exist.xquery.parser.XQueryAST tmp111_AST = null; + tmp111_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp111_AST); match(LITERAL_namespace); prefix=ncnameOrKeyword(); astFactory.addASTChild(currentAST, returnAST); @@ -1869,10 +1885,10 @@ case LITERAL_namespace: case LITERAL_declare: case LITERAL_default: - case 63: + case 64: case LITERAL_ordering: case LITERAL_construction: - case 66: + case 67: case LITERAL_option: case LITERAL_function: case LITERAL_variable: @@ -1886,9 +1902,9 @@ case LITERAL_strip: case LITERAL_ordered: case LITERAL_unordered: - case 84: + case 85: case LITERAL_inherit: - case 86: + case 87: case LITERAL_external: case LITERAL_schema: case LITERAL_as: @@ -1942,17 +1958,17 @@ case LITERAL_node: case LITERAL_attribute: case LITERAL_comment: - case 169: + case 170: case LITERAL_document: case LITERAL_child: case LITERAL_self: case LITERAL_descendant: - case 181: case 182: + case 183: case LITERAL_parent: case LITERAL_ancestor: - case 185: case 186: + case 187: case LITERAL_collection: case LITERAL_validate: { @@ -2004,9 +2020,9 @@ name=ncnameOrKeyword(); nc1_AST = (org.exist.xquery.parser.XQueryAST)returnAST; astFactory.addASTChild(currentAST, returnAST); - org.exist.xquery.parser.XQueryAST tmp112_AST = null; - tmp112_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp112_AST); + org.exist.xquery.parser.XQueryAST tmp113_AST = null; + tmp113_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp113_AST); match(COLON); name2=ncnameOrKeyword(); astFactory.addASTChild(currentAST, returnAST); @@ -2038,9 +2054,9 @@ ASTPair currentAST = new ASTPair(); org.exist.xquery.parser.XQueryAST typeDeclaration_AST = null; - org.exist.xquery.parser.XQueryAST tmp113_AST = null; - tmp113_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp113_AST); + org.exist.xquery.parser.XQueryAST tmp114_AST = null; + tmp114_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp114_AST); match(LITERAL_as); sequenceType(); astFactory.addASTChild(currentAST, returnAST); @@ -2125,17 +2141,17 @@ } case LITERAL_default: { - org.exist.xquery.parser.XQueryAST tmp120_AST = null; - tmp120_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp120_AST); - match(LITERAL_default); org.exist.xquery.parser.XQueryAST tmp121_AST = null; tmp121_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp121_AST); - match(LITERAL_element); + match(LITERAL_default); org.exist.xquery.parser.XQueryAST tmp122_AST = null; tmp122_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp122_AST); + match(LITERAL_element); + org.exist.xquery.parser.XQueryAST tmp123_AST = null; + tmp123_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp123_AST); match(LITERAL_namespace); schemaPrefix_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root; break; @@ -2182,9 +2198,9 @@ ASTPair currentAST = new ASTPair(); org.exist.xquery.parser.XQueryAST returnType_AST = null; - org.exist.xquery.parser.XQueryAST tmp124_AST = null; - tmp124_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp124_AST); + org.exist.xquery.parser.XQueryAST tmp125_AST = null; + tmp125_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp125_AST); match(LITERAL_as); sequenceType(); astFactory.addASTChild(currentAST, returnAST); @@ -2199,9 +2215,9 @@ org.exist.xquery.parser.XQueryAST functionBody_AST = null; org.exist.xquery.parser.XQueryAST e_AST = null; - org.exist.xquery.parser.XQueryAST tmp125_AST = null; - tmp125_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp125_AST); + org.exist.xquery.parser.XQueryAST tmp126_AST = null; + tmp126_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp126_AST); match(LCURLY); expr(); e_AST = (org.exist.xquery.parser.XQueryAST)returnAST; @@ -2235,9 +2251,9 @@ inputState.guessing--; } if ( synPredMatched90 ) { - org.exist.xquery.parser.XQueryAST tmp127_AST = null; - tmp127_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp127_AST); + org.exist.xquery.parser.XQueryAST tmp128_AST = null; + tmp128_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp128_AST); match(LITERAL_empty); match(LPAREN); match(RPAREN); @@ -2245,13 +2261,13 @@ } else { boolean synPredMatched92 = false; - if (((LA(1)==95))) { + if (((LA(1)==96))) { int _m92 = mark(); synPredMatched92 = true; inputState.guessing++; try { { - match(95); + match(96); match(LPAREN); } } @@ -2262,10 +2278,10 @@ inputState.guessing--; } if ( synPredMatched92 ) { - org.exist.xquery.parser.XQueryAST tmp130_AST = null; - tmp130_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp130_AST); - match(95); + org.exist.xquery.parser.XQueryAST tmp131_AST = null; + tmp131_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp131_AST); + match(96); match(LPAREN); match(RPAREN); sequenceType_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root; @@ -2343,9 +2359,9 @@ ASTPair currentAST = new ASTPair(); org.exist.xquery.parser.XQueryAST uri_AST = null; - org.exist.xquery.parser.XQueryAST tmp134_AST = null; - tmp134_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp134_AST); + org.exist.xquery.parser.XQueryAST tmp135_AST = null; + tmp135_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp135_AST); match(STRING_LITERAL); uri_AST = (org.exist.xquery.parser.XQueryAST... [truncated message content] |