zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #04712
[Merge] lp:zorba/3.0 into lp:zorba
Matthias Brantner has proposed merging lp:zorba/3.0 into lp:zorba.
Requested reviews:
Zorba Coders (zorba-coders)
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/jsoniq/+merge/92168
Adds JSONiq.
--
The attached diff has been truncated due to its size.
https://code.launchpad.net/~zorba-coders/zorba/jsoniq/+merge/92168
Your team Zorba Coders is requested to review the proposed merge of lp:zorba/3.0 into lp:zorba.
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2012-02-09 00:24:44 +0000
@@ -0,0 +1,2 @@
+CMakeLists.txt.user
+build
=== modified file 'CMakeConfiguration.txt'
--- CMakeConfiguration.txt 2012-01-11 17:30:25 +0000
+++ CMakeConfiguration.txt 2012-02-09 00:24:44 +0000
@@ -152,6 +152,9 @@
SET(ZORBA_WITH_BIG_INTEGER OFF CACHE BOOL "enable arbitrary precision integers")
MESSAGE(STATUS "ZORBA_WITH_BIG_INTEGER: " ${ZORBA_WITH_BIG_INTEGER})
+SET(ZORBA_WITH_JSON ON CACHE BOOL "enable integrated JSON support")
+MESSAGE(STATUS "ZORBA_WITH_JSON: " ${ZORBA_WITH_JSON})
+
IF (ZORBA_SUPPRESS_SWIG)
SET (no_swig ON)
ELSE (ZORBA_SUPPRESS_SWIG)
=== modified file 'ChangeLog'
--- ChangeLog 2012-02-07 14:26:42 +0000
+++ ChangeLog 2012-02-09 00:24:44 +0000
@@ -36,6 +36,7 @@
* Fixed bug #918157 (Add XQFTTS to validation queue)
* Fixed bug with unversioned modules with C++ external functions
+
version 2.1
New Features:
=== added file 'NOTICE.txt'
--- NOTICE.txt 1970-01-01 00:00:00 +0000
+++ NOTICE.txt 2012-02-09 00:24:44 +0000
@@ -0,0 +1,740 @@
+-----------
+Zorba 2.1.0
+-----------
+
+(Note: This file is generated automatically from NOTICE.xml.
+Please do not modify this file directly.)
+
+
+
+
+Apache 2
+
+ Copyright 2006-2011 The FLWOR Foundation
+
+ See LICENSE.txt for license information.
+
+ ------------------------
+ This product includes software developed at
+ The FLWOR Foundation (http://www.flworfound.org/).
+
+ ------------------------
+ Portions of this software were developed at the Systems
+ Group of the ETH Zurich, Switzerland.
+
+
+Other files used by this project:
+----------------------------------------------------
+
+src/zorbatypes/m_apm.h
+src/zorbatypes/mapm/
+
+Copyright: 1999-2007 Michael C. Ring
+Website: http://www.tc.umn.edu/~ringx004/mapm-main.html
+
+ This software is Freeware.
+
+ Permission to use, copy, and distribute this software and its
+ documentation for any purpose with or without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and
+ that both that copyright notice and this permission notice appear
+ in supporting documentation.
+
+ Permission to modify the software is granted. Permission to distribute
+ the modified code is granted. Modifications are to be distributed by
+ using the file 'license.txt' as a template to modify the file header.
+ 'license.txt' is available in the official MAPM distribution.
+
+ To distribute modified source code, insert the file 'license.txt'
+ at the top of all modified source code files and edit accordingly.
+
+ This software is provided "as is" without express or implied warranty.
+
+----------------------------------------------------
+
+src/zorbamisc/config/stdint.h
+
+Copyright: 2006 Alexander Chemeris
+
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. The name of the author may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------
+
+src/zorbautils/stemmer/
+
+Copyright: 2001 Dr. Martin Porter
+
+
+ All the software given out on this Snowball site is covered by the BSD
+ License (see http://www.opensource.org/licenses/bsd-license.html), with
+ Copyright (c) 2001, Dr Martin Porter, and (for the Java developments)
+ Copyright (c) 2002, Richard Boulton.
+
+ Essentially, all this means is that you can do what you like with the code,
+ except claim another Copyright for it, or claim that it is issued under a
+ different license. The software is also issued without warranties, which
+ means that if anyone suffers through its use, they cannot come back and sue
+ you. You also have to alert anyone to whom you give the Snowball software to
+ the fact that it is covered by the BSD license.
+
+ We have not bothered to insert the licensing arrangement into the text of
+ the Snowball software.
+
+----------------------------------------------------
+
+src/util/less.h
+
+Copyright: 1998 Paul J. Lucas
+
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ o Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ o The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------
+
+src/util/auto_vector.h (has been modified)
+
+Copyright: 2003 Reliable Software
+
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ o Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ o The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------
+
+cmake_modules/FindBoost.cmake
+
+Copyright:
+ 2006-2008 Andreas Schneider <mail@xxxxxxxxxxxx>
+ 2007 Wengo
+ 2007 Mike Jackson
+ 2008 Andreas Pakulat <apaku@xxxxxx>
+
+
+
+ Redistribution AND use is allowed according to the terms of the New BSD license.
+ For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+----------------------------------------------------
+
+cmake_modules/FindJNI.cmake
+cmake_modules/FindPythonLibs.cmake
+cmake_modules/FindSWIG.cmake
+
+Copyright: 2001-2009 Kitware, Inc.
+
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the names of Kitware, Inc., the Insight Software Consortium,
+ nor the names of their contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ ------------------------------------------------------------------------------
+
+ The above copyright and license notice applies to distributions of
+ CMake in source and binary form. Some source files contain additional
+ notices of original copyright by their contributors; see each source
+ for details. Third-party software packages supplied with CMake under
+ compatible licenses provide their own copyright notices documented in
+ corresponding subdirectories.
+
+ ------------------------------------------------------------------------------
+
+ CMake was initially developed by Kitware with the following sponsorship:
+
+ * National Library of Medicine at the National Institutes of Health
+ as part of the Insight Segmentation and Registration Toolkit (ITK).
+
+ * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
+ Visualization Initiative.
+
+ * National Alliance for Medical Image Computing (NAMIC) is funded by the
+ National Institutes of Health through the NIH Roadmap for Medical Research,
+ Grant U54 EB005149.
+
+ * Kitware, Inc.
+
+----------------------------------------------------
+
+/xml.xsd
+
+Copyright: 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
+
+
+ All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+ W3C Software Notice and License
+
+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+ License
+
+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+ Disclaimers
+
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+
+----------------------------------------------------
+
+schemas/xslt-xquery-serialization.xsd
+
+Copyright: 2010 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
+
+
+ All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+ W3C Software Notice and License
+
+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+ License
+
+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+ Disclaimers
+
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+
+----------------------------------------------------
+
+modules/w3c/xpath-functions.xsd
+
+Copyright: 2005 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
+
+
+ All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+ W3C Software Notice and License
+
+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+ License
+
+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+ Disclaimers
+
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+
+----------------------------------------------------
+
+include/xqc.h
+
+Copyright: 2008, Matthias Brantner, John Snelson
+
+
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the developers nor the names of contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------
+
+modules/functx/functx.xq
+
+Copyright: 2007 Datypic
+
+
+ : This library is free software; you can redistribute it and/or
+ : modify it under the terms of the GNU Lesser General Public
+ : License as published by the Free Software Foundation; either
+ : version 2.1 of the License.
+
+ : This library 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
+ : Lesser General Public License for more details.
+
+ : You should have received a copy of the GNU Lesser General Public
+ : License along with this library; if not, write to the Free Software
+ : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+----------------------------------------------------
+
+src/compiler/parser/FlexLexer.h
+
+Copyright: 1993 The Regents of the University of California
+
+
+ // All rights reserved.
+ //
+ // This code is derived from software contributed to Berkeley by
+ // Kent Williams and Tom Epperly.
+ //
+ // Redistribution and use in source and binary forms, with or without
+ // modification, are permitted provided that the following conditions
+ // are met:
+
+ // 1. Redistributions of source code must retain the above copyright
+ // notice, this list of conditions and the following disclaimer.
+ // 2. Redistributions in binary form must reproduce the above copyright
+ // notice, this list of conditions and the following disclaimer in the
+ // documentation and/or other materials provided with the distribution.
+
+ // Neither the name of the University nor the names of its contributors
+ // may be used to endorse or promote products derived from this software
+ // without specific prior written permission.
+
+ // THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ // IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ // PURPOSE.
+
+----------------------------------------------------
+
+src/diagnostics/StackWalker.cpp
+src/diagnostics/StackWalker.h
+
+Copyright: 2005 Jochen Kalmbach
+
+
+ Under BSD License: http://www.opensource.org/licenses/bsd-license.php
+
+----------------------------------------------------
+
+src/util/singleton.h
+src/util/threads.h
+
+Copyright: 2001 Andrei Alexandrescu
+
+
+ This code accompanies the book:
+ Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
+ Patterns Applied". Copyright (c) 2001. Addison-Wesley.
+ Permission to use, copy, modify, distribute and sell this software for any
+ purpose is hereby granted without fee, provided that the above copyright
+ notice appear in all copies and that both that copyright notice and this
+ permission notice appear in supporting documentation.
+ The author or Addison-Wesley Longman make no representations about the
+ suitability of this software for any purpose. It is provided "as is"
+ without express or implied warranty.
+
+
+External libraries used by this project:
+----------------------------------------------------
+
+Name: LIBXML2
+Preferred version: 2.2.16 or higher
+Is mandatory: true
+Website: http://xmlsoft.org/
+License: MIT
+Copyright: 1998-2002 Daniel Veillard. All Rights Reserved.
+External notice:
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name of Daniel Veillard shall not
+ be used in advertising or otherwise to promote the sale, use or other deal-
+ ings in this Software without prior written authorization from him.
+
+----------------------------------------------------
+
+Name: LIBXSLT
+Preferred version: 1.1.26
+Is mandatory: false
+Website: http://xmlsoft.org/XSLT/
+License: MIT
+Copyright: 2001-2002 Daniel Veillard. All Rights Reserved.
+External notice:
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+ Except as contained in this notice, the name of Daniel Veillard shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from him.
+
+
+----------------------------------------------------
+
+Name: ICU4C
+Preferred version: 3.6 or higher
+Is mandatory: true
+Website: http://www.icu-project.org/
+License: ICU License
+Copyright: 1995-2011 International Business Machines Corporation and others
+External notice:
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+ Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
+
+----------------------------------------------------
+
+Name: CURL
+Preferred version: above 7.12
+Is mandatory: false
+Website: http://curl.haxx.se/
+License: MIT/X derivate license
+Copyright: 1996 - 2011, Daniel Stenberg, <daniel@xxxxxxx>.
+External notice:
+
+ All rights reserved.
+
+ Permission to use, copy, modify, and distribute this software for any purpose
+ with or without fee is hereby granted, provided that the above copyright
+ notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+ OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name of a copyright holder shall not
+ be used in advertising or otherwise to promote the sale, use or other dealings
+ in this Software without prior written authorization of the copyright holder.
+
+----------------------------------------------------
+
+Name: ICONV
+Preferred version: above 1.12
+Is mandatory: true
+Website: http://www.gnu.org/software/libiconv/
+License: LGPL
+Copyright: 1998, 2010 Free Software Foundation, Inc.
+External notice:
+
+----------------------------------------------------
+
+Name: ZLIB
+Preferred version: 1.2.5
+Is mandatory: true
+Website: http://www.zlib.net/
+Copyright: 1995-2004 Jean-loup Gailly and Mark Adler
+External notice:
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly jloup@xxxxxxxx
+ Mark Adler madler@xxxxxxxxxxxxxxxxxx
+
+----------------------------------------------------
+
+Name: XERCES
+Preferred version: 2.8.0 or higher
+Is mandatory: true
+Website: http://xerces.apache.org/xerces-c/
+License: Apache 2
+Copyright: Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.
+External notice:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+----------------------------------------------------
+
+Name: BOOST (boost_filesystem)
+Preferred version: 1.32 or higher
+Is mandatory: false
+Website: http://www.boost.org/
+License: Boost Software License v1.0
+Copyright:
+ Beman Dawes, David Abrahams, 1998-2005.
+ Rene Rivera 2004-2007
+
+External notice:
+
+ Permission is hereby granted, free of charge, to any person or organization
+ obtaining a copy of the software and accompanying documentation covered by
+ this license (the "Software") to use, reproduce, display, distribute,
+ execute, and transmit the Software, and to prepare derivative works of the
+ Software, and to permit third-parties to whom the Software is furnished to
+ do so, all subject to the following:
+
+ The copyright notices in the Software and this entire statement, including
+ the above license grant, this restriction and the following disclaimer,
+ must be included in all copies of the Software, in whole or in part, and
+ all derivative works of the Software, unless such copies or derivative
+ works are solely in the form of machine-executable object code generated by
+ a source language processor.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+External applications used by this project:
+----------------------------------------------------
+
+Name: FLEX
+Preferred version: 2.5.33
+Is mandatory: false
+Website: http://flex.sourceforge.net/
+Copyright:
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The Flex Project.
+ 1990, 1997 The Regents of the University of California. All rights reserved.
+
+External notice:
+
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+ Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+----------------------------------------------------
+
+Name: BISON
+Preferred version: 2.4 or higher
+Is mandatory: false
+Website: http://www.gnu.org/software/bison/
+License: GPL
+Copyright: 1998, 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+External notice:
+
+----------------------------------------------------
+
+Name: DOXYGEN
+Preferred version: v1.7.4
+Is mandatory: false
+Website: www.doxygen.org
+License: GPL
+Copyright: 1997-2011 by Dimitri van Heesch
+External notice:
+
+ Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted.
+ No representations are made about the suitability of this software for any purpose.
+ It is provided "as is" without express or implied warranty.
+ See the GNU General Public License for more details.
+
+ Documents produced by doxygen are derivative works derived from the input used in their production; they are not affected by this license.
+
+----------------------------------------------------
+
+Name: CMAKE
+Preferred version: 2.8.4
+Is mandatory: true
+Website: http://www.cmake.org/
+License: Creative Commons Attribution-NoDerivs 3.0 Unported License
+Copyright: 2000-2009 Kitware, Inc., Insight Software Consortium. All rights reserved.
+External notice:
+
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+ Neither the names of Kitware, Inc., the Insight Software Consortium, nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------
+
+Name: SWIG
+Preferred version: 2.0.4 or above
+Is mandatory: false
+Website: http://www.swig.org/
+License: GPL
+Copyright:
+ 1995-2011 The SWIG Developers
+ 2005-2006 Arizona Board of Regents (University of Arizona).
+ 1998-2005 University of Chicago.
+ 1995-1998 The University of Utah and the Regents of the University of California
+
+External notice:
+
+ SWIG 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 3 of the License, or
+ (at your option) any later version. See the LICENSE-GPL file for
+ the full terms of the GNU General Public license version 3.
+
+ Portions of SWIG are also licensed under the terms of the licenses
+ in the file LICENSE-UNIVERSITIES. You must observe the terms of
+ these licenses, as well as the terms of the GNU General Public License,
+ when you distribute SWIG.
+
+ The SWIG library and examples, under the Lib and Examples top level
+ directories, are distributed under the following terms:
+
+ You may copy, modify, distribute, and make derivative works based on
+ this software, in source code or object code form, without
+ restriction. If you distribute the software to others, you may do
+ so according to the terms of your choice. This software is offered as
+ is, without warranty of any kind.
+
+ See the COPYRIGHT file for a list of contributors to SWIG and their
+ copyright notices.
+
\ No newline at end of file
=== removed file 'NOTICE.txt'
--- NOTICE.txt 2011-10-21 08:09:17 +0000
+++ NOTICE.txt 1970-01-01 00:00:00 +0000
@@ -1,740 +0,0 @@
------------
-Zorba 2.1.0
------------
-
-(Note: This file is generated automatically from NOTICE.xml.
-Please do not modify this file directly.)
-
-
-
-
-Apache 2
-
- Copyright 2006-2011 The FLWOR Foundation
-
- See LICENSE.txt for license information.
-
- ------------------------
- This product includes software developed at
- The FLWOR Foundation (http://www.flworfound.org/).
-
- ------------------------
- Portions of this software were developed at the Systems
- Group of the ETH Zurich, Switzerland.
-
-
-Other files used by this project:
-----------------------------------------------------
-
-src/zorbatypes/m_apm.h
-src/zorbatypes/mapm/
-
-Copyright: 1999-2007 Michael C. Ring
-Website: http://www.tc.umn.edu/~ringx004/mapm-main.html
-
- This software is Freeware.
-
- Permission to use, copy, and distribute this software and its
- documentation for any purpose with or without fee is hereby granted,
- provided that the above copyright notice appear in all copies and
- that both that copyright notice and this permission notice appear
- in supporting documentation.
-
- Permission to modify the software is granted. Permission to distribute
- the modified code is granted. Modifications are to be distributed by
- using the file 'license.txt' as a template to modify the file header.
- 'license.txt' is available in the official MAPM distribution.
-
- To distribute modified source code, insert the file 'license.txt'
- at the top of all modified source code files and edit accordingly.
-
- This software is provided "as is" without express or implied warranty.
-
-----------------------------------------------------
-
-src/zorbamisc/config/stdint.h
-
-Copyright: 2006 Alexander Chemeris
-
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. The name of the author may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-----------------------------------------------------
-
-src/zorbautils/stemmer/
-
-Copyright: 2001 Dr. Martin Porter
-
-
- All the software given out on this Snowball site is covered by the BSD
- License (see http://www.opensource.org/licenses/bsd-license.html), with
- Copyright (c) 2001, Dr Martin Porter, and (for the Java developments)
- Copyright (c) 2002, Richard Boulton.
-
- Essentially, all this means is that you can do what you like with the code,
- except claim another Copyright for it, or claim that it is issued under a
- different license. The software is also issued without warranties, which
- means that if anyone suffers through its use, they cannot come back and sue
- you. You also have to alert anyone to whom you give the Snowball software to
- the fact that it is covered by the BSD license.
-
- We have not bothered to insert the licensing arrangement into the text of
- the Snowball software.
-
-----------------------------------------------------
-
-src/util/less.h
-
-Copyright: 1998 Paul J. Lucas
-
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- o Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- o Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- o The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
-----------------------------------------------------
-
-src/util/auto_vector.h (has been modified)
-
-Copyright: 2003 Reliable Software
-
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- o Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- o Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- o The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
-----------------------------------------------------
-
-cmake_modules/FindBoost.cmake
-
-Copyright:
- 2006-2008 Andreas Schneider <mail@xxxxxxxxxxxx>
- 2007 Wengo
- 2007 Mike Jackson
- 2008 Andreas Pakulat <apaku@xxxxxx>
-
-
-
- Redistribution AND use is allowed according to the terms of the New BSD license.
- For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-----------------------------------------------------
-
-cmake_modules/FindJNI.cmake
-cmake_modules/FindPythonLibs.cmake
-cmake_modules/FindSWIG.cmake
-
-Copyright: 2001-2009 Kitware, Inc.
-
-
- Distributed under the OSI-approved BSD License (the "License");
- see accompanying file Copyright.txt for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License for more information.
-
- CMake - Cross Platform Makefile Generator
- Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the names of Kitware, Inc., the Insight Software Consortium,
- nor the names of their contributors may be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- ------------------------------------------------------------------------------
-
- The above copyright and license notice applies to distributions of
- CMake in source and binary form. Some source files contain additional
- notices of original copyright by their contributors; see each source
- for details. Third-party software packages supplied with CMake under
- compatible licenses provide their own copyright notices documented in
- corresponding subdirectories.
-
- ------------------------------------------------------------------------------
-
- CMake was initially developed by Kitware with the following sponsorship:
-
- * National Library of Medicine at the National Institutes of Health
- as part of the Insight Segmentation and Registration Toolkit (ITK).
-
- * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
- Visualization Initiative.
-
- * National Alliance for Medical Image Computing (NAMIC) is funded by the
- National Institutes of Health through the NIH Roadmap for Medical Research,
- Grant U54 EB005149.
-
- * Kitware, Inc.
-
-----------------------------------------------------
-
-/xml.xsd
-
-Copyright: 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
-
-
- All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
-
- W3C Software Notice and License
-
- This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
-
- License
-
- By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
-
- Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
- •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
- •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
- •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
-
- Disclaimers
-
- THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
-
- The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
-
-----------------------------------------------------
-
-schemas/xslt-xquery-serialization.xsd
-
-Copyright: 2010 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
-
-
- All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
-
- W3C Software Notice and License
-
- This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
-
- License
-
- By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
-
- Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
- •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
- •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
- •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
-
- Disclaimers
-
- THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
-
- The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
-
-----------------------------------------------------
-
-modules/w3c/xpath-functions.xsd
-
-Copyright: 2005 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
-
-
- All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
-
- W3C Software Notice and License
-
- This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
-
- License
-
- By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
-
- Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
- •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
- •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
- •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
-
- Disclaimers
-
- THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
-
- The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
-
-----------------------------------------------------
-
-include/xqc.h
-
-Copyright: 2008, Matthias Brantner, John Snelson
-
-
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the developers nor the names of contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
-
-----------------------------------------------------
-
-modules/functx/functx.xq
-
-Copyright: 2007 Datypic
-
-
- : This library is free software; you can redistribute it and/or
- : modify it under the terms of the GNU Lesser General Public
- : License as published by the Free Software Foundation; either
- : version 2.1 of the License.
-
- : This library 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
- : Lesser General Public License for more details.
-
- : You should have received a copy of the GNU Lesser General Public
- : License along with this library; if not, write to the Free Software
- : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----------------------------------------------------
-
-src/compiler/parser/FlexLexer.h
-
-Copyright: 1993 The Regents of the University of California
-
-
- // All rights reserved.
- //
- // This code is derived from software contributed to Berkeley by
- // Kent Williams and Tom Epperly.
- //
- // Redistribution and use in source and binary forms, with or without
- // modification, are permitted provided that the following conditions
- // are met:
-
- // 1. Redistributions of source code must retain the above copyright
- // notice, this list of conditions and the following disclaimer.
- // 2. Redistributions in binary form must reproduce the above copyright
- // notice, this list of conditions and the following disclaimer in the
- // documentation and/or other materials provided with the distribution.
-
- // Neither the name of the University nor the names of its contributors
- // may be used to endorse or promote products derived from this software
- // without specific prior written permission.
-
- // THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- // IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- // PURPOSE.
-
-----------------------------------------------------
-
-src/diagnostics/StackWalker.cpp
-src/diagnostics/StackWalker.h
-
-Copyright: 2005 Jochen Kalmbach
-
-
- Under BSD License: http://www.opensource.org/licenses/bsd-license.php
-
-----------------------------------------------------
-
-src/util/singleton.h
-src/util/threads.h
-
-Copyright: 2001 Andrei Alexandrescu
-
-
- This code accompanies the book:
- Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
- Patterns Applied". Copyright (c) 2001. Addison-Wesley.
- Permission to use, copy, modify, distribute and sell this software for any
- purpose is hereby granted without fee, provided that the above copyright
- notice appear in all copies and that both that copyright notice and this
- permission notice appear in supporting documentation.
- The author or Addison-Wesley Longman make no representations about the
- suitability of this software for any purpose. It is provided "as is"
- without express or implied warranty.
-
-
-External libraries used by this project:
-----------------------------------------------------
-
-Name: LIBXML2
-Preferred version: 2.2.16 or higher
-Is mandatory: true
-Website: http://xmlsoft.org/
-License: MIT
-Copyright: 1998-2002 Daniel Veillard. All Rights Reserved.
-External notice:
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name of Daniel Veillard shall not
- be used in advertising or otherwise to promote the sale, use or other deal-
- ings in this Software without prior written authorization from him.
-
-----------------------------------------------------
-
-Name: LIBXSLT
-Preferred version: 1.1.26
-Is mandatory: false
-Website: http://xmlsoft.org/XSLT/
-License: MIT
-Copyright: 2001-2002 Daniel Veillard. All Rights Reserved.
-External notice:
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
- Except as contained in this notice, the name of Daniel Veillard shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from him.
-
-
-----------------------------------------------------
-
-Name: ICU4C
-Preferred version: 3.6 or higher
-Is mandatory: true
-Website: http://www.icu-project.org/
-License: ICU License
-Copyright: 1995-2011 International Business Machines Corporation and others
-External notice:
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
-
-----------------------------------------------------
-
-Name: CURL
-Preferred version: above 7.12
-Is mandatory: false
-Website: http://curl.haxx.se/
-License: MIT/X derivate license
-Copyright: 1996 - 2011, Daniel Stenberg, <daniel@xxxxxxx>.
-External notice:
-
- All rights reserved.
-
- Permission to use, copy, modify, and distribute this software for any purpose
- with or without fee is hereby granted, provided that the above copyright
- notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
- OR OTHER DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name of a copyright holder shall not
- be used in advertising or otherwise to promote the sale, use or other dealings
- in this Software without prior written authorization of the copyright holder.
-
-----------------------------------------------------
-
-Name: ICONV
-Preferred version: above 1.12
-Is mandatory: true
-Website: http://www.gnu.org/software/libiconv/
-License: LGPL
-Copyright: 1998, 2010 Free Software Foundation, Inc.
-External notice:
-
-----------------------------------------------------
-
-Name: ZLIB
-Preferred version: 1.2.5
-Is mandatory: true
-Website: http://www.zlib.net/
-Copyright: 1995-2004 Jean-loup Gailly and Mark Adler
-External notice:
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly jloup@xxxxxxxx
- Mark Adler madler@xxxxxxxxxxxxxxxxxx
-
-----------------------------------------------------
-
-Name: XERCES
-Preferred version: 2.8.0 or higher
-Is mandatory: true
-Website: http://xerces.apache.org/xerces-c/
-License: Apache 2
-Copyright: Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.
-External notice:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-----------------------------------------------------
-
-Name: BOOST (boost_filesystem)
-Preferred version: 1.32 or higher
-Is mandatory: false
-Website: http://www.boost.org/
-License: Boost Software License v1.0
-Copyright:
- Beman Dawes, David Abrahams, 1998-2005.
- Rene Rivera 2004-2007
-
-External notice:
-
- Permission is hereby granted, free of charge, to any person or organization
- obtaining a copy of the software and accompanying documentation covered by
- this license (the "Software") to use, reproduce, display, distribute,
- execute, and transmit the Software, and to prepare derivative works of the
- Software, and to permit third-parties to whom the Software is furnished to
- do so, all subject to the following:
-
- The copyright notices in the Software and this entire statement, including
- the above license grant, this restriction and the following disclaimer,
- must be included in all copies of the Software, in whole or in part, and
- all derivative works of the Software, unless such copies or derivative
- works are solely in the form of machine-executable object code generated by
- a source language processor.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
- SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
- FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
-
-External applications used by this project:
-----------------------------------------------------
-
-Name: FLEX
-Preferred version: 2.5.33
-Is mandatory: false
-Website: http://flex.sourceforge.net/
-Copyright:
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The Flex Project.
- 1990, 1997 The Regents of the University of California. All rights reserved.
-
-External notice:
-
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
- Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
-----------------------------------------------------
-
-Name: BISON
-Preferred version: 2.4 or higher
-Is mandatory: false
-Website: http://www.gnu.org/software/bison/
-License: GPL
-Copyright: 1998, 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-External notice:
-
-----------------------------------------------------
-
-Name: DOXYGEN
-Preferred version: v1.7.4
-Is mandatory: false
-Website: www.doxygen.org
-License: GPL
-Copyright: 1997-2011 by Dimitri van Heesch
-External notice:
-
- Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted.
- No representations are made about the suitability of this software for any purpose.
- It is provided "as is" without express or implied warranty.
- See the GNU General Public License for more details.
-
- Documents produced by doxygen are derivative works derived from the input used in their production; they are not affected by this license.
-
-----------------------------------------------------
-
-Name: CMAKE
-Preferred version: 2.8.4
-Is mandatory: true
-Website: http://www.cmake.org/
-License: Creative Commons Attribution-NoDerivs 3.0 Unported License
-Copyright: 2000-2009 Kitware, Inc., Insight Software Consortium. All rights reserved.
-External notice:
-
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
- Neither the names of Kitware, Inc., the Insight Software Consortium, nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-----------------------------------------------------
-
-Name: SWIG
-Preferred version: 2.0.4 or above
-Is mandatory: false
-Website: http://www.swig.org/
-License: GPL
-Copyright:
- 1995-2011 The SWIG Developers
- 2005-2006 Arizona Board of Regents (University of Arizona).
- 1998-2005 University of Chicago.
- 1995-1998 The University of Utah and the Regents of the University of California
-
-External notice:
-
- SWIG 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 3 of the License, or
- (at your option) any later version. See the LICENSE-GPL file for
- the full terms of the GNU General Public license version 3.
-
- Portions of SWIG are also licensed under the terms of the licenses
- in the file LICENSE-UNIVERSITIES. You must observe the terms of
- these licenses, as well as the terms of the GNU General Public License,
- when you distribute SWIG.
-
- The SWIG library and examples, under the Lib and Examples top level
- directories, are distributed under the following terms:
-
- You may copy, modify, distribute, and make derivative works based on
- this software, in source code or object code form, without
- restriction. If you distribute the software to others, you may do
- so according to the terms of your choice. This software is offered as
- is, without warranty of any kind.
-
- See the COPYRIGHT file for a list of contributors to SWIG and their
- copyright notices.
-
\ No newline at end of file
=== modified file 'doc/cxx/examples/CMakeLists.txt'
--- doc/cxx/examples/CMakeLists.txt 2011-08-19 00:03:31 +0000
+++ doc/cxx/examples/CMakeLists.txt 2012-02-09 00:24:44 +0000
@@ -36,6 +36,10 @@
# LIST(APPEND API_EXAMPLES debugger.cpp)
ENDIF(ZORBA_WITH_DEBUGGER)
+IF (ZORBA_WITH_JSON)
+ LIST (APPEND API_EXAMPLES jsoniq.cpp)
+ENDIF (ZORBA_WITH_JSON)
+
CREATE_TEST_SOURCELIST(
examples
examples.cpp
@@ -63,6 +67,11 @@
ZORBA_ADD_TEST(${TName} examples ${NAME_WITHOUT_EXT})
ENDFOREACH(test)
+# Any known bugs
+IF (ZORBA_WITH_JSON)
+ EXPECTED_FAILURE(doc/cxx/examples/jsoniq.cpp 928710)
+ENDIF (ZORBA_WITH_JSON)
+
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Makefile.cmake ${CMAKE_CURRENT_BINARY_DIR}/Makefile.zorba)
MESSAGE(STATUS "configured ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.cmake ${CMAKE_CURRENT_BINARY_DIR}/Makefile.zorba")
=== added file 'doc/cxx/examples/jsoniq.cpp'
--- doc/cxx/examples/jsoniq.cpp 1970-01-01 00:00:00 +0000
+++ doc/cxx/examples/jsoniq.cpp 2012-02-09 00:24:44 +0000
@@ -0,0 +1,392 @@
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <iostream>
+#include <sstream>
+
+#include <zorba/zorba.h>
+#include <zorba/store_manager.h>
+#include <zorba/serializer.h>
+#include <zorba/singleton_item_sequence.h>
+#include <zorba/zorba_exception.h>
+
+using namespace zorba;
+
+namespace jsoniq_test {
+
+/**
+ * Test accessing a JSONArray's members
+ */
+bool
+example_1(Zorba* aZorba)
+{
+ Iterator_t lIterator, lMembers;
+ XQuery_t lQuery = aZorba->compileQuery("[ 1, 2, 3 ]");
+ lIterator = lQuery->iterator();
+ lIterator->open();
+ Item lItem;
+ lIterator->next(lItem);
+
+ // Ensure we got a JSON array
+ if (!lItem.isJSONItem() ||
+ lItem.getJSONItemKind() != store::StoreConsts::jsonArray) {
+ std::cerr << "Item is not JSON Array!" << std::endl;
+ return false;
+ }
+
+ // Ensure array has 3 integer members
+ lMembers = lItem.getArrayMembers();
+ lMembers->open();
+ Item lMember;
+ int count = 0;
+ while (lMembers->next(lMember)) {
+ // This will throw an exception if the item isn't an integer
+ std::cout << lMember.getLongValue() << std::endl;
+ count++;
+ }
+ if (count != 3) {
+ std::cerr << count << " array members returned, expecting 3" << std::endl;
+ return false;
+ }
+ lMembers->close();
+ lIterator->close();
+
+ return true;
+}
+
+
+/**
+ * Test accessing a JSONObject's Object Pairs, as well as the Pairs'
+ * names and values
+ */
+bool
+example_2(Zorba* aZorba)
+{
+ Iterator_t lIterator, lPairs;
+ XQuery_t lQuery = aZorba->compileQuery("{ \"one\" : 1, \"two\" : 2 }");
+ lIterator = lQuery->iterator();
+ lIterator->open();
+ Item lItem;
+ lIterator->next(lItem);
+
+ // Ensure we got a JSON object
+ if (!lItem.isJSONItem() ||
+ lItem.getJSONItemKind() != store::StoreConsts::jsonObject) {
+ std::cerr << "Item is not JSON object!" << std::endl;
+ return false;
+ }
+
+ // Ensure object has 2 pairs with integer values
+ lPairs = lItem.getObjectPairs();
+ lPairs->open();
+ Item lPair;
+ int count = 0;
+ while (lPairs->next(lPair)) {
+ if (!lPair.isJSONItem() ||
+ lPair.getJSONItemKind() != store::StoreConsts::jsonPair) {
+ std::cerr << "Item is not a JSON pair!" << std::endl;
+ }
+ Item lName = lPair.getPairName();
+ std::cout << " \"" << lName.getStringValue() << "\": ";
+ Item lValue = lPair.getPairValue();
+ std::cout << lValue.getLongValue() << std::endl;
+ count++;
+ }
+ if (count != 2) {
+ std::cerr << count << " object pairs returned, expecting 2" << std::endl;
+ return false;
+ }
+ lPairs->close();
+ lIterator->close();
+
+ return true;}
+
+
+/**
+ * Test accessing a JSONArray's members directly by index
+ */
+bool
+example_3(Zorba* aZorba)
+{
+ Iterator_t lIterator;
+ XQuery_t lQuery = aZorba->compileQuery("[ 1, 2, 3 ]");
+ lIterator = lQuery->iterator();
+ lIterator->open();
+ Item lItem;
+ lIterator->next(lItem);
+
+ Item lMember;
+ for (int i = 1; i <= 3; i++) {
+ lMember = lItem.getArrayMember(i);
+ std::cout << lMember.getLongValue() << std::endl;
+ }
+
+ lIterator->close();
+
+ return true;
+}
+
+
+/**
+ * Test accessing a JSONObject's values directly by name
+ */
+bool
+example_4(Zorba* aZorba)
+{
+ Iterator_t lIterator;
+ XQuery_t lQuery = aZorba->compileQuery("{ \"one\" : 1, \"two\" : 2 }");
+ lIterator = lQuery->iterator();
+ lIterator->open();
+ Item lItem;
+ lIterator->next(lItem);
+
+ Item lValue;
+ lValue = lItem.getObjectValue("one");
+ std::cout << lValue.getLongValue() << std::endl;
+ lValue = lItem.getObjectValue("two");
+ std::cout << lValue.getLongValue() << std::endl;
+
+ lIterator->close();
+
+ return true;
+}
+
+/**
+ * Test accessing a non-existent JSONArray member
+ */
+bool
+example_5(Zorba* aZorba)
+{
+ Iterator_t lIterator, lMembers;
+ XQuery_t lQuery = aZorba->compileQuery("[ 1, 2, 3 ]");
+ lIterator = lQuery->iterator();
+ lIterator->open();
+ Item lItem;
+ lIterator->next(lItem);
+
+ Item lNonMember = lItem.getArrayMember(4);
+ lIterator->close();
+
+ if (!lNonMember.isNull()) {
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * Test accessing a non-existent JSONObject pair value
+ */
+bool
+example_6(Zorba* aZorba)
+{
+ Iterator_t lIterator;
+ XQuery_t lQuery = aZorba->compileQuery("{ \"one\" : 1, \"two\" : 2 }");
+ lIterator = lQuery->iterator();
+ lIterator->open();
+ Item lItem;
+ lIterator->next(lItem);
+
+ Item lNonValue = lItem.getObjectValue("three");
+ lIterator->close();
+
+ if (!lNonValue.isNull()) {
+ return false;
+ }
+ return true;
+}
+
+/**
+ * Utility function: Given an item, bind that item to a simple query and
+ * serialize the result, then ensure the result matches the expected string.
+ */
+bool
+serialize(Zorba* aZorba, Item aItem, std::string aExpected)
+{
+ Zorba_SerializerOptions lSerialOpt;
+ lSerialOpt.omit_xml_declaration = ZORBA_OMIT_XML_DECLARATION_YES;
+ XQuery_t lQuery = aZorba->compileQuery("declare variable $i external; $i");
+ lQuery->getDynamicContext()->setVariable("i", aItem);
+ std::stringstream lStream;
+ lQuery->execute(lStream, &lSerialOpt);
+ std::string lResult = lStream.str();
+ std::cout << lResult << std::endl;
+ if (lResult.compare(aExpected) != 0) {
+ std::cout << "Wrong value! Expected " << aExpected << std::endl;
+ return false;
+ }
+ return true;
+}
+
+/**
+ * Test creating a JSON null value.
+ */
+bool
+example_7(Zorba* aZorba)
+{
+ Item lNull = aZorba->getItemFactory()->createJSONNull();
+ return serialize(aZorba, lNull, "null");
+}
+
+/**
+ * Test creating some JSON numbers.
+ */
+bool
+example_8(Zorba* aZorba)
+{
+ Item lNum = aZorba->getItemFactory()->createJSONNumber(String("12345"));
+ if (lNum.getType().getLocalName().compare("integer") != 0) {
+ std::cout << "Didn't create an xs:integer!";
+ return false;
+ }
+ if (!serialize(aZorba, lNum, "12345")) {
+ return false;
+ }
+
+ lNum = aZorba->getItemFactory()->createJSONNumber(String("123.345"));
+ if (lNum.getType().getLocalName().compare("decimal") != 0) {
+ std::cout << "Didn't create an xs:decimal!";
+ return false;
+ }
+ if (!serialize(aZorba, lNum, "123.345")) {
+ return false;
+ }
+
+ lNum = aZorba->getItemFactory()->createJSONNumber(String("12.34e5"));
+ if (lNum.getType().getLocalName().compare("double") != 0) {
+ std::cout << "Didn't create an xs:double!";
+ return false;
+ }
+ if (!serialize(aZorba, lNum, "1.234E6")) {
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * Test creating a JSON pair.
+ */
+bool example_9(Zorba* aZorba)
+{
+ Item lValue = aZorba->getItemFactory()->createJSONNumber("1234");
+ Item lPair = aZorba->getItemFactory()->createJSONPair("name", lValue);
+ // Standalone Pairs get boxed into a JSON Object
+ return serialize(aZorba, lPair, "{ \"name\" : 1234 }");
+}
+
+/**
+ * Test creating a JSON array.
+ */
+bool example_10(Zorba* aZorba)
+{
+ std::vector<Item> lMembers;
+ for (int i = 1; i <= 4; i++) {
+ // xs:int is fine for JSON arrays
+ lMembers.push_back(aZorba->getItemFactory()->createInt(i));
+ }
+ Item lArray = aZorba->getItemFactory()->createJSONArray(lMembers);
+ return serialize(aZorba, lArray, "[ 1, 2, 3, 4 ]");
+}
+
+/**
+ * Test creating a JSON object.
+ */
+bool example_11(Zorba* aZorba)
+{
+ Item lValue = aZorba->getItemFactory()->createInt(1234);
+ std::vector<Item> lPairs;
+ lPairs.push_back(aZorba->getItemFactory()->createJSONPair("foo", lValue));
+
+ Item lObject = aZorba->getItemFactory()->createJSONObject(lPairs);
+ return serialize(aZorba, lObject, "{ \"foo\" : 1234 }");
+}
+
+} /* namespace jsoniq-test */
+
+int
+jsoniq(int argc, char* argv[])
+{
+ void* lStore = StoreManager::getStore();
+ Zorba *lZorba = Zorba::getInstance(lStore);
+
+ bool res = false;
+
+ try {
+ std::cout << "executing jsoniq example 1" << std::endl;
+ res = jsoniq_test::example_1(lZorba);
+ if (!res) return 1;
+ std::cout << std::endl;
+
+ std::cout << "executing jsoniq example 2" << std::endl;
+ res = jsoniq_test::example_2(lZorba);
+ if (!res) return 1;
+ std::cout << std::endl;
+
+ std::cout << "executing jsoniq example 3" << std::endl;
+ res = jsoniq_test::example_3(lZorba);
+ if (!res) return 1;
+ std::cout << std::endl;
+
+ std::cout << "executing jsoniq example 4" << std::endl;
+ res = jsoniq_test::example_4(lZorba);
+ if (!res) return 1;
+ std::cout << std::endl;
+
+ std::cout << "executing jsoniq example 5" << std::endl;
+ res = jsoniq_test::example_5(lZorba);
+ if (!res) return 1;
+ std::cout << std::endl;
+
+ std::cout << "executing jsoniq example 6" << std::endl;
+ res = jsoniq_test::example_6(lZorba);
+ if (!res) return 1;
+ std::cout << std::endl;
+
+ std::cout << "executing jsoniq example 7" << std::endl;
+ res = jsoniq_test::example_7(lZorba);
+ if (!res) return 1;
+ std::cout << std::endl;
+
+ std::cout << "executing jsoniq example 8" << std::endl;
+ res = jsoniq_test::example_8(lZorba);
+ if (!res) return 1;
+ std::cout << std::endl;
+
+ std::cout << "executing jsoniq example 9" << std::endl;
+ res = jsoniq_test::example_9(lZorba);
+ if (!res) return 1;
+ std::cout << std::endl;
+
+ std::cout << "executing jsoniq example 10" << std::endl;
+ res = jsoniq_test::example_10(lZorba);
+ if (!res) return 1;
+ std::cout << std::endl;
+
+ std::cout << "executing jsoniq example 11" << std::endl;
+ res = jsoniq_test::example_11(lZorba);
+ if (!res) return 1;
+ std::cout << std::endl;
+ }
+ catch (ZorbaException& e) {
+ std::cout << "ZorbaException raised: " << e.what() << std::endl;
+ return 2;
+ }
+
+ lZorba->shutdown();
+ StoreManager::shutdownStore(lStore);
+ return 0;
+}
=== modified file 'doc/zorba/CMakeLists.txt'
--- doc/zorba/CMakeLists.txt 2011-10-07 08:28:43 +0000
+++ doc/zorba/CMakeLists.txt 2012-02-09 00:24:44 +0000
@@ -46,6 +46,10 @@
${CMAKE_CURRENT_BINARY_DIR}/html/noisepattern.png COPYONLY)
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/scripting_spec.html
${CMAKE_CURRENT_BINARY_DIR}/html/scripting_spec.html COPYONLY)
+ CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/XQueryforJSON.html
+ ${CMAKE_CURRENT_BINARY_DIR}/html/XQueryforJSON.html COPYONLY)
+ CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/JSONforXQuery.html
+ ${CMAKE_CURRENT_BINARY_DIR}/html/JSONforXQuery.html COPYONLY)
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/W3C-WD.css
${CMAKE_CURRENT_BINARY_DIR}/html/W3C-WD.css COPYONLY)
=== added file 'doc/zorba/JSONforXQuery.html'
--- doc/zorba/JSONforXQuery.html 1970-01-01 00:00:00 +0000
+++ doc/zorba/JSONforXQuery.html 2012-02-09 00:24:44 +0000
@@ -0,0 +1,1 @@
+<html><head><title>JSON for XQuery</title><style type="text/css">@import url('https://themes.googleusercontent.com/fonts/css?kit=lhDjYqiy3mZ0x6ROQEUoUw');ol{margin:0;padding:0}p{margin:0}.c8{padding-left:0pt;text-align:justify;margin-left:36pt}.c19{max-width:468pt;background-color:#ffffff;padding:72pt 72pt 72pt 72pt}.c20{list-style-type:disc;margin:0;padding:0}.c0{color:#1155cc;text-decoration:underline}.c13{color:inherit;text-decoration:inherit}.c1{text-indent:139.5pt;direction:ltr}.c17{text-align:center}.c11{margin-left:36pt}.c10{margin-left:18pt}.c14{text-indent:144pt}.c15{font-weight:bold}.c22{color:#4a86e8}.c18{height:18pt}.c6{margin-left:144pt}.c9{height:11pt}.c3{direction:ltr}.c4{text-align:right}.c7{font-style:italic}.c16{margin-left:58.5pt}.c12{text-align:justify}.c5{color:#38761d}.c2{font-family:Consolas}.c21{margin-left:49.5pt}.title{padding-top:24pt;line-height:1.15;text-align:center;color:#4a86e8;font-size:36pt;font-family:Arial;font-weight:bold;padding-bottom:6pt}.subtitle{padding-top:18pt;line-height:1.15;text-align:left;color:#666666;font-style:italic;font-size:24pt;font-family:Georgia;padding-bottom:4pt}body{color:#000000;font-size:11pt;font-family:Arial}h1{padding-top:24pt;line-height:1.15;text-align:left;color:#4a86e8;font-size:24pt;font-family:Arial;font-weight:bold;padding-bottom:6pt}h2{padding-top:18pt;line-height:1.15;text-align:left;color:#ff9900;font-size:18pt;font-family:Arial;font-weight:bold;padding-bottom:4pt}h3{padding-top:14pt;line-height:1.15;text-align:left;color:#000000;font-size:14pt;font-family:Arial;font-weight:bold;padding-bottom:4pt}h4{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-size:12pt;font-family:Arial;font-weight:bold;padding-bottom:2pt}h5{padding-top:11pt;line-height:1.15;text-align:left;color:#000000;font-size:11pt;font-family:Arial;font-weight:bold;padding-bottom:2pt}h6{padding-top:10pt;line-height:1.15;text-align:left;color:#000000;font-size:10pt;font-family:Arial;font-weight:bold;padding-bottom:2pt}</style></head><body class="c19"><p class="c3 title"><a name="h.li2wdq8unbq"></a><span>JSONiq for XQuery users</span></p><p class="c3 title"><a name="h.5ipqqclfxk4n"></a><span class="c5">JSON for XQuery</span></p><hr><p class="c17 c3"><span>This tutorial introduces the JSONiq language, which declaratively manipulates JSON data.</span></p><p class="c17 c3"><span>Why don't you go ahead can try the queries of this document on our online demo interface?</span></p><p class="c3 c17"><span> </span><span class="c0 c15"><a class="c13" href="http://jsoniq.zorba-xquery.com/">http://jsoniq.zorba-xquery.com/</a></span></p><hr><p class="c9 c3"><span></span></p><h2 class="c3 c18"><a name="h.8gra0ylxutrv"></a></h2><p class="c10 c3"><span class="c0"><a class="c13" href="#h.f453h84m2u1a">JSON</a></span></p><p class="c3 c10"><span class="c0"><a class="c13" href="#h.qtfakecy3fr7">Elevator Pitch</a></span></p><p class="c10 c3"><span class="c0"><a class="c13" href="#h.yugk1mszt0re">And here you go</a></span></p><p class="c3 c11"><span class="c0"><a class="c13" href="#h.39rm37noeh9g">JSONiq types</a></span></p><p class="c11 c3"><span class="c0"><a class="c13" href="#h.j0wg8654ivtw">JSON Constructors</a></span></p><p class="c11 c3"><span class="c0"><a class="c13" href="#h.qe57mgdf5ql">JSON as a subset of JSONiq</a></span></p><p class="c10 c3"><span class="c0"><a class="c13" href="#h.mjv7kyjurri2">JSON Navigation</a></span></p><p class="c11 c3"><span class="c0"><a class="c13" href="#h.xosiyb17dh24">Objects</a></span></p><p class="c11 c3"><span class="c0"><a class="c13" href="#h.mrf42gizl3y6">Arrays</a></span></p><p class="c11 c3"><span class="c0"><a class="c13" href="#h.hdc3dgohtdut">Pairs</a></span></p><p class="c10 c3"><span class="c0"><a class="c13" href="#h.eb0bxle2oykl">Relational Algebra</a></span></p><p class="c10 c3"><span class="c0"><a class="c13" href="#h.oii6pvliilhi">Access external data</a></span></p><p class="c10 c3"><span class="c0"><a class="c13" href="#h.bm3buqmzhtko">I want more</a></span></p><p><span></span></p><p class="c9 c3"><span></span></p><h1 class="c3"><a name="h.f453h84m2u1a"></a><span>JSON</span></h1><p class="c3 c12"><span>As explained on </span><span class="c0"><a class="c13" href="http://www.json.org/">http://www.json.org/</a></span><span>, JSON is a lightweight data-interchange format designed for humans as well as for computers. It supports as values:</span></p><ol class="c20" start="1"><li class="c8 c3"><span>objects (string-to-value map)</span></li><li class="c8 c3"><span>arrays (ordered sequence of values)</span></li><li class="c8 c3"><span>strings</span></li><li class="c8 c3"><span>numbers</span></li><li class="c8 c3"><span>booleans (true, false)</span></li><li class="c8 c3"><span>null</span></li></ol><p class="c9 c3"><span></span></p><p class="c3"><span>JSONiq extends XQuery to query and update JSON data, like XML data.</span></p><h1 class="c3"><a name="h.qtfakecy3fr7"></a><span>Elevator Pitch</span></h1><p class="c3 c12"><span>Here is an appetizer before we start the tutorial from scratch.</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">let $stores :=</span></p><p class="c3"><span class="c2">[</span></p><p class="c3"><span class="c2"> { "store number" : 1, "state" : "MA" },</span></p><p class="c3"><span class="c2"> { "store number" : 2, "state" : "MA" },</span></p><p class="c3"><span class="c2"> { "store number" : 3, "state" : "CA" },</span></p><p class="c3"><span class="c2"> { "store number" : 4, "state" : "CA" }</span></p><p class="c3"><span class="c2">]</span></p><p class="c3"><span class="c2">let $sales := [</span></p><p class="c3"><span class="c2"> { "product" : "broiler", "store number" : 1, "quantity" : 20 },</span></p><p class="c3"><span class="c2"> { "product" : "toaster", "store number" : 2, "quantity" : 100 },</span></p><p class="c3"><span class="c2"> { "product" : "toaster", "store number" : 2, "quantity" : 50 },</span></p><p class="c3"><span class="c2"> { "product" : "toaster", "store number" : 3, "quantity" : 50 },</span></p><p class="c3"><span class="c2"> { "product" : "blender", "store number" : 3, "quantity" : 100 },</span></p><p class="c3"><span class="c2"> { "product" : "blender", "store number" : 3, "quantity" : 150 },</span></p><p class="c3"><span class="c2"> { "product" : "socks", "store number" : 1, "quantity" : 500 },</span></p><p class="c3"><span class="c2"> { "product" : "socks", "store number" : 2, "quantity" : 10 },</span></p><p class="c3"><span class="c2"> { "product" : "shirt", "store number" : 3, "quantity" : 10 }</span></p><p class="c3"><span class="c2">]</span></p><p class="c3"><span class="c2">let $join :=</span></p><p class="c3"><span class="c2"> for $store in jn:values($stores), $sale in jn:values($sales)</span></p><p class="c3"><span class="c2"> where $store("store number") = $sale("store number")</span></p><p class="c3"><span class="c2"> return {</span></p><p class="c3"><span class="c2"> "nb" : $store("store number"),</span></p><p class="c3"><span class="c2"> "state" : $store("state"),</span></p><p class="c3"><span class="c2"> "sold" : $sale("product")</span></p><p class="c3"><span class="c2"> }</span></p><p class="c3"><span class="c2">return [$join]</span></p><p class="c6 c3"><span class="c5 c2">[ </span></p><p class="c6 c3"><span class="c5 c2"> { "nb" : 1, "state" : "MA", "sold" : "broiler" },</span></p><p class="c6 c3"><span class="c5 c2"> { "nb" : 1, "state" : "MA", "sold" : "socks" },</span></p><p class="c6 c3"><span class="c5 c2"> { "nb" : 2, "state" : "MA", "sold" : "toaster" },</span></p><p class="c6 c3"><span class="c5 c2"> { "nb" : 2, "state" : "MA", "sold" : "toaster" },</span></p><p class="c6 c3"><span class="c5 c2"> { "nb" : 2, "state" : "MA", "sold" : "socks" },</span></p><p class="c6 c3"><span class="c5 c2"> { "nb" : 3, "state" : "CA", "sold" : "toaster" },</span></p><p class="c6 c3"><span class="c5 c2"> { "nb" : 3, "state" : "CA", "sold" : "blender" },</span></p><p class="c6 c3"><span class="c5 c2"> { "nb" : 3, "state" : "CA", "sold" : "blender" },</span></p><p class="c6 c3"><span class="c5 c2"> { "nb" : 3, "state" : "CA", "sold" : "shirt" }</span></p><p class="c6 c3"><span class="c5 c2"> ]</span></p><p class="c9 c3"><span></span></p><h1 class="c3"><a name="h.yugk1mszt0re"></a><span>And here you go</span></h1><h2 class="c3"><a name="h.39rm37noeh9g"></a><span>JSONiq types</span></h2><p class="c3"><span>JSONiq maps JSON types to XQuery. Numbers are xs:integer or xs:decimal, strings are xs:string, true and false are xs:boolean and null is a new atomic type jn:null.</span></p><p class="c9 c3"><span></span></p><p class="c3"><span>JSONiq introduces new items: objects, arrays and pairs. Objects have pairs. Pairs have a string name and a value. Array have members which are values. Values are objects, arrays, XML nodes or atomic items.</span></p><p class="c9 c3"><span></span></p><p class="c3"><span>The new item types for objects and arrays are object() and array(). json-item() is a supertype of both, and json-pair() is the item type for pairs.</span></p><h2 class="c3"><a name="h.j0wg8654ivtw"></a><span>JSON Constructors</span></h2><p class="c3"><span>JSONiq introduces JSON constructors, in a similar way to XML constructors.</span></p><p class="c9 c3"><span></span></p><p class="c3"><span>You can put any expression in a array. The items in the sequence produced by the expression will become members of the array:</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">[ 1 to 10 ]</span></p><p class="c3 c4"><span class="c5 c2">[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]</span></p><p class="c9 c3 c4"><span class="c5 c2"></span></p><p class="c3"><span>Or you can dynamically compute an object:</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">{</span></p><p class="c3"><span class="c2"> "Greeting" : let $d := "Mister Spock"</span></p><p class="c3"><span class="c2"> return concat("Hello, ", $d),</span></p><p class="c3"><span class="c2"> "Farewell" : string-join(("Live", "long", "and", "prosper"),</span></p><p class="c3"><span class="c2"> " ")</span></p><p class="c3"><span class="c2">}</span></p><p class="c9 c3"><span class="c2 c5"></span></p><p class="c3 c4"><span class="c5 c2">{ "Greeting" : "Hello, Mister Spock", "Farewell" : "Live long and prosper" }</span></p><p class="c9 c3"><span class="c5"></span></p><p class="c3"><span>You can also dynamically generate pairs:</span></p><p class="c9 c3"><span class="c2"></span></p><p class="c3"><span class="c2">concat("Integer ", 2) : 2 * 2</span></p><p class="c3 c4"><span class="c5 c2">"Integer 2" : 4</span></p><p class="c9 c3 c4"><span class="c5 c2"></span></p><p class="c3"><span>and then wrap lots of them in an object:</span></p><p class="c9 c3"><span class="c2"></span></p><p class="c3"><span class="c2">{</span></p><p class="c3"><span class="c2"> for $i in 1 to 10</span></p><p class="c3"><span class="c2"> return concat("Square of ", $i) : $i * $i</span></p><p class="c3"><span class="c2">}</span></p><p class="c6 c3"><span class="c5 c2">{</span></p><p class="c6 c3"><span class="c5 c2">"Square of 1" : 1,</span></p><p class="c6 c3"><span class="c5 c2">"Square of 2" : 4,</span></p><p class="c6 c3"><span class="c5 c2">"Square of 3" : 9,</span></p><p class="c6 c3"><span class="c5 c2">"Square of 4" : 16,</span></p><p class="c3 c6"><span class="c5 c2">"Square of 5" : 25,</span></p><p class="c6 c3"><span class="c5 c2">"Square of 6" : 36,</span></p><p class="c6 c3"><span class="c5 c2">"Square of 7" : 49,</span></p><p class="c6 c3"><span class="c5 c2">"Square of 8" : 64,</span></p><p class="c6 c3"><span class="c5 c2">"Square of 9" : 81,</span></p><p class="c6 c3"><span class="c5 c2">"Square of 10" : 100</span></p><p class="c6 c3"><span class="c5 c2">}</span></p><p class="c9 c3"><span></span></p><h2 class="c3"><a name="h.qe57mgdf5ql"></a><span>JSON as a subset of JSONiq</span></h2><p class="c3 c12"><span>Every well-formed JSON document is a JSONiq query as well, because This means that you can copy-and-paste a JSON document into a query. The following are JSONiq queries that are "idempotent" (they just output themselves):</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">{ "pi" : 3.14, "sq2" : 1.4 }</span></p><p class="c3 c4"><span class="c5 c2">{ "pi" : 3.14, "sq2" : 1.4 }</span></p><p class="c9 c3"><span class="c5 c2"></span></p><p class="c3"><span class="c2">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c3 c4"><span class="c5 c2">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c9 c3"><span class="c2"></span></p><p class="c3"><span class="c2">{</span></p><p class="c3"><span class="c2"> "operations" : [</span></p><p class="c3"><span class="c2"> { "binary" : [ "and", "or"] },</span></p><p class="c3"><span class="c2"> { "unary" : ["not"] }</span></p><p class="c3"><span class="c2"> ],</span></p><p class="c3"><span class="c2"> "bits" : [</span></p><p class="c3"><span class="c2"> 0, 1</span></p><p class="c3"><span class="c2"> ]</span></p><p class="c3"><span class="c2">}</span></p><p class="c14 c3"><span class="c5 c2">{</span></p><p class="c14 c3"><span class="c5 c2"> "operations" : [</span></p><p class="c14 c3"><span class="c5 c2"> { "binary" : [ "and", "or" ] },</span></p><p class="c14 c3"><span class="c5 c2"> { "unary" : [ "not" ] }</span></p><p class="c14 c3"><span class="c5 c2"> ],</span></p><p class="c14 c3"><span class="c5 c2"> "bits" : [</span></p><p class="c14 c3"><span class="c5 c2"> 0, 1</span></p><p class="c3 c14"><span class="c5 c2"> ]</span></p><p class="c14 c3"><span class="c5 c2">}</span></p><p class="c9 c3 c4"><span class="c5 c2"></span></p><p class="c3 c12"><span>This works with objects, arrays (even nested), strings, numbers, booleans, null. </span><span class="c7">The exceptions to this rule (but we are working on it!) are that:</span></p><p class="c3 c12"><span class="c7">(i) if a pair has a true, false or null value, there must be a space on at least one side of the colon (this will be fixed).</span></p><p class="c3 c12"><span class="c7">(ii) empty objects are not recognized</span></p><p class="c3 c12"><span class="c7">(iii) characters escaped with the \ in JSON strings are not recognized</span></p><p class="c3 c9"><span class="c7 c2"></span></p><p class="c3 c12"><span>It also works the other way round: if your query outputs an object or an array, you can readily use it as a JSON document.</span></p><p class="c9 c3 c4"><span class="c5 c2"></span></p><h1 class="c3"><a name="h.mjv7kyjurri2"></a><span>JSON Navigation</span></h1><p class="c3 c12"><span>I</span><span>f you have some JSON data, you can access it and navigate.</span></p><p class="c9 c3 c12"><span></span></p><p class="c3 c12"><span>All you need to know is, again: JSONiq views</span></p><ol class="c20" start="1"><li class="c3 c8"><span>an array as a sequence of values,</span></li><li class="c8 c3"><span>an object as a set of pairs,</span></li><li class="c8 c3"><span>a pair as a (name, value) tuple.</span></li></ol><h2 class="c3 c12"><a name="h.xosiyb17dh24"></a><span>Objects</span></h2><p class="c3 c12"><span>If you use an object as a functor and provide it with a string, it will return the pair named after its parameter:</span></p><p class="c9 c3"><span class="c2"></span></p><p class="c3"><span class="c2">let $person := {</span></p><p class="c3"><span class="c2"> "first name" : "Sarah",</span></p><p class="c3"><span class="c2"> "age" : 13,</span></p><p class="c3"><span class="c2"> "gender" : "female",</span></p><p class="c3"><span class="c2"> "friends" : [ "Jim", "Mary", "Jennifer"]</span></p><p class="c3"><span class="c2">}</span></p><p class="c3"><span class="c2">return $person("first name")</span></p><p class="c3 c4"><span class="c5 c2">"first name" : "Sarah"</span></p><p class="c9 c3 c4"><span class="c5 c2"></span></p><h2 class="c3"><a name="h.mrf42gizl3y6"></a><span>Arrays</span></h2><p class="c3 c12"><span>If you use an array as a functor and provide it with an integer, it will return the corresponding entry:</span></p><p class="c9 c3"><span class="c2"></span></p><p class="c3"><span class="c2">let $friends := [ "Jim", "Mary", "Jennifer"]</span></p><p class="c3"><span class="c2">return $friends(2)</span></p><p class="c3 c4"><span class="c5 c2">Mary</span></p><h2 class="c3"><a name="h.hdc3dgohtdut"></a><span>Pairs</span></h2><p class="c3"><span>Given a pair, you can get its name and value using the functions jn:name and jn:value:</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">let $pair := "name of the pair" : "value of the pair"</span></p><p class="c3"><span class="c2">return { "name" : jn:name($pair), "value" : jn:value($pair) }</span></p><p class="c9 c3"><span class="c2"></span></p><p class="c3 c4"><span class="c5 c2">{ "name" : "name of the pair", "value" : "value of the pair" }</span></p><p class="c9 c3"><span class="c5"></span></p><p class="c3"><span>This functions also exist in plural form for objects:</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">let $person := {</span></p><p class="c3"><span class="c2"> "name" : "Sarah",</span></p><p class="c3"><span class="c2"> "age" : 13,</span></p><p class="c3"><span class="c2"> "gender" : "female",</span></p><p class="c3"><span class="c2"> "friends" : [ "Jim", "Mary", "Jennifer"]</span></p><p class="c3"><span class="c2">}</span></p><p class="c3"><span class="c2">return { "names" : [ jn:names($person)],</span></p><p class="c3"><span class="c2"> "values" : [ jn:values($person)]</span></p><p class="c3"><span class="c2"> }</span></p><p class="c3 c16"><span class="c5 c2">{</span></p><p class="c3 c16"><span class="c5 c2">"names" : [ "name", "age", "gender", "friends" ],</span></p><p class="c3 c16"><span class="c5 c2">"values" : [ "Sarah", 13, "female", [ "Jim", "Mary", "Jennifer" ] ]</span></p><p class="c3 c16"><span class="c5 c2">}</span></p><p class="c3"><span>jn:values can also be used for an array:</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">let $person := {</span></p><p class="c3"><span class="c2"> "name" : "Sarah",</span></p><p class="c3"><span class="c2"> "age" : 13,</span></p><p class="c3"><span class="c2"> "gender" : "female",</span></p><p class="c3"><span class="c2"> "friends" : [ "Jim", "Mary", "Jennifer"]</span></p><p class="c3"><span class="c2">}</span></p><p class="c3"><span class="c2">return jn:values($person("friends"))</span></p><p class="c3 c4"><span class="c5">[ "Jim", "Mary", "Jennifer" ]</span></p><p class="c9 c3 c4"><span class="c5"></span></p><h1 class="c3"><a name="h.eb0bxle2oykl"></a><span>Relational Algebra</span></h1><p class="c3 c12"><span>Remember last century's SELECT FROM WHERE statements? Well, JSONiq didn't throw out the baby with the bathwater. It has selection, projection and join capability.</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">let $stores :=</span></p><p class="c3"><span class="c2">[</span></p><p class="c3"><span class="c2"> { "store number" : 1, "state" : "MA" },</span></p><p class="c3"><span class="c2"> { "store number" : 2, "state" : "MA" },</span></p><p class="c3"><span class="c2"> { "store number" : 3, "state" : "CA" },</span></p><p class="c3"><span class="c2"> { "store number" : 4, "state" : "CA" }</span></p><p class="c3"><span class="c2">]</span></p><p class="c3"><span class="c2">let $sales := [</span></p><p class="c3"><span class="c2"> { "product" : "broiler", "store number" : 1, "quantity" : 20 },</span></p><p class="c3"><span class="c2"> { "product" : "toaster", "store number" : 2, "quantity" : 100 },</span></p><p class="c3"><span class="c2"> { "product" : "toaster", "store number" : 2, "quantity" : 50 },</span></p><p class="c3"><span class="c2"> { "product" : "toaster", "store number" : 3, "quantity" : 50 },</span></p><p class="c3"><span class="c2"> { "product" : "blender", "store number" : 3, "quantity" : 100 },</span></p><p class="c3"><span class="c2"> { "product" : "blender", "store number" : 3, "quantity" : 150 },</span></p><p class="c3"><span class="c2"> { "product" : "socks", "store number" : 1, "quantity" : 500 },</span></p><p class="c3"><span class="c2"> { "product" : "socks", "store number" : 2, "quantity" : 10 },</span></p><p class="c3"><span class="c2"> { "product" : "shirt", "store number" : 3, "quantity" : 10 }</span></p><p class="c3"><span class="c2">]</span></p><p class="c3"><span class="c2">let $join :=</span></p><p class="c3"><span class="c2"> for $store in jn:values($stores), $sale in jn:values($sales)</span></p><p class="c3"><span class="c2"> where $store("store number") = $sale("store number")</span></p><p class="c3"><span class="c2"> return {</span></p><p class="c3"><span class="c2"> "nb" : $store("store number"),</span></p><p class="c3"><span class="c2"> "state" : $store("state"),</span></p><p class="c3"><span class="c2"> "sold" : $sale("product")</span></p><p class="c3"><span class="c2"> }</span></p><p class="c3"><span class="c2">return [$join]</span></p><p class="c1"><span class="c5 c2">[ </span></p><p class="c1"><span class="c5 c2">{ "nb" : 1, "state" : "MA", "sold" : "broiler" },</span></p><p class="c1"><span class="c5 c2">{ "nb" : 1, "state" : "MA", "sold" : "socks" },</span></p><p class="c1"><span class="c5 c2">{ "nb" : 2, "state" : "MA", "sold" : "toaster" },</span></p><p class="c1"><span class="c5 c2">{ "nb" : 2, "state" : "MA", "sold" : "toaster" },</span></p><p class="c1"><span class="c5 c2">{ "nb" : 2, "state" : "MA", "sold" : "socks" },</span></p><p class="c1"><span class="c5 c2">{ "nb" : 3, "state" : "CA", "sold" : "toaster" },</span></p><p class="c1"><span class="c5 c2">{ "nb" : 3, "state" : "CA", "sold" : "blender" },</span></p><p class="c1"><span class="c5 c2">{ "nb" : 3, "state" : "CA", "sold" : "blender" },</span></p><p class="c1"><span class="c5 c2">{ "nb" : 3, "state" : "CA", "sold" : "shirt" }</span></p><p class="c1"><span class="c5 c2"> ]</span></p><h1 class="c3"><a name="h.oii6pvliilhi"></a><span>Access external data</span></h1><p class="c3"><span>You can access a JSON file on your local disk with</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">jn:json("file.json")</span></p><p class="c3 c4"><span class="c5 c2">[ "The", "contents", "of", "your", "file" ]</span></p><p class="c9 c3"><span></span></p><p class="c3"><span>Our implementation even supports collections of JSON objects or arrays:</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">dml:collection("my:data")</span></p><p class="c3 c4"><span class="c5 c2">{ "foo" : "Your" }</span></p><p class="c3 c4"><span class="c5 c2">{ "foo" : "Collection" }</span></p><p class="c3 c4"><span class="c5 c2">{ "foo" : "of" }</span></p><p class="c3 c4"><span class="c5 c2">{ "foo" : "JSON" }</span></p><p class="c3 c4"><span class="c5 c2">{ "foo" : "objects" }</span></p><h1 class="c3"><a name="h.fopcxnkoydgt"></a><span>JSON and XML</span></h1><p class="c3 c12"><span>You can readily use XML and JSON in the same program. If you put a JSON array in an XML constructor, it will be flattened (its member values are recursively taken, even in arrays of arrays). If you put a JSON pair in an XML constructor, it will be unboxed (its value is taken).</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">let $data := {</span></p><p class="c3"><span class="c2"> "color" : "blue",</span></p><p class="c3"><span class="c2"> "closed" : true,</span></p><p class="c3"><span class="c2"> "points" : [[10,10], [20,10], [20,20], [10,20]]</span></p><p class="c3"><span class="c2"> }</span></p><p class="c9 c3"><span class="c2"></span></p><p class="c3"><span class="c2">let $stroke := attribute stroke { $data("color") }</span></p><p class="c3"><span class="c2">let $points := attribute points { $data("points") }</span></p><p class="c3"><span class="c2">return</span></p><p class="c3"><span class="c2"> if ($data("closed")) then</span></p><p class="c3"><span class="c2"> <svg><polygon>{ $stroke, $points }</polygon></svg></span></p><p class="c3"><span class="c2"> else</span></p><p class="c3"><span class="c2"> <svg><polyline>{ $stroke, $points }</polyline></svg></span></p><p class="c9 c3"><span class="c2"></span></p><p class="c3 c21"><span class="c5 c2"><?xml version="1.0" encoding="UTF-8"?></span></p><p class="c3 c21"><span class="c5 c2"><svg><polygon stroke="blue" points="10 10 20 10 20 20 10 20"/></svg></span></p><p class="c9 c3"><span></span></p><h1 class="c3"><a name="h.bm3buqmzhtko"></a><span>I want more</span></h1><p class="c3 c12"><span>JSONiq supports JSON updates. You can declaratively update your JSON data. JSONiq provides functions that produce a list of updates. The list of updates that is eventually output by your program is then applied to your JSON data.</span></p><p class="c9 c3"><span></span></p><p class="c3"><span class="c2">let $my-data := jn:json("persons.json")</span></p><p class="c3"><span class="c2">let $john := jn:value($my-data("John"))</span></p><p class="c3"><span class="c2">let $mary := jn:value($my-data("Mary"))</span></p><p class="c3"><span class="c2">return (jn:replace-value($john, "status", "married"),</span></p><p class="c3"><span class="c2"> j:replace-value($mary, "status", "married"))</span></p><p class="c9 c3"><span></span></p><p class="c3"><span>JSONiq works with the XQuery 3.0 standard (switch, typeswitch and try-catch expressions, universal/existential quantifiers, path expressions, filtering expressions, functors, mappings, grouping, windowing will work). The Zorba implementation is also compatible with the proprietary Zorba scripting.</span></p></body></html>
\ No newline at end of file
=== added file 'doc/zorba/XQueryforJSON.html'
--- doc/zorba/XQueryforJSON.html 1970-01-01 00:00:00 +0000
+++ doc/zorba/XQueryforJSON.html 2012-02-09 00:24:44 +0000
@@ -0,0 +1,1 @@
+<html><head><title>XQuery for JSON</title><style type="text/css">@import url('https://themes.googleusercontent.com/fonts/css?kit=lhDjYqiy3mZ0x6ROQEUoUw');ol{margin:0;padding:0}p{margin:0}.c10{list-style-type:disc;margin:0;padding:0}.c21{max-width:468pt;background-color:#ffffff;padding:72pt 72pt 72pt 72pt}.c1{height:11pt;direction:ltr}.c9{color:#ff0000;font-style:italic}.c13{text-indent:-13.5pt;margin-left:76.5pt}.c2{color:#1155cc;text-decoration:underline}.c15{color:inherit;text-decoration:inherit}.c3{direction:ltr}.c6{text-align:justify}.c5{text-align:right}.c4{margin-left:144pt}.c11{font-style:italic}.c18{color:#ff9900}.c20{height:18pt}.c8{margin-left:36pt}.c19{text-align:center}.c17{color:#4a86e8}.c0{font-family:Consolas}.c7{color:#38761d}.c12{font-weight:bold}.c14{padding-left:0pt}.c16{margin-left:18pt}.title{padding-top:24pt;line-height:1.15;text-align:center;color:#4a86e8;font-size:36pt;font-family:Arial;font-weight:bold;padding-bottom:6pt}.subtitle{padding-top:18pt;line-height:1.15;text-align:left;color:#666666;font-style:italic;font-size:24pt;font-family:Georgia;padding-bottom:4pt}body{color:#000000;font-size:11pt;font-family:Arial}h1{padding-top:24pt;line-height:1.15;text-align:left;color:#4a86e8;font-size:24pt;font-family:Arial;font-weight:bold;padding-bottom:6pt}h2{padding-top:18pt;line-height:1.15;text-align:left;color:#ff9900;font-size:18pt;font-family:Arial;font-weight:bold;padding-bottom:4pt}h3{padding-top:14pt;line-height:1.15;text-align:left;color:#000000;font-size:14pt;font-family:Arial;font-weight:bold;padding-bottom:4pt}h4{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-size:12pt;font-family:Arial;font-weight:bold;padding-bottom:2pt}h5{padding-top:11pt;line-height:1.15;text-align:left;color:#000000;font-size:11pt;font-family:Arial;font-weight:bold;padding-bottom:2pt}h6{padding-top:10pt;line-height:1.15;text-align:left;color:#000000;font-size:10pt;font-family:Arial;font-weight:bold;padding-bottom:2pt}</style></head><body class="c21"><p class="c3 title"><a name="h.li2wdq8unbq"></a><span>JSONiq for JSON users</span></p><p class="c3 title"><a name="h.5ipqqclfxk4n"></a><span class="c7">XQuery for JSON</span></p><hr><p class="c3 c19"><span>This tutorial introduces the JSONiq language, which declaratively manipulates JSON data.</span></p><p class="c3 c19"><span>Why don't you go ahead can try the queries of this document on our online demo interface?</span></p><p class="c3 c19"><span> </span><span class="c2 c12"><a class="c15" href="http://jsoniq.zorba-xquery.com/">http://jsoniq.zorba-xquery.com/</a></span></p><hr><p class="c1"><span></span></p><h2 class="c3 c20"><a name="h.8gra0ylxutrv"></a></h2><p class="c3 c16"><span class="c2"><a class="c15" href="#h.f453h84m2u1a">JSON</a></span></p><p class="c3 c16"><span class="c2"><a class="c15" href="#h.qtfakecy3fr7">Elevator Pitch</a></span></p><p class="c3 c16"><span class="c2"><a class="c15" href="#h.yugk1mszt0re">And here you go</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.4uvhbej4btrt">Like Monsieur Jourdain, you already knew some JSONiq</a></span></p><p class="c3 c16"><span class="c2"><a class="c15" href="#h.1gal1zhyffu4">JSONiq basics</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.ncbxtez2z3rn">The real JSONiq Hello, World!</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.ifcjheuaxoqc">Numbers and arithmetic operations</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.jmbc6c1fqqwx">Logical operations</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.iq1ixg5ywx0r">Strings</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.rv6w8p4wenfa">Sequences</a></span></p><p class="c3 c16"><span class="c2"><a class="c15" href="#h.7x2r8sj1zjwe">A bit more in depth</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.b6c9zq9um8cu">Variables</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.92ak2udyfghp">Iteration</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.zdhx60a5duyu">Conditions</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.ccs6lkxiixw4">Composability of Expressions</a></span></p><p class="c3 c16"><span class="c2"><a class="c15" href="#h.mjv7kyjurri2">JSON Navigation</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.xosiyb17dh24">Objects</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.mrf42gizl3y6">Arrays</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.hdc3dgohtdut">Pairs</a></span></p><p class="c3 c16"><span class="c2"><a class="c15" href="#h.eb0bxle2oykl">Relational Algebra</a></span></p><p class="c3 c16"><span class="c2"><a class="c15" href="#h.oii6pvliilhi">Access external data</a></span></p><p class="c3 c16"><span class="c2"><a class="c15" href="#h.bm3buqmzhtko">I want more</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.5itcphr8262b">Even more</a></span></p><p class="c3 c8"><span class="c2"><a class="c15" href="#h.j7oh3cyhem38">More is not enough</a></span></p><p><span></span></p><p class="c1"><span></span></p><h1 class="c3"><a name="h.f453h84m2u1a"></a><span>JSON</span></h1><p class="c3 c6"><span>As explained on </span><span class="c2"><a class="c15" href="http://www.json.org/">http://www.json.org/</a></span><span>, JSON is a lightweight data-interchange format designed for humans as well as for computers. It supports as values:</span></p><ol class="c10" start="1"><li class="c3 c6 c8 c14"><span>objects (string-to-value map)</span></li><li class="c3 c6 c8 c14"><span>arrays (ordered sequence of values)</span></li><li class="c3 c6 c8 c14"><span>strings</span></li><li class="c3 c6 c8 c14"><span>numbers</span></li><li class="c3 c6 c8 c14"><span>booleans (true, false)</span></li><li class="c3 c6 c8 c14"><span>null</span></li></ol><p class="c1"><span></span></p><p class="c3"><span>JSONiq provides declarative querying and updating capabilities on JSON data.</span></p><h1 class="c3"><a name="h.qtfakecy3fr7"></a><span>Elevator Pitch</span></h1><p class="c3 c6"><span>JSONiq is based on XQuery, which is a W3C standard (like XML and HTML). XQuery is a very powerful declarative language that manipulates XML data, but that is also a very good fit for JSON. Here is an appetizer before we start the tutorial from scratch.</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">let $stores :=</span></p><p class="c3"><span class="c0">[</span></p><p class="c3"><span class="c0"> { "store number" : 1, "state" : "MA" },</span></p><p class="c3"><span class="c0"> { "store number" : 2, "state" : "MA" },</span></p><p class="c3"><span class="c0"> { "store number" : 3, "state" : "CA" },</span></p><p class="c3"><span class="c0"> { "store number" : 4, "state" : "CA" }</span></p><p class="c3"><span class="c0">]</span></p><p class="c3"><span class="c0">let $sales := [</span></p><p class="c3"><span class="c0"> { "product" : "broiler", "store number" : 1, "quantity" : 20 },</span></p><p class="c3"><span class="c0"> { "product" : "toaster", "store number" : 2, "quantity" : 100 },</span></p><p class="c3"><span class="c0"> { "product" : "toaster", "store number" : 2, "quantity" : 50 },</span></p><p class="c3"><span class="c0"> { "product" : "toaster", "store number" : 3, "quantity" : 50 },</span></p><p class="c3"><span class="c0"> { "product" : "blender", "store number" : 3, "quantity" : 100 },</span></p><p class="c3"><span class="c0"> { "product" : "blender", "store number" : 3, "quantity" : 150 },</span></p><p class="c3"><span class="c0"> { "product" : "socks", "store number" : 1, "quantity" : 500 },</span></p><p class="c3"><span class="c0"> { "product" : "socks", "store number" : 2, "quantity" : 10 },</span></p><p class="c3"><span class="c0"> { "product" : "shirt", "store number" : 3, "quantity" : 10 }</span></p><p class="c3"><span class="c0">]</span></p><p class="c3"><span class="c0">let $join :=</span></p><p class="c3"><span class="c0"> for $store in jn:values($stores), $sale in jn:values($sales)</span></p><p class="c3"><span class="c0"> where $store("store number") = $sale("store number")</span></p><p class="c3"><span class="c0"> return {</span></p><p class="c3"><span class="c0"> "nb" : $store("store number"),</span></p><p class="c3"><span class="c0"> "state" : $store("state"),</span></p><p class="c3"><span class="c0"> "sold" : $sale("product")</span></p><p class="c3"><span class="c0"> }</span></p><p class="c3"><span class="c0">return [$join]</span></p><p class="c3 c4"><span class="c0 c7">[ </span></p><p class="c3 c4"><span class="c0 c7"> { "nb" : 1, "state" : "MA", "sold" : "broiler" },</span></p><p class="c3 c4"><span class="c0 c7"> { "nb" : 1, "state" : "MA", "sold" : "socks" },</span></p><p class="c3 c4"><span class="c0 c7"> { "nb" : 2, "state" : "MA", "sold" : "toaster" },</span></p><p class="c3 c4"><span class="c0 c7"> { "nb" : 2, "state" : "MA", "sold" : "toaster" },</span></p><p class="c3 c4"><span class="c0 c7"> { "nb" : 2, "state" : "MA", "sold" : "socks" },</span></p><p class="c3 c4"><span class="c0 c7"> { "nb" : 3, "state" : "CA", "sold" : "toaster" },</span></p><p class="c3 c4"><span class="c0 c7"> { "nb" : 3, "state" : "CA", "sold" : "blender" },</span></p><p class="c3 c4"><span class="c0 c7"> { "nb" : 3, "state" : "CA", "sold" : "blender" },</span></p><p class="c3 c4"><span class="c0 c7"> { "nb" : 3, "state" : "CA", "sold" : "shirt" }</span></p><p class="c3 c4"><span class="c0 c7"> ]</span></p><p class="c1"><span></span></p><h1 class="c3"><a name="h.yugk1mszt0re"></a><span>And here you go</span></h1><h2 class="c3"><a name="h.4uvhbej4btrt"></a><span>Like Monsieur Jourdain, you already knew some JSONiq</span></h2><p class="c3 c6"><span>The first thing you need to know is that every well-formed JSON document is a JSONiq query as well.</span></p><p class="c1"><span></span></p><p class="c3 c6"><span>This means that you can copy-and-paste a JSON document into a query. The following are JSONiq queries that are "idempotent" (they just output themselves):</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">{ "pi" : 3.14, "sq2" : 1.4 }</span></p><p class="c3 c5"><span class="c0 c7">{ "pi" : 3.14, "sq2" : 1.4 }</span></p><p class="c1"><span class="c0 c7"></span></p><p class="c3"><span class="c0">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c3 c5"><span class="c0 c7">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span class="c0">{</span></p><p class="c3"><span class="c0"> "operations" : [</span></p><p class="c3"><span class="c0"> { "binary" : [ "and", "or"] },</span></p><p class="c3"><span class="c0"> { "unary" : ["not"] }</span></p><p class="c3"><span class="c0"> ],</span></p><p class="c3"><span class="c0"> "bits" : [</span></p><p class="c3"><span class="c0"> 0, 1</span></p><p class="c3"><span class="c0"> ]</span></p><p class="c3"><span class="c0">}</span></p><p class="c3 c4"><span class="c0 c7">{</span></p><p class="c3 c4"><span class="c0 c7"> "operations" : [</span></p><p class="c3 c4"><span class="c0 c7"> { "binary" : [ "and", "or" ] },</span></p><p class="c3 c4"><span class="c0 c7"> { "unary" : [ "not" ] }</span></p><p class="c3 c4"><span class="c0 c7"> ],</span></p><p class="c3 c4"><span class="c0 c7"> "bits" : [</span></p><p class="c3 c4"><span class="c0 c7"> 0, 1</span></p><p class="c3 c4"><span class="c0 c7"> ]</span></p><p class="c3 c4"><span class="c0 c7">}</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c3"><span>This works with objects, arrays (even nested), strings, numbers, booleans, null. </span><span class="c11">The exceptions to this rule (but we are working on it!) are that:</span></p><p class="c3 c6"><span class="c11">(i) if a pair has a true, false or null value, there must be a space on at least one side of the colon (this will be fixed).</span></p><p class="c3 c6"><span class="c11">(ii) empty objects are not recognized</span></p><p class="c3 c6"><span class="c11">(iii) characters escaped with the \ in JSON strings are not recognized</span></p><p class="c1"><span class="c9 c0"></span></p><p class="c3 c6"><span>It also works the other way round: if your query outputs an object or an array, you can readily use it as a JSON document.</span></p><p class="c1"><span></span></p><p class="c3 c6"><span>JSONiq is a declarative language. This means that you only need to say </span><span class="c11">what</span><span> you want - the compiler will take care of the </span><span class="c11">how</span><span>. In the above queries, you are basically saying: I want to output this JSON content, and here it is.</span></p><h1 class="c3"><a name="h.1gal1zhyffu4"></a><span>JSONiq basics</span></h1><h2 class="c3"><a name="h.ncbxtez2z3rn"></a><span>The real JSONiq Hello, World!</span></h2><p class="c3"><span>Wondering what a hello world program looks like in JSONiq? Here it is:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">"Hello, World!"</span></p><p class="c3 c5"><span class="c0 c7">Hello, World!</span></p><p class="c1"><span class="c0 c7"></span></p><p class="c3"><span>Not surprisingly, it outputs the string "Hello, World!". Again, just say what you want and you will get it.</span></p><h2 class="c3"><a name="h.ifcjheuaxoqc"></a><span>Numbers and arithmetic operations</span></h2><p class="c3 c6"><span>Okay, so, now, you might be thinking: "What is the use of this language if it just outputs what I put in?" Of course, JSONiq can more than that. And still in a declarative way. Here is how it works with numbers:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">2 + 2</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span>will surprisingly output:</span></p><p class="c3 c5"><span class="c0 c7">4</span></p><p class="c1"><span></span></p><p class="c3"><span>whereas</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">(38 + 2) div 2 + 11 * 2</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span>will output</span></p><p class="c3 c5"><span class="c0 c7">42</span></p><p class="c1"><span class="c0 c7"></span></p><p class="c3 c6"><span>(mind the division operator which is the "div" keyword. The slash has other semantics).</span></p><p class="c1"><span></span></p><p class="c3"><span>Like JSON, JSONiq works with decimals, too:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">6.022e23 * 42</span></p><p class="c3 c5"><span class="c0 c7">2.52924E25</span></p><h2 class="c3"><a name="h.jmbc6c1fqqwx"></a><span>Logical operations</span></h2><p class="c3 c6"><span>JSONiq supports boolean operations.</span></p><p class="c1 c6"><span></span></p><p class="c3"><span class="c0">true and false</span></p><p class="c3 c5"><span class="c0 c7">false</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c3"><span class="c0">(true or false) and (false or true)</span></p><p class="c3 c5"><span class="c0 c7">true</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c3"><span>The unary not is a function (yes, JSONiq has functions, and they are in the same way as in many languages):</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span class="c0">not(true)</span></p><p class="c3 c5"><span class="c0 c7">false</span></p><h2 class="c3"><a name="h.iq1ixg5ywx0r"></a><span>Strings</span></h2><p class="c3"><span>JSONiq is capable of manipulating strings as well, using functions:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">concat("Hello ", "Captain Kirk")</span></p><p class="c3 c5"><span class="c0 c7">Hello Captain Kirk</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c3"><span class="c0">substring("Mister Spock", 8, 5)</span></p><p class="c3 c5"><span class="c0 c7">Spock</span></p><h2 class="c3"><a name="h.rv6w8p4wenfa"></a><span>Sequences</span></h2><p class="c3"><span>Until now, we only handled single values (an object, an array, a number, a string, a boolean). JSONiq supports sequences of values. You can build a sequence using commas:</span></p><p class="c1"><span></span></p><p class="c3"><span>1, 2, 3, 4, 5, 6, 7, 8, 9, 10</span></p><p class="c3 c5"><span class="c7">1 2 3 4 5 6 7 8 9 10</span></p><p class="c1"><span class="c7"></span></p><p class="c3"><span class="c0">1, </span><span class="c0">true</span><span class="c0">, 4.2e1, "Life"</span></p><p class="c3 c5"><span class="c0 c7">1 true 42 Life</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span class="c0">{ "Question" : "Ultimate" }, ["Life", "The universe", "and everything"]</span></p><p class="c1 c5"><span class="c0"></span></p><p class="c3 c5"><span class="c0 c7">{ "Question" : "Ultimate" }[ "Life", "The universe", "and everything" ]</span></p><p class="c1 c5"><span class="c0"></span></p><p class="c3"><span>The "to" operator is very convenient, too:</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span class="c0">1 to 100</span></p><p class="c3 c5"><span class="c7">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20</span></p><p class="c3 c5"><span class="c7">21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40</span></p><p class="c3 c5"><span class="c7">41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60</span></p><p class="c3 c5"><span class="c7">61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80</span></p><p class="c3 c5"><span class="c7">81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100</span></p><p class="c1"><span></span></p><p class="c3"><span>Some functions even work on sequences:</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span class="c0">sum(1 to 100)</span></p><p class="c3 c5"><span class="c0 c7">5050</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c3"><span class="c0">string-join(("These", "are", "some", "words"), "-")</span></p><p class="c3 c5"><span class="c0 c7">These-are-some-words</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c3"><span class="c0">count(10 to 20)</span></p><p class="c3 c5"><span class="c0 c7">11</span></p><p class="c1"><span class="c0 c7"></span></p><p class="c3"><span class="c0">avg(1 to 100)</span></p><p class="c3 c5"><span class="c0 c7">50.5</span></p><h1 class="c3"><a name="h.7x2r8sj1zjwe"></a><span>A bit more in depth</span></h1><h2 class="c3"><a name="h.b6c9zq9um8cu"></a><span>Variables</span></h2><p class="c3"><span>You can bind a sequence of values to a (dollar-prefixed) variable, like so:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">let $x := "Bearing 3 1 4 Mark 5. "</span></p><p class="c3"><span class="c0">return concat($x, "Engage!")</span></p><p class="c3 c5"><span class="c0 c7">Bearing 3 1 4 Mark 5. Engage!</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c1 c5"><span class="c0"></span></p><p class="c3"><span class="c0">let $x := ("Kirk", "Picard", "Sisko")</span></p><p class="c3"><span class="c0">return string-join($x, " and ")</span></p><p class="c3 c5"><span class="c0 c7">Kirk and Picard and Sisko</span></p><p class="c1"><span class="c0 c7"></span></p><p class="c3"><span>You can bind as many variables as you want:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">let $x := 1</span></p><p class="c3"><span class="c0">let $y := $x * 2</span></p><p class="c3"><span class="c0">let $z := $y + $x</span></p><p class="c3"><span class="c0">return [$x, $y, $z]</span></p><p class="c3 c5"><span class="c0 c7">[ 1, 2, 3 ]</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c3"><span>and even reuse the same name:</span></p><p class="c3"><span class="c0">let $x := 1</span></p><p class="c3"><span class="c0">let $x := $x + 2</span></p><p class="c3"><span class="c0">let $x := $x + 3</span></p><p class="c3"><span class="c0">return $x</span></p><p class="c3 c5"><span class="c0 c7">6</span></p><h2 class="c3"><a name="h.92ak2udyfghp"></a><span>Iteration</span></h2><p class="c3 c6"><span>In a way very similar to let, you can iterate over a sequence of values with the "for" keyword. Instead of binding the entire sequence of the variable, it will bind each value of the sequence in turn to this variable.</span></p><p class="c1 c6"><span></span></p><p class="c3 c6"><span class="c0">for $i in 1 to 10</span></p><p class="c3 c6"><span class="c0">return $i * 2</span></p><p class="c3 c5"><span class="c0 c7">2 4 6 8 10 12 14 16 18 20</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c3"><span>More interestingly, you can combine fors and lets like so:</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span class="c0">let $sequence := 1 to 10</span></p><p class="c3"><span class="c0">for $value in $sequence</span></p><p class="c3"><span class="c0">let $square := $value * 2</span></p><p class="c3"><span class="c0">return $square</span></p><p class="c3 c5"><span class="c0 c7">2 4 6 8 10 12 14 16 18 20</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c3"><span>and even filter out some values:</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span class="c0">let $sequence := 1 to 10</span></p><p class="c3"><span class="c0">for $value in $sequence</span></p><p class="c3"><span class="c0">let $square := $value * 2</span></p><p class="c3"><span class="c0">where $square < 10</span></p><p class="c3"><span class="c0">return $square</span></p><p class="c3 c5"><span class="c0 c7">2 4 6 8</span></p><h2 class="c3"><a name="h.zdhx60a5duyu"></a><span>Conditions</span></h2><p class="c3"><span>You can make the output depend on a condition with an if-then-else construct:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">for $x in 1 to 10</span></p><p class="c3"><span class="c0">return if ($x < 5) then $x</span></p><p class="c3"><span class="c0"> else -$x</span></p><p class="c3 c5"><span class="c0 c7">1 2 3 4 -5 -6 -7 -8 -9 -10</span></p><h2 class="c3"><a name="h.ccs6lkxiixw4"></a><span>Composability of Expressions</span></h2><p class="c3"><span>Now that you know of a couple of elementary JSONiq expressions, you can combine then in more elaborate expressions. For example, you can put any sequence of values in an array:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">[ 1 to 10 ]</span></p><p class="c3 c5"><span class="c0 c7">[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c3"><span>Or you can dynamically compute the value of object pairs:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">{</span></p><p class="c3"><span class="c0"> "Greeting" : let $d := "Mister Spock"</span></p><p class="c3"><span class="c0"> return concat("Hello, ", $d),</span></p><p class="c3"><span class="c0"> "Farewell" : string-join(("Live", "long", "and", "prosper"),</span></p><p class="c3"><span class="c0"> " ")</span></p><p class="c3"><span class="c0">}</span></p><p class="c1"><span class="c0 c7"></span></p><p class="c3 c5"><span class="c0 c7">{ "Greeting" : "Hello, Mister Spock", "Farewell" : "Live long and prosper" }</span></p><p class="c1"><span class="c7"></span></p><p class="c3"><span>You can also dynamically generate pairs:</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span class="c0">concat("Integer ", 2) : 2 * 2</span></p><p class="c3 c5"><span class="c0 c7">"Integer 2" : 4</span></p><p class="c1 c5"><span class="c0 c7"></span></p><p class="c3"><span>and then wrap lots of them in an object:</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span class="c0">{</span></p><p class="c3"><span class="c0"> for $i in 1 to 10</span></p><p class="c3"><span class="c0"> return concat("Square of ", $i) : $i * $i</span></p><p class="c3"><span class="c0">}</span></p><p class="c3 c4"><span class="c0 c7">{</span></p><p class="c3 c4"><span class="c0 c7">"Square of 1" : 1,</span></p><p class="c3 c4"><span class="c0 c7">"Square of 2" : 4,</span></p><p class="c3 c4"><span class="c0 c7">"Square of 3" : 9,</span></p><p class="c3 c4"><span class="c0 c7">"Square of 4" : 16,</span></p><p class="c3 c4"><span class="c0 c7">"Square of 5" : 25,</span></p><p class="c3 c4"><span class="c0 c7">"Square of 6" : 36,</span></p><p class="c3 c4"><span class="c0 c7">"Square of 7" : 49,</span></p><p class="c3 c4"><span class="c0 c7">"Square of 8" : 64,</span></p><p class="c3 c4"><span class="c0 c7">"Square of 9" : 81,</span></p><p class="c3 c4"><span class="c0 c7">"Square of 10" : 100</span></p><p class="c3 c4"><span class="c0 c7">}</span></p><h1 class="c3"><a name="h.mjv7kyjurri2"></a><span>JSON Navigation</span></h1><p class="c3 c6"><span>Up to now, you learnt how to compose expressions so as to do some computations and to build pairs, objects and arrays. It also works the other way round: if you have some JSON data, you can access it and navigate.</span></p><p class="c1 c6"><span></span></p><p class="c3 c6"><span>All you need to know is: JSONiq views</span></p><ol class="c10" start="1"><li class="c3 c6 c8 c14"><span>an array as a sequence of values,</span></li><li class="c3 c6 c8 c14"><span>an object as a set of name/value pairs (we call them just: pairs)</span></li><li class="c3 c6 c8 c14"><span>a pair as a (name, value) tuple.</span></li></ol><h2 class="c3 c6"><a name="h.xosiyb17dh24"></a><span>Objects</span></h2><p class="c3 c6"><span>If you use an object as a functor and provide it with a string, it will return the pair named after its parameter:</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span class="c0">let $person := {</span></p><p class="c3"><span class="c0"> "first name" : "Sarah",</span></p><p class="c3"><span class="c0"> "age" : 13,</span></p><p class="c3"><span class="c0"> "gender" : "female",</span></p><p class="c3"><span class="c0"> "friends" : [ "Jim", "Mary", "Jennifer"]</span></p><p class="c3"><span class="c0">}</span></p><p class="c3"><span class="c0">return $person("first name")</span></p><p class="c3 c5"><span class="c0 c7">"first name" : "Sarah"</span></p><p class="c1 c5"><span class="c0 c7"></span></p><h2 class="c3"><a name="h.mrf42gizl3y6"></a><span>Arrays</span></h2><p class="c3 c6"><span>If you use an array as a functor and provide it with an integer, it will return the corresponding entry:</span></p><p class="c1"><span class="c0"></span></p><p class="c3"><span class="c0">let $friends := [ "Jim", "Mary", "Jennifer"]</span></p><p class="c3"><span class="c0">return $friends(2)</span></p><p class="c3 c5"><span class="c0 c7">Mary</span></p><h2 class="c3"><a name="h.hdc3dgohtdut"></a><span>Pairs</span></h2><p class="c3"><span>Given a pair, you can get its name and value using the functions jn:name and jn:value:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">let $pair := "name of the pair" : "value of the pair"</span></p><p class="c3"><span class="c0">return { "name" : jn:name($pair), "value" : jn:value($pair) }</span></p><p class="c1"><span class="c0"></span></p><p class="c3 c5"><span class="c0 c7">{ "name" : "name of the pair", "value" : "value of the pair" }</span></p><p class="c1"><span class="c7"></span></p><p class="c3"><span>This functions also exist in plural form for objects:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">let $person := {</span></p><p class="c3"><span class="c0"> "name" : "Sarah",</span></p><p class="c3"><span class="c0"> "age" : 13,</span></p><p class="c3"><span class="c0"> "gender" : "female",</span></p><p class="c3"><span class="c0"> "friends" : [ "Jim", "Mary", "Jennifer"]</span></p><p class="c3"><span class="c0">}</span></p><p class="c3"><span class="c0">return { "names" : [ jn:names($person)],</span></p><p class="c3"><span class="c0"> "values" : [ jn:values($person)]</span></p><p class="c3"><span class="c0"> }</span></p><p class="c3 c13"><span class="c0 c7">{</span></p><p class="c13 c3"><span class="c0 c7">"names" : [ "name", "age", "gender", "friends" ],</span></p><p class="c13 c3"><span class="c0 c7">"values" : [ "Sarah", 13, "female", [ "Jim", "Mary", "Jennifer" ] ]</span></p><p class="c13 c3"><span class="c0 c7">}</span></p><p class="c3"><span>jn:values can also be used for an array:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">let $person := {</span></p><p class="c3"><span class="c0"> "name" : "Sarah",</span></p><p class="c3"><span class="c0"> "age" : 13,</span></p><p class="c3"><span class="c0"> "gender" : "female",</span></p><p class="c3"><span class="c0"> "friends" : [ "Jim", "Mary", "Jennifer"]</span></p><p class="c3"><span class="c0">}</span></p><p class="c3"><span class="c0">return jn:values($person("friends"))</span></p><p class="c3 c5"><span class="c7">[ "Jim", "Mary", "Jennifer" ]</span></p><p class="c1 c5"><span class="c7"></span></p><h1 class="c3"><a name="h.eb0bxle2oykl"></a><span>Relational Algebra</span></h1><p class="c3 c6"><span>Remember last century's SELECT FROM WHERE statements? Well, JSONiq didn't throw out the baby with the bathwater. It has selection, projection and join capability.</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">let $stores :=</span></p><p class="c3"><span class="c0">[</span></p><p class="c3"><span class="c0"> { "store number" : 1, "state" : "MA" },</span></p><p class="c3"><span class="c0"> { "store number" : 2, "state" : "MA" },</span></p><p class="c3"><span class="c0"> { "store number" : 3, "state" : "CA" },</span></p><p class="c3"><span class="c0"> { "store number" : 4, "state" : "CA" }</span></p><p class="c3"><span class="c0">]</span></p><p class="c3"><span class="c0">let $sales := [</span></p><p class="c3"><span class="c0"> { "product" : "broiler", "store number" : 1, "quantity" : 20 },</span></p><p class="c3"><span class="c0"> { "product" : "toaster", "store number" : 2, "quantity" : 100 },</span></p><p class="c3"><span class="c0"> { "product" : "toaster", "store number" : 2, "quantity" : 50 },</span></p><p class="c3"><span class="c0"> { "product" : "toaster", "store number" : 3, "quantity" : 50 },</span></p><p class="c3"><span class="c0"> { "product" : "blender", "store number" : 3, "quantity" : 100 },</span></p><p class="c3"><span class="c0"> { "product" : "blender", "store number" : 3, "quantity" : 150 },</span></p><p class="c3"><span class="c0"> { "product" : "socks", "store number" : 1, "quantity" : 500 },</span></p><p class="c3"><span class="c0"> { "product" : "socks", "store number" : 2, "quantity" : 10 },</span></p><p class="c3"><span class="c0"> { "product" : "shirt", "store number" : 3, "quantity" : 10 }</span></p><p class="c3"><span class="c0">]</span></p><p class="c3"><span class="c0">let $join :=</span></p><p class="c3"><span class="c0"> for $store in jn:values($stores), $sale in jn:values($sales)</span></p><p class="c3"><span class="c0"> where $store("store number") = $sale("store number")</span></p><p class="c3"><span class="c0"> return {</span></p><p class="c3"><span class="c0"> "nb" : $store("store number"),</span></p><p class="c3"><span class="c0"> "state" : $store("state"),</span></p><p class="c3"><span class="c0"> "sold" : $sale("product")</span></p><p class="c3"><span class="c0"> }</span></p><p class="c3"><span class="c0">return [$join]</span></p><p class="c3 c4"><span class="c0 c7">[ </span></p><p class="c3 c4"><span class="c0 c7">{ "nb" : 1, "state" : "MA", "sold" : "broiler" },</span></p><p class="c3 c4"><span class="c0 c7">{ "nb" : 1, "state" : "MA", "sold" : "socks" },</span></p><p class="c3 c4"><span class="c0 c7">{ "nb" : 2, "state" : "MA", "sold" : "toaster" },</span></p><p class="c3 c4"><span class="c0 c7">{ "nb" : 2, "state" : "MA", "sold" : "toaster" },</span></p><p class="c3 c4"><span class="c0 c7">{ "nb" : 2, "state" : "MA", "sold" : "socks" },</span></p><p class="c3 c4"><span class="c0 c7">{ "nb" : 3, "state" : "CA", "sold" : "toaster" },</span></p><p class="c3 c4"><span class="c0 c7">{ "nb" : 3, "state" : "CA", "sold" : "blender" },</span></p><p class="c3 c4"><span class="c0 c7">{ "nb" : 3, "state" : "CA", "sold" : "blender" },</span></p><p class="c3 c4"><span class="c0 c7">{ "nb" : 3, "state" : "CA", "sold" : "shirt" }</span></p><p class="c3 c4"><span class="c0 c7"> ]</span></p><h1 class="c3"><a name="h.oii6pvliilhi"></a><span>Access external data</span></h1><p class="c3"><span>You can access a JSON file on your local disk with</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">jn:json("file.json")</span></p><p class="c3 c5"><span class="c0 c7">[ "The", "contents", "of", "your", "file" ]</span></p><p class="c1"><span></span></p><p class="c3"><span>Our implementation even supports collections of JSON objects or arrays:</span></p><p class="c1"><span></span></p><p class="c3"><span class="c0">dml:collection("my:data")</span></p><p class="c3 c5"><span class="c0 c7">{ "foo" : "Your" }</span></p><p class="c3 c5"><span class="c0 c7">{ "foo" : "Collection" }</span></p><p class="c3 c5"><span class="c0 c7">{ "foo" : "of" }</span></p><p class="c3 c5"><span class="c0 c7">{ "foo" : "JSON" }</span></p><p class="c3 c5"><span class="c0 c7">{ "foo" : "objects" }</span></p><h1 class="c3"><a name="h.bm3buqmzhtko"></a><span>I want more</span></h1><p class="c3 c6"><span>JSONiq supports JSON updates. You can declaratively update your JSON data. JSONiq provides functions that produce a list of updates. The list of updates that is eventually output by your program is then applied to your JSON data.</span></p><p class="c1"><span></span></p><p class="c3"><span>let $my-data := jn:json("persons.json")</span></p><p class="c3"><span>let $john := jn:value($my-data("John"))</span></p><p class="c3"><span>let $mary := jn:value($my-data("Mary"))</span></p><p class="c3"><span>return (jn:replace-value($john, "status", "married"), j:replace-value($mary, "status", "married"))</span></p><h2 class="c3"><a name="h.5itcphr8262b"></a><span>Even more</span></h2><p class="c3"><span>JSONiq can do way more that what is presented here. Here are a couple of highlights:</span></p><p class="c3 c6"><span>- JSONiq is a strongly typed language, but is smart enough to not bother you with types when unnecessary. It potentially supports static typing as well to detect errors before you even execute your program.</span></p><p class="c3"><span>- You can define your own functions and modules.</span></p><p class="c3"><span>- JSONiq provides you with loads of available modules.</span></p><p class="c3 c6"><span>- JSONiq has tons of further features such as switch, typeswitch and try-catch expressions, universal/existential quantifiers, path expressions, filtering expressions, functors, mappings, grouping, windowing.</span></p><h2 class="c3"><a name="h.j7oh3cyhem38"></a><span>More is not enough</span></h2><p class="c3 c6"><span>- JSONiq supports XML. Yes: you can manipulate JSON and XML with the same language! JSONiq is actually a superset of XQuery, a W3C standard, and extends its data model to support JSON.</span></p><p class="c3 c6"><span>- JSONiq supports scripting. If you need to write a full-fledged, side-effecting Web application, scripting is for you.</span></p></body></html>
\ No newline at end of file
=== modified file 'doc/zorba/indexpage.dox.in'
--- doc/zorba/indexpage.dox.in 2011-10-07 08:28:43 +0000
+++ doc/zorba/indexpage.dox.in 2012-02-09 00:24:44 +0000
@@ -124,7 +124,15 @@
\ref options_and_annotations
- <!--li>\ref extensions_update</li-->
+</td></tr>
+<tr><td class="tdDocIndexTable">
+
+ <h2>JSONiq</h2>
+
+
+ <a href="XQueryforJSON.html">JSONiq for JSON users</a>
+
+ <a href="JSONforXQuery.html">JSONiq for XQuery users</a>
</td></tr>
=== modified file 'include/zorba/config.h.cmake'
--- include/zorba/config.h.cmake 2012-02-05 12:31:20 +0000
+++ include/zorba/config.h.cmake 2012-02-09 00:24:44 +0000
@@ -155,6 +155,7 @@
#cmakedefine ZORBA_WITH_BIG_INTEGER
#cmakedefine ZORBA_WITH_DEBUGGER
#cmakedefine ZORBA_WITH_FILE_ACCESS
+#cmakedefine ZORBA_WITH_JSON
#cmakedefine ZORBA_WITH_LIBXML2_SAX
// Zorba parser configuration
=== modified file 'include/zorba/diagnostic.h'
--- include/zorba/diagnostic.h 2011-07-01 16:07:54 +0000
+++ include/zorba/diagnostic.h 2012-02-09 00:24:44 +0000
@@ -239,7 +239,15 @@
ZORBA_DEBUGGER, // Zorba Debugger
ZORBA_OS, // Operating System
ZORBA_SERIALIZATION,
- ZORBA_STORE
+ ZORBA_STORE,
+
+ JSON_PARSER,
+ JSON_SERIALIZATION,
+
+# ifdef ZORBA_WITH_JSON
+ JSONIQ_CORE,
+ JSONIQ_UPDATE
+# endif
};
/**
=== modified file 'include/zorba/error.h'
--- include/zorba/error.h 2011-07-04 21:23:55 +0000
+++ include/zorba/error.h 2012-02-09 00:24:44 +0000
@@ -42,6 +42,13 @@
*/
typedef internal::SystemDiagnostic<internal::ZorbaErrQName> ZorbaErrorCode;
+#ifdef ZORBA_WITH_JSON
+/**
+ * An %JSONiqErrorCode is a diagnostic for all JSONiq-specific errors.
+ */
+typedef internal::SystemDiagnostic<internal::JSONiqErrQName> JSONiqErrorCode;
+#endif
+
///////////////////////////////////////////////////////////////////////////////
/**
=== modified file 'include/zorba/identtypes.h'
--- include/zorba/identtypes.h 2011-09-21 14:49:55 +0000
+++ include/zorba/identtypes.h 2012-02-09 00:24:44 +0000
@@ -18,10 +18,14 @@
#include <zorba/config.h>
-namespace zorba {
-class ZORBA_DLL_PUBLIC IdentTypes {
+namespace zorba
+{
+
+class ZORBA_DLL_PUBLIC IdentTypes
+{
public:
- typedef enum {
+ typedef enum
+ {
NAMED_TYPE, // builtin atomic type
ELEMENT_TYPE,
ATTRIBUTE_TYPE,
@@ -30,12 +34,20 @@
TEXT_TYPE,
COMMENT_TYPE,
ANY_NODE_TYPE, // node()
+#ifdef ZORBA_WITH_JSON
+ STRUCTURED_ITEM_TYPE,
+ JSON_ITEM_TYPE,
+ JSON_OBJECT_TYPE,
+ JSON_ARRAY_TYPE,
+ JSON_PAIR_TYPE,
+#endif
ITEM_TYPE, // item()
EMPTY_TYPE, // empty-sequence()
INVALID_TYPE,
} kind_t;
- typedef enum {
+ typedef enum
+ {
QUANT_ONE,
QUANT_QUESTION,
QUANT_PLUS,
=== modified file 'include/zorba/internal/qname.h'
--- include/zorba/internal/qname.h 2011-06-30 16:42:30 +0000
+++ include/zorba/internal/qname.h 2012-02-09 00:24:44 +0000
@@ -182,6 +182,46 @@
///////////////////////////////////////////////////////////////////////////////
+#ifdef ZORBA_WITH_JSON
+
+/**
+ * An %JSONiqErrQName is-a FixedQName for standard JSONiq errors.
+ */
+class ZORBA_DLL_PUBLIC JSONiqErrQName :
+ public FixedQName<JSONiqErrQName,char const*>
+{
+ typedef FixedQName<JSONiqErrQName,char const*> base_type;
+public:
+ static char const NAMESPACE[];
+ static char const PREFIX[];
+
+ /**
+ * Constructs an %JSONiqErrQName.
+ *
+ * @param localname The local-name of the error.
+ */
+ JSONiqErrQName( char const *localname ) : base_type( localname ) { }
+
+ /**
+ * Gets the category of error this QName represents.
+ *
+ * @return Returns UNKNOWN_CATEGORY as there currently
+ * are no categories for JSONiq errors
+ */
+ zorba::diagnostic::category category() const;
+
+ /**
+ * Gets the kind of error this QName represents.
+ *
+ * @return Returns said kind.
+ */
+ zorba::diagnostic::kind kind() const;
+};
+
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+
/**
* An %ZorbaWarningQName is-a FixedQName for Zorba warnings.
*/
=== modified file 'include/zorba/item.h'
--- include/zorba/item.h 2012-01-11 17:30:25 +0000
+++ include/zorba/item.h 2012-02-09 00:24:44 +0000
@@ -142,6 +142,21 @@
Item
getType() const;
+#ifdef ZORBA_WITH_JSON
+
+ /**
+ * \brief Check if the Item is a JSON Item, that is, part of the JSONiq
+ * data model.
+ *
+ * Note that this function is available for all types of Items.
+ *
+ * @return true if the Item is a JSON Item, false otherwise.
+ */
+ bool
+ isJSONItem() const;
+
+#endif /* ZORBA_WITH_JSON */
+
/** \brief Get the atomization value of the Item.
*
* The atomization value is the value that is returned by atomization
@@ -346,6 +361,83 @@
int
getNodeKind() const;
+#ifdef ZORBA_WITH_JSON
+
+ /** \brief Get the kind of this (JSON) Item.
+ *
+ * Note that this function is only available for JSON Items, that is, Items
+ * which return true from isJSONItem().
+ *
+ * @return the kind of this JSON item
+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON).
+ */
+ store::StoreConsts::JSONItemKind
+ getJSONItemKind() const;
+
+ /** \brief Get the pairs from a JSON Object.
+ *
+ * Note that this function is only available for JSON Objects.
+ *
+ * @return Iterator over the pairs in this object.
+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON Object).
+ */
+ Iterator_t
+ getObjectPairs() const;
+
+ /** \brief Get the members of a JSON Array.
+ *
+ * Note that this function is only available for JSON Arrays.
+ *
+ * @return Iterator over the members of this array.
+ * @throw ZorbaException if an error occure (e.g. the Item is not of type JSON Array).
+ */
+ Iterator_t
+ getArrayMembers() const;
+
+ /** \brief Returns the value of a JSON Pair with the given name from a JSON Object.
+ *
+ * Note that this function is only available for JSON Objects.
+ *
+ * @param aName the name of the pair to return.
+ * @return Item the named Pair.
+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON Object).
+ */
+ Item
+ getObjectValue(String aName) const;
+
+ /** \brief Returns the item in the JSON array at the specified index.
+ *
+ * Note that this function is only available for JSON Arrays.
+ *
+ * @param aIndex the index in the array.
+ * @return Item the indexed Item.
+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON Array).
+ */
+ Item
+ getArrayMember(uint32_t aIndex) const;
+
+ /** \brief Returns the name of a JSON Pair.
+ *
+ * Note that this function is only available for JSON Pairs.
+ *
+ * @return Item the name of the Pair.
+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON Pair).
+ */
+ Item
+ getPairName() const;
+
+ /** \brief Returns the value of a JSON Pair.
+ *
+ * Note that this function is only available for JSON Pairs.
+ *
+ * @return Item the value of the Pair.
+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON Pair).
+ */
+ Item
+ getPairValue() const;
+
+#endif /* ZORBA_WITH_JSON */
+
/**
* Checks whether the item's content is streamable.
*
=== modified file 'include/zorba/item_factory.h'
--- include/zorba/item_factory.h 2012-01-11 17:30:25 +0000
+++ include/zorba/item_factory.h 2012-02-09 00:24:44 +0000
@@ -123,7 +123,7 @@
/** \brief Creates a Base64Binary Item
* see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
*
- * @param aBinData a pointer to the base64 binary data.
+ * @param aBinData a pointer to the base6c4 binary data.
* @param aLength the length of the base64 binary data.
* @return The Base64Binary Item.
*/
@@ -679,6 +679,51 @@
virtual Item createTextNode(
Item parent,
String content) = 0;
+
+#ifdef ZORBA_WITH_JSON
+
+ /**
+ * Create a JSON null item.
+ */
+ virtual Item createJSONNull() = 0;
+
+ /**
+ * Create a JSON Number item from a string. This will actually be
+ * an xs:integer, xs:double, or xs:decimal, depending on the content
+ * of the string.
+ *
+ * @param aString The input string.
+ */
+ virtual Item createJSONNumber(String aString) = 0;
+
+ /**
+ * Create a JSON Object containing the specified JSON Pairs.
+ *
+ * @param aPairs A std::vector<Item> containing JSON Pair items.
+ */
+ virtual Item createJSONObject(std::vector<Item>& aPairs) = 0;
+
+ /**
+ * Create a JSON Array containing the specified items.
+ *
+ * @param aItems A std::vector<Item> containing Items which may
+ * be stored in a JSON Array (namely JSON Arrays, JSON Objects,
+ * JSON nulls, valid JSON numeric types, or xs:strings).
+ */
+ virtual Item createJSONArray(std::vector<Item>& aItems) = 0;
+
+ /**
+ * Create a JSON Pair, suitable for putting into a JSON Object.
+ *
+ * @param aName The name for the pair.
+ * @param aValue The value for the pair. This must be of a type
+ * which may be the value of a JSON pair (namely JSON Arrays, JSON Objects,
+ * JSON nulls, valid JSON numeric types, or xs:strings).
+ */
+ virtual Item createJSONPair(String aName, Item aValue) = 0;
+
+#endif /* ZORBA_WITH_JSON */
+
}; // class ItemFactory
} // namespace zorba
=== modified file 'include/zorba/options.h'
--- include/zorba/options.h 2012-01-11 17:30:25 +0000
+++ include/zorba/options.h 2012-02-09 00:24:44 +0000
@@ -83,7 +83,11 @@
ZORBA_SERIALIZATION_METHOD_HTML,
ZORBA_SERIALIZATION_METHOD_XHTML,
ZORBA_SERIALIZATION_METHOD_TEXT,
- ZORBA_SERIALIZATION_METHOD_BINARY
+ ZORBA_SERIALIZATION_METHOD_BINARY,
+#ifdef ZORBA_WITH_JSON
+ ZORBA_SERIALIZATION_METHOD_JSON,
+ ZORBA_SERIALIZATION_METHOD_JSONIQ
+#endif
} Zorba_serialization_method_t;
=== modified file 'include/zorba/pregenerated/diagnostic_list.h'
--- include/zorba/pregenerated/diagnostic_list.h 2011-12-21 14:40:33 +0000
+++ include/zorba/pregenerated/diagnostic_list.h 2012-02-09 00:24:44 +0000
@@ -504,6 +504,12 @@
extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0042_ITERATOR_CLOSED;
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0043_CANNOT_SERIALIZE_JSON_ITEM;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0044_CANNOT_SERIALIZE_XML_ITEM;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0045_CANNOT_SERIALIZE_MIXED_XDM_JDM;
+
extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0070_INVALID_SERIALIZATION_METHOD_FOR_SAX;
extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0080_CANNOT_RETRIEVE_NODE_REFERENCE;
@@ -704,6 +710,8 @@
extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZSTR0012_COLLECTION_ITEM_MUST_BE_A_NODE;
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZSTR0013_COLLECTION_ITEM_MUST_BE_STRUCTURED;
+
extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZSTR0015_IC_ALREADY_EXISTS;
extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZSTR0016_IC_DOES_NOT_EXIST;
@@ -746,8 +754,70 @@
extern ZORBA_DLL_PUBLIC ZorbaErrorCode XSST0010;
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0001_ILLEGAL_CHARACTER;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0002_ILLEGAL_CODEPOINT;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0003_ILLEGAL_ESCAPE;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0004_ILLEGAL_LITERAL;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0005_ILLEGAL_NUMBER;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0006_UNEXPECTED_TOKEN;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0007_UNTERMINATED_STRING;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0001_NOT_DOCUMENT_OR_ELEMENT_NODE;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0002_ELEMENT_MISSING_ATTRIBUTE;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0003_BAD_ATTRIBUTE_VALUE;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0004_BAD_ELEMENT;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0005_BAD_CHILD_ELEMENT;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0006_NO_ELEMENT_CHILD;
+
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0007_NO_TEXT_CHILD;
+
} // namespace zerr
+namespace jerr {
+
+#if defined(ZORBA_WITH_JSON)
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSDY0001;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSDY0002;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSDY0003;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSDY0020;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSDY0040;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSDY0041;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0060;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0061;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSTY0001;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSTY0002;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0062;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0063;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0064;
+
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0065;
+#endif
+
+} // namespace jerr
+
namespace zwarn {
extern ZORBA_DLL_PUBLIC ZorbaWarningCode ZWST0002_UNKNOWN_ANNOTATION;
=== modified file 'include/zorba/store_consts.h'
--- include/zorba/store_consts.h 2011-06-14 17:26:33 +0000
+++ include/zorba/store_consts.h 2012-02-09 00:24:44 +0000
@@ -25,6 +25,13 @@
{
public:
+ enum NsScoping
+ {
+ ALL_NAMESPACES,
+ ONLY_LOCAL_NAMESPACES,
+ ONLY_PARENT_NAMESPACES
+ };
+
enum NodeKind
{
anyNode = 0,
@@ -36,16 +43,10 @@
commentNode = 6
};
- enum NsScoping
- {
- ALL_NAMESPACES,
- ONLY_LOCAL_NAMESPACES,
- ONLY_PARENT_NAMESPACES
- };
-
static std::string toString(NodeKind k)
{
- switch(k) {
+ switch(k)
+ {
case anyNode:
return "anyNode";
@@ -71,6 +72,39 @@
return "<unknown NodeKind>";
}
}
+
+
+ /* ATTENTION: the ordering of the enum values is important. Do NOT change it! */
+ enum JSONItemKind
+ {
+ jsonItem = 0,
+ jsonObject = 1,
+ jsonArray = 2,
+ jsonPair = 3
+ };
+
+
+ static std::string toString(JSONItemKind k)
+ {
+ switch(k)
+ {
+ case jsonItem:
+ return "json-item";
+
+ case jsonObject:
+ return "object";
+
+ case jsonArray:
+ return "array";
+
+ case jsonPair:
+ return "pair";
+
+ default:
+ return "<unknown JSONItemKind>";
+ }
+ }
+
};
} // namespace store
=== modified file 'include/zorba/typeident.h'
--- include/zorba/typeident.h 2011-06-14 17:26:33 +0000
+++ include/zorba/typeident.h 2012-02-09 00:24:44 +0000
@@ -64,45 +64,55 @@
const String& localNameName,
bool localNameWildcard,
TypeIdentifier_t contentType,
- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
- );
+ IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
static
TypeIdentifier_t
createDocumentType(
TypeIdentifier_t contentType,
- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
- );
-
- static
- TypeIdentifier_t
- createPIType(
- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
- );
-
- static
- TypeIdentifier_t
- createTextType(
- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
- );
-
- static
- TypeIdentifier_t
- createCommentType(
- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
- );
-
- static
- TypeIdentifier_t
- createAnyNodeType(
- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
- );
-
- static
- TypeIdentifier_t
- createItemType(
- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
- );
+ IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
+
+ static
+ TypeIdentifier_t
+ createPIType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
+
+ static
+ TypeIdentifier_t
+ createTextType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
+
+ static
+ TypeIdentifier_t
+ createCommentType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
+
+ static
+ TypeIdentifier_t
+ createAnyNodeType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
+
+#ifdef ZORBA_WITH_JSON
+ static
+ TypeIdentifier_t
+ createStructuredItemType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
+
+ static
+ TypeIdentifier_t
+ createJSONItemType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
+
+ static
+ TypeIdentifier_t
+ createJSONObjectType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
+
+ static
+ TypeIdentifier_t
+ createJSONArrayType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
+
+ static
+ TypeIdentifier_t
+ createJSONPairType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
+#endif
+
+ static
+ TypeIdentifier_t
+ createItemType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
static
TypeIdentifier_t
=== modified file 'modules/ExternalModules.conf'
--- modules/ExternalModules.conf 2012-02-08 05:52:51 +0000
+++ modules/ExternalModules.conf 2012-02-09 00:24:44 +0000
@@ -27,7 +27,7 @@
# currently only works for bzr, since svn tags are just different URLS)
data-cleaning bzr lp:zorba/data-cleaning-module zorba-2.1
-data-converters bzr lp:zorba/data-converters-module zorba-2.1
+data-converters bzr lp:zorba/data-converters-module
data-formatting bzr lp:zorba/data-formatting-module zorba-2.1
email bzr lp:zorba/email-module zorba-2.1
excel bzr lp:zorba/excel-module zorba-2.1
=== modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt'
--- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-02-05 12:31:20 +0000
+++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-02-09 00:24:44 +0000
@@ -103,6 +103,11 @@
DECLARE_ZORBA_MODULE(FILE store/static/integrity_constraints/dml.xq VERSION 2.0
URI "http://www.zorba-xquery.com/modules/store/static/integrity_constraints/dml")
+DECLARE_ZORBA_MODULE(FILE store/jsoniq/dynamic/collections/ddl.xq VERSION 1.0
+ URI "http://www.zorba-xquery.com/modules/store/jsoniq/dynamic/collections/ddl")
+DECLARE_ZORBA_MODULE(FILE store/jsoniq/dynamic/collections/dml.xq VERSION 1.0
+ URI "http://www.zorba-xquery.com/modules/store/jsoniq/dynamic/collections/dml")
+
# debugger client DBGP message handler module
IF (ZORBA_WITH_DEBUGGER)
DECLARE_ZORBA_MODULE (FILE debugger/dbgp-message-handler.xq VERSION 1.0
=== added file 'modules/com/zorba-xquery/www/modules/converters/json-options.xsd'
--- modules/com/zorba-xquery/www/modules/converters/json-options.xsd 1970-01-01 00:00:00 +0000
+++ modules/com/zorba-xquery/www/modules/converters/json-options.xsd 2012-02-09 00:24:44 +0000
@@ -0,0 +1,47 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:json="http://www.zorba-xquery.com/modules/converters/json-options"
+ targetNamespace="http://www.zorba-xquery.com/modules/converters/json-options"
+ elementFormDefault="qualified" attributeFormDefault="unqualified">
+<!--
+:: Copyright 2006-2008 The FLWOR Foundation.
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+::
+-->
+
+
+ <xs:element name="options">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="json-param" minOccurs="1" maxOccurs="1">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="value" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="simple-json"/>
+ <xs:enumeration value="json-ml"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="type" type="xs:string" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
=== added file 'modules/com/zorba-xquery/www/modules/converters/json.xq'
--- modules/com/zorba-xquery/www/modules/converters/json.xq 1970-01-01 00:00:00 +0000
+++ modules/com/zorba-xquery/www/modules/converters/json.xq 2012-02-09 00:24:44 +0000
@@ -0,0 +1,231 @@
+xquery version "3.0";
+
+ (:
+ : Copyright 2006-2009 The FLWOR Foundation.
+ :
+ : Licensed under the Apache License, Version 2.0 (the "License");
+ : you may not use this file except in compliance with the License.
+ : You may obtain a copy of the License at
+ :
+ : http://www.apache.org/licenses/LICENSE-2.0
+ :
+ : Unless required by applicable law or agreed to in writing, software
+ : distributed under the License is distributed on an "AS IS" BASIS,
+ : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ : See the License for the specific language governing permissions and
+ : limitations under the License.
+ :)
+
+ (:~
+ :
+ : <p>In order to enable JSON processing with XQuery, Zorba implements a set
+ : of functions that open XQuery developers the door to process JSON
+ : data. Specifically, this module provides two types of functions. Functions
+ : to:
+ : <ul>
+ : <li>parse JSON and convert it to XDM and</li>
+ : <li>serialize XDM in order to output JSON.</li>
+ : </ul>
+ : </p>
+ :
+ : <p>Both types of functions are available to parse and serialize two
+ : types of XDM-JSON mappings:<ul><li>the first mapping called in this document
+ : <strong>simple XDM-JSON</strong> has been
+ : <a href="http://john.snelson.org.uk/parsing-json-into-xquery">
+ : proposed by John Snelson</a></li><li>the second mapping is called
+ : <a href="http://jsonml.org/">JsonML</a></li></ul>In the following, we
+ : briefly describe both mappings.</p>
+ :
+ : <h2>Simple XDM-JSON Mapping</h2>
+ : <ul><li>In order to process JSON with XQuery, Zorba implements a mapping between
+ : JSON and XML that was initially proposed by John Snelson in his article
+ : <a href="http://snelson.org.uk/archives/2008/02/parsing_json_in.php#more"
+ : target="_blank">Parsing JSON into XQuery</a></li></ul>
+ :
+ : <h2>JsonML Mapping</h2>
+ : <ul>
+ : <li><a href="http://jsonml.org" target="_blank">JSonML</a> (JSON Markup Language)
+ : is an application of the JSON format.</li>
+ : <li>The purpose of JSonML is to provide a compact format for transporting
+ : XML-based markup as JSon. In contrast to the <strong>simple XDM-JSON</strong> mapping described above
+ : <strong>JsonML</strong> allows a lossless conversion back and forth.</li></ul>
+ :
+ : @author Sorin Nasoi
+ :
+ : @see <a href="http://john.snelson.org.uk/parsing-json-into-xquery">Mapping proposed by John Snelson</a>
+ : @see <a href="http://jsonml.org" target="_blank">JSonML</a>
+ : @project data processing/data converters
+ :
+ :)
+module namespace json = "http://www.zorba-xquery.com/modules/converters/json";
+
+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
+
+import schema namespace json-options = "http://www.zorba-xquery.com/modules/converters/json-options";
+
+declare namespace err = "http://www.w3.org/2005/xqt-errors";
+
+declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
+declare option ver:module-version "2.0";
+
+(:~
+ : This function parses a JSON string and returns an XDM instance according
+ : to either one of the mappings described above.
+ :
+ : @param $arg a sequence of valid JSON strings.
+ : @param $options a set of name and value pairs that provide options
+ : to configure the JSON mapping process that have to be validated against the
+ : "http://www.zorba-xquery.com/modules/converters/json-options" schema.
+ : @return a sequence of nodes according to either one of the mappings described above.
+ : @error err:XQDY0027 if $options can not be validated against the json-options schema
+ : @error json:ParseError if the JSON string passed as parameter is not
+ : valid JSON.
+ : @example test_json/Queries/converters/jansson/parse_json_02.xq
+ : @example test_json/Queries/converters/jansson/parse_json_ml_01.xq
+ :)
+declare function json:parse(
+ $arg as xs:string?,
+ $options as element(json-options:options)
+) as element(*, xs:untyped)*
+{
+ let $validated-options := if(schema:is-validated($options)) then
+ $options
+ else
+ validate{$options}
+ return
+ json:parse-internal($arg, $validated-options)
+};
+
+(:~
+ : This function parses a JSON string and returns an XDM instance according
+ : to simple XDM-JSON mapping described above.
+ :
+ : @param $arg a sequence of valid JSON strings.
+ : @return a sequence of nodes according to Simple XDM-JSON mapping described above.
+ : @error json:ParseError if the JSON string passed as parameter is not
+ : valid JSON.
+ : @example test_json/Queries/converters/jansson/parse_json_11.xq
+ :)
+declare function json:parse(
+ $arg as xs:string?
+) as element(*, xs:untyped)*
+{
+ json:parse-internal($arg,
+ validate {
+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
+ <json-param name="mapping" value="simple-json" />
+ </options>
+ }
+ )
+};
+
+(:~
+ : This function parses a JSON string and returns an XDM instance according
+ : to JsonML mapping described above.
+ :
+ : @param $arg a sequence of valid JSON strings.
+ : @return a sequence of nodes according the JSON-ML mapping described above.
+ : @error json:ParseError if the JSON string passed as parameter is not
+ : valid JSON.
+ : @example test_json/Queries/converters/jansson/parse_json_ml_05.xq
+ :)
+declare function json:parse-ml(
+ $arg as xs:string?
+) as element(*, xs:untyped)*
+{
+ json:parse-internal($arg,
+ validate {
+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
+ <json-param name="mapping" value="json-ml" type="array"/>
+ </options>
+ }
+ )
+};
+
+declare %private function json:parse-internal(
+ $html as xs:string,
+ $options as item()?
+) as element()* external;
+
+
+(:~
+ : The serialize function takes a sequence of nodes as parameter and
+ : transforms each element into a valid JSON string according to one of the
+ : mappings described above.
+ :
+ : @param $xml a sequence of nodes.
+ : @param $options a set of name and value pairs that provide options
+ : to configure the JSON mapping process that have to be validated against the
+ : "http://www.zorba-xquery.com/modules/converters/json-options" schema.
+ : @return a JSON string.
+ : @error err:XQDY0027 if $options can not be validated against the json-options schema
+ : @error json:InvalidXDM if the input $xml is not a valid XDM
+ : representation of JSON or JSON ML.
+ : @example test_json/Queries/converters/jansson/serialize_json_01.xq
+ : @example test_json/Queries/converters/jansson/serialize_json_ml_01.xq
+ :)
+declare function json:serialize(
+ $xml as item()*,
+ $options as element(json-options:options)
+) as xs:string
+{
+ let $validated-options := if(schema:is-validated($options)) then
+ $options
+ else
+ validate{$options}
+ return
+ json:serialize-internal($xml, $validated-options)
+};
+
+(:~
+ : The serialize function takes a sequence of nodes as parameter and
+ : transforms each element into a valid JSON string according to the
+ : Simple XDM-JSON mapping described above
+ :
+ : @param $xml a sequence of nodes.
+ : @return a JSON string.
+ : @error json:InvalidXDM if the input $xml is not a valid XDM
+ : representation of JSON or JSON ML.
+ : @example test_json/Queries/converters/jansson/serialize_json_18.xq
+ :)
+declare function json:serialize(
+ $xml as item()*
+) as xs:string
+{
+ json:serialize-internal($xml,
+ validate {
+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
+ <json-param name="mapping" value="simple-json" />
+ </options>
+ }
+ )
+};
+
+(:~
+ : The serialize function takes a sequence of nodes as parameter and
+ : transforms each element into a valid JSON string according to the
+ : JsonML mapping described above.
+ :
+ : @param $xml a sequence of nodes.
+ : @return a JSON string.
+ : @error json:InvalidXDM if the input $xml is not a valid XDM
+ : representation of JSON or JSON ML.
+ : @example test_json/Queries/converters/jansson/serialize_json_ml_04.xq
+ :)
+declare function json:serialize-ml(
+ $xml as item()*
+) as xs:string
+{
+ json:serialize-internal($xml,
+ validate {
+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
+ <json-param name="mapping" value="json-ml" type="array"/>
+ </options>
+ }
+ )
+};
+
+declare %private function json:serialize-internal(
+ $xml as item()*,
+ $options as item()?
+ ) as xs:string external;
=== modified file 'modules/com/zorba-xquery/www/modules/pregenerated/errors.xq'
--- modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2011-12-21 14:40:33 +0000
+++ modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2012-02-09 00:24:44 +0000
@@ -309,6 +309,18 @@
(:~
:)
+declare variable $zerr:ZAPI0043 as xs:QName := fn:QName($zerr:NS, "zerr:ZAPI0043");
+
+(:~
+:)
+declare variable $zerr:ZAPI0044 as xs:QName := fn:QName($zerr:NS, "zerr:ZAPI0044");
+
+(:~
+:)
+declare variable $zerr:ZAPI0045 as xs:QName := fn:QName($zerr:NS, "zerr:ZAPI0045");
+
+(:~
+:)
declare variable $zerr:ZAPI0070 as xs:QName := fn:QName($zerr:NS, "zerr:ZAPI0070");
(:~
@@ -704,6 +716,10 @@
(:~
:)
+declare variable $zerr:ZSTR0013 as xs:QName := fn:QName($zerr:NS, "zerr:ZSTR0013");
+
+(:~
+:)
declare variable $zerr:ZSTR0015 as xs:QName := fn:QName($zerr:NS, "zerr:ZSTR0015");
(:~
@@ -784,4 +800,60 @@
(:~
:)
-declare variable $zerr:XSST0010 as xs:QName := fn:QName($zerr:NS, "zerr:XSST0010");
\ No newline at end of file
+declare variable $zerr:XSST0010 as xs:QName := fn:QName($zerr:NS, "zerr:XSST0010");
+
+(:~
+:)
+declare variable $zerr:ZJPE0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0001");
+
+(:~
+:)
+declare variable $zerr:ZJPE0002 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0002");
+
+(:~
+:)
+declare variable $zerr:ZJPE0003 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0003");
+
+(:~
+:)
+declare variable $zerr:ZJPE0004 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0004");
+
+(:~
+:)
+declare variable $zerr:ZJPE0005 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0005");
+
+(:~
+:)
+declare variable $zerr:ZJPE0006 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0006");
+
+(:~
+:)
+declare variable $zerr:ZJPE0007 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0007");
+
+(:~
+:)
+declare variable $zerr:ZJSE0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0001");
+
+(:~
+:)
+declare variable $zerr:ZJSE0002 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0002");
+
+(:~
+:)
+declare variable $zerr:ZJSE0003 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0003");
+
+(:~
+:)
+declare variable $zerr:ZJSE0004 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0004");
+
+(:~
+:)
+declare variable $zerr:ZJSE0005 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0005");
+
+(:~
+:)
+declare variable $zerr:ZJSE0006 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0006");
+
+(:~
+:)
+declare variable $zerr:ZJSE0007 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0007");
\ No newline at end of file
=== added directory 'modules/com/zorba-xquery/www/modules/store/jsoniq'
=== added directory 'modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic'
=== added directory 'modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections'
=== added file 'modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/ddl.xq'
--- modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/ddl.xq 1970-01-01 00:00:00 +0000
+++ modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/ddl.xq 2012-02-09 00:24:44 +0000
@@ -0,0 +1,122 @@
+xquery version "3.0";
+
+(:
+ : Copyright 2006-2009 The FLWOR Foundation.
+ :
+ : Licensed under the Apache License, Version 2.0 (the "License");
+ : you may not use this file except in compliance with the License.
+ : You may obtain a copy of the License at
+ :
+ : http://www.apache.org/licenses/LICENSE-2.0
+ :
+ : Unless required by applicable law or agreed to in writing, software
+ : distributed under the License is distributed on an "AS IS" BASIS,
+ : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ : See the License for the specific language governing permissions and
+ : limitations under the License.
+:)
+
+(:~
+ : This modules defines a set of functions for managing persistent, ordered, and
+ : updatable collections that can contain both XML nodes and JSON objects and arrays.
+ :
+ : <p>Please refer to our documentation for <a href="../../html/data_lifecycle.html">
+ : more information</a> about the lifecycle management and the manipulation of such
+ : collections.</p>
+ :
+ : @see <a href="../../html/data_lifecycle.html">Data Lifecycle</a>
+ : @see http://www.zorba-xquery.com/modules/store/dynamic/collections/dml
+ : @see <a href="www.zorba-xquery.com_errors.html">http://www.zorba-xquery.com/errors</a>
+ :
+ : @author Matthias Brantner, David Graf, Till Westmann, Markos Zaharioudakis
+ :
+ : @project store/jsoniq/collections/dynamic
+ :
+ :)
+module namespace ddl = "http://www.zorba-xquery.com/modules/store/jsoniq/dynamic/collections/ddl";
+
+declare namespace zerr = "http://www.zorba-xquery.com/errors";
+declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
+
+declare option ver:module-version "1.0";
+declare option ver:zorba-version "2.1";
+
+(:~
+ : The function returns true if a collection with the given QName is available.
+ :
+ : @param $name The QName of the collection that is being checked.
+ :
+ : @return true if the collection is available and false otherwise.
+ :
+ :)
+declare function ddl:is-available-collection($name as xs:QName) as xs:boolean external;
+
+
+(:~
+ : The function returns a sequence of QNames of the collections that are
+ : available. The sequence will be empty if there are no collections.
+ :
+ : @return A sequence of QNames, one for each available collection, or an emtpy sequence.
+ :
+ :)
+declare function ddl:available-collections() as xs:QName* external;
+
+
+(:~
+ : The create function is an updating function which creates
+ : the collection with the given expanded QName.
+ :
+ : @param $name The QName of the collection to create.
+ :
+ : @return The result of the function is an empty XDM instance and a
+ : pending update list which, once applied, creates a collection
+ : with the given name.
+ :
+ : @error zerr:ZDDY0002 if a collection with the given expanded QName already
+ : exists.
+ :
+ :)
+declare updating function ddl:create($name as xs:QName) external;
+
+
+(:~
+ : The create function is an updating function which creates
+ : the collection with the given expanded QName. Moreover, it adds copies
+ : of the sequence $content to the new collection.
+ :
+ : @param $name The QName of the collection to create.
+ : @param $content The sequence of items that should be added to the new collection.
+ : The sequence may contain any mix of XML nodes, JSON objects, or
+ : JSON arrays.
+ : @return The result of the function is an empty XDM instance and a
+ : pending update list which, once applied, creates a collection
+ : with the given name and inserts the given nodes into it.
+ :
+ : @error zerr:ZDDY0002 if a collection with the given expanded QName already
+ : exists.
+ :
+ : @see ddl:create
+ : @see ddl:insert-nodes-last
+ :
+ :)
+declare updating function ddl:create(
+ $name as xs:QName,
+ $content as structured-item()*) external;
+
+
+(:~
+ : The delete function is an updating function that removes
+ : the collection with the given expanded QName.
+ :
+ : @param $name The QName of the collection to delete.
+ :
+ : @return The result of the function is an empty XDM instance and a pending
+ : update list which, once applied, deletes the collection with the given
+ : name.
+ :
+ : @error zerr:ZDDY0003 if the collection with the given name does not exist.
+ : @error zerr:ZDDY0015 if any of the in-scope variables references a node that
+ : belongs to the collection with QName $name.
+ :
+ :)
+declare updating function ddl:delete($coll as xs:QName) external;
=== added file 'modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/dml.xq'
--- modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/dml.xq 1970-01-01 00:00:00 +0000
+++ modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/dml.xq 2012-02-09 00:24:44 +0000
@@ -0,0 +1,354 @@
+xquery version "3.0";
+
+(:
+ : Copyright 2006-2009 The FLWOR Foundation.
+ :
+ : Licensed under the Apache License, Version 2.0 (the "License");
+ : you may not use this file except in compliance with the License.
+ : You may obtain a copy of the License at
+ :
+ : http://www.apache.org/licenses/LICENSE-2.0
+ :
+ : Unless required by applicable law or agreed to in writing, software
+ : distributed under the License is distributed on an "AS IS" BASIS,
+ : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ : See the License for the specific language governing permissions and
+ : limitations under the License.
+:)
+
+(:~
+ : This modules provides a set of functions to modify a collection and retrieve the
+ : items contained in a particular collection. Collections that are accessed by the
+ : functions of this module may contain any mix of XML nodes, JSON objects, or
+ : JSON arrays. The term "structured item" is used in this module to refer to an
+ : XML node, JSON object, or JSON array.
+ :
+ : <p>Please refer to our documentation for <a href="../../html/data_lifecycle.html">
+ : more information</a> about the lifecycle management and the manipulation of such
+ : collections.</p>
+ :
+ : @see <a href="../../html/data_lifecycle.html">Data Lifecycle</a>
+ : @see http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl
+ : @see <a href="www.zorba-xquery.com_errors.html">http://www.zorba-xquery.com/errors</a>
+ :
+ : @author Matthias Brantner, David Graf, Till Westmann, Markos Zaharioudakis
+ :
+ : @project store/jsoniq/collections/dynamic
+ :)
+module namespace dml = "http://www.zorba-xquery.com/modules/store/jsoniq/dynamic/collections/dml";
+
+declare namespace zerr = "http://www.zorba-xquery.com/errors";
+declare namespace ann = "http://www.zorba-xquery.com/annotations";
+
+declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
+
+declare option ver:module-version "1.0";
+declare option ver:zorba-version "2.1";
+
+(:~
+ : The insert-nodes-first function is an updating function that inserts copies of the
+ : given structured items at the beginning of the collection.
+ :
+ : @param $name The name of the collection to which the items should be added.
+ : @param $content The sequences of structured items whose copies should be added
+ : to the collection.
+ :
+ : @return The result of the function is an empty XDM instance and a pending update
+ : list which, once applied, inserts the items into the collection.
+ :
+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
+ :
+ :)
+declare updating function dml:insert-nodes-first(
+ $name as xs:QName,
+ $content as structured-item()*) external;
+
+(:~
+ : The insert-nodes-last function is an updating function that inserts copies of the
+ : given structured items at the end of the collection.
+ :
+ : @param $name The name of the collection to which the items should be added.
+ : @param $content The sequences of structured items whose copies should be added
+ : to the collection.
+ :
+ : @return The result of the function is an empty XDM instance and a pending update list
+ : which, once applied, inserts the items into the collection.
+ :
+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
+ :
+ :)
+declare updating function dml:insert-nodes-last(
+ $name as xs:QName,
+ $content as structured-item()*) external;
+
+
+(:~
+ : The insert-nodes-before function is an updating function that inserts copies
+ : of the given structured items into a collection at the position directly
+ : preceding the given target item.
+ :
+ : @param $name The name of the collection to which the items should be added.
+ : @param $target The item in the collection before which the $content
+ : sequence should be inserted.
+ : @param $content The sequences of structured items whose copies should be
+ : added to the collection.
+ :
+ : @return The result of the function is an empty XDM instance and a pending update list
+ : which, once applied, inserts the items into the collection.
+ :
+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
+ : @error zerr:ZDDY0011 if the target item is not contained in the collection.
+ :
+ :)
+declare updating function dml:insert-nodes-before(
+ $name as xs:QName,
+ $target as structured-item(),
+ $content as structured-item()*) external;
+
+
+(:~
+ : The insert-nodes-after function is an updating function that inserts copies
+ : of the given structured items into a collection at the position directly
+ : following the given target item.
+ :
+ : @param $name The name of the collection to which the items should be added.
+ : @param $target The structured item in the collection after which the $content
+ : sequence should be inserted.
+ : @param $content The sequences of structured items whose copies should be added
+ : to the collection.
+ :
+ : @return The result of the function is an empty XDM instance and a pending update list
+ : which, once applied, inserts the items into the collection.
+ :
+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
+ : @error zerr:ZDDY0011 if the target item is not contained in the collection.
+ :
+ :)
+declare updating function dml:insert-nodes-after(
+ $name as xs:QName,
+ $pos as structured-item(),
+ $content as structured-item()*) external;
+
+
+(:~
+ : This function does the same as the insert-nodes function except
+ : it immediately applies the resulting pending updates and returns the
+ : structured items that have been inserted.
+ :
+ : @param $name The name of the collection to which the items should be added.
+ : @param $content The sequences of structured items whose copies should be added
+ : to the collection.
+ :
+ : @return The result of the function is the sequence of items that have been
+ : inserted into the collection.
+ :
+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
+ :
+ : @see dml:insert-nodes-first
+ :
+ :)
+declare %ann:sequential function dml:apply-insert-nodes-first(
+ $name as xs:QName,
+ $content as structured-item()*) as structured-item()* external;
+
+
+(:~
+ : This function does the same as the insert-nodes-last function except
+ : it immediately applies the resulting pending updates and returns the
+ : structured items that have been inserted.
+ :
+ : @param $name The name of the collection to which the items should be added.
+ : @param $content The sequences of structured items whose copies should be added
+ : to the collection.
+ :
+ : @return The result of the function is the sequence of items that have been
+ : inserted into the collection.
+ :
+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
+ :
+ : @see dml:insert-nodes-last
+ :
+ :)
+declare %ann:sequential function dml:apply-insert-nodes-last(
+ $name as xs:QName,
+ $content as structured-item()*) as structured-item()* external;
+
+
+(:~
+ : This function does the same as the insert-nodes-before function except
+ : it immediately applies the resulting pending updates and returns the
+ : structured items that have been inserted.
+ :
+ : @param $name The name of the collection to which the items should be added.
+ : @param $target The structured item in the collection before which the $content
+ : sequence should be inserted.
+ : @param $content The sequences of structured items whose copies should be added
+ : to the collection.
+ :
+ : @return The result of the function is the sequence of items that have been
+ : inserted into the collection.
+ :
+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
+ :
+ : @see dml:insert-nodes-before
+ :
+ :)
+declare %ann:sequential function dml:apply-insert-nodes-before(
+ $name as xs:QName,
+ $target as structured-item(),
+ $content as structured-item()*) as structured-item()* external;
+
+
+(:~
+ : This function does the same as the insert-nodes-after function except
+ : it immediately applies the resulting pending updates and returns the
+ : structured items that have been inserted.
+ :
+ : @param $name The name of the collection to which the items should be added.
+ : @param $target The structured item in the collection after which the $content
+ : sequence should be inserted.
+ : @param $content The sequences of structured items whose copies should be added
+ : to the collection.
+ :
+ : @return The result of the function is the sequence of items that have been
+ : inserted into the collection.
+ :
+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
+ :
+ : @see dml:insert-nodes-after
+ :
+ :)
+declare %ann:sequential function dml:apply-insert-nodes-after(
+ $name as xs:QName,
+ $pos as structured-item(),
+ $content as structured-item()*) as structured-item()* external;
+
+
+(:~
+ : The delete-nodes function is an updating function that deletes zero of more
+ : structured items from a collection.
+ :
+ : @param $target the structured items in the collection that should be deleted.
+ :
+ : @return The result of this function is an empty XDM instance and a pending update
+ : list which, once applied, deletes the items from their collections.
+ :
+ : @error zerr:ZDDY0011 if any items in the $target sequence is not a member of
+ : a collection or not all items of the $target sequence belong to the
+ : same collection.
+ :)
+declare updating function dml:delete-nodes($target as structured-item()*) external;
+
+
+(:~
+ : The delete-node-first function is an updating function that deletes the
+ : first item from a collection.
+ :
+ : @param $name The name of the collection from which the first item should be deleted.
+ :
+ : @return The result of this function is an empty XDM instance and a pending update
+ : list which, once applied, deletes the first item from the collection.
+ :
+ : @error zerr:ZDDY0011 if the collection doesn't contain any item.
+ :
+ :)
+declare updating function dml:delete-node-first($name as xs:QName) external;
+
+
+(:~
+ : The delete-nodes-first function is an updating function that deletes the
+ : first n items from a collection.
+ :
+ : @param $name The name of the collection from which the first items should be deleted.
+ : @param $number The number of items that should be removed from the beginning of
+ : the collection.
+ :
+ : @return The result of this function is an empty XDM instance and a pending update
+ : list which, once applied, deletes the items from the collection.
+ :
+ : @error zerr:ZDDY0011 if the collection doesn't contain the given number of items.
+ :
+ :)
+declare updating function dml:delete-nodes-first(
+ $name as xs:QName,
+ $number as xs:integer) external;
+
+
+(:~
+ : The delete-node-last function is an updating function that deletes the
+ : last item from a collection.
+ :
+ : @param $name The name of the collection from which the last item should be deleted.
+ :
+ : @return The result of this function is an empty XDM instance and a pending update
+ : list which, once applied, deletes the last item from the collection.
+ :
+ : @error zerr:ZDDY0009 If available collections does not provide a mapping
+ : for the expanded QName $name.
+ : @error zerr:ZDDY0011 if the collection doesn't contain any item.
+ :
+ :)
+declare updating function dml:delete-node-last($name as xs:QName) external;
+
+
+(:~
+ : The delete-nodes-last function is an updating function that deletes the
+ : last n items from an ordered collection.
+ :
+ : @param $name The name of the collection from which the last items should be deleted.
+ : @param $number The number of items to delete.
+ :
+ : @return The result of this function is an empty XDM instance and a pending update
+ : list which, once applied, deletes the last n items.
+ :
+ : @error zerr:ZDDY0009 If available collections does not provide a mapping
+ : for the expanded QName $name.
+ : @error zerr:ZDDY0011 if the collection doesn't contain the given number of items.
+ :
+ :)
+declare updating function dml:delete-nodes-last(
+ $name as xs:QName,
+ $number as xs:integer) external;
+
+
+(:~
+ : The index-of function returns the index of the given structured item in
+ : the collection.
+ :
+ : @param $item The structured item to retrieve the index of.
+ :
+ : @return Returns the position as xs:integer of the given item in the collection.
+ :
+ : @error zerr:ZDDY0011 if item is not contained in any collection.
+ :
+ :)
+declare function dml:index-of($item as structured-item()) as xs:integer external;
+
+
+(:~
+ : The collection function returns the sequence of structured items of the
+ : collection identified by the given name.
+ :
+ : @param $name The name of the collection.
+ :
+ : @return The sequence contained in the given collection.
+ :
+ : @error zerr:ZDDY0009 If available collections does not provide a mapping
+ : for the expanded QName $name.
+ :
+ :)
+declare function dml:collection($name as xs:QName) as structured-item()* external;
+
+
+(:~
+ : This function returns the name of the collection the given structured item
+ : belongs to.
+ :
+ : @param $item The item for which to get the name of the collection
+ : @return The result of this function is a QName which identifies the collection
+ : to which the given item belongs to.
+ :
+ : @error zerr:ZDDY0011 if the given item does not belong to a collection.
+ :
+ :)
+declare function dml:collection-name($item as structured-item()) as xs:QName external;
=== added directory 'modules/com/zorba-xquery/www/modules/store/jsoniq/static'
=== modified file 'modules/org/CMakeLists.txt'
--- modules/org/CMakeLists.txt 2011-01-19 14:45:10 +0000
+++ modules/org/CMakeLists.txt 2012-02-09 00:24:44 +0000
@@ -12,3 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ADD_SUBDIRECTORY(expath)
+ADD_SUBDIRECTORY(jsoniq)
+
=== added directory 'modules/org/jsoniq'
=== added file 'modules/org/jsoniq/CMakeLists.txt'
--- modules/org/jsoniq/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ modules/org/jsoniq/CMakeLists.txt 2012-02-09 00:24:44 +0000
@@ -0,0 +1,15 @@
+# Copyright 2011 The FLWOR Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+ADD_SUBDIRECTORY(www)
=== added directory 'modules/org/jsoniq/www'
=== added file 'modules/org/jsoniq/www/CMakeLists.txt'
--- modules/org/jsoniq/www/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ modules/org/jsoniq/www/CMakeLists.txt 2012-02-09 00:24:44 +0000
@@ -0,0 +1,21 @@
+# Copyright 2006-2008 The FLWOR Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+IF(ZORBA_WITH_JSON)
+ DECLARE_ZORBA_MODULE(FILE functions.xq VERSION 1.0
+ URI "http://www.jsoniq.org/functions")
+ DECLARE_ZORBA_MODULE (FILE pregenerated/errors.xq
+ URI "http://www.jsoniq.org/errors")
+ENDIF(ZORBA_WITH_JSON)
+
=== added file 'modules/org/jsoniq/www/functions.xq'
--- modules/org/jsoniq/www/functions.xq 1970-01-01 00:00:00 +0000
+++ modules/org/jsoniq/www/functions.xq 2012-02-09 00:24:44 +0000
@@ -0,0 +1,389 @@
+(:~
+ : This module provides the functions defined by the JSONiq specification,
+ : sections 1.7 (Functions) and 1.10 (Update Primitives). JSONiq extends
+ : the XQuery specification to also deal with JSON data natively. See
+ :
+ : http://www.jsoniq.org/
+ :
+ : for details.
+ :
+ : This module depends on having the JSONiq feature enabled in Zorba,
+ : ie, Zorba must be compiled with ZORBA_WITH_JSON.
+ :)
+module namespace j = "http://www.jsoniq.org/functions";
+
+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
+
+declare namespace jdm = "http://www.jsoniq.org/";
+
+declare namespace err = "http://www.w3.org/2005/xqt-errors";
+
+declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
+declare option ver:module-version "1.0";
+
+(:~
+ : Recursively "flatten" a JSON Array, by replacing any arrays with their
+ : members. Equivalent to
+ :
+ : define function j:flatten($arg as array()) {
+ : for $value in j:values($arg)
+ : return
+ : if ($value instance of array())
+ : then j:flatten($value)
+ : else $value
+ : };
+ :
+ : @param $a A JSON Array.
+ : @return The flattened version of $a.
+ :)
+declare function j:flatten($a as array()) as item()* external;
+
+(:~
+ : This function has the same semantics as fn:parse-xml(), except that
+ : it parses the string as JSON (not XML), and returns an Object or
+ : Array rather than an XML document.
+ :
+ : @param $j A string containing a valid JSON text.
+ : @return a JSON Object or Array item.
+ :)
+declare function j:parse-json($j as xs:string) as json-item()? external;
+
+(:~
+ : Returns the names used in the Pairs of the object. This function is
+ : equivalent to
+ :
+ : for $p in j:pairs($arg) return j:name($p)
+ :
+ : The names will be returned in an implementation-defined order
+ :
+ : @param $o A JSON Object.
+ : @return The names of pairs in the object.
+ :)
+declare function j:names($o as object()) as xs:string* external;
+
+(:~
+ : Returns the name of the Pair.
+ :
+ : @param $p A JSON Pair.
+ : @return The name of the Pair.
+ :)
+declare function j:name($p as pair()) as xs:string external;
+
+(:~
+ : Returns the Pairs of the Object. The pairs will be returned in an
+ : implementation-defined order.
+ :
+ : @param $o A JSON Object.
+ : @return A sequence of JSON Pair items.
+ :)
+declare function j:pairs($o as object()) as pair()* external;
+
+(:~
+ : Returns the Pair of an Object with the specified name. If no such
+ : Pair exists in the Object, returns the empty sequence.
+ :
+ : @param $o A JSON Object.
+ : @param $n A name.
+ : @return The Pair with the given name, or empty sequence.
+ :)
+declare function j:pair($o as object(), $n as xs:string) as pair()? external;
+
+(:~
+ : Returns the member of an Array at the specified position (starting from 1).
+ : If the position is out of bounds of the array, returns the empty sequence.
+ :
+ : @param $a A JSON Array.
+ : @param $p The position in the array.
+ : @return The member at the specified position, or empty sequence.
+ :)
+declare function j:member($o as array(), $p as xs:integer) as item()? external;
+
+(:~
+ : Returns the size of a JSON Object or JSON Array. The size of an Object
+ : is the number of Pairs contained within it; the size of an Array is
+ : the number of members contained within it.
+ :
+ : @param $j A JSON Object or JSON Array.
+ : @return The number of items in $j.
+ : @error j:JUDY0060 if $j is a JSON Pair.
+ :)
+declare function j:size($j as json-item()) as xs:integer external;
+
+(:~
+ : Returns all Pairs in an Object, or all members of an Array. When
+ : passed an Object, the Pairs will be returned in an implementation-
+ : defined order.
+ :
+ : @param $j A JSON Object or JSON Array.
+ : @return All Pairs/members of $j.
+ : @error j:JUDY0060 if $j is a JSON Pair.
+ :)
+declare function j:values($j as json-item()) as item()* external;
+
+(:~
+ : Returns the value of a JSON Pair.
+ :
+ : @param $p A JSON Pair.
+ : @return the value of $p.
+ :)
+declare function j:value($p as pair()) as item() external;
+
+(:~
+ : Returns the jdm:null value null.
+ :
+ : @return the said value
+ :)
+declare function j:null() as jdm:null external;
+
+(:~
+ : Insert one or more pairs into an object. Recall that a JSON Object
+ : may not contain two pairs with the same name. This function will not
+ : replace a pair in an object.
+ :
+ : @param $o A JSON Object.
+ : @param $p A sequence of Pairs to insert.
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, inserts the pairs into the object.
+ : @error j:JUDY0060 if pair with the given name already exists.
+ :)
+declare updating function j:insert-into(
+ $o as object(),
+ $p as pair()*) external;
+
+(:~
+ : Insert one or more items into a JSON Array. The items will be inserted
+ : at the beginning of the array.
+ :
+ : @param $a A JSON Array.
+ : @param $i A sequence of items to insert.
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, inserts the items into the array.
+ :)
+declare updating function j:insert-as-first(
+ $a as array(),
+ $i as item()*) external;
+
+(:~
+ : Insert one or more items into a JSON Array. The items will be inserted
+ : after the specified position in the array.
+ :
+ : The position must exist in the array. You cannot specify an position of 0
+ : to insert at the beginning of the array (use j:insert-as-first($a, ...) or
+ : j:insert-before($a, 1, ...)).
+ :
+ : @param $a A JSON Array.
+ : @param $pos The position.
+ : @param $i A sequence of items to insert.
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, inserts the items into the array.
+ : @error j:JUDY0061 if the position doesn't select an existing array member
+ :)
+declare updating function j:insert-after(
+ $a as array(),
+ $pos as xs:integer,
+ $i as item()*) external;
+
+(:~
+ : Insert one or more items into a JSON Array. The items will be inserted
+ : before the specified position in the array.
+ :
+ : The position must exist in the array.
+ :
+ : @param $a A JSON Array.
+ : @param $pos The position.
+ : @param $i A sequence of items to insert.
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, inserts the items into the array.
+ : @error j:JUDY0061 if the position doesn't select an existing array member
+ :)
+declare updating function j:insert-before(
+ $a as array(),
+ $pos as xs:integer,
+ $i as item()*) external;
+
+(:~
+ : Insert one or more items into a JSON Array. The items will be inserted
+ : at the end of the array.
+ :
+ : @param $a A JSON Array.
+ : @param $i A sequence of items to insert.
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, inserts the items into the array.
+ :)
+declare updating function j:insert-as-last(
+ $a as array(),
+ $i as item()*) external;
+
+(:~
+ : Delete an item from a JSON Array or a Pair from a JSON Object.
+ :
+ : If $j is an Object and $selector is an xs:string, deletes the Pair
+ : $i($selector) if it exists, raising an error if it does not exist.
+ :
+ : If $j is an Array and $selector is an xs:integer, deletes the member
+ : $i($selector) if it exists, raising an error if it does not exist.
+ :
+ : In any other case, a type error is raised.
+ : @param $j A JSON Array or JSON Object.
+ : @param $select An xs:string (if $j is an Object) or xs:integer
+ : (if $j is an array).
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, deletes the item from the array or object.
+ : @error j:JUDY0061 if the selector doesn't select an existing pair or
+ : array member
+ : @error j:JUDY0062 if the first argument is a pair
+ : @error j:JUDY0063 invalid type for second argument (must be xs:integer
+ : if first argument is an array or xs:string if first argument is an object)
+ :)
+declare updating function j:delete(
+ $j as json-item(),
+ $selector as xs:anyAtomicType)
+{
+ try {
+ typeswitch ($j)
+ case $o as object()
+ return j:delete-pair($o, $selector treat as xs:string)
+ case $a as array()
+ return j:delete-member($a, $selector treat as xs:integer)
+ default return
+ fn:error(
+ fn:QName("http://www.jsoniq.org/errors", "JUDY0062"),
+ "first argument to delete function is pair() but must be array() or object()",
+ $j)
+ } catch err:XPDY0050 {
+ fn:error(
+ fn:QName("http://www.jsoniq.org/errors", "JUDY0063"),
+ concat(
+ schema:schema-type($selector),
+ ": invalid type for second argument; should be ",
+ typeswitch ($j)
+ case object() return "xs:string"
+ default return "xs:integer"
+ ),
+ $selector
+ )
+ }
+};
+
+(:~
+ : Delete a pair from a JSON Object by name.
+ :
+ : @param $o A JSON Object.
+ : @param $n The name of the Pair to delete.
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, deletes the pair from the object.
+ : @error j:JUDY0061 if the key doesn't select an existing pair.
+ :)
+declare updating function j:delete-pair(
+ $o as object(),
+ $key as xs:string) external;
+
+(:~
+ : Delete an item from a JSON Array.
+ :
+ : @param $a A JSON Array.
+ : @param $pos The position in the array to delete.
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, deletes the item from the array.
+ : @error j:JUDY0061 if the position doesn't select an existing member
+ :)
+declare updating function j:delete-member(
+ $a as array(),
+ $pos as xs:integer) external;
+
+(:~
+ : Assigns a new name to a JSON Pair in an Object.
+ :
+ : @param $o A JSON Object.
+ : @param $old-name The current name of a Pair in the Object.
+ : @param $new-name The new name for the Pair.
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, renames the pair.
+ : @error j:JUDY0061 if $old-name doesn't select an existing pair.
+ :)
+declare updating function j:rename(
+ $o as object(),
+ $old-name as xs:string,
+ $new-name as xs:string) external;
+
+(:~
+ : Replace an item in an Array, or the value of a Pair in an Object.
+ :
+ : If $j is an Object and $selector is an xs:string, replaces the value
+ : of the Pair $i($selector) if it exists, raising an error if it does
+ : not exist.
+ :
+ : If $j is an Array and $selector is an xs:integer, replaces the member
+ : $i($selector) if it exists, raising an error if it does not exist.
+ :
+ : In any other case, a type error is raised.
+ :
+ : @param $j A JSON Object or Array.
+ : @param $select An xs:string (if $j is an Object) or xs:integer
+ : (if $j is an array).
+ : @param $new-val The new item to insert into the Object or Array in
+ : place of the old value.
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, replaces the selected item in the object or array.
+ : @error j:JUDY0061 if $selector is wrong. (QQQ needs testing)
+ :)
+declare updating function j:replace-value(
+ $j as json-item(),
+ $selector as xs:anyAtomicType,
+ $new-val as item())
+{
+ try {
+ typeswitch ($j)
+ case $o as object()
+ return j:replace-value-in-object($o, $selector treat as xs:string, $new-val)
+ case $a as array()
+ return j:replace-value-in-array($a, $selector treat as xs:integer, $new-val)
+ default return
+ fn:error(
+ fn:QName("http://www.jsoniq.org/errors", "JUDY0062"),
+ "first argument to replace-value function is pair() but must be array() or object()",
+ $j)
+ } catch err:XPDY0050 {
+ fn:error(
+ fn:QName("http://www.jsoniq.org/errors", "JUDY0063"),
+ concat(
+ schema:schema-type($selector),
+ ": invalid type for second argument; should be ",
+ typeswitch ($j)
+ case object() return "xs:string"
+ default return "xs:integer"
+ ),
+ $selector
+ )
+ }
+};
+
+(:~
+ : Replace the value of a Pair in an Object.
+ :
+ : @param $o A JSON Object.
+ : @param $n The name of a Pair in $o.
+ : @param $new-val The new value for the Pair.
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, replaces the value of the selected pair in the object.
+ : @error j:JUDY0061 if the position doesn't select an existing member
+ :)
+declare updating function j:replace-value-in-object(
+ $o as object(),
+ $n as xs:string,
+ $new-val as item()) external;
+
+(:~
+ : Replace an item in a JSON Array.
+ : @param $a A JSON Array.
+ : @param $pos The position in the array to replace.
+ : @param $new-valu The new item to put in the array in place of the
+ : existing item.
+ : @return An empty XDM instance and a pending update list which, once
+ : applied, replaces the selected item in the array.
+ : @error j:JUDY0061 if the position doesn't select an existing member
+ :)
+declare updating function j:replace-value-in-array(
+ $a as array(),
+ $pos as xs:integer,
+ $new-val as item()) external;
=== added directory 'modules/org/jsoniq/www/pregenerated'
=== added file 'modules/org/jsoniq/www/pregenerated/errors.xq'
--- modules/org/jsoniq/www/pregenerated/errors.xq 1970-01-01 00:00:00 +0000
+++ modules/org/jsoniq/www/pregenerated/errors.xq 2012-02-09 00:24:44 +0000
@@ -0,0 +1,109 @@
+(:
+ : Copyright 2006-2011 The FLWOR Foundation.
+ :
+ : Licensed under the Apache License, Version 2.0 (the "License");
+ : you may not use this file except in compliance with the License.
+ : You may obtain a copy of the License at
+ :
+ : http://www.apache.org/licenses/LICENSE-2.0
+ :
+ : Unless required by applicable law or agreed to in writing, software
+ : distributed under the License is distributed on an "AS IS" BASIS,
+ : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ : See the License for the specific language governing permissions and
+ : limitations under the License.
+ :)
+
+ (:
+ : THIS FILE IS GENERATED.
+ : PLEASE DO NOT EDIT.
+ :)
+ (:~
+ : This module contains one declaration of a variable for each
+ : error of the http://www.jsoniq.org/errors namespace.
+ : The variables serves as documentation for the errors but can also
+ : be used in the code. For example, one useful scenario is to compare
+ : an error caught in the catch clause of a try-catch expression with one of
+ : the variables.
+ :
+ : @author Carlos Lopez
+ :
+ : @project error
+ :)
+
+xquery version '1.0';
+
+module namespace jerr = 'http://www.jsoniq.org/errors';
+
+declare variable $jerr:NS := 'http://www.jsoniq.org/errors';
+
+(:~
+:)
+declare variable $jerr:JSDY0001 as xs:QName := fn:QName($jerr:NS, "jerr:JSDY0001");
+
+(:~
+:)
+declare variable $jerr:JSDY0002 as xs:QName := fn:QName($jerr:NS, "jerr:JSDY0002");
+
+(:~
+ :error raised by object constructor
+:)
+declare variable $jerr:JSDY0003 as xs:QName := fn:QName($jerr:NS, "jerr:JSDY0003");
+
+
+declare variable $jerr:JSDY0020 as xs:QName := fn:QName($jerr:NS, "jerr:JSDY0020");
+
+(:~
+ :parser errors raised by the JSONIQLoader
+:)
+declare variable $jerr:JSDY0040 as xs:QName := fn:QName($jerr:NS, "jerr:JSDY0040");
+
+(:~
+ :error raised by block expression
+:)
+declare variable $jerr:JSDY0041 as xs:QName := fn:QName($jerr:NS, "jerr:JSDY0041");
+
+(:~
+ :error raised by insert-into
+:)
+declare variable $jerr:JUDY0060 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0060");
+
+(:~
+ :error raised by upd:delete, upd:insert-before/after
+:)
+declare variable $jerr:JUDY0061 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0061");
+
+(:~
+ :objects or arrays don't have a typed value
+:)
+declare variable $jerr:JSTY0001 as xs:QName := fn:QName($jerr:NS, "jerr:JSTY0001");
+
+(:~
+ :objects or arrays don't have a string value
+:)
+declare variable $jerr:JSTY0002 as xs:QName := fn:QName($jerr:NS, "jerr:JSTY0002");
+
+(:~
+ :error raised by upd:delete if the argument is not an object or array
+:)
+declare variable $jerr:JUDY0062 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0062");
+
+(:~
+ :error raised by upd:delete if the first argument is an
+ : object/array but second argument is not of type xs:string/xs:integer,
+ : respectively
+ :
+:)
+declare variable $jerr:JUDY0063 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0063");
+
+(:~
+ :error raised by mergeUpdates. An insert-before or insert-last
+ : UP must not have the same target as any other insert-before, -last, -as-first, or -as-last UP
+ :
+:)
+declare variable $jerr:JUDY0064 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0064");
+
+(:~
+ :error raised by upd:rename
+:)
+declare variable $jerr:JUDY0065 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0065");
\ No newline at end of file
=== modified file 'src/annotations/annotations.h'
--- src/annotations/annotations.h 2012-01-11 17:30:25 +0000
+++ src/annotations/annotations.h 2012-02-09 00:24:44 +0000
@@ -22,7 +22,7 @@
#include "common/shared_types.h"
-#include "compiler/parsetree/parsenodes.h"
+//#include "compiler/parsetree/parsenodes.h"
#include "zorbautils/hashmap_itemh.h"
=== modified file 'src/api/collectionimpl.cpp'
--- src/api/collectionimpl.cpp 2011-11-02 06:14:25 +0000
+++ src/api/collectionimpl.cpp 2012-02-09 00:24:44 +0000
@@ -429,12 +429,17 @@
store::Store* lStore = & GENV_STORE;
- store::Collection_t lColl = lStore->getCollection(lQName);
-
- if (!lColl)
- {
- lColl = lStore->getCollection(lQName, true);
- }
+ store::Collection_t lColl = lStore->getCollection(lQName, false, false);
+
+ if (!lColl)
+ lColl = lStore->getCollection(lQName, true, false);
+
+ if (!lColl)
+ lColl = lStore->getCollection(lQName, false, true);
+
+ if (!lColl)
+ lColl = lStore->getCollection(lQName, true, true);
+
// must exist because otherwise we wouldn't have an instance of this class
ZORBA_ASSERT(lColl);
=== modified file 'src/api/dynamiccontextimpl.cpp'
--- src/api/dynamiccontextimpl.cpp 2012-01-11 17:30:25 +0000
+++ src/api/dynamiccontextimpl.cpp 2012-02-09 00:24:44 +0000
@@ -429,7 +429,8 @@
TypeManager* tm = theStaticContext->get_typemanager();
xqtref_t lItemType = tm->create_named_type(lItem->getType(),
- TypeConstants::QUANT_ONE);
+ TypeConstants::QUANT_ONE,
+ QueryLoc::null);
if (!TypeOps::is_subtype(tm,
*lItemType,
=== modified file 'src/api/item.cpp'
--- src/api/item.cpp 2012-02-02 09:56:52 +0000
+++ src/api/item.cpp 2012-02-09 00:24:44 +0000
@@ -170,6 +170,18 @@
return Item();
}
+#ifdef ZORBA_WITH_JSON
+
+bool
+Item::isJSONItem() const
+{
+ ITEM_TRY
+ return m_item->isJSONItem();
+ ITEM_CATCH
+ return false;
+}
+
+#endif /* ZORBA_WITH_JSON */
Iterator_t Item::getAtomizationValue() const
{
@@ -448,6 +460,102 @@
return -1;
}
+#ifdef ZORBA_WITH_JSON
+
+store::StoreConsts::JSONItemKind
+Item::getJSONItemKind() const
+{
+ ITEM_TRY
+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
+
+ return m_item->getJSONItemKind();
+ ITEM_CATCH
+ return store::StoreConsts::jsonItem;
+}
+
+Iterator_t
+Item::getObjectPairs() const
+{
+ ITEM_TRY
+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
+
+ // TODO, we should have an error handler here
+ return new StoreIteratorImpl(m_item->getPairs(), nullptr);
+
+ ITEM_CATCH
+ return NULL;
+}
+
+Iterator_t
+Item::getArrayMembers() const
+{
+ ITEM_TRY
+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
+
+ // TODO, we should have an error handler here
+ return new StoreIteratorImpl(m_item->getMembers(), nullptr);
+
+ ITEM_CATCH
+ return NULL;
+}
+
+Item
+Item::getObjectValue(String aName) const
+{
+ zstring& lName = Unmarshaller::getInternalString(aName);
+ store::Item_t lIndex;
+ if (!GENV_ITEMFACTORY->createString(lIndex, lName)) {
+ // QQQ probably should throw exception here
+ return Item();
+ }
+ ITEM_TRY
+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ););
+ store::Item_t lPair = m_item->getPair(lIndex);
+ if (lPair.isNull()) {
+ return Item();
+ }
+ return &*lPair->getValue();
+ ITEM_CATCH
+ return Item();
+}
+
+Item
+Item::getArrayMember(uint32_t aIndex) const
+{
+ store::Item_t lIndex;
+ if (!GENV_ITEMFACTORY->createInteger(lIndex, Integer(aIndex))) {
+ // QQQ probably should throw exception here
+ return Item();
+ }
+ ITEM_TRY
+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
+ return &*m_item->getMember(lIndex);
+ ITEM_CATCH
+ return Item();
+}
+
+Item
+Item::getPairName() const
+{
+ ITEM_TRY
+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
+ return &*m_item->getName();
+ ITEM_CATCH
+ return Item();
+}
+
+Item
+Item::getPairValue() const
+{
+ ITEM_TRY
+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
+ return &*m_item->getValue();
+ ITEM_CATCH
+ return Item();
+}
+
+#endif /* ZORBA_WITH_JSON */
+
bool
Item::isStreamable() const
{
=== modified file 'src/api/itemfactoryimpl.cpp'
--- src/api/itemfactoryimpl.cpp 2012-01-11 17:30:25 +0000
+++ src/api/itemfactoryimpl.cpp 2012-02-09 00:24:44 +0000
@@ -24,6 +24,7 @@
#include "zorbatypes/duration.h"
#include "system/globalenv.h"
#include "store/api/item_factory.h"
+#include "store/api/copymode.h"
#include "api/unmarshaller.h"
#include "types/casting.h"
@@ -805,6 +806,66 @@
return &*lItem;
}
+#ifdef ZORBA_WITH_JSON
+
+zorba::Item ItemFactoryImpl::createJSONNull()
+{
+ store::Item_t lItem;
+ theItemFactory->createJSONNull(lItem);
+ return &*lItem;
+}
+
+zorba::Item ItemFactoryImpl::createJSONNumber(String aString)
+{
+ store::Item_t lItem;
+ zstring &lString = Unmarshaller::getInternalString(aString);
+ theItemFactory->createJSONNumber(lItem, lString);
+ return &*lItem;
+}
+
+static void addItems(store::Item* parent, std::vector<Item> &items)
+{
+ // "Copy" the items into the parent
+ store::CopyMode noCopy;
+ noCopy.theDoCopy = false;
+ std::vector<Item>::iterator i = items.begin();
+ std::vector<Item>::iterator end = items.end();
+ for (; i != end; i++) {
+ Unmarshaller::getInternalItem(*i)->copy(parent, noCopy);
+ }
+}
+
+zorba::Item ItemFactoryImpl::createJSONObject(std::vector<Item> &aPairs)
+{
+ store::Item_t lItem;
+ theItemFactory->createJSONObject(lItem);
+ addItems(lItem.getp(), aPairs);
+ return &*lItem;
+}
+
+zorba::Item ItemFactoryImpl::createJSONArray(std::vector<Item> &aItems)
+{
+ store::Item_t lItem;
+ theItemFactory->createJSONArray(lItem);
+ addItems(lItem.getp(), aItems);
+ return &*lItem;
+}
+
+zorba::Item ItemFactoryImpl::createJSONPair(String aName, Item aValue)
+{
+ store::Item_t lNameItem;
+ theItemFactory->createString(lNameItem, Unmarshaller::getInternalString(aName));
+
+ store::Item_t lValueItem = Unmarshaller::getInternalItem(aValue);
+ store::Item_t lItem;
+ theItemFactory->createJSONObjectPair(lItem, lNameItem, lValueItem);
+ return &*lItem;
+}
+
+
+
+#endif /* ZORBA_WITH_JSON */
+
} // namespace zorba
/* vim:set et sw=2 ts=2: */
=== modified file 'src/api/itemfactoryimpl.h'
--- src/api/itemfactoryimpl.h 2012-01-11 17:30:25 +0000
+++ src/api/itemfactoryimpl.h 2012-02-09 00:24:44 +0000
@@ -244,6 +244,24 @@
Item parent,
String content);
+#ifdef ZORBA_WITH_JSON
+ virtual Item
+ createJSONNull();
+
+ virtual Item
+ createJSONNumber(String aString);
+
+ virtual Item
+ createJSONObject(std::vector<Item>& aPairs);
+
+ virtual Item
+ createJSONArray(std::vector<Item>& aItems);
+
+ virtual Item
+ createJSONPair(String aName, Item aValue);
+
+#endif /* ZORBA_WITH_JSON */
+
protected:
store::ItemFactory* theItemFactory;
=== modified file 'src/api/options.cpp'
--- src/api/options.cpp 2012-01-11 17:30:25 +0000
+++ src/api/options.cpp 2012-02-09 00:24:44 +0000
@@ -17,6 +17,7 @@
#include <string.h>
#include <zorba/options.h>
+#include "diagnostics/xquery_diagnostics.h"
Zorba_CompilerHints::Zorba_CompilerHints()
:
@@ -36,7 +37,11 @@
Zorba_SerializerOptions::Zorba_SerializerOptions()
:
+#ifdef ZORBA_WITH_JSON
+ ser_method(ZORBA_SERIALIZATION_METHOD_JSONIQ),
+#else
ser_method(ZORBA_SERIALIZATION_METHOD_XML),
+#endif
byte_order_mark(ZORBA_BYTE_ORDER_MARK_NO),
escape_uri_attributes(ZORBA_ESCAPE_URI_ATTRIBUTES_NO),
include_content_type(ZORBA_INCLUDE_CONTENT_TYPE_NO),
@@ -63,9 +68,15 @@
else if (strcmp(value, "html") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_HTML;
else if (strcmp(value, "xhtml") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_XHTML;
else if (strcmp(value, "text") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_TEXT;
+ else if (strcmp(value, "binary") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_BINARY;
+#ifdef ZORBA_WITH_JSON
+ else if (strcmp(value, "json") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_JSON;
+ else if (strcmp(value, "jsoniq") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_JSONIQ;
+#endif
else
{
- ; // TODO signal errors for incorrect values?
+ throw XQUERY_EXCEPTION
+ (err::SEPM0016, ERROR_PARAMS( value, "method", ZED( GoodValuesAreXMLEtc ) ));
}
}
else if (strcmp(parameter, "byte-order-mark") == 0)
=== modified file 'src/api/serialization/serializer.cpp'
--- src/api/serialization/serializer.cpp 2012-01-11 17:30:25 +0000
+++ src/api/serialization/serializer.cpp 2012-02-09 00:24:44 +0000
@@ -16,9 +16,10 @@
#include "stdafx.h"
#include <sstream>
+#include <iomanip>
#include <zorba/zorba_string.h>
-
+#include <zorbamisc/ns_consts.h>
#include "zorbatypes/numconversions.h"
#include "diagnostics/xquery_diagnostics.h"
#include "diagnostics/assert.h"
@@ -39,7 +40,8 @@
#include "store/api/iterator.h"
#include "store/api/iterator_factory.h"
#include "store/api/item.h"
-
+#include <store/api/item_factory.h>
+#include <store/api/copymode.h>
namespace zorba {
@@ -194,9 +196,15 @@
const unsigned char* temp = chars;
unicode::code_point cp = utf8::next_char(temp);
- // raise an error iff (1) the serialization format is XML 1.0 and (2) the given character is an invalid XML 1.0 character
- if (ser && ser->method == PARAMETER_VALUE_XML && ser->version == "1.0" && !xml::is_valid(cp))
+ // raise an error iff (1) the serialization format is XML 1.0 and
+ // (2) the given character is an invalid XML 1.0 character
+ if (ser &&
+ ser->method == PARAMETER_VALUE_XML &&
+ ser->version == "1.0" &&
+ !xml::is_valid(cp))
+ {
throw XQUERY_EXCEPTION( err::FOCH0001, ERROR_PARAMS( cp ) );
+ }
if (cp >= 0x10000 && cp <= 0x10FFFF)
{
@@ -347,7 +355,7 @@
/*******************************************************************************
********************************************************************************/
-void serializer::emitter::emit_declaration_end()
+void serializer::emitter::emit_end()
{
// Do nothing in the default emitter
}
@@ -393,6 +401,12 @@
********************************************************************************/
void serializer::emitter::emit_item(store::Item* item)
{
+#ifdef ZORBA_WITH_JSON
+ if (item->isJSONItem())
+ {
+ throw XQUERY_EXCEPTION(zerr::ZAPI0043_CANNOT_SERIALIZE_JSON_ITEM);
+ }
+#endif
if (item->isAtomic())
{
if (previous_item == PREVIOUS_ITEM_WAS_TEXT)
@@ -764,7 +778,6 @@
return false;
}
-
/*******************************************************************************
********************************************************************************/
@@ -809,7 +822,7 @@
////////////////////////////////////////////////////////////////////////////////
// //
-// XML Emitter //
+// XML emitter //
// //
////////////////////////////////////////////////////////////////////////////////
@@ -889,6 +902,335 @@
}
+#ifdef ZORBA_WITH_JSON
+
+////////////////////////////////////////////////////////////////////////////////
+// //
+// JSON emitter //
+// //
+////////////////////////////////////////////////////////////////////////////////
+
+serializer::json_emitter::json_emitter(
+ serializer* the_serializer,
+ transcoder& the_transcoder)
+ : emitter(the_serializer, the_transcoder),
+ theXMLStringStream(nullptr)
+{
+}
+
+serializer::json_emitter::~json_emitter()
+{
+ delete theXMLStringStream;
+}
+
+void serializer::json_emitter::emit_item(store::Item *item)
+{
+ if (!item->isJSONItem())
+ {
+ throw XQUERY_EXCEPTION(zerr::ZAPI0044_CANNOT_SERIALIZE_XML_ITEM);
+ }
+ emit_json_item(item, 0);
+}
+
+void serializer::json_emitter::emit_declaration()
+{
+}
+
+void serializer::json_emitter::emit_end()
+{
+}
+
+void serializer::json_emitter::emit_json_item(store::Item* item, int depth)
+{
+ // This is called for any item within a JSON array or object, or for a
+ // top-level JSON array or object. So JSON rules for simple types may
+ // apply here.
+ if (item->isJSONObject()) {
+ emit_json_object(item, depth);
+ }
+ else if (item->isJSONArray()) {
+ emit_json_array(item, depth);
+ }
+ else if (item->isJSONPair()) {
+ emit_json_pair(item, depth);
+ }
+ else if (item->isAtomic()) {
+ store::SchemaTypeCode type = item->getTypeCode();
+ switch (type) {
+ case store::XS_STRING:
+ emit_json_string(item->getStringValue());
+ break;
+
+ case store::XS_DOUBLE:
+ case store::XS_FLOAT:
+ if (item->isNaN()) {
+ emit_jsoniq_value("number", "NaN", depth);
+ break;
+ }
+ else if (item->isPosOrNegInf()) {
+ emit_jsoniq_value("number", "Infinity", depth);
+ break;
+ }
+ // else fall through
+ case store::XS_INTEGER:
+ case store::XS_DECIMAL:
+ case store::XS_NON_POSITIVE_INTEGER:
+ case store::XS_NEGATIVE_INTEGER:
+ case store::XS_LONG:
+ case store::XS_INT:
+ case store::XS_SHORT:
+ case store::XS_BYTE:
+ case store::XS_NON_NEGATIVE_INTEGER:
+ case store::XS_UNSIGNED_LONG:
+ case store::XS_UNSIGNED_INT:
+ case store::XS_UNSIGNED_SHORT:
+ case store::XS_UNSIGNED_BYTE:
+ case store::XS_POSITIVE_INTEGER:
+ // All numerics get serialized the same way
+ tr << item->getStringValue();
+ break;
+
+ case store::XS_BOOLEAN:
+ tr << (item->getBooleanValue() ? "true" : "false");
+ break;
+
+ case store::JDM_NULL:
+ tr << "null";
+ break;
+
+ default: {
+ emit_jsoniq_value(item->getType()->getStringValue(),
+ item->getStringValue(), depth);
+ break;
+ }
+ }
+ }
+ else {
+ // OK, we've got a non-atomic non-JDM Item here, so serialize it as XML
+ // and output it as a "JSONiq value".
+ if (!theXMLEmitter) {
+ theXMLStringStream = new std::stringstream();
+ theXMLTranscoder = ser->create_transcoder(*theXMLStringStream);
+ theXMLEmitter = new serializer::xml_emitter(ser, *theXMLTranscoder);
+ }
+ theXMLEmitter->emit_item(item);
+ std::string xml = theXMLStringStream->str();
+ emit_jsoniq_value("XML", xml, depth);
+ theXMLStringStream->str("");
+ }
+}
+
+/*******************************************************************************
+
+********************************************************************************/
+void serializer::json_emitter::emit_json_object(store::Item* obj, int depth)
+{
+ store::Item_t pair;
+ store::Iterator_t it = obj->getPairs();
+ it->open();
+ bool first = true;
+ if (ser->indent) {
+ tr << "{" <<ser->END_OF_LINE;
+ }
+ else {
+ tr << "{ ";
+ }
+ depth++;
+ while (it->next(pair)) {
+ if (first) {
+ first = false;
+ }
+ else {
+ tr << ", ";
+ if (ser->indent) {
+ tr << ser->END_OF_LINE;
+ }
+ }
+ if (ser->indent) {
+ emit_indentation(depth);
+ }
+ emit_json_pair(pair, depth);
+ }
+ if (ser->indent) {
+ tr << ser->END_OF_LINE;
+ emit_indentation(depth-1);
+ tr << "}";
+ }
+ else {
+ tr << " }";
+ }
+}
+
+/*******************************************************************************
+
+********************************************************************************/
+void serializer::json_emitter::emit_json_array(store::Item* array, int depth)
+{
+ store::Item_t member;
+ store::Iterator_t it = array->getMembers();
+ it->open();
+ bool first = true;
+ tr << "[ ";
+ while (it->next(member)) {
+ if (first) {
+ first = false;
+ }
+ else {
+ tr << ", ";
+ }
+ emit_json_item(member, depth);
+ }
+ tr << " ]";
+}
+
+/*******************************************************************************
+
+********************************************************************************/
+void serializer::json_emitter::emit_json_pair(store::Item* pair, int depth)
+{
+ emit_json_item(pair->getName(), depth);
+ tr << " : ";
+ emit_json_item(pair->getValue(), depth);
+}
+
+/*******************************************************************************
+
+********************************************************************************/
+void serializer::json_emitter::emit_jsoniq_value
+ (zstring type, zstring value, int depth)
+{
+ // Create items for constant strings, if not already done
+ if (!theJsoniqValueName) {
+ zstring jsoniqvaluestring("JSONiq value");
+ zstring typestring("type");
+ zstring valuestring("value");
+ GENV_ITEMFACTORY->createString(theJsoniqValueName, jsoniqvaluestring);
+ GENV_ITEMFACTORY->createString(theTypeName, typestring);
+ GENV_ITEMFACTORY->createString(theValueName, valuestring);
+ }
+
+ // Create the inner JSON object
+ store::Item_t inner;
+ GENV_ITEMFACTORY->createJSONObject(inner);
+ // Inner object contains two pairs
+ store::Item_t typeitem, valueitem;
+ store::Item_t typepair, valuepair;
+ GENV_ITEMFACTORY->createString(typeitem, type);
+ GENV_ITEMFACTORY->createString(valueitem, value);
+ GENV_ITEMFACTORY->createJSONObjectPair(typepair, theTypeName, typeitem);
+ GENV_ITEMFACTORY->createJSONObjectPair(valuepair, theValueName, valueitem);
+
+ // "Copy" pairs into object
+ store::CopyMode noCopy;
+ noCopy.theDoCopy = false;
+ typepair->copy(inner.getp(), noCopy);
+ valuepair->copy(inner.getp(), noCopy);
+
+ // Create the outer JSON object with one pair
+ store::Item_t outer;
+ GENV_ITEMFACTORY->createJSONObject(outer);
+ store::Item_t outerpair;
+ GENV_ITEMFACTORY->createJSONObjectPair(outerpair, theJsoniqValueName, inner);
+ outerpair->copy(outer, noCopy);
+
+ emit_json_object(outer, depth);
+}
+
+void serializer::json_emitter::emit_json_string(zstring string)
+{
+ tr << '"';
+ zstring::const_iterator i = string.begin();
+ zstring::const_iterator end = string.end();
+ for (; i < end; i++) {
+ if (*i < 0x20) {
+ // Escape control sequences
+ std::stringstream hex;
+ hex << "\\u" << std::setw(4) << std::setfill('0')
+ << std::hex << static_cast<int>(*i);
+ tr << hex.str();
+ continue;
+ }
+ if (*i == '\\' || *i == '"') {
+ // Output escape char for \ or "
+ tr << '\\';
+ // Fall through to output original character
+ }
+ tr << *i;
+ }
+ tr << '"';
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// //
+// JSONiq emitter (auto-detects JSON or XML) //
+// //
+////////////////////////////////////////////////////////////////////////////////
+
+serializer::jsoniq_emitter::jsoniq_emitter(
+ serializer* the_serializer,
+ transcoder& the_transcoder)
+ :
+ emitter(the_serializer, the_transcoder),
+ theEmitterState(JESTATE_UNDETERMINED),
+ theEmitter(nullptr)
+{
+}
+
+serializer::jsoniq_emitter::~jsoniq_emitter()
+{
+ delete theEmitter;
+}
+
+void serializer::jsoniq_emitter::emit_declaration()
+{
+ // Probably I should set a flag here to note whether emit_declaration() has
+ // been called or not. However, I know that all serializer::serialize()
+ // methods DO call emit_declaration() and call it first, so there's no need.
+}
+
+void serializer::jsoniq_emitter::emit_item(store::Item *item)
+{
+ bool isJson = item->isJSONItem();
+
+ if (theEmitterState == JESTATE_UNDETERMINED) {
+ // Initialize theEmitter based on item type, passing through our serializer
+ // and transcoder.
+ if (isJson) {
+ theEmitterState = JESTATE_JDM;
+ theEmitter = new json_emitter(ser, tr);
+ }
+ else {
+ theEmitterState = JESTATE_XDM;
+ theEmitter = new xml_emitter(ser, tr);
+ }
+ // Since this was the first item, call emit_declaration().
+ theEmitter->emit_declaration();
+ }
+ else {
+ // Error checking
+ if ( (isJson && theEmitterState == JESTATE_XDM) ||
+ (!isJson && theEmitterState == JESTATE_JDM) ) {
+ throw XQUERY_EXCEPTION(zerr::ZAPI0045_CANNOT_SERIALIZE_MIXED_XDM_JDM);
+ }
+ }
+
+ // Pass through
+ theEmitter->emit_item(item);
+}
+
+void serializer::jsoniq_emitter::emit_end()
+{
+ // Not really clear what to do if we serialized no items and hence have
+ // no emitter yet, but doing nothing at all seems reasonable.
+ if (theEmitter) {
+ theEmitter->emit_end();
+ }
+}
+
+
+#endif /* ZORBA_WITH_JSON */
+
////////////////////////////////////////////////////////////////////////////////
// //
// HTML Emitter //
@@ -1043,7 +1385,7 @@
/*******************************************************************************
********************************************************************************/
-void serializer::html_emitter::emit_declaration_end()
+void serializer::html_emitter::emit_end()
{
}
@@ -1439,7 +1781,7 @@
/*******************************************************************************
********************************************************************************/
-void serializer::sax2_emitter::emit_declaration_end()
+void serializer::sax2_emitter::emit_end()
{
theSAX2ContentHandler->endDocument();
}
@@ -1893,7 +2235,6 @@
}
}
-
////////////////////////////////////////////////////////////////////////////////
// //
// Serializer //
@@ -1940,7 +2281,12 @@
media_type.clear();
+ // This default should match the default for ser_method in Zorba_SerializerOptions
+#ifdef ZORBA_WITH_JSON
+ method = PARAMETER_VALUE_JSONIQ;
+#else
method = PARAMETER_VALUE_XML;
+#endif
normalization_form.clear();
@@ -2032,6 +2378,12 @@
method = PARAMETER_VALUE_TEXT;
else if (!strcmp(aValue, "binary"))
method = PARAMETER_VALUE_BINARY;
+#ifdef ZORBA_WITH_JSON
+ else if (!strcmp(aValue, "json"))
+ method = PARAMETER_VALUE_JSON;
+ else if (!strcmp(aValue, "jsoniq"))
+ method = PARAMETER_VALUE_JSONIQ;
+#endif
else
throw XQUERY_EXCEPTION(
err::SEPM0016, ERROR_PARAMS( aValue, aName, ZED( GoodValuesAreXMLEtc ) )
@@ -2160,22 +2512,10 @@
********************************************************************************/
bool serializer::setup(std::ostream& os)
{
- if (encoding == PARAMETER_VALUE_UTF_8)
- {
- tr = new transcoder(os, false);
- }
-#ifndef ZORBA_NO_UNICODE
- else if (encoding == PARAMETER_VALUE_UTF_16)
- {
- tr = new transcoder(os, true);
- }
-#endif
- else
- {
- ZORBA_ASSERT(0);
+ tr = create_transcoder(os);
+ if (!tr) {
return false;
}
-
if (method == PARAMETER_VALUE_XML)
e = new xml_emitter(this, *tr);
else if (method == PARAMETER_VALUE_HTML)
@@ -2186,6 +2526,12 @@
e = new text_emitter(this, *tr);
else if (method == PARAMETER_VALUE_BINARY)
e = new binary_emitter(this, *tr);
+#ifdef ZORBA_WITH_JSON
+ else if (method == PARAMETER_VALUE_JSON)
+ e = new json_emitter(this, *tr);
+ else if (method == PARAMETER_VALUE_JSONIQ)
+ e = new jsoniq_emitter(this, *tr);
+#endif
else
{
ZORBA_ASSERT(0);
@@ -2204,6 +2550,24 @@
return true;
}
+transcoder* serializer::create_transcoder(std::ostream &os)
+{
+ if (encoding == PARAMETER_VALUE_UTF_8)
+ {
+ return new transcoder(os, false);
+ }
+#ifndef ZORBA_NO_UNICODE
+ else if (encoding == PARAMETER_VALUE_UTF_16)
+ {
+ return new transcoder(os, true);
+ }
+#endif
+ else
+ {
+ ZORBA_ASSERT(0);
+ return nullptr;
+ }
+}
/*******************************************************************************
@@ -2265,7 +2629,7 @@
e->emit_item(&*lItem);
}
//+ aObject->close();
- e->emit_declaration_end();
+ e->emit_end();
}
@@ -2311,7 +2675,7 @@
}
//object->close();
- e->emit_declaration_end();
+ e->emit_end();
}
} // namespace zorba
=== modified file 'src/api/serialization/serializer.h'
--- src/api/serialization/serializer.h 2011-11-11 07:44:01 +0000
+++ src/api/serialization/serializer.h 2012-02-09 00:24:44 +0000
@@ -69,6 +69,10 @@
PARAMETER_VALUE_XHTML,
PARAMETER_VALUE_TEXT,
PARAMETER_VALUE_BINARY,
+#ifdef ZORBA_WITH_JSON
+ PARAMETER_VALUE_JSON,
+ PARAMETER_VALUE_JSONIQ,
+#endif
PARAMETER_VALUE_UTF_8
#ifndef ZORBA_NO_UNICODE
@@ -168,6 +172,7 @@
bool setup(std::ostream& os);
+ transcoder* create_transcoder(std::ostream& os);
///////////////////////////////////////////////////////////
// //
@@ -198,8 +203,20 @@
/**
* Outputs the end of the serialized document.
*/
- virtual void emit_declaration_end();
-
+ virtual void emit_end();
+
+ /**
+ * Serializes the given item, depending on its type, and its children. This
+ * will be called by serializer for each top-level item in the sequence.
+ *
+ * @param item the item to serialize
+ */
+ virtual void emit_item(store::Item* item);
+
+ // End of the "public" emitter API. All remaining methods are implementation
+ // details and will not be called from outside.
+
+ protected:
/**
* Outputs the doctype declaration. This function is not used by the
* default emitter, it is intended to be defined by the XML, HTML and XHTML
@@ -208,13 +225,6 @@
virtual void emit_doctype(const zstring& elementName);
/**
- * Serializes the given item, depending on its type, and its children.
- *
- * @param item the item to serialize
- */
- virtual void emit_item(store::Item* item);
-
- /**
* Serializes the given streamable item.
*
* @param item the item to serialize
@@ -270,7 +280,6 @@
*/
void emit_indentation(int depth);
- protected:
bool haveBinding(std::pair<zstring, zstring>& nsBinding) const;
bool havePrefix(const zstring& pre) const;
@@ -316,9 +325,94 @@
virtual void emit_declaration();
+ protected:
virtual void emit_doctype(const zstring& elementName);
};
+ ///////////////////////////////////////////////////////////
+ // //
+ // class json_emitter //
+ // //
+ ///////////////////////////////////////////////////////////
+
+#ifdef ZORBA_WITH_JSON
+
+ class json_emitter : public emitter
+ {
+ public:
+ json_emitter(serializer* the_serializer, transcoder& the_transcoder);
+
+ virtual ~json_emitter();
+
+ virtual void emit_declaration();
+
+ virtual void emit_item(store::Item *item);
+
+ virtual void emit_end();
+
+ private:
+
+ /**
+ * Outputs a JSON item. This method is called both for top-level JSON
+ * items as well as any items within a JSON object or array, so it may
+ * output simple typed values differently than standard XML serialization.
+ */
+ void emit_json_item(store::Item* item, int depth);
+
+ void emit_json_object(store::Item* object, int depth);
+
+ void emit_json_array(store::Item* array, int depth);
+
+ void emit_json_pair(store::Item* pair, int depth);
+
+ void emit_json_value(store::Item* value, int depth);
+
+ void emit_jsoniq_value(zstring type, zstring value, int depth);
+
+ void emit_json_string(zstring string);
+
+ store::Item_t theJsoniqValueName;
+ store::Item_t theTypeName;
+ store::Item_t theValueName;
+
+ rchandle<emitter> theXMLEmitter;
+ rchandle<transcoder> theXMLTranscoder;
+ std::stringstream* theXMLStringStream;
+ };
+
+
+ ///////////////////////////////////////////////////////////
+ // //
+ // class jsoniq_emitter (auto-detects JSON or XML) //
+ // //
+ ///////////////////////////////////////////////////////////
+
+ class jsoniq_emitter : public emitter
+ {
+ public:
+ jsoniq_emitter(serializer* the_serializer, transcoder& the_transcoder);
+
+ virtual ~jsoniq_emitter();
+
+ virtual void emit_declaration();
+
+ virtual void emit_item(store::Item *item);
+
+ virtual void emit_end();
+
+ private:
+ enum JSONiqEmitterState {
+ JESTATE_UNDETERMINED,
+ JESTATE_JDM,
+ JESTATE_XDM
+ } theEmitterState;
+
+ serializer::emitter* theEmitter;
+ };
+
+#endif /* ZORBA_WITH_JSON */
+
+
///////////////////////////////////////////////////////////
// //
@@ -331,6 +425,7 @@
public:
xhtml_emitter(serializer* the_serializer, transcoder& the_transcoder);
+ protected:
virtual void emit_node(const store::Item* item, int depth);
};
@@ -347,7 +442,9 @@
html_emitter(serializer* the_serializer, transcoder& the_transcoder);
virtual void emit_declaration();
- virtual void emit_declaration_end();
+ virtual void emit_end();
+
+ protected:
virtual void emit_doctype(const zstring& elementName);
virtual void emit_node(const store::Item* item, int depth);
};
@@ -366,6 +463,9 @@
virtual void emit_declaration();
+ virtual void emit_item(store::Item* item);
+
+ protected:
virtual void emit_node(const store::Item* item, int depth);
virtual int emit_node_children(
@@ -373,8 +473,6 @@
int depth,
bool perform_escaping = true);
- virtual void emit_item(store::Item* item);
-
virtual void emit_streamable_item(store::Item* item);
};
@@ -400,16 +498,17 @@
std::stringstream& aSStream,
SAX2_ContentHandler* aSAX2ContentHandler);
+ void emit_declaration();
+ void emit_item(store::Item* item );
+ void emit_end();
+
+ protected:
void emit_startPrefixMapping(
const store::Item* item,
store::NsBindings& nsBindings );
void emit_endPrefixMapping(store::NsBindings& nsBindings );
- void emit_declaration();
-
- void emit_declaration_end();
-
void emit_node(const store::Item* item, int depth);
void emit_node(const store::Item* item);
@@ -427,8 +526,6 @@
void emit_node_children(const store::Item* item);
bool emit_bindings(const store::Item* item, int depth);
-
- void emit_item(store::Item* item );
};
=== modified file 'src/api/serializerimpl.cpp'
--- src/api/serializerimpl.cpp 2011-06-14 17:26:33 +0000
+++ src/api/serializerimpl.cpp 2012-02-09 00:24:44 +0000
@@ -20,8 +20,9 @@
#include <zorba/singleton_item_sequence.h>
#include <zorba/diagnostic_handler.h>
-#include "api/zorbaimpl.h"
-#include "api/unmarshaller.h"
+#include <diagnostics/assert.h>
+#include <api/zorbaimpl.h>
+#include <api/unmarshaller.h>
#include "serializerimpl.h"
@@ -88,6 +89,8 @@
{
switch (theInternalSerializer.getSerializationMethod())
{
+ case serializer::PARAMETER_VALUE_XML:
+ return ZORBA_SERIALIZATION_METHOD_XML;
case serializer::PARAMETER_VALUE_HTML:
return ZORBA_SERIALIZATION_METHOD_HTML;
case serializer::PARAMETER_VALUE_XHTML:
@@ -96,8 +99,14 @@
return ZORBA_SERIALIZATION_METHOD_TEXT;
case serializer::PARAMETER_VALUE_BINARY:
return ZORBA_SERIALIZATION_METHOD_BINARY;
+#ifdef ZORBA_WITH_JSON
+ case serializer::PARAMETER_VALUE_JSON:
+ return ZORBA_SERIALIZATION_METHOD_JSON;
+ case serializer::PARAMETER_VALUE_JSONIQ:
+ return ZORBA_SERIALIZATION_METHOD_JSONIQ;
+#endif
default:
- return ZORBA_SERIALIZATION_METHOD_XML;
+ ZORBA_ASSERT(0);
}
}
@@ -119,6 +128,12 @@
aInternalSerializer.setParameter("method", "text"); break;
case ZORBA_SERIALIZATION_METHOD_BINARY:
aInternalSerializer.setParameter("method", "binary"); break;
+#ifdef ZORBA_WITH_JSON
+ case ZORBA_SERIALIZATION_METHOD_JSON:
+ aInternalSerializer.setParameter("method", "json"); break;
+ case ZORBA_SERIALIZATION_METHOD_JSONIQ:
+ aInternalSerializer.setParameter("method", "jsoniq"); break;
+#endif
}
switch (aSerializerOptions.byte_order_mark)
=== modified file 'src/api/typeidentimpl.cpp'
--- src/api/typeidentimpl.cpp 2011-09-15 11:46:01 +0000
+++ src/api/typeidentimpl.cpp 2012-02-09 00:24:44 +0000
@@ -23,13 +23,14 @@
namespace zorba {
TypeIdentifier::TypeIdentifier()
- : m_kind(IdentTypes::INVALID_TYPE),
- m_quantifier(IdentTypes::QUANT_ONE),
- m_uri(""),
- m_uriWildcard(false),
- m_localName(""),
- m_localNameWildcard(false),
- m_contentType()
+ :
+ m_kind(IdentTypes::INVALID_TYPE),
+ m_quantifier(IdentTypes::QUANT_ONE),
+ m_uri(""),
+ m_uriWildcard(false),
+ m_localName(""),
+ m_localNameWildcard(false),
+ m_contentType()
{
}
@@ -188,6 +189,59 @@
}
+#ifdef ZORBA_WITH_JSON
+
+TypeIdentifier_t TypeIdentifier::createStructuredItemType(IdentTypes::quantifier_t q)
+{
+ TypeIdentifier_t ti(new TypeIdentifier());
+ ti->m_kind = IdentTypes::STRUCTURED_ITEM_TYPE;
+ ti->m_quantifier = q;
+
+ return ti;
+}
+
+
+TypeIdentifier_t TypeIdentifier::createJSONItemType(IdentTypes::quantifier_t q)
+{
+ TypeIdentifier_t ti(new TypeIdentifier());
+ ti->m_kind = IdentTypes::JSON_ITEM_TYPE;
+ ti->m_quantifier = q;
+
+ return ti;
+}
+
+
+TypeIdentifier_t TypeIdentifier::createJSONObjectType(IdentTypes::quantifier_t q)
+{
+ TypeIdentifier_t ti(new TypeIdentifier());
+ ti->m_kind = IdentTypes::JSON_OBJECT_TYPE;
+ ti->m_quantifier = q;
+
+ return ti;
+}
+
+
+TypeIdentifier_t TypeIdentifier::createJSONArrayType(IdentTypes::quantifier_t q)
+{
+ TypeIdentifier_t ti(new TypeIdentifier());
+ ti->m_kind = IdentTypes::JSON_ARRAY_TYPE;
+ ti->m_quantifier = q;
+
+ return ti;
+}
+
+
+TypeIdentifier_t TypeIdentifier::createJSONPairType(IdentTypes::quantifier_t q)
+{
+ TypeIdentifier_t ti(new TypeIdentifier());
+ ti->m_kind = IdentTypes::JSON_PAIR_TYPE;
+ ti->m_quantifier = q;
+
+ return ti;
+}
+#endif
+
+
TypeIdentifier_t TypeIdentifier::createItemType(IdentTypes::quantifier_t quantifier)
{
TypeIdentifier_t ti(new TypeIdentifier());
=== modified file 'src/compiler/codegen/plan_visitor.cpp'
--- src/compiler/codegen/plan_visitor.cpp 2012-01-11 17:30:25 +0000
+++ src/compiler/codegen/plan_visitor.cpp 2012-02-09 00:24:44 +0000
@@ -38,6 +38,7 @@
#include "compiler/expression/flwor_expr.h"
#include "compiler/expression/fo_expr.h"
#include "compiler/expression/script_exprs.h"
+#include "compiler/expression/json_exprs.h"
#include "compiler/expression/update_exprs.h"
#ifndef ZORBA_NO_FULL_TEXT
#include "compiler/expression/ft_expr.h"
@@ -57,10 +58,12 @@
#include "runtime/visitors/printer_visitor_api.h"
#include "runtime/visitors/iterprinter.h"
#include "runtime/sequences/SequencesImpl.h"
+#include "runtime/sequences/sequences.h"
#include "runtime/core/sequencetypes.h"
#include "runtime/core/item_iterator.h"
#include "runtime/core/var_iterators.h"
#include "runtime/core/constructors.h"
+#include "runtime/json/json_constructors.h"
#include "runtime/core/apply_updates.h"
#include "runtime/core/path_iterators.h"
#include "runtime/core/nodeid_iterators.h"
@@ -2781,10 +2784,13 @@
axisItep->setDocTestKind(v.getDocTestKind());
axisItep->setNodeKind(v.getNodeKind());
axisItep->setQName(v.getQName());
- store::Item *typeName = v.getTypeName();
+ store::Item* typeName = v.getTypeName();
if (typeName != NULL)
{
- axisItep->setType(sctx->get_typemanager()->create_named_type(typeName));
+ axisItep->setType(sctx->get_typemanager()->
+ create_named_type(typeName,
+ TypeConstants::QUANT_ONE,
+ qloc));
}
axisItep->setNilledAllowed(v.getNilledAllowed());
}
@@ -2985,25 +2991,26 @@
{
CODEGEN_TRACE_OUT("");
- PlanIter_t content = pop_itstack ();
+ PlanIter_t content = pop_itstack();
bool isRoot = false;
theEnclosedContextStack.pop();
expr* e = plan_visitor_ns::pop_stack(theConstructorsStack);
ZORBA_ASSERT(e = &v);
+
if (theConstructorsStack.empty() || is_enclosed_expr(theConstructorsStack.top()))
{
isRoot = true;
}
- switch (v.get_type ())
+ switch (v.get_type())
{
case text_expr::text_constructor:
- push_itstack (new TextIterator(sctx, qloc, content, isRoot));
+ push_itstack(new TextIterator(sctx, qloc, content, isRoot));
break;
case text_expr::comment_constructor:
- push_itstack (new CommentIterator (sctx, qloc, content, isRoot));
+ push_itstack(new CommentIterator(sctx, qloc, content, isRoot));
break;
default:
@@ -3042,6 +3049,103 @@
}
+#ifdef ZORBA_WITH_JSON
+
+/*******************************************************************************
+
+ JSON Constructors
+
+********************************************************************************/
+bool begin_visit(json_pair_expr& v)
+{
+ CODEGEN_TRACE_IN("");
+ return true;
+}
+
+
+void end_visit(json_pair_expr& v)
+{
+ CODEGEN_TRACE_OUT("");
+
+ PlanIter_t valueIter = pop_itstack();
+ PlanIter_t nameIter = pop_itstack();
+
+ push_itstack(new JSONPairIterator(sctx, qloc, nameIter, valueIter, true));
+}
+
+
+bool begin_visit(json_object_expr& v)
+{
+ CODEGEN_TRACE_IN("");
+ return true;
+}
+
+
+void end_visit(json_object_expr& v)
+{
+ CODEGEN_TRACE_OUT("");
+
+ std::vector<PlanIter_t> inputs;
+
+ expr* inputExpr = v.get_expr();
+
+ if (inputExpr != NULL)
+ {
+ PlanIter_t inputIter = pop_itstack();
+
+ if (dynamic_cast<FnConcatIterator*>(inputIter.getp()) != NULL)
+ {
+ inputs = static_cast<FnConcatIterator*>(inputIter.getp())->getChildren();
+ }
+ else
+ {
+ inputs.push_back(inputIter);
+ }
+ }
+
+ bool copyInput = true;
+
+ push_itstack(new JSONObjectIterator(sctx, qloc, inputs, copyInput));
+}
+
+
+bool begin_visit(json_array_expr& v)
+{
+ CODEGEN_TRACE_IN("");
+ return true;
+}
+
+
+void end_visit(json_array_expr& v)
+{
+ CODEGEN_TRACE_OUT("");
+
+ std::vector<PlanIter_t> inputs;
+
+ expr* inputExpr = v.get_expr();
+
+ if (inputExpr != NULL)
+ {
+ PlanIter_t inputIter = pop_itstack();
+
+ if (dynamic_cast<FnConcatIterator*>(inputIter.getp()) != NULL)
+ {
+ inputs = static_cast<FnConcatIterator*>(inputIter.getp())->getChildren();
+ }
+ else
+ {
+ inputs.push_back(inputIter);
+ }
+ }
+
+ bool copyInput = true;
+
+ push_itstack(new JSONArrayIterator(sctx, qloc, inputs, copyInput));
+}
+
+#endif // ZORBA_WITH_JSON
+
+
bool begin_visit(const_expr& v)
{
CODEGEN_TRACE_IN("");
=== modified file 'src/compiler/expression/CMakeLists.txt'
--- src/compiler/expression/CMakeLists.txt 2011-06-14 14:21:49 +0000
+++ src/compiler/expression/CMakeLists.txt 2012-02-09 00:24:44 +0000
@@ -18,6 +18,7 @@
expr_type.cpp
expr.cpp
expr_put.cpp
+ json_exprs.cpp
var_expr.cpp
path_expr.cpp
flwor_expr.cpp
=== modified file 'src/compiler/expression/abstract_expr_visitor.h'
--- src/compiler/expression/abstract_expr_visitor.h 2011-11-17 16:32:04 +0000
+++ src/compiler/expression/abstract_expr_visitor.h 2012-02-09 00:24:44 +0000
@@ -50,6 +50,14 @@
EXPR_VISITOR_METHODS (const_expr);
EXPR_VISITOR_METHODS (doc_expr);
EXPR_VISITOR_METHODS (elem_expr);
+ EXPR_VISITOR_METHODS (pi_expr);
+ EXPR_VISITOR_METHODS (text_expr);
+#ifdef ZORBA_WITH_JSON
+ EXPR_VISITOR_METHODS (json_pair_expr);
+ EXPR_VISITOR_METHODS (json_object_expr);
+ EXPR_VISITOR_METHODS (json_array_expr);
+#endif
+
EXPR_VISITOR_METHODS (expr);
EXPR_VISITOR_METHODS (extension_expr);
EXPR_VISITOR_METHODS (flwor_expr);
@@ -63,10 +71,9 @@
EXPR_VISITOR_METHODS (name_cast_expr);
EXPR_VISITOR_METHODS (order_expr);
EXPR_VISITOR_METHODS (order_modifier);
- EXPR_VISITOR_METHODS (pi_expr);
+
EXPR_VISITOR_METHODS (promote_expr);
EXPR_VISITOR_METHODS (relpath_expr);
- EXPR_VISITOR_METHODS (text_expr);
EXPR_VISITOR_METHODS (treat_expr);
EXPR_VISITOR_METHODS (validate_expr);
EXPR_VISITOR_METHODS (var_expr);
=== modified file 'src/compiler/expression/expr.cpp'
--- src/compiler/expression/expr.cpp 2012-01-11 17:30:25 +0000
+++ src/compiler/expression/expr.cpp 2012-02-09 00:24:44 +0000
@@ -497,7 +497,7 @@
bool cast_expr::is_optional() const
{
- return TypeOps::quantifier(*theTargetType) == TypeConstants::QUANT_QUESTION;
+ return theTargetType->get_quantifier() == TypeConstants::QUANT_QUESTION;
}
@@ -622,7 +622,7 @@
bool castable_expr::is_optional() const
{
- return TypeOps::quantifier(*theTargetType) == TypeConstants::QUANT_QUESTION;
+ return theTargetType->get_quantifier() == TypeConstants::QUANT_QUESTION;
}
@@ -1512,10 +1512,9 @@
const QueryLoc& loc,
expr_t aChild)
:
- expr(sctx, loc, aChild->get_expr_kind()),
+ expr(sctx, loc, function_trace_expr_kind),
theExpr(aChild)
{
- theKind = function_trace_expr_kind;
bool modified;
compute_return_type(false, &modified);
compute_scripting_kind();
@@ -1524,10 +1523,9 @@
function_trace_expr::function_trace_expr(expr_t aExpr)
:
- expr(aExpr->get_sctx(), aExpr->get_loc(), aExpr->get_expr_kind()),
+ expr(aExpr->get_sctx(), aExpr->get_loc(), function_trace_expr_kind),
theExpr(aExpr)
{
- theKind = function_trace_expr_kind;
bool modified;
compute_return_type(false, &modified);
compute_scripting_kind();
=== modified file 'src/compiler/expression/expr.h'
--- src/compiler/expression/expr.h 2012-01-11 17:30:25 +0000
+++ src/compiler/expression/expr.h 2012-02-09 00:24:44 +0000
@@ -372,6 +372,12 @@
- F(I) = error
4. Put F(I) in the output sequence.
+
+ theFnQName:
+ -----------
+ Stores the QName of the function, if the promote expr is used to cast the
+ function's body to its result type
+
********************************************************************************/
class promote_expr : public cast_base_expr
{
=== removed file 'src/compiler/expression/expr_annotations.cpp'
--- src/compiler/expression/expr_annotations.cpp 2011-11-17 16:32:04 +0000
+++ src/compiler/expression/expr_annotations.cpp 1970-01-01 00:00:00 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "compiler/expression/expr_annotations.h"
-#include "compiler/expression/expr.h"
-#include "functions/function.h"
-
-namespace zorba {
-
-
-bool ExpressionPropertyComputer::returnsDuplicateNodes(expr *e)
-{
- return true;
-}
-
-
-bool ExpressionPropertyComputer::returnsDescendantNodes(expr *e)
-{
- switch(e->get_expr_kind()) {
- case relpath_expr_kind:
- {
- relpath_expr *re = static_cast<relpath_expr *>(e);
- uint32_t numSteps = re->size();
- for(uint32_t i = 0; i < numSteps; ++i) {
- expr *rec = &*(*re)[i];
- axis_step_expr *axis = dynamic_cast<axis_step_expr *>(rec);
- if (axis != NULL) {
- if (axis->getAxis() == axis_kind_descendant
- || axis->getAxis() == axis_kind_descendant_or_self) {
- return true;
- }
- } else {
- return returnsDescendantNodes(rec);
- }
- }
- }
- break;
-
- default:
- for(expr_iterator i = e->expr_begin(); !i.done(); ++i) {
- if (*i != NULL) {
- if (returnsDescendantNodes(*i)) {
- return true;
- }
- }
- }
- break;
- }
- return false;
-}
-
-
-bool ExpressionPropertyComputer::returnsAncestorNodes(expr *e)
-{
- return true;
-}
-
-}
-/* vim:set et sw=2 ts=2: */
=== removed file 'src/compiler/expression/expr_annotations.h'
--- src/compiler/expression/expr_annotations.h 2011-06-14 17:26:33 +0000
+++ src/compiler/expression/expr_annotations.h 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#pragma once
-#ifndef ZORBA_EXPR_ANNOTATIONS_H
-#define ZORBA_EXPR_ANNOTATIONS_H
-
-#include <set>
-#include "compiler/expression/expr_base.h"
-
-namespace zorba {
-
-class ExpressionPropertyComputer {
- public:
- bool returnsDuplicateNodes(expr *e);
- bool returnsAncestorNodes(expr *e);
- bool returnsDescendantNodes(expr *e);
-};
-
-#if 0 // Fix before using!!
-class SourceFinder {
- public:
- typedef std::set<expr *> sources_t;
-
- SourceFinder() { }
- ~SourceFinder() { }
-
- void reset() { m_sources.clear(); }
- void findSources(expr *e);
- const sources_t& getSources() const;
-
- private:
- sources_t m_sources;
-
- void findSourcesInChildren(expr *e);
-};
-#endif
-
-}
-
-#endif /* ZORBA_EXPR_ANNOTATIONS_H */
-/* vim:set et sw=2 ts=2: */
=== modified file 'src/compiler/expression/expr_base.cpp'
--- src/compiler/expression/expr_base.cpp 2012-01-11 17:30:25 +0000
+++ src/compiler/expression/expr_base.cpp 2012-02-09 00:24:44 +0000
@@ -1039,6 +1039,11 @@
case attr_expr_kind:
case text_expr_kind:
case pi_expr_kind:
+#ifdef ZORBA_WITH_JSON
+ case json_pair_expr_kind:
+ case json_object_expr_kind:
+ case json_array_expr_kind:
+#endif
{
return !contains_expr(e);
}
=== modified file 'src/compiler/expression/expr_base.h'
--- src/compiler/expression/expr_base.h 2012-01-11 17:30:25 +0000
+++ src/compiler/expression/expr_base.h 2012-02-09 00:24:44 +0000
@@ -109,6 +109,12 @@
wrapper_expr_kind,
function_trace_expr_kind,
+#ifdef ZORBA_WITH_JSON
+ json_pair_expr_kind,
+ json_object_expr_kind,
+ json_array_expr_kind,
+#endif
+
unknown_expr_kind
};
=== modified file 'src/compiler/expression/expr_classes.h'
--- src/compiler/expression/expr_classes.h 2011-11-17 16:32:04 +0000
+++ src/compiler/expression/expr_classes.h 2012-02-09 00:24:44 +0000
@@ -70,5 +70,11 @@
class debugger_expr;
class function_trace_expr;
class wrapper_expr;
+
+#ifdef ZORBA_WITH_JSON
+ class json_pair_expr;
+ class json_object_expr;
+ class json_array_expr;
+#endif
}
/* vim:set et sw=2 ts=2: */
=== modified file 'src/compiler/expression/expr_iter.cpp'
--- src/compiler/expression/expr_iter.cpp 2012-01-11 17:30:25 +0000
+++ src/compiler/expression/expr_iter.cpp 2012-02-09 00:24:44 +0000
@@ -22,6 +22,7 @@
#include "compiler/expression/path_expr.h"
#include "compiler/expression/fo_expr.h"
#include "compiler/expression/script_exprs.h"
+#include "compiler/expression/json_exprs.h"
#include "compiler/expression/update_exprs.h"
#include "compiler/expression/flwor_expr.h"
#include "compiler/expression/function_item_expr.h"
@@ -380,6 +381,45 @@
break;
}
+#ifdef ZORBA_WITH_JSON
+ case json_pair_expr_kind:
+ {
+ json_pair_expr* e = static_cast<json_pair_expr*>(theExpr);
+
+ EXPR_ITER_BEGIN();
+
+ EXPR_ITER_NEXT(e->theNameExpr);
+ EXPR_ITER_NEXT(e->theValueExpr);
+
+ EXPR_ITER_END();
+ break;
+ }
+
+ case json_object_expr_kind:
+ {
+ json_object_expr* e = static_cast<json_object_expr*>(theExpr);
+
+ EXPR_ITER_BEGIN();
+
+ EXPR_ITER_NEXT(e->theContentExpr);
+
+ EXPR_ITER_END();
+ break;
+ }
+
+ case json_array_expr_kind:
+ {
+ json_array_expr* e = static_cast<json_array_expr*>(theExpr);
+
+ EXPR_ITER_BEGIN();
+
+ EXPR_ITER_NEXT(e->theContentExpr);
+
+ EXPR_ITER_END();
+ break;
+ }
+#endif
+
case if_expr_kind:
{
if_expr* ifExpr = static_cast<if_expr*>(theExpr);
=== modified file 'src/compiler/expression/expr_put.cpp'
--- src/compiler/expression/expr_put.cpp 2012-01-11 17:30:25 +0000
+++ src/compiler/expression/expr_put.cpp 2012-02-09 00:24:44 +0000
@@ -30,6 +30,7 @@
#include "compiler/expression/expr.h"
#include "compiler/expression/fo_expr.h"
#include "compiler/expression/script_exprs.h"
+#include "compiler/expression/json_exprs.h"
#include "compiler/expression/update_exprs.h"
#ifndef ZORBA_NO_FULL_TEXT
#include "compiler/expression/ft_expr.h"
@@ -795,7 +796,7 @@
BEGIN_PUT(attr_expr);
theQNameExpr->put(os);
- PUT_SUB( "=", theValueExpr );
+ PUT_SUB("=", theValueExpr);
END_PUT();
}
@@ -803,21 +804,50 @@
ostream& text_expr::put(ostream& os) const
{
- BEGIN_PUT( text_expr );
+ BEGIN_PUT(text_expr);
theContentExpr->put(os);
END_PUT();
}
-ostream& pi_expr::put( ostream& os) const
-{
- BEGIN_PUT( pi_expr );
- PUT_SUB( "TARGET", theTargetExpr );
- PUT_SUB( "CONTENT", theContentExpr );
- END_PUT();
-}
-
-
-ostream& insert_expr::put( ostream& os) const
+ostream& pi_expr::put(ostream& os) const
+{
+ BEGIN_PUT(pi_expr);
+ PUT_SUB("TARGET", theTargetExpr);
+ PUT_SUB("CONTENT", theContentExpr);
+ END_PUT();
+}
+
+
+#ifdef ZORBA_WITH_JSON
+ostream& json_pair_expr::put(ostream& os) const
+{
+ BEGIN_PUT(json_pair_expr);
+ PUT_SUB("NAME", theNameExpr);
+ PUT_SUB("VALUE", theValueExpr);
+ END_PUT();
+}
+
+
+ostream& json_object_expr::put(ostream& os) const
+{
+ BEGIN_PUT(json_object_expr);
+ if (theContentExpr)
+ theContentExpr->put(os);
+ END_PUT();
+}
+
+
+ostream& json_array_expr::put(ostream& os) const
+{
+ BEGIN_PUT(json_array_expr);
+ if (theContentExpr)
+ theContentExpr->put(os);
+ END_PUT();
+}
+#endif
+
+
+ostream& insert_expr::put(ostream& os) const
{
BEGIN_PUT( insert_expr );
theSourceExpr->put(os);
@@ -825,14 +855,14 @@
END_PUT();
}
-ostream& delete_expr::put( ostream& os) const
+ostream& delete_expr::put(ostream& os) const
{
BEGIN_PUT( delete_expr );
theTargetExpr->put(os);
END_PUT();
}
-ostream& replace_expr::put( ostream& os) const
+ostream& replace_expr::put(ostream& os) const
{
BEGIN_PUT( replace_expr );
theTargetExpr->put(os);
=== modified file 'src/compiler/expression/expr_type.cpp'
--- src/compiler/expression/expr_type.cpp 2012-01-11 17:30:25 +0000
+++ src/compiler/expression/expr_type.cpp 2012-02-09 00:24:44 +0000
@@ -18,6 +18,7 @@
#include <zorba/config.h>
#include "diagnostics/assert.h"
+#include "diagnostics/util_macros.h"
#include "diagnostics/xquery_diagnostics.h"
#include "system/globalenv.h"
@@ -243,8 +244,7 @@
{
xqtref_t sourceType = e->theSteps[0]->get_return_type();
- if (TypeOps::is_empty(get_type_manager(), *sourceType) ||
- TypeOps::is_none(get_type_manager(), *sourceType))
+ if (sourceType->is_empty() || sourceType->is_none())
{
newType = sourceType;
}
@@ -256,7 +256,7 @@
{
xqtref_t stepType = sourceType;
- for (ulong i = 1; i < e->size(); ++i)
+ for (csize i = 1; i < e->size(); ++i)
{
const axis_step_expr* axisStep = e->theSteps[i].cast<axis_step_expr>();
@@ -302,7 +302,7 @@
switch (funcKind)
{
- case FunctionConsts::ZORBA_STORE_COLLECTIONS_STATIC_DML_COLLECTION_1:
+ case FunctionConsts::STATIC_COLLECTIONS_DML_COLLECTION_1:
{
const store::Item* qname = e->theArgs[0]->getQName(theSctx);
@@ -315,11 +315,8 @@
}
else
{
- throw XQUERY_EXCEPTION(
- zerr::ZDDY0001_COLLECTION_NOT_DECLARED,
- ERROR_PARAMS( qname->getStringValue() ),
- ERROR_LOC( get_loc() )
- );
+ RAISE_ERROR(zerr::ZDDY0001_COLLECTION_NOT_DECLARED, get_loc(),
+ ERROR_PARAMS(qname->getStringValue()));
}
}
break;
@@ -384,8 +381,8 @@
xqtref_t target_ptype = TypeOps::prime_type(tm, *e->theTargetType);
TypeConstants::quantifier_t q =
- TypeOps::intersect_quant(TypeOps::quantifier(*input_type),
- TypeOps::quantifier(*e->theTargetType));
+ TypeOps::intersect_quant(input_type->get_quantifier(),
+ e->theTargetType->get_quantifier());
if (TypeOps::is_subtype(tm, *input_ptype, *target_ptype, get_loc()))
{
@@ -407,8 +404,8 @@
xqtref_t target_ptype = TypeOps::prime_type(tm, *e->theTargetType);
TypeConstants::quantifier_t q =
- TypeOps::intersect_quant(TypeOps::quantifier(*in_type),
- TypeOps::quantifier(*e->theTargetType));
+ TypeOps::intersect_quant(in_type->get_quantifier(),
+ e->theTargetType->get_quantifier());
if (TypeOps::is_subtype(tm, *in_ptype, *target_ptype, get_loc()))
{
@@ -465,13 +462,14 @@
case doc_expr_kind:
{
- doc_expr* e = static_cast<doc_expr*>(this);
+ xqtref_t contentType =
+ (theSctx->construction_mode() == StaticContextConsts::cons_preserve ?
+ rtm.ANY_TYPE :
+ rtm.UNTYPED_TYPE);
newType = tm->create_node_type(store::StoreConsts::documentNode,
NULL,
- (e->theContent == NULL ?
- NULL :
- e->theContent->get_return_type()),
+ contentType,
TypeConstants::QUANT_ONE,
false,
false);
@@ -480,14 +478,14 @@
case elem_expr_kind:
{
- xqtref_t typeName =
+ xqtref_t contentType =
(theSctx->construction_mode() == StaticContextConsts::cons_preserve ?
rtm.ANY_TYPE :
rtm.UNTYPED_TYPE);
newType = tm->create_node_type(store::StoreConsts::elementNode,
NULL,
- typeName,
+ contentType,
TypeConstants::QUANT_ONE,
false,
false);
@@ -496,13 +494,9 @@
case attr_expr_kind:
{
- attr_expr* e = static_cast<attr_expr*>(this);
-
newType = tm->create_node_type(store::StoreConsts::attributeNode,
NULL,
- (e->theValueExpr == NULL ?
- NULL :
- e->theValueExpr->get_return_type()),
+ rtm.UNTYPED_ATOMIC_TYPE_ONE,
TypeConstants::QUANT_ONE,
false,
false);
@@ -523,10 +517,10 @@
{
xqtref_t t = e->get_text()->get_return_type();
- if (TypeOps::is_empty(get_type_manager(), *t))
+ if (t->is_empty())
newType = t;
- else if (TypeOps::type_min_cnt(tm, *t) == 0)
+ else if (t->min_card() == 0)
q = TypeConstants::QUANT_QUESTION;
nodeKind = store::StoreConsts::textNode;
@@ -563,6 +557,26 @@
break;
}
+#ifdef ZORBA_WITH_JSON
+ case json_pair_expr_kind:
+ {
+ newType = rtm.JSON_PAIR_TYPE_ONE;
+ break;
+ }
+
+ case json_object_expr_kind:
+ {
+ newType = rtm.JSON_OBJECT_TYPE_ONE;
+ break;
+ }
+
+ case json_array_expr_kind:
+ {
+ newType = rtm.JSON_ARRAY_TYPE_ONE;
+ break;
+ }
+#endif
+
case const_expr_kind:
{
const_expr* e = static_cast<const_expr*>(this);
=== modified file 'src/compiler/expression/expr_visitor.h'
--- src/compiler/expression/expr_visitor.h 2011-11-17 16:32:04 +0000
+++ src/compiler/expression/expr_visitor.h 2012-02-09 00:24:44 +0000
@@ -69,6 +69,12 @@
DECL_EXPR_VISITOR_VISIT_MEM_FNS( text_expr );
DECL_EXPR_VISITOR_VISIT_MEM_FNS( pi_expr );
+#ifdef ZORBA_WITH_JSON
+ DECL_EXPR_VISITOR_VISIT_MEM_FNS( json_pair_expr );
+ DECL_EXPR_VISITOR_VISIT_MEM_FNS( json_object_expr );
+ DECL_EXPR_VISITOR_VISIT_MEM_FNS( json_array_expr );
+#endif
+
DECL_EXPR_VISITOR_VISIT_MEM_FNS( trycatch_expr );
DECL_EXPR_VISITOR_VISIT_MEM_FNS( function_item_expr );
DECL_EXPR_VISITOR_VISIT_MEM_FNS( dynamic_function_invocation_expr );
=== modified file 'src/compiler/expression/flwor_expr.cpp'
--- src/compiler/expression/flwor_expr.cpp 2012-02-02 09:56:52 +0000
+++ src/compiler/expression/flwor_expr.cpp 2012-02-09 00:24:44 +0000
@@ -175,7 +175,7 @@
xqtref_t declaredType = varExpr->get_type();
if (declaredType != NULL)
{
- if (TypeOps::is_empty(tm, *declaredType))
+ if (declaredType->is_empty())
RAISE_ERROR(err::XPTY0004, loc,
ERROR_PARAMS(ZED(BadType_23o), "empty-sequence"));
=== modified file 'src/compiler/expression/fo_expr.cpp'
--- src/compiler/expression/fo_expr.cpp 2012-01-11 17:30:25 +0000
+++ src/compiler/expression/fo_expr.cpp 2012-02-09 00:24:44 +0000
@@ -248,8 +248,7 @@
expr_t fo_expr::clone(substitution_t& subst) const
{
- if (get_func()->getKind() ==
- FunctionConsts::ZORBA_STORE_COLLECTIONS_STATIC_DML_COLLECTION_1)
+ if (get_func()->getKind() == FunctionConsts::STATIC_COLLECTIONS_DML_COLLECTION_1)
{
expr::subst_iter_t i = subst.find(this);
=== added file 'src/compiler/expression/json_exprs.cpp'
--- src/compiler/expression/json_exprs.cpp 1970-01-01 00:00:00 +0000
+++ src/compiler/expression/json_exprs.cpp 2012-02-09 00:24:44 +0000
@@ -0,0 +1,197 @@
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "compiler/expression/json_exprs.h"
+#include "compiler/expression/expr_visitor.h"
+
+#ifdef ZORBA_WITH_JSON
+
+namespace zorba
+{
+
+SERIALIZABLE_CLASS_VERSIONS(json_pair_expr)
+END_SERIALIZABLE_CLASS_VERSIONS(json_pair_expr)
+
+SERIALIZABLE_CLASS_VERSIONS(json_object_expr)
+END_SERIALIZABLE_CLASS_VERSIONS(json_object_expr)
+
+SERIALIZABLE_CLASS_VERSIONS(json_array_expr)
+END_SERIALIZABLE_CLASS_VERSIONS(json_array_expr)
+
+DEF_EXPR_ACCEPT(json_pair_expr)
+DEF_EXPR_ACCEPT(json_object_expr)
+DEF_EXPR_ACCEPT(json_array_expr)
+
+
+/*******************************************************************************
+ JSONPairConstructor ::= AdditiveExpr (":" AdditiveExpr)?
+********************************************************************************/
+json_pair_expr::json_pair_expr(
+ static_context* sctx,
+ const QueryLoc& loc)
+ :
+ expr(sctx, loc, json_pair_expr_kind)
+{
+}
+
+json_pair_expr::json_pair_expr(
+ static_context* sctx,
+ const QueryLoc& loc,
+ const expr_t& name,
+ const expr_t& value)
+ :
+ expr(sctx, loc, json_pair_expr_kind),
+ theNameExpr(name),
+ theValueExpr(value)
+{
+ compute_scripting_kind();
+}
+
+
+void json_pair_expr::serialize(::zorba::serialization::Archiver& ar)
+{
+ serialize_baseclass(ar, (expr*)this);
+ ar & theNameExpr;
+ ar & theValueExpr;
+}
+
+
+void json_pair_expr::compute_scripting_kind()
+{
+ checkNonUpdating(theNameExpr);
+ checkNonUpdating(theValueExpr);
+
+ short nameExprKind = theNameExpr->get_scripting_detail();
+ short valueExprKind = theValueExpr->get_scripting_detail();
+
+ theScriptingKind = (nameExprKind | valueExprKind);
+
+ theScriptingKind &= ~VACUOUS_EXPR;
+
+ if (is_sequential())
+ theScriptingKind &= ~SIMPLE_EXPR;
+}
+
+
+expr_t json_pair_expr::clone(substitution_t& subst) const
+{
+ return new json_pair_expr(theSctx,
+ get_loc(),
+ theNameExpr->clone(subst),
+ theValueExpr->clone(subst));
+}
+
+
+/*******************************************************************************
+ JSONObjectConstructor ::= "{" Expr? "}"
+********************************************************************************/
+json_object_expr::json_object_expr(
+ static_context* sctx,
+ const QueryLoc& loc,
+ const expr_t& content)
+ :
+ expr(sctx, loc, json_object_expr_kind),
+ theContentExpr(content)
+{
+ compute_scripting_kind();
+}
+
+
+void json_object_expr::serialize(::zorba::serialization::Archiver& ar)
+{
+ serialize_baseclass(ar, (expr*)this);
+ ar & theContentExpr;
+}
+
+
+void json_object_expr::compute_scripting_kind()
+{
+ if (theContentExpr)
+ {
+ checkNonUpdating(theContentExpr);
+
+ theScriptingKind = theContentExpr->get_scripting_detail();
+
+ theScriptingKind &= ~VACUOUS_EXPR;
+ }
+ else
+ {
+ theScriptingKind = SIMPLE_EXPR;
+ }
+}
+
+
+expr_t json_object_expr::clone(substitution_t& subst) const
+{
+ return new json_object_expr(theSctx,
+ get_loc(),
+ (theContentExpr ?
+ theContentExpr->clone(subst) :
+ NULL));
+}
+
+
+/*******************************************************************************
+ JSONArrayConstructor ::= "[" Expr? "]"
+********************************************************************************/
+json_array_expr::json_array_expr(
+ static_context* sctx,
+ const QueryLoc& loc,
+ const expr_t& content)
+ :
+ expr(sctx, loc, json_array_expr_kind),
+ theContentExpr(content)
+{
+ compute_scripting_kind();
+}
+
+
+void json_array_expr::serialize(::zorba::serialization::Archiver& ar)
+{
+ serialize_baseclass(ar, (expr*)this);
+ ar & theContentExpr;
+}
+
+
+void json_array_expr::compute_scripting_kind()
+{
+ if (theContentExpr)
+ {
+ checkNonUpdating(theContentExpr);
+
+ theScriptingKind = theContentExpr->get_scripting_detail();
+
+ theScriptingKind &= ~VACUOUS_EXPR;
+ }
+ else
+ {
+ theScriptingKind = SIMPLE_EXPR;
+ }
+}
+
+
+expr_t json_array_expr::clone(substitution_t& subst) const
+{
+ return new json_array_expr(theSctx,
+ get_loc(),
+ theContentExpr->clone(subst));
+}
+
+
+}
+
+#endif // ZORBA_WITH_JSON
+
=== added file 'src/compiler/expression/json_exprs.h'
--- src/compiler/expression/json_exprs.h 1970-01-01 00:00:00 +0000
+++ src/compiler/expression/json_exprs.h 2012-02-09 00:24:44 +0000
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+#ifndef ZORBA_COMPILER_JSON_EXPRS
+#define ZORBA_COMPILER_JSON_EXPRS
+
+#include <string>
+#include <vector>
+
+#include <zorba/store_consts.h>
+
+#include "compiler/expression/expr_base.h"
+
+#ifdef ZORBA_WITH_JSON
+
+
+namespace zorba
+{
+
+
+/*******************************************************************************
+ JSONPairConstructor ::= AdditiveExpr (":" AdditiveExpr)?
+********************************************************************************/
+class json_pair_expr : public expr
+{
+ friend class ExprIterator;
+
+protected:
+ expr_t theNameExpr;
+ expr_t theValueExpr;
+
+public:
+ SERIALIZABLE_CLASS(json_pair_expr)
+ SERIALIZABLE_CLASS_CONSTRUCTOR2(json_pair_expr, expr)
+ void serialize(::zorba::serialization::Archiver& ar);
+
+public:
+ json_pair_expr(
+ static_context* sctx,
+ const QueryLoc& loc);
+
+ json_pair_expr(
+ static_context* sctx,
+ const QueryLoc& loc,
+ const expr_t& name,
+ const expr_t& value);
+
+ void set_name_expr(const expr_t& name) { theNameExpr = name; }
+
+ void set_value_expr(const expr_t& value) { theValueExpr = value; }
+
+ expr* get_name_expr() const { return theNameExpr.getp(); }
+
+ expr* get_value_expr() const { return theValueExpr.getp(); }
+
+ void compute_scripting_kind();
+
+ expr_t clone(substitution_t& s) const;
+
+ void accept(expr_visitor&);
+
+ std::ostream& put(std::ostream&) const;
+};
+
+
+/*******************************************************************************
+ JSONObjectConstructor ::= "{" Expr? "}"
+********************************************************************************/
+class json_object_expr : public expr
+{
+ friend class ExprIterator;
+
+protected:
+ expr_t theContentExpr;
+
+public:
+ SERIALIZABLE_CLASS(json_object_expr)
+ SERIALIZABLE_CLASS_CONSTRUCTOR2(json_object_expr, expr)
+ void serialize(::zorba::serialization::Archiver& ar);
+
+public:
+ json_object_expr(
+ static_context* sctx,
+ const QueryLoc& loc,
+ const expr_t& content);
+
+ expr* get_expr() const { return theContentExpr.getp(); }
+
+ void compute_scripting_kind();
+
+ expr_t clone(substitution_t& s) const;
+
+ void accept(expr_visitor&);
+
+ std::ostream& put(std::ostream&) const;
+};
+
+
+/*******************************************************************************
+ JSONArrayConstructor ::= "[" Expr? "]"
+********************************************************************************/
+class json_array_expr : public expr
+{
+ friend class ExprIterator;
+
+protected:
+ expr_t theContentExpr;
+
+public:
+ SERIALIZABLE_CLASS(json_array_expr)
+ SERIALIZABLE_CLASS_CONSTRUCTOR2(json_array_expr, expr)
+ void serialize(::zorba::serialization::Archiver& ar);
+
+public:
+ json_array_expr(
+ static_context* sctx,
+ const QueryLoc& loc,
+ const expr_t& content);
+
+ expr* get_expr() const { return theContentExpr.getp(); }
+
+ void compute_scripting_kind();
+
+ expr_t clone(substitution_t& s) const;
+
+ void accept(expr_visitor&);
+
+ std::ostream& put(std::ostream&) const;
+};
+
+
+}
+
+#endif // ZORBA_WITH_JSON
+
+#endif
+
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */
+/* vim:set et sw=2 ts=2: */
=== modified file 'src/compiler/expression/script_exprs.h'
--- src/compiler/expression/script_exprs.h 2012-01-11 17:30:25 +0000
+++ src/compiler/expression/script_exprs.h 2012-02-09 00:24:44 +0000
@@ -17,24 +17,10 @@
#ifndef ZORBA_COMPILER_SCRIPT_EXPRS
#define ZORBA_COMPILER_SCRIPT_EXPRS
-#include <string>
#include <vector>
-#include <zorba/store_consts.h>
-
#include "compiler/expression/expr_base.h"
-#include "zorbautils/checked_vector.h"
-
-#include "zorbatypes/schema_types.h"
-
-#include "diagnostics/xquery_diagnostics.h"
-
-#include "context/static_context.h"
-
-#include "types/typeimpl.h"
-
-#include "store/api/item.h"
namespace zorba
{
=== modified file 'src/compiler/parser/location.hh'
--- src/compiler/parser/location.hh 2009-09-23 08:37:57 +0000
+++ src/compiler/parser/location.hh 2012-02-09 00:24:44 +0000
@@ -1,9 +1,8 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.5. */
/* Locations for Bison parsers in C++
- Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2002-2007, 2009-2011 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
@@ -44,13 +43,10 @@
# include "position.hh"
-/* Line 162 of location.cc */
-#line 1 "[Bison:b4_percent_define_default]"
-
namespace zorba {
/* Line 162 of location.cc */
-#line 54 "/Users/dagraf/work/28msec/software/zorba/build/src/compiler/parser/location.hh"
+#line 50 "/home/jsoniq/zorba/debug/src/compiler/parser/location.hh"
/// Abstract a location.
class location
@@ -160,12 +156,9 @@
}
-/* Line 271 of location.cc */
-#line 1 "[Bison:b4_percent_define_default]"
-
} // zorba
/* Line 271 of location.cc */
-#line 170 "/Users/dagraf/work/28msec/software/zorba/build/src/compiler/parser/location.hh"
+#line 163 "/home/jsoniq/zorba/debug/src/compiler/parser/location.hh"
#endif // not BISON_LOCATION_HH
=== modified file 'src/compiler/parser/position.hh'
--- src/compiler/parser/position.hh 2009-11-15 17:47:20 +0000
+++ src/compiler/parser/position.hh 2012-02-09 00:24:44 +0000
@@ -1,9 +1,8 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.5. */
/* Positions for Bison parsers in C++
- Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2002-2007, 2009-2011 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
@@ -44,13 +43,10 @@
# include <algorithm>
-/* Line 38 of location.cc */
-#line 1 "[Bison:b4_percent_define_default]"
-
namespace zorba {
-/* Line 38 of location.cc */
-#line 54 "/Users/dagraf/work/28msec/software/zorba/build/src/compiler/parser/position.hh"
+/* Line 37 of location.cc */
+#line 50 "/home/jsoniq/zorba/debug/src/compiler/parser/position.hh"
/// Abstract a position.
class position
{
@@ -84,12 +80,7 @@
/// (column related) Advance to the COUNT next columns.
inline void columns (int count = 1)
{
-// zorba patch: std::max is not available on windows!
-// column = std::max (1u, column + count);
- if (1u <= (column+count))
- column += count;
- else
- column = 1u;
+ column = std::max (1u, column + count);
}
/** \} */
@@ -136,10 +127,11 @@
inline bool
operator== (const position& pos1, const position& pos2)
{
- return
- (pos1.filename == pos2.filename
- || pos1.filename && pos2.filename && *pos1.filename == *pos2.filename)
- && pos1.line == pos2.line && pos1.column == pos2.column;
+ return (pos1.line == pos2.line
+ && pos1.column == pos2.column
+ && (pos1.filename == pos2.filename
+ || (pos1.filename && pos2.filename
+ && *pos1.filename == *pos2.filename)));
}
/// Compare two position objects.
@@ -162,11 +154,8 @@
}
-/* Line 144 of location.cc */
-#line 1 "[Bison:b4_percent_define_default]"
-
} // zorba
/* Line 144 of location.cc */
-#line 167 "/Users/dagraf/work/28msec/software/zorba/build/src/compiler/parser/position.hh"
+#line 161 "/home/jsoniq/zorba/debug/src/compiler/parser/position.hh"
#endif // not BISON_POSITION_HH
=== modified file 'src/compiler/parser/stack.hh'
--- src/compiler/parser/stack.hh 2009-09-23 08:37:57 +0000
+++ src/compiler/parser/stack.hh 2012-02-09 00:24:44 +0000
@@ -1,10 +1,8 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.5. */
/* Stack handling for Bison parsers in C++
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
- Foundation, Inc.
+ Copyright (C) 2002-2011 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
@@ -38,13 +36,10 @@
#include <deque>
-/* Line 1067 of lalr1.cc */
-#line 1 "[Bison:b4_percent_define_default]"
-
namespace zorba {
-/* Line 1067 of lalr1.cc */
-#line 48 "/Users/dagraf/work/28msec/software/zorba/build/src/compiler/parser/stack.hh"
+/* Line 1149 of lalr1.cc */
+#line 43 "/home/jsoniq/zorba/debug/src/compiler/parser/stack.hh"
template <class T, class S = std::deque<T> >
class stack
{
@@ -131,13 +126,10 @@
unsigned int range_;
};
-/* Line 1153 of lalr1.cc */
-#line 1 "[Bison:b4_percent_define_default]"
-
} // zorba
-/* Line 1153 of lalr1.cc */
-#line 141 "/Users/dagraf/work/28msec/software/zorba/build/src/compiler/parser/stack.hh"
+/* Line 1235 of lalr1.cc */
+#line 133 "/home/jsoniq/zorba/debug/src/compiler/parser/stack.hh"
#endif // not BISON_STACK_HH[]dnl
=== modified file 'src/compiler/parser/xquery_parser.cpp'
--- src/compiler/parser/xquery_parser.cpp 2011-08-19 22:45:54 +0000
+++ src/compiler/parser/xquery_parser.cpp 2012-02-09 00:24:44 +0000
@@ -1,10 +1,8 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.5. */
/* Skeleton implementation for Bison LALR(1) parsers in C++
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
- Foundation, Inc.
+ Copyright (C) 2002-2011 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
@@ -37,8 +35,8 @@
/* First part of user declarations. */
-/* Line 311 of lalr1.cc */
-#line 87 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 293 of lalr1.cc */
+#line 87 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
#include "common/common.h"
@@ -74,16 +72,16 @@
-/* Line 311 of lalr1.cc */
-#line 79 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
+/* Line 293 of lalr1.cc */
+#line 77 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
#include "xquery_parser.hpp"
/* User implementation prologue. */
-/* Line 317 of lalr1.cc */
-#line 876 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 299 of lalr1.cc */
+#line 892 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
// HACK to trigger rchandle release: rchandles are freed when refcount == 0
// (not <= 0); but Bison never increments the refcount, so we do it manually...
@@ -94,8 +92,8 @@
}
}
-/* Line 317 of lalr1.cc */
-#line 976 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 299 of lalr1.cc */
+#line 1016 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
#include "compiler/parser/xquery_scanner.h"
@@ -104,11 +102,11 @@
-/* Line 317 of lalr1.cc */
-#line 109 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
+/* Line 299 of lalr1.cc */
+#line 107 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -119,6 +117,26 @@
# endif
#endif
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+ If N is 0, then set CURRENT to the empty location which ends
+ the previous symbol: RHS[0] (always defined). */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (N) \
+ { \
+ (Current).begin = YYRHSLOC (Rhs, 1).begin; \
+ (Current).end = YYRHSLOC (Rhs, N).end; \
+ } \
+ else \
+ { \
+ (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
+ } \
+ while (false)
+#endif
+
/* Suppress unused-variable warnings by "using" E. */
#define YYUSE(e) ((void) (e))
@@ -168,14 +186,10 @@
#define YYRECOVERING() (!!yyerrstatus_)
-/* Line 380 of lalr1.cc */
-#line 1 "[Bison:b4_percent_define_default]"
-
namespace zorba {
-/* Line 380 of lalr1.cc */
-#line 178 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
-#if YYERROR_VERBOSE
+/* Line 382 of lalr1.cc */
+#line 193 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
/* Return YYSTR after stripping away unnecessary quotes and
backslashes, so that it's suitable for yyerror. The heuristic is
@@ -214,7 +228,6 @@
return yystr;
}
-#endif
/// Build a parser object.
xquery_parser::xquery_parser (xquery_driver& driver_yyarg)
@@ -277,2414 +290,2441 @@
case 109: /* "\"'DECIMAL'\"" */
/* Line 480 of lalr1.cc */
-#line 874 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+#line 890 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ delete (yyvaluep->decval); };
/* Line 480 of lalr1.cc */
-#line 285 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
+#line 298 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
break;
case 123: /* "\"'DOUBLE'\"" */
/* Line 480 of lalr1.cc */
-#line 873 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+#line 889 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ delete (yyvaluep->dval); };
/* Line 480 of lalr1.cc */
-#line 294 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
+#line 307 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
break;
case 148: /* "\"'INTEGER'\"" */
/* Line 480 of lalr1.cc */
-#line 872 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+#line 888 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ delete (yyvaluep->ival); };
/* Line 480 of lalr1.cc */
-#line 303 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 326: /* "VersionDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 312 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 327: /* "MainModule" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 321 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 328: /* "LibraryModule" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 330 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 329: /* "ModuleDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 339 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 330: /* "SIND_DeclList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 348 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 331: /* "SIND_Decl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 357 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 332: /* "Setter" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 366 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 333: /* "BoundarySpaceDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 375 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 334: /* "DefaultCollationDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 384 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 335: /* "BaseURIDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 393 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 336: /* "ConstructionDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 402 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 337: /* "OrderingModeDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 411 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 338: /* "EmptyOrderDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 420 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 339: /* "CopyNamespacesDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 429 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 340: /* "Import" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 438 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 341: /* "SchemaImport" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 447 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 342: /* "URILiteralList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 456 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 343: /* "SchemaPrefix" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 465 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 344: /* "ModuleImport" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 474 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 345: /* "NamespaceDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 483 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 346: /* "DefaultNamespaceDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 492 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 347: /* "VFO_DeclList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 501 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 348: /* "VFO_Decl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 510 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 349: /* "DecimalFormatDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 519 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 350: /* "DecimalFormatParamList" */
-
-/* Line 480 of lalr1.cc */
-#line 897 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+#line 316 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 331: /* "VersionDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 325 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 332: /* "MainModule" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 334 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 333: /* "LibraryModule" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 343 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 334: /* "ModuleDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 352 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 335: /* "SIND_DeclList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 361 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 336: /* "SIND_Decl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 370 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 337: /* "Setter" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 379 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 338: /* "BoundarySpaceDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 388 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 339: /* "DefaultCollationDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 397 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 340: /* "BaseURIDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 406 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 341: /* "ConstructionDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 415 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 342: /* "OrderingModeDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 424 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 343: /* "EmptyOrderDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 433 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 344: /* "CopyNamespacesDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 442 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 345: /* "Import" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 451 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 346: /* "SchemaImport" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 460 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 347: /* "URILiteralList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 469 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 348: /* "SchemaPrefix" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 478 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 349: /* "ModuleImport" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 487 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 350: /* "NamespaceDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 496 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 351: /* "DefaultNamespaceDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 505 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 352: /* "VFO_DeclList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 514 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 353: /* "VFO_Decl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 523 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 354: /* "DecimalFormatDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 532 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 355: /* "DecimalFormatParamList" */
+
+/* Line 480 of lalr1.cc */
+#line 916 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ delete (yyvaluep->vstrpair); };
/* Line 480 of lalr1.cc */
-#line 528 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
+#line 541 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
break;
- case 351: /* "DecimalFormatParam" */
+ case 356: /* "DecimalFormatParam" */
/* Line 480 of lalr1.cc */
-#line 897 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+#line 916 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ delete (yyvaluep->strpair); };
/* Line 480 of lalr1.cc */
-#line 537 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 353: /* "OptionDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 546 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 354: /* "FTOptionDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 555 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 355: /* "CtxItemDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 564 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 356: /* "CtxItemDecl2" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 573 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 357: /* "CtxItemDecl3" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 582 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 358: /* "CtxItemDecl4" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 591 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 359: /* "VarDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 600 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 360: /* "VarNameAndType" */
-
-/* Line 480 of lalr1.cc */
-#line 897 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+#line 550 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 358: /* "OptionDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 559 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 359: /* "FTOptionDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 568 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 360: /* "CtxItemDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 577 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 361: /* "CtxItemDecl2" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 586 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 362: /* "CtxItemDecl3" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 595 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 363: /* "CtxItemDecl4" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 604 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 364: /* "VarDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 613 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 365: /* "VarNameAndType" */
+
+/* Line 480 of lalr1.cc */
+#line 916 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ delete (yyvaluep->varnametype); };
/* Line 480 of lalr1.cc */
-#line 609 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 361: /* "AnnotationList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 618 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 362: /* "Annotation" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 627 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 363: /* "AnnotationLiteralList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 636 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 364: /* "FunctionDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 645 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 365: /* "FunctionDecl2" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 654 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 366: /* "FunctionDeclSimple" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 663 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 367: /* "FunctionDeclUpdating" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 672 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 368: /* "FunctionSig" */
-
-/* Line 480 of lalr1.cc */
-#line 897 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+#line 622 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 366: /* "AnnotationList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 631 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 367: /* "Annotation" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 640 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 368: /* "AnnotationLiteralList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 649 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 369: /* "FunctionDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 658 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 370: /* "FunctionDecl2" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 667 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 371: /* "FunctionDeclSimple" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 676 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 372: /* "FunctionDeclUpdating" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 685 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 373: /* "FunctionSig" */
+
+/* Line 480 of lalr1.cc */
+#line 916 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ delete (yyvaluep->fnsig); };
/* Line 480 of lalr1.cc */
-#line 681 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 369: /* "ParamList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 690 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 370: /* "Param" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 699 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 371: /* "CollectionDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 708 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 373: /* "IndexDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 717 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 374: /* "IndexKeyList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 726 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 375: /* "IndexKeySpec" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 735 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 376: /* "IntegrityConstraintDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 744 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 377: /* "QueryBody" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 753 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 378: /* "StatementsAndOptionalExprTop" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 762 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 379: /* "StatementsAndOptionalExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 771 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 380: /* "StatementsAndExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 780 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 381: /* "Statements" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 789 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 382: /* "Statement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 798 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 383: /* "BlockStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 807 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 384: /* "BlockExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 816 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 385: /* "EnclosedStatementsAndOptionalExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 825 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 386: /* "VarDeclStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 834 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 389: /* "AssignStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 843 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 390: /* "ApplyStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 852 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 391: /* "ExitStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 861 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 392: /* "WhileStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 870 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 393: /* "FlowCtlStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 879 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 394: /* "FLWORStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 395: /* "ReturnStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 897 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 396: /* "IfStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 906 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 397: /* "TryStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 915 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 398: /* "CatchListStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 924 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 399: /* "CatchStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 933 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 400: /* "Expr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 942 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 401: /* "ExprSingle" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 951 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 402: /* "ExprSimple" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 960 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 403: /* "FLWORExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 969 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 404: /* "ReturnExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 978 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 407: /* "FLWORWinCond" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 987 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 408: /* "WindowClause" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 996 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 409: /* "CountClause" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1005 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 410: /* "ForLetWinClause" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1014 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 412: /* "FLWORClauseList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1023 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 413: /* "ForClause" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1032 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 414: /* "VarInDeclList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1041 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 415: /* "VarInDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1050 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 416: /* "PositionalVar" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1059 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 417: /* "FTScoreVar" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1068 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 418: /* "LetClause" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1077 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 419: /* "VarGetsDeclList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1086 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 420: /* "VarGetsDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1095 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 421: /* "WindowVarDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1104 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 422: /* "WindowVars" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1113 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 423: /* "WindowVars3" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1122 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 424: /* "WindowVars2" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1131 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 425: /* "WhereClause" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1140 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 426: /* "GroupByClause" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1149 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 427: /* "GroupSpecList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1158 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 428: /* "GroupSpec" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1167 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 429: /* "GroupCollationSpec" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1176 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 430: /* "OrderByClause" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1185 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 431: /* "OrderSpecList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1194 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 432: /* "OrderSpec" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1203 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 433: /* "OrderModifier" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1212 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 434: /* "OrderDirSpec" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1221 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 435: /* "OrderEmptySpec" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1230 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 436: /* "OrderCollationSpec" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1239 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 437: /* "QuantifiedExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1248 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 438: /* "QVarInDeclList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1257 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 439: /* "QVarInDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1266 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 440: /* "SwitchExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1275 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 441: /* "SwitchCaseClauseList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1284 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 442: /* "SwitchCaseClause" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1293 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 443: /* "SwitchCaseOperandList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1302 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 444: /* "SwitchStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1311 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 447: /* "TypeswitchExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1320 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 448: /* "TypeswitchStatement" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1329 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 449: /* "CaseClauseList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1338 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 450: /* "CaseClause" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1347 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 453: /* "IfExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1356 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 454: /* "OrExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1365 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 455: /* "AndExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1374 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 456: /* "ComparisonExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1383 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 458: /* "FTContainsExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1392 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 459: /* "opt_FTIgnoreOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1401 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 460: /* "RangeExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1410 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 461: /* "AdditiveExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1419 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 462: /* "MultiplicativeExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1428 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 463: /* "UnionExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1437 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 464: /* "IntersectExceptExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1446 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 465: /* "InstanceofExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1455 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 466: /* "TreatExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1464 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 467: /* "CastableExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1473 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 468: /* "CastExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1482 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 469: /* "UnaryExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1491 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 470: /* "SignList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1500 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 471: /* "ValueExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1509 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 472: /* "ValueComp" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1518 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 473: /* "NodeComp" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1527 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 474: /* "ValidateExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1536 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 475: /* "ExtensionExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1545 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 476: /* "Pragma_list" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1554 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 477: /* "Pragma" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1563 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 478: /* "PathExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1572 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 480: /* "RelativePathExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1581 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 481: /* "StepExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1590 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 482: /* "AxisStep" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1599 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 483: /* "ForwardStep" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1608 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 484: /* "ForwardAxis" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1617 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 485: /* "AbbrevForwardStep" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1626 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 486: /* "ReverseStep" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1635 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 487: /* "ReverseAxis" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1644 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 488: /* "NodeTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1653 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 489: /* "NameTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1662 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 490: /* "Wildcard" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1671 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 491: /* "FilterExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1680 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 492: /* "PredicateList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1689 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 493: /* "Predicate" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1698 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 494: /* "PrimaryExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1707 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 495: /* "Literal" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1716 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 496: /* "NumericLiteral" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1725 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 497: /* "VarRef" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1734 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 498: /* "ParenthesizedExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1743 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 499: /* "ContextItemExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1752 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 500: /* "OrderedExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1761 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 501: /* "UnorderedExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1770 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 502: /* "FunctionCall" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1779 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 503: /* "ArgList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1788 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 504: /* "Constructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1797 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 505: /* "DirectConstructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1806 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 506: /* "DirElemConstructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1815 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 507: /* "DirElemContentList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1824 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 508: /* "DirAttributeList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1833 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 509: /* "DirAttr" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1842 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 511: /* "DirAttributeValue" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1851 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 512: /* "opt_QuoteAttrContentList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1860 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 513: /* "QuoteAttrContentList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1869 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 514: /* "opt_AposAttrContentList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1878 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 515: /* "AposAttrContentList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1887 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 516: /* "QuoteAttrValueContent" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1896 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 517: /* "AposAttrValueContent" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1905 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 518: /* "DirElemContent" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1914 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 519: /* "CommonContent" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1923 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 520: /* "DirCommentConstructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1932 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 521: /* "DirPIConstructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1941 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 522: /* "CDataSection" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1950 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 523: /* "ComputedConstructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1959 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 524: /* "CompDocConstructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1968 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 525: /* "CompElemConstructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1977 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 526: /* "CompAttrConstructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1986 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 527: /* "CompTextConstructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 1995 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 528: /* "CompCommentConstructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2004 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 529: /* "CompPIConstructor" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2013 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 530: /* "SingleType" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2022 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 531: /* "TypeDeclaration" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2031 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 532: /* "SequenceType" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2040 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 533: /* "OccurrenceIndicator" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2049 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 534: /* "ItemType" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2058 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 535: /* "TypeList" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2067 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 536: /* "AtomicType" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2076 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 537: /* "KindTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2085 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 538: /* "AnyKindTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2094 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 539: /* "DocumentTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2103 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 540: /* "TextTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2112 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 541: /* "CommentTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2121 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 542: /* "PITest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2130 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 543: /* "AttributeTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2139 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 544: /* "SchemaAttributeTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2148 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 545: /* "ElementTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2157 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 546: /* "SchemaElementTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2166 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 547: /* "TypeName" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2175 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 548: /* "TypeName_WITH_HOOK" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2184 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 549: /* "StringLiteral" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2193 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 554: /* "AnyFunctionTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2202 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 555: /* "TypedFunctionTest" */
-
-/* Line 480 of lalr1.cc */
-#line 888 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2211 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 558: /* "InsertExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2220 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 559: /* "DeleteExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2229 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 560: /* "ReplaceExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2238 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 561: /* "RenameExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2247 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 562: /* "TransformExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2256 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 563: /* "VarNameList" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2265 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 564: /* "VarNameDecl" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2274 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 565: /* "TryExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2283 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 566: /* "CatchListExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2292 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 567: /* "CatchExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2301 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 568: /* "BracedExpr" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2310 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 569: /* "NameTestList" */
-
-/* Line 480 of lalr1.cc */
-#line 897 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+#line 694 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 374: /* "ParamList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 703 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 375: /* "Param" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 712 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 376: /* "CollectionDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 721 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 378: /* "IndexDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 730 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 379: /* "IndexKeyList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 739 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 380: /* "IndexKeySpec" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 748 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 381: /* "IntegrityConstraintDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 757 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 382: /* "QueryBody" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 766 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 383: /* "StatementsAndOptionalExprTop" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 775 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 384: /* "StatementsAndOptionalExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 784 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 385: /* "StatementsAndExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 793 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 386: /* "Statements" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 802 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 387: /* "Statement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 811 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 388: /* "BlockStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 820 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 389: /* "BlockExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 829 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 390: /* "EnclosedStatementsAndOptionalExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 838 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 391: /* "VarDeclStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 847 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 394: /* "AssignStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 856 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 395: /* "ApplyStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 865 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 396: /* "ExitStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 874 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 397: /* "WhileStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 883 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 398: /* "FlowCtlStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 892 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 399: /* "FLWORStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 901 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 400: /* "ReturnStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 910 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 401: /* "IfStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 919 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 402: /* "TryStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 928 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 403: /* "CatchListStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 937 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 404: /* "CatchStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 946 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 405: /* "Expr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 955 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 406: /* "ExprSingle" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 964 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 407: /* "ExprSimple" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 973 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 408: /* "FLWORExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 982 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 409: /* "ReturnExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 991 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 412: /* "FLWORWinCond" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1000 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 413: /* "WindowClause" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1009 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 414: /* "CountClause" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1018 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 415: /* "ForLetWinClause" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1027 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 417: /* "FLWORClauseList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1036 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 418: /* "ForClause" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1045 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 419: /* "VarInDeclList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1054 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 420: /* "VarInDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1063 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 421: /* "PositionalVar" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1072 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 422: /* "FTScoreVar" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1081 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 423: /* "LetClause" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1090 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 424: /* "VarGetsDeclList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1099 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 425: /* "VarGetsDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1108 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 426: /* "WindowVarDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1117 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 427: /* "WindowVars" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1126 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 428: /* "WindowVars3" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1135 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 429: /* "WindowVars2" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1144 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 430: /* "WhereClause" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1153 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 431: /* "GroupByClause" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1162 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 432: /* "GroupSpecList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1171 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 433: /* "GroupSpec" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1180 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 434: /* "GroupCollationSpec" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1189 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 435: /* "OrderByClause" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1198 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 436: /* "OrderSpecList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1207 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 437: /* "OrderSpec" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1216 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 438: /* "OrderModifier" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1225 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 439: /* "OrderDirSpec" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1234 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 440: /* "OrderEmptySpec" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1243 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 441: /* "OrderCollationSpec" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1252 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 442: /* "QuantifiedExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1261 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 443: /* "QVarInDeclList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1270 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 444: /* "QVarInDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1279 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 445: /* "SwitchExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1288 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 446: /* "SwitchCaseClauseList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1297 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 447: /* "SwitchCaseClause" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1306 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 448: /* "SwitchCaseOperandList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1315 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 449: /* "SwitchStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1324 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 452: /* "TypeswitchExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1333 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 453: /* "TypeswitchStatement" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1342 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 454: /* "CaseClauseList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1351 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 455: /* "CaseClause" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1360 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 458: /* "IfExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1369 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 459: /* "OrExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1378 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 460: /* "AndExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1387 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 461: /* "ComparisonExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1396 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 463: /* "FTContainsExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1405 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 464: /* "opt_FTIgnoreOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1414 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 465: /* "RangeExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1423 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 466: /* "JSONPairConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 910 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1432 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 467: /* "AdditiveExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1441 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 468: /* "MultiplicativeExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1450 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 469: /* "UnionExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1459 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 470: /* "IntersectExceptExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1468 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 471: /* "InstanceofExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1477 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 472: /* "TreatExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1486 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 473: /* "CastableExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1495 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 474: /* "CastExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1504 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 475: /* "UnaryExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1513 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 476: /* "SignList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1522 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 477: /* "ValueExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1531 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 478: /* "ValueComp" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1540 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 479: /* "NodeComp" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1549 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 480: /* "ValidateExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1558 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 481: /* "ExtensionExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1567 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 482: /* "Pragma_list" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1576 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 483: /* "Pragma" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1585 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 484: /* "PathExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1594 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 486: /* "RelativePathExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1603 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 487: /* "StepExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1612 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 488: /* "AxisStep" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1621 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 489: /* "ForwardStep" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1630 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 490: /* "ForwardAxis" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1639 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 491: /* "AbbrevForwardStep" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1648 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 492: /* "ReverseStep" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1657 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 493: /* "ReverseAxis" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1666 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 494: /* "NodeTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1675 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 495: /* "NameTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1684 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 496: /* "Wildcard" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1693 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 497: /* "FilterExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1702 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 498: /* "PredicateList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1711 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 499: /* "Predicate" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1720 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 500: /* "PrimaryExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1729 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 501: /* "Literal" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1738 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 502: /* "NumericLiteral" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1747 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 503: /* "VarRef" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1756 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 504: /* "ParenthesizedExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1765 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 505: /* "ContextItemExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1774 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 506: /* "OrderedExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1783 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 507: /* "UnorderedExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1792 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 508: /* "FunctionCall" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1801 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 509: /* "ArgList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1810 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 510: /* "Constructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1819 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 511: /* "DirectConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1828 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 512: /* "DirElemConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1837 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 513: /* "DirElemContentList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1846 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 514: /* "DirAttributeList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1855 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 515: /* "DirAttr" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1864 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 517: /* "DirAttributeValue" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1873 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 518: /* "opt_QuoteAttrContentList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1882 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 519: /* "QuoteAttrContentList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1891 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 520: /* "opt_AposAttrContentList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1900 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 521: /* "AposAttrContentList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1909 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 522: /* "QuoteAttrValueContent" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1918 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 523: /* "AposAttrValueContent" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1927 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 524: /* "DirElemContent" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1936 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 525: /* "CommonContent" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1945 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 526: /* "DirCommentConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1954 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 527: /* "DirPIConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1963 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 528: /* "CDataSection" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1972 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 529: /* "ComputedConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1981 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 530: /* "CompDocConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1990 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 531: /* "CompElemConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 1999 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 532: /* "CompAttrConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2008 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 533: /* "CompTextConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2017 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 534: /* "CompCommentConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2026 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 535: /* "CompPIConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2035 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 536: /* "SingleType" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2044 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 537: /* "TypeDeclaration" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2053 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 538: /* "SequenceType" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2062 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 539: /* "OccurrenceIndicator" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2071 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 540: /* "ItemType" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2080 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 541: /* "TypeList" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2089 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 542: /* "AtomicType" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2098 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 543: /* "KindTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2107 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 544: /* "AnyKindTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2116 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 545: /* "DocumentTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2125 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 546: /* "TextTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2134 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 547: /* "CommentTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2143 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 548: /* "PITest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2152 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 549: /* "AttributeTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2161 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 550: /* "SchemaAttributeTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2170 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 551: /* "ElementTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2179 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 552: /* "SchemaElementTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2188 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 553: /* "TypeName" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2197 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 554: /* "TypeName_WITH_HOOK" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2206 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 555: /* "StringLiteral" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2215 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 560: /* "AnyFunctionTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2224 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 561: /* "TypedFunctionTest" */
+
+/* Line 480 of lalr1.cc */
+#line 904 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2233 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 564: /* "InsertExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2242 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 565: /* "DeleteExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2251 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 566: /* "ReplaceExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2260 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 567: /* "RenameExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2269 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 568: /* "TransformExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2278 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 569: /* "VarNameList" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2287 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 570: /* "VarNameDecl" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2296 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 571: /* "TryExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2305 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 572: /* "CatchListExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2314 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 573: /* "CatchExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2323 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 574: /* "BracedExpr" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2332 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 575: /* "NameTestList" */
+
+/* Line 480 of lalr1.cc */
+#line 916 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ delete (yyvaluep->name_test_list); };
/* Line 480 of lalr1.cc */
-#line 2319 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 570: /* "FTSelection" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2328 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 573: /* "FTOr" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2337 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 574: /* "FTAnd" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2346 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 575: /* "FTMildNot" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2355 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 576: /* "FTUnaryNot" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2364 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 577: /* "FTPrimaryWithOptions" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2373 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 578: /* "opt_FTMatchOptions" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2382 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 580: /* "FTWeight" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2391 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 581: /* "FTPrimary" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2400 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 582: /* "opt_FTTimes" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2409 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 583: /* "FTExtensionSelection" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2418 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 585: /* "FTWords" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2427 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 586: /* "FTWordsValue" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2436 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 588: /* "FTAnyallOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2445 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 591: /* "FTPosFilter" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2454 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 592: /* "FTOrder" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2463 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 593: /* "FTWindow" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2472 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 594: /* "FTDistance" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2481 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 595: /* "FTUnit" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2490 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 596: /* "FTMatchOptions" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2499 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 597: /* "FTMatchOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2508 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 598: /* "FTCaseOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2517 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 599: /* "FTDiacriticsOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2526 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 600: /* "FTExtensionOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2535 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 601: /* "FTStemOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2544 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 602: /* "FTThesaurusOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2553 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 606: /* "FTThesaurusID" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2562 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 609: /* "FTStopWordOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2571 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 610: /* "FTStopWords" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2580 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 614: /* "FTStopWordsInclExcl" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2589 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 615: /* "FTLanguageOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2598 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 616: /* "FTWildCardOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2607 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 617: /* "FTContent" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2616 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 618: /* "FTTimes" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2625 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 619: /* "FTRange" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2634 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 620: /* "FTScope" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2643 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 621: /* "FTBigUnit" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2652 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 622: /* "FTIgnoreOption" */
-
-/* Line 480 of lalr1.cc */
-#line 891 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->node) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2661 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 625: /* "QNAME" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2670 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 626: /* "FUNCTION_NAME" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2679 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
- break;
- case 627: /* "EQNAME" */
-
-/* Line 480 of lalr1.cc */
-#line 894 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
- { release_hack( (yyvaluep->expr) ); };
-
-/* Line 480 of lalr1.cc */
-#line 2688 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
+#line 2341 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 576: /* "FTSelection" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2350 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 579: /* "FTOr" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2359 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 580: /* "FTAnd" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2368 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 581: /* "FTMildNot" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2377 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 582: /* "FTUnaryNot" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2386 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 583: /* "FTPrimaryWithOptions" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2395 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 584: /* "opt_FTMatchOptions" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2404 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 586: /* "FTWeight" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2413 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 587: /* "FTPrimary" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2422 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 588: /* "opt_FTTimes" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2431 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 589: /* "FTExtensionSelection" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2440 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 591: /* "FTWords" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2449 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 592: /* "FTWordsValue" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2458 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 594: /* "FTAnyallOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2467 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 597: /* "FTPosFilter" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2476 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 598: /* "FTOrder" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2485 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 599: /* "FTWindow" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2494 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 600: /* "FTDistance" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2503 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 601: /* "FTUnit" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2512 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 602: /* "FTMatchOptions" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2521 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 603: /* "FTMatchOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2530 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 604: /* "FTCaseOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2539 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 605: /* "FTDiacriticsOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2548 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 606: /* "FTExtensionOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2557 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 607: /* "FTStemOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2566 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 608: /* "FTThesaurusOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2575 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 612: /* "FTThesaurusID" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2584 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 615: /* "FTStopWordOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2593 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 616: /* "FTStopWords" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2602 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 620: /* "FTStopWordsInclExcl" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2611 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 621: /* "FTLanguageOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2620 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 622: /* "FTWildCardOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2629 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 623: /* "FTContent" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2638 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 624: /* "FTTimes" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2647 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 625: /* "FTRange" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2656 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 626: /* "FTScope" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2665 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 627: /* "FTBigUnit" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2674 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 628: /* "FTIgnoreOption" */
+
+/* Line 480 of lalr1.cc */
+#line 907 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->node) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2683 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 629: /* "JSONConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 910 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2692 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 630: /* "JSONDirectArrayConstructor" */
+
+/* Line 480 of lalr1.cc */
+#line 910 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2701 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 638: /* "QNAME" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2710 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 639: /* "FUNCTION_NAME" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2719 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
+ break;
+ case 640: /* "EQNAME" */
+
+/* Line 480 of lalr1.cc */
+#line 913 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
+ { release_hack( (yyvaluep->expr) ); };
+
+/* Line 480 of lalr1.cc */
+#line 2728 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
break;
default:
@@ -2727,6 +2767,18 @@
}
#endif
+ inline bool
+ xquery_parser::yy_pact_value_is_default_ (int yyvalue)
+ {
+ return yyvalue == yypact_ninf_;
+ }
+
+ inline bool
+ xquery_parser::yy_table_value_is_error_ (int yyvalue)
+ {
+ return yyvalue == yytable_ninf_;
+ }
+
int
xquery_parser::parse ()
{
@@ -2748,7 +2800,7 @@
/// Location of the lookahead.
location_type yylloc;
/// The locations where the error started and ended.
- location_type yyerror_range[2];
+ location_type yyerror_range[3];
/// $$.
semantic_type yyval;
@@ -2762,14 +2814,14 @@
/* User initialization code. */
-/* Line 553 of lalr1.cc */
-#line 140 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 565 of lalr1.cc */
+#line 140 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
yylloc.begin.filename = yylloc.end.filename = &(driver.theFilename2);
}
-/* Line 553 of lalr1.cc */
-#line 2773 "/home/mbrantner/zorba/trunk/build/src/compiler/parser/xquery_parser.cpp"
+/* Line 565 of lalr1.cc */
+#line 2825 "/home/jsoniq/zorba/debug/src/compiler/parser/xquery_parser.cpp"
/* Initialize the stacks. The initial state will be pushed in
yynewstate, since the latter expects the semantical and the
@@ -2797,7 +2849,7 @@
/* Try to take a decision without lookahead. */
yyn = yypact_[yystate];
- if (yyn == yypact_ninf_)
+ if (yy_pact_value_is_default_ (yyn))
goto yydefault;
/* Read a lookahead token. */
@@ -2830,8 +2882,8 @@
yyn = yytable_[yyn];
if (yyn <= 0)
{
- if (yyn == 0 || yyn == yytable_ninf_)
- goto yyerrlab;
+ if (yy_table_value_is_error_ (yyn))
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
@@ -2887,8 +2939,8 @@
{
case 3:
-/* Line 678 of lalr1.cc */
-#line 994 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1034 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(2) - (2)].node);
}
@@ -2896,8 +2948,8 @@
case 4:
-/* Line 678 of lalr1.cc */
-#line 1003 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1043 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = NULL; YYABORT;
}
@@ -2905,8 +2957,8 @@
case 5:
-/* Line 678 of lalr1.cc */
-#line 1012 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1052 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(1) - (1)].node);
driver.set_expr( (yyval.node) );
@@ -2915,8 +2967,8 @@
case 6:
-/* Line 678 of lalr1.cc */
-#line 1018 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1058 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
MainModule* mm = dynamic_cast<MainModule*>((yysemantic_stack_[(2) - (2)].node));
mm->set_version_decl( static_cast<VersionDecl*>((yysemantic_stack_[(2) - (1)].node)) );
@@ -2927,8 +2979,8 @@
case 7:
-/* Line 678 of lalr1.cc */
-#line 1026 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1066 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(1) - (1)].node);
driver.set_expr( (yyval.node) );
@@ -2937,8 +2989,8 @@
case 8:
-/* Line 678 of lalr1.cc */
-#line 1032 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1072 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
LibraryModule* lm = dynamic_cast<LibraryModule*>((yysemantic_stack_[(2) - (2)].node));
lm->set_version_decl( static_cast<VersionDecl*>((yysemantic_stack_[(2) - (1)].node)) );
@@ -2949,8 +3001,8 @@
case 9:
-/* Line 678 of lalr1.cc */
-#line 1043 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1083 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new VersionDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(4) - (3)].sval)), "utf-8" );
}
@@ -2958,8 +3010,8 @@
case 10:
-/* Line 678 of lalr1.cc */
-#line 1048 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1088 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new VersionDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(6) - (3)].sval)), SYMTAB((yysemantic_stack_[(6) - (5)].sval)) );
}
@@ -2967,8 +3019,8 @@
case 11:
-/* Line 678 of lalr1.cc */
-#line 1056 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1096 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
Prolog* prolog = new Prolog(LOC((yyloc)), static_cast<SIND_DeclList*>((yysemantic_stack_[(3) - (1)].node)), NULL);
@@ -2978,8 +3030,8 @@
case 12:
-/* Line 678 of lalr1.cc */
-#line 1063 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1103 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
Prolog* prolog = new Prolog(LOC((yyloc)), NULL, static_cast<VFO_DeclList*>((yysemantic_stack_[(3) - (1)].node)));
@@ -2989,8 +3041,8 @@
case 13:
-/* Line 678 of lalr1.cc */
-#line 1070 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1110 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
Prolog* prolog = new Prolog(LOC((yyloc)),
static_cast<SIND_DeclList*>((yysemantic_stack_[(5) - (1)].node)),
@@ -3002,8 +3054,8 @@
case 14:
-/* Line 678 of lalr1.cc */
-#line 1079 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1119 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new MainModule( LOC((yyloc)), static_cast<QueryBody*>((yysemantic_stack_[(1) - (1)].expr)), NULL );
}
@@ -3011,8 +3063,8 @@
case 15:
-/* Line 678 of lalr1.cc */
-#line 1086 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1126 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(3) - (1)].node); (yyval.node) = (yysemantic_stack_[(3) - (3)].expr); // to prevent the Bison warning
(yylocation_stack_[(3) - (1)]).step();
@@ -3023,8 +3075,8 @@
case 16:
-/* Line 678 of lalr1.cc */
-#line 1094 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1134 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(3) - (1)].node); (yyval.node) = (yysemantic_stack_[(3) - (3)].expr); // to prevent the Bison warning
(yylocation_stack_[(3) - (1)]).step();
@@ -3035,8 +3087,8 @@
case 17:
-/* Line 678 of lalr1.cc */
-#line 1102 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1142 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(5) - (1)].node); (yyval.node) = (yysemantic_stack_[(5) - (3)].node); (yyval.node) = (yysemantic_stack_[(5) - (5)].expr); // to prevent the Bison warning
(yylocation_stack_[(5) - (3)]).step();
@@ -3047,8 +3099,8 @@
case 18:
-/* Line 678 of lalr1.cc */
-#line 1110 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1150 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(5) - (1)].node); (yyval.node) = (yysemantic_stack_[(5) - (3)].node); (yyval.node) = (yysemantic_stack_[(5) - (5)].expr); // to prevent the Bison warning
(yylocation_stack_[(5) - (1)]).step();
@@ -3059,8 +3111,8 @@
case 19:
-/* Line 678 of lalr1.cc */
-#line 1121 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1161 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new LibraryModule(LOC((yyloc)), static_cast<ModuleDecl*>((yysemantic_stack_[(1) - (1)].node)), NULL);
}
@@ -3068,8 +3120,8 @@
case 20:
-/* Line 678 of lalr1.cc */
-#line 1126 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1166 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
Prolog* prolog = new Prolog(LOC((yyloc)), static_cast<SIND_DeclList*>((yysemantic_stack_[(3) - (2)].node)), NULL);
@@ -3079,8 +3131,8 @@
case 21:
-/* Line 678 of lalr1.cc */
-#line 1133 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1173 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
Prolog* prolog = new Prolog(LOC((yyloc)), NULL, static_cast<VFO_DeclList*>((yysemantic_stack_[(3) - (2)].node)));
@@ -3090,8 +3142,8 @@
case 22:
-/* Line 678 of lalr1.cc */
-#line 1140 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1180 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
Prolog* prolog = new Prolog(LOC((yyloc)),
static_cast<SIND_DeclList*>((yysemantic_stack_[(5) - (2)].node)),
@@ -3103,8 +3155,8 @@
case 23:
-/* Line 678 of lalr1.cc */
-#line 1152 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1192 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new ModuleDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(6) - (3)].sval)), SYMTAB((yysemantic_stack_[(6) - (5)].sval)) );
@@ -3114,8 +3166,8 @@
case 24:
-/* Line 678 of lalr1.cc */
-#line 1162 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1202 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
SIND_DeclList *sdl = new SIND_DeclList( LOC((yyloc)) );
sdl->push_back( (yysemantic_stack_[(1) - (1)].node) );
@@ -3125,8 +3177,8 @@
case 25:
-/* Line 678 of lalr1.cc */
-#line 1169 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1209 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
((SIND_DeclList*)(yysemantic_stack_[(3) - (1)].node))->push_back( (yysemantic_stack_[(3) - (3)].node) );
(yyval.node) = (yysemantic_stack_[(3) - (1)].node);
@@ -3135,8 +3187,8 @@
case 26:
-/* Line 678 of lalr1.cc */
-#line 1176 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1216 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
// error
(yyval.node) = (yysemantic_stack_[(3) - (1)].node); (yyval.node) = (yysemantic_stack_[(3) - (3)].node); // to prevent the Bison warning
@@ -3148,8 +3200,8 @@
case 40:
-/* Line 678 of lalr1.cc */
-#line 1211 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1251 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new BoundarySpaceDecl(LOC((yyloc)), StaticContextConsts::preserve_space);
}
@@ -3157,8 +3209,8 @@
case 41:
-/* Line 678 of lalr1.cc */
-#line 1216 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1256 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new BoundarySpaceDecl(LOC((yyloc)), StaticContextConsts::strip_space);
}
@@ -3166,8 +3218,8 @@
case 42:
-/* Line 678 of lalr1.cc */
-#line 1224 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1264 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new DefaultCollationDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(4) - (4)].sval)) );
}
@@ -3175,8 +3227,8 @@
case 43:
-/* Line 678 of lalr1.cc */
-#line 1232 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1272 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new BaseURIDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (3)].sval)) );
}
@@ -3184,8 +3236,8 @@
case 44:
-/* Line 678 of lalr1.cc */
-#line 1240 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1280 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new ConstructionDecl(LOC((yyloc)), StaticContextConsts::cons_preserve);
}
@@ -3193,8 +3245,8 @@
case 45:
-/* Line 678 of lalr1.cc */
-#line 1245 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1285 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new ConstructionDecl(LOC((yyloc)), StaticContextConsts::cons_strip);
}
@@ -3202,8 +3254,8 @@
case 46:
-/* Line 678 of lalr1.cc */
-#line 1253 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1293 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new OrderingModeDecl(LOC((yyloc)), StaticContextConsts::ordered);
}
@@ -3211,8 +3263,8 @@
case 47:
-/* Line 678 of lalr1.cc */
-#line 1258 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1298 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new OrderingModeDecl(LOC((yyloc)), StaticContextConsts::unordered);
}
@@ -3220,8 +3272,8 @@
case 48:
-/* Line 678 of lalr1.cc */
-#line 1266 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1306 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new EmptyOrderDecl(LOC((yyloc)), StaticContextConsts::empty_greatest);
}
@@ -3229,8 +3281,8 @@
case 49:
-/* Line 678 of lalr1.cc */
-#line 1271 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1311 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new EmptyOrderDecl(LOC((yyloc)), StaticContextConsts::empty_least);
}
@@ -3238,8 +3290,8 @@
case 50:
-/* Line 678 of lalr1.cc */
-#line 1279 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1319 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new CopyNamespacesDecl(LOC((yyloc)),
StaticContextConsts::preserve_ns,
@@ -3249,8 +3301,8 @@
case 51:
-/* Line 678 of lalr1.cc */
-#line 1286 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1326 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new CopyNamespacesDecl(LOC((yyloc)),
StaticContextConsts::preserve_ns,
@@ -3260,8 +3312,8 @@
case 52:
-/* Line 678 of lalr1.cc */
-#line 1293 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1333 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new CopyNamespacesDecl(LOC((yyloc)),
StaticContextConsts::no_preserve_ns,
@@ -3271,8 +3323,8 @@
case 53:
-/* Line 678 of lalr1.cc */
-#line 1300 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1340 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new CopyNamespacesDecl(LOC((yyloc)),
StaticContextConsts::no_preserve_ns,
@@ -3282,8 +3334,8 @@
case 56:
-/* Line 678 of lalr1.cc */
-#line 1315 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1355 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yyval.node); // to prevent the Bison warning
error((yylocation_stack_[(3) - (2)]), "syntax error, \"import\" should be followed by either \"schema\" or \"module\".");
@@ -3293,8 +3345,8 @@
case 57:
-/* Line 678 of lalr1.cc */
-#line 1325 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1365 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new SchemaImport( LOC((yyloc)), NULL, SYMTAB((yysemantic_stack_[(3) - (3)].sval)), NULL );
}
@@ -3302,8 +3354,8 @@
case 58:
-/* Line 678 of lalr1.cc */
-#line 1330 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1370 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new SchemaImport(LOC((yyloc)),
dynamic_cast<SchemaPrefix*>((yysemantic_stack_[(4) - (3)].node)),
@@ -3314,8 +3366,8 @@
case 59:
-/* Line 678 of lalr1.cc */
-#line 1338 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1378 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new SchemaImport(LOC((yyloc)),
NULL,
@@ -3326,8 +3378,8 @@
case 60:
-/* Line 678 of lalr1.cc */
-#line 1346 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1386 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new SchemaImport(LOC((yyloc)),
dynamic_cast<SchemaPrefix*>((yysemantic_stack_[(6) - (3)].node)),
@@ -3338,8 +3390,8 @@
case 61:
-/* Line 678 of lalr1.cc */
-#line 1357 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1397 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
URILiteralList *ull = new URILiteralList( LOC((yyloc)));
ull->push_back( SYMTAB((yysemantic_stack_[(1) - (1)].sval)) );
@@ -3349,8 +3401,8 @@
case 62:
-/* Line 678 of lalr1.cc */
-#line 1364 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1404 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
if ( URILiteralList *ull = dynamic_cast<URILiteralList*>((yysemantic_stack_[(3) - (1)].node)) )
ull->push_back( SYMTAB((yysemantic_stack_[(3) - (3)].sval)) );
@@ -3361,8 +3413,8 @@
case 63:
-/* Line 678 of lalr1.cc */
-#line 1375 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1415 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new SchemaPrefix( LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (2)].sval)) );
}
@@ -3370,8 +3422,8 @@
case 64:
-/* Line 678 of lalr1.cc */
-#line 1380 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1420 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new SchemaPrefix( LOC((yyloc)), true );
}
@@ -3379,8 +3431,8 @@
case 65:
-/* Line 678 of lalr1.cc */
-#line 1388 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1428 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new ModuleImport(LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (3)].sval)), NULL);
@@ -3390,8 +3442,8 @@
case 66:
-/* Line 678 of lalr1.cc */
-#line 1395 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1435 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new ModuleImport(LOC((yyloc)), SYMTAB((yysemantic_stack_[(6) - (4)].sval)), SYMTAB((yysemantic_stack_[(6) - (6)].sval)), NULL);
@@ -3401,8 +3453,8 @@
case 67:
-/* Line 678 of lalr1.cc */
-#line 1402 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1442 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new ModuleImport(LOC((yyloc)),
SYMTAB((yysemantic_stack_[(5) - (3)].sval)),
@@ -3414,8 +3466,8 @@
case 68:
-/* Line 678 of lalr1.cc */
-#line 1411 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1451 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new ModuleImport(LOC((yyloc)),
SYMTAB((yysemantic_stack_[(8) - (4)].sval)),
@@ -3428,8 +3480,8 @@
case 69:
-/* Line 678 of lalr1.cc */
-#line 1424 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1464 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new NamespaceDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(5) - (3)].sval)), SYMTAB((yysemantic_stack_[(5) - (5)].sval)) );
}
@@ -3437,8 +3489,8 @@
case 70:
-/* Line 678 of lalr1.cc */
-#line 1432 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1472 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new DefaultNamespaceDecl(LOC((yyloc)),
ParseConstants::ns_element_default,
@@ -3448,8 +3500,8 @@
case 71:
-/* Line 678 of lalr1.cc */
-#line 1439 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1479 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new DefaultNamespaceDecl(LOC((yyloc)),
ParseConstants::ns_function_default,
@@ -3459,8 +3511,8 @@
case 72:
-/* Line 678 of lalr1.cc */
-#line 1449 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1489 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
VFO_DeclList *vdl = new VFO_DeclList( LOC((yyloc)));
vdl->push_back( (yysemantic_stack_[(1) - (1)].node) );
@@ -3470,8 +3522,8 @@
case 73:
-/* Line 678 of lalr1.cc */
-#line 1456 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1496 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
((VFO_DeclList*)(yysemantic_stack_[(3) - (1)].node))->push_back( (yysemantic_stack_[(3) - (3)].node) );
(yyval.node) = (yysemantic_stack_[(3) - (1)].node);
@@ -3480,8 +3532,8 @@
case 74:
-/* Line 678 of lalr1.cc */
-#line 1463 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1503 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(3) - (1)].node); (yyval.node) = (yysemantic_stack_[(3) - (3)].node); // to prevent the Bison warning
(yylocation_stack_[(3) - (1)]).step();
@@ -3492,8 +3544,8 @@
case 83:
-/* Line 678 of lalr1.cc */
-#line 1486 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1526 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new DecimalFormatNode(LOC((yyloc)), (yysemantic_stack_[(4) - (4)].vstrpair));
delete (yysemantic_stack_[(4) - (4)].vstrpair);
@@ -3502,8 +3554,8 @@
case 84:
-/* Line 678 of lalr1.cc */
-#line 1492 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1532 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new DecimalFormatNode(LOC((yyloc)), static_cast<QName*>((yysemantic_stack_[(4) - (3)].expr)), (yysemantic_stack_[(4) - (4)].vstrpair));
delete (yysemantic_stack_[(4) - (4)].vstrpair);
@@ -3512,8 +3564,8 @@
case 85:
-/* Line 678 of lalr1.cc */
-#line 1501 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1541 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.vstrpair) = new vector<string_pair_t>();
(yyval.vstrpair)->push_back( *(yysemantic_stack_[(1) - (1)].strpair) );
@@ -3523,8 +3575,8 @@
case 86:
-/* Line 678 of lalr1.cc */
-#line 1508 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1548 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yysemantic_stack_[(2) - (1)].vstrpair)->push_back( *(yysemantic_stack_[(2) - (2)].strpair) );
delete (yysemantic_stack_[(2) - (2)].strpair);
@@ -3534,8 +3586,8 @@
case 87:
-/* Line 678 of lalr1.cc */
-#line 1518 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1558 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
StringLiteral *sl = static_cast<StringLiteral*>((yysemantic_stack_[(3) - (3)].expr));
(yyval.strpair) = new string_pair_t( (yysemantic_stack_[(3) - (1)].strval), sl->get_strval().str() );
@@ -3545,78 +3597,78 @@
case 88:
-/* Line 678 of lalr1.cc */
-#line 1527 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1567 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ (yyval.strval) = "decimal-separator"; }
break;
case 89:
-/* Line 678 of lalr1.cc */
-#line 1528 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1568 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ (yyval.strval) = "digit"; }
break;
case 90:
-/* Line 678 of lalr1.cc */
-#line 1529 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1569 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ (yyval.strval) = "grouping-separator"; }
break;
case 91:
-/* Line 678 of lalr1.cc */
-#line 1530 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1570 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ (yyval.strval) = "infinty"; }
break;
case 92:
-/* Line 678 of lalr1.cc */
-#line 1531 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1571 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ (yyval.strval) = "minus-sign"; }
break;
case 93:
-/* Line 678 of lalr1.cc */
-#line 1532 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1572 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ (yyval.strval) = "NaN"; }
break;
case 94:
-/* Line 678 of lalr1.cc */
-#line 1533 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1573 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ (yyval.strval) = "pattern-separator"; }
break;
case 95:
-/* Line 678 of lalr1.cc */
-#line 1534 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1574 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ (yyval.strval) = "percent"; }
break;
case 96:
-/* Line 678 of lalr1.cc */
-#line 1535 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1575 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ (yyval.strval) = "per-mille"; }
break;
case 97:
-/* Line 678 of lalr1.cc */
-#line 1536 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1576 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{ (yyval.strval) = "zero-digit"; }
break;
case 98:
-/* Line 678 of lalr1.cc */
-#line 1542 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1582 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new OptionDecl(LOC((yyloc)), static_cast<QName*>((yysemantic_stack_[(4) - (3)].expr)), SYMTAB((yysemantic_stack_[(4) - (4)].sval)));
}
@@ -3624,8 +3676,8 @@
case 99:
-/* Line 678 of lalr1.cc */
-#line 1550 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1590 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new FTOptionDecl( LOC((yyloc)), dynamic_cast<FTMatchOptions*>((yysemantic_stack_[(3) - (3)].node)) );
}
@@ -3633,8 +3685,8 @@
case 100:
-/* Line 678 of lalr1.cc */
-#line 1558 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1598 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(4) - (4)].node);
}
@@ -3642,8 +3694,8 @@
case 101:
-/* Line 678 of lalr1.cc */
-#line 1566 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1606 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
CtxItemDecl* d = dynamic_cast<CtxItemDecl*>((yysemantic_stack_[(3) - (3)].node));
d->theType = (yysemantic_stack_[(3) - (2)].node);
@@ -3653,8 +3705,8 @@
case 102:
-/* Line 678 of lalr1.cc */
-#line 1573 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1613 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(1) - (1)].node);
}
@@ -3662,8 +3714,8 @@
case 103:
-/* Line 678 of lalr1.cc */
-#line 1581 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1621 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
CtxItemDecl* d = dynamic_cast<CtxItemDecl*>((yysemantic_stack_[(1) - (1)].node));
d->theIsExternal = false;
@@ -3673,8 +3725,8 @@
case 104:
-/* Line 678 of lalr1.cc */
-#line 1588 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1628 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new CtxItemDecl(LOC((yyloc)), NULL);
}
@@ -3682,8 +3734,8 @@
case 105:
-/* Line 678 of lalr1.cc */
-#line 1593 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1633 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(2) - (2)].node);
}
@@ -3691,8 +3743,8 @@
case 106:
-/* Line 678 of lalr1.cc */
-#line 1601 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1641 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new CtxItemDecl(LOC((yyloc)), (yysemantic_stack_[(2) - (2)].expr));
}
@@ -3700,8 +3752,8 @@
case 107:
-/* Line 678 of lalr1.cc */
-#line 1609 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1649 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(4) - (2)].varnametype)));
@@ -3719,8 +3771,8 @@
case 108:
-/* Line 678 of lalr1.cc */
-#line 1624 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1664 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(3) - (2)].varnametype)));
@@ -3738,8 +3790,8 @@
case 109:
-/* Line 678 of lalr1.cc */
-#line 1639 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1679 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(5) - (2)].varnametype)));
@@ -3757,8 +3809,8 @@
case 110:
-/* Line 678 of lalr1.cc */
-#line 1657 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1697 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.varnametype) = new VarNameAndType(LOC((yyloc)), static_cast<QName*>((yysemantic_stack_[(3) - (3)].expr)), NULL, NULL);
}
@@ -3766,8 +3818,8 @@
case 111:
-/* Line 678 of lalr1.cc */
-#line 1662 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1702 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.varnametype) = new VarNameAndType(LOC((yyloc)),
static_cast<QName*>((yysemantic_stack_[(4) - (3)].expr)),
@@ -3778,8 +3830,8 @@
case 112:
-/* Line 678 of lalr1.cc */
-#line 1670 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1710 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.varnametype) = new VarNameAndType(LOC((yyloc)),
static_cast<QName*>((yysemantic_stack_[(4) - (4)].expr)),
@@ -3790,8 +3842,8 @@
case 113:
-/* Line 678 of lalr1.cc */
-#line 1678 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1718 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.varnametype) = new VarNameAndType(LOC((yyloc)),
static_cast<QName*>((yysemantic_stack_[(5) - (4)].expr)),
@@ -3802,8 +3854,8 @@
case 114:
-/* Line 678 of lalr1.cc */
-#line 1689 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1729 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new AnnotationListParsenode(LOC((yyloc)), static_cast<AnnotationParsenode*>((yysemantic_stack_[(1) - (1)].node)));
}
@@ -3811,8 +3863,8 @@
case 115:
-/* Line 678 of lalr1.cc */
-#line 1694 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1734 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
static_cast<AnnotationListParsenode*>((yysemantic_stack_[(2) - (1)].node))->push_back(static_cast<AnnotationParsenode*>((yysemantic_stack_[(2) - (2)].node)));
(yyval.node) = (yysemantic_stack_[(2) - (1)].node);
@@ -3821,8 +3873,8 @@
case 116:
-/* Line 678 of lalr1.cc */
-#line 1703 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1743 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new AnnotationParsenode(LOC((yyloc)), new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval))), NULL);
}
@@ -3830,8 +3882,8 @@
case 117:
-/* Line 678 of lalr1.cc */
-#line 1708 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1748 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new AnnotationParsenode(LOC((yyloc)),
new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(4) - (1)].sval))),
@@ -3841,8 +3893,8 @@
case 118:
-/* Line 678 of lalr1.cc */
-#line 1715 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1755 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new AnnotationParsenode(LOC((yyloc)), new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval)), true), NULL);
}
@@ -3850,8 +3902,8 @@
case 119:
-/* Line 678 of lalr1.cc */
-#line 1720 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1760 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new AnnotationParsenode(LOC((yyloc)),
new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(4) - (1)].sval)), true),
@@ -3861,8 +3913,8 @@
case 120:
-/* Line 678 of lalr1.cc */
-#line 1730 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1770 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new AnnotationLiteralListParsenode(LOC((yyloc)), (yysemantic_stack_[(1) - (1)].expr));
}
@@ -3870,8 +3922,8 @@
case 121:
-/* Line 678 of lalr1.cc */
-#line 1735 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1775 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
static_cast<AnnotationLiteralListParsenode*>((yysemantic_stack_[(3) - (1)].node))->push_back((yysemantic_stack_[(3) - (3)].expr));
(yyval.node) = (yysemantic_stack_[(3) - (1)].node);
@@ -3880,8 +3932,8 @@
case 122:
-/* Line 678 of lalr1.cc */
-#line 1744 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1784 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
static_cast<FunctionDecl*>((yysemantic_stack_[(2) - (2)].node))->setComment( SYMTAB((yysemantic_stack_[(2) - (1)].sval)) );
(yyval.node) = (yysemantic_stack_[(2) - (2)].node);
@@ -3890,8 +3942,8 @@
case 123:
-/* Line 678 of lalr1.cc */
-#line 1750 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1790 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
FunctionDecl* fdecl = static_cast<FunctionDecl*>((yysemantic_stack_[(3) - (3)].node));
@@ -3904,8 +3956,8 @@
case 124:
-/* Line 678 of lalr1.cc */
-#line 1763 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1803 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(1) - (1)].node);
}
@@ -3913,8 +3965,8 @@
case 125:
-/* Line 678 of lalr1.cc */
-#line 1768 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1808 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = (yysemantic_stack_[(1) - (1)].node);
}
@@ -3922,8 +3974,8 @@
case 126:
-/* Line 678 of lalr1.cc */
-#line 1776 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1816 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new FunctionDecl(LOC((yyloc)),
static_cast<QName*>((yysemantic_stack_[(4) - (2)].expr)),
@@ -3938,8 +3990,8 @@
case 127:
-/* Line 678 of lalr1.cc */
-#line 1787 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1827 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new FunctionDecl(LOC ((yyloc)),
static_cast<QName*>((yysemantic_stack_[(4) - (2)].expr)),
@@ -3954,8 +4006,8 @@
case 128:
-/* Line 678 of lalr1.cc */
-#line 1802 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1842 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new FunctionDecl(LOC ((yyloc)),
static_cast<QName*>((yysemantic_stack_[(5) - (3)].expr)),
@@ -3970,8 +4022,8 @@
case 129:
-/* Line 678 of lalr1.cc */
-#line 1814 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1854 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new FunctionDecl(LOC((yyloc)),
static_cast<QName*>((yysemantic_stack_[(5) - (3)].expr)),
@@ -3986,8 +4038,8 @@
case 130:
-/* Line 678 of lalr1.cc */
-#line 1829 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1869 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.fnsig) = new FunctionSig(NULL);
}
@@ -3995,8 +4047,8 @@
case 131:
-/* Line 678 of lalr1.cc */
-#line 1834 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1874 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.fnsig) = new FunctionSig(dynamic_cast<ParamList*>((yysemantic_stack_[(3) - (2)].node)));
}
@@ -4004,8 +4056,8 @@
case 132:
-/* Line 678 of lalr1.cc */
-#line 1839 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1879 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.fnsig) = new FunctionSig(NULL, dynamic_cast<SequenceType*>((yysemantic_stack_[(4) - (4)].node)));
}
@@ -4013,8 +4065,8 @@
case 133:
-/* Line 678 of lalr1.cc */
-#line 1844 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1884 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.fnsig) = new FunctionSig(dynamic_cast<ParamList*>((yysemantic_stack_[(5) - (2)].node)), dynamic_cast<SequenceType*>((yysemantic_stack_[(5) - (5)].node)));
}
@@ -4022,8 +4074,8 @@
case 134:
-/* Line 678 of lalr1.cc */
-#line 1852 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1892 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
ParamList *pl = new ParamList( LOC((yyloc)) );
pl->push_back( dynamic_cast<Param*>((yysemantic_stack_[(1) - (1)].node)) );
@@ -4033,8 +4085,8 @@
case 135:
-/* Line 678 of lalr1.cc */
-#line 1859 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1899 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
if ( ParamList *pl = dynamic_cast<ParamList*>((yysemantic_stack_[(3) - (1)].node)) )
pl->push_back( dynamic_cast<Param*>((yysemantic_stack_[(3) - (3)].node)) );
@@ -4045,8 +4097,8 @@
case 136:
-/* Line 678 of lalr1.cc */
-#line 1870 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1910 "/home/jsoniq/zorba/sandbox/src/compiler/parser/xquery_parser.y"
{
(yyval.node) = new Param(LOC((yyloc)), static_cast<QName*>((yysemantic_stack_[(2) - (2)].expr)), NULL);
}
@@ -4054,8 +4106,8 @@
case 137:
-/* Line 678 of lalr1.cc */
-#line 1875 "/home/mbrantner/zorba/trunk/core/src/compiler/parser/xquery_parser.y"
+/* Line 690 of lalr1.cc */
+#line 1915 "/home/jsoniq/z
Follow ups