diff -Nru raptor2-2.0.12/CMakeLists.txt raptor2-2.0.13/CMakeLists.txt --- raptor2-2.0.12/CMakeLists.txt 2013-11-25 01:21:43.000000000 +0000 +++ raptor2-2.0.13/CMakeLists.txt 2013-12-16 01:14:13.000000000 +0000 @@ -9,8 +9,8 @@ SET(RAPTOR_VERSION_MAJOR 2) SET(RAPTOR_VERSION_MINOR 0) -SET(RAPTOR_VERSION_RELEASE 12) -SET(RAPTOR_MIN_VERSION_DECIMAL 20012) +SET(RAPTOR_VERSION_RELEASE 13) +SET(RAPTOR_MIN_VERSION_DECIMAL 20013) SET(VERSION "${RAPTOR_VERSION_MAJOR}.${RAPTOR_VERSION_MINOR}.${RAPTOR_VERSION_RELEASE}") MATH(EXPR RAPTOR_VERSION_DECIMAL "${RAPTOR_VERSION_MAJOR} * 10000 + ${RAPTOR_VERSION_MINOR} * 100 + ${RAPTOR_VERSION_RELEASE}") diff -Nru raptor2-2.0.12/ChangeLog raptor2-2.0.13/ChangeLog --- raptor2-2.0.12/ChangeLog 2013-12-13 14:52:01.000000000 +0000 +++ raptor2-2.0.13/ChangeLog 2014-01-30 03:55:43.000000000 +0000 @@ -1,4 +1,199 @@ -2013-12-13 Dave Beckett +2014-01-29 Dave Beckett + + * Snapshotted raptor2_2_0_13 for 2.0.13 release (GIT + fde3f210e7442de6de16c410443fd8a695f09820) + +2014-01-29 Dave Beckett + + * NEWS.html, RELEASE.html: + 2.0.13 + +2014-01-27 Dave Beckett + + * ChangeLog, INSTALL.html, LICENSE.html, NEWS.html, README.html, + RELEASE.html, TODO.html, UPGRADING.html: 2.0.13 and 2014 + + * configure.ac: Use presence of libxml / curl config programs as + test for presence + + Symptom was that after configuring, curl was present but not used + for WWW fetching. + + Original commit that changed this was + commit 7da03ba5cd6e45ea41afebd4955acf6e96e9d622 + Date: Fri Apr 5 19:01:55 2013 +0100 + + which was Raptor 2.0.10 onwards + +2014-01-15 Dave Beckett + + * autogen.sh: Create NEWS and README + +2014-01-14 Dave Beckett + + * Makefile.am: fix html rules more + + * .travis.yml: Travis CI fix + + * Makefile.am: fix html rule + +2014-01-10 Dave Beckett + + * src/raptor_abbrev.c: + Revert: (raptor_abbrev_subject_find): Remove + double free of lookup_node. + + This reverts commit c1c82f1be5d86ebf95fa10b86a938d6799e35626. + + * src/raptor_rfc2396.c: + (raptor_uri_resolve_uri_reference): Handle NULL ref->path + + * src/raptor_abbrev.c: + (raptor_abbrev_subject_find): Remove double free of lookup_node + Remove call to raptor_free_abbrev_node() + +2014-01-07 Dave Beckett + + * configure.ac: Use AC_CHECK_PROGS to find jing + AC_CHECK_PROG doesn't default to setting it as found! + +2014-01-04 Dave Beckett + + * src/raptor_general.c: 2014 + + * src/turtle_lexer.l: Remove YY_INPUT - never want to read from + stdin/file + +2014-01-02 Dave Beckett + + * Merge pull request #12 from dajobe/bison3.0-new Switch to use + and require Bison 3.0 + + * src/turtle_lexer.l: Provide missing flex prototypes for flex + 2.5.35 or earlier + + * src/parsedate.y: + (raptor_parse_date): No need for cast to void* for yyparse + +2014-01-01 Dave Beckett + + * src/turtle_parser.y: Remove redundant declaration of + turtle_lexer_lex + + * configure.ac, src/Makefile.am: Alter configure to accept bison + 3.0.0 or newer, no yacc + + * src/parsedate.y: Add bison 3.0 directives + + * src/parsedate.y: Bison 3.0 the parsedate parser + + - Update to new directives + - Set %param + - Update error call + + * src/turtle_parser.y: Bison 3.0 the turtle parser + + - Use bison 3.0+ directives replacing all command line arguments + - Update lexer and parser parameters (remove use of YYLEX_PARAM) + - (turtle_parser_error): Add scanner arg. + - Use rdf_parser argument directly rather than via casted variable. + - Add %empty directives + - Remove casts to raptor_parser* that are no longer needed + - (turtle_parse): Pass in scanner + + * src/turtle_parser.y: Remove YY_DECL + + * src/turtle_lexer.l: Add %option bison-bridge + + * src/turtle_lexer.l: Remove turtle_lexer_lex prototype / header + override + + No longer use YYDECL - the default works. + + * src/turtle_lexer.l: Replace turtle_parser_lval with yylval + + * src/turtle_common.c: Move turtle_lexer.h include earlier so + YYSTYPE can be found + + * src/turtle_lexer.l, src/turtle_parser.y: Remove token union + unused integer field + +2013-12-30 Dave Beckett + + * src/parsedate.y: bison %pure-parser + + * src/turtle_parser.y: bison %define api.push-pull pull + + * tests/ntriples/Makefile.am: Add bug-562.out to dist + + * src/raptor_json_writer.c: + (raptor_json_writer_literal_object): No need for strlen + + * src/raptor_json_writer.c: + (raptor_json_writer_quoted): No need for strlen + + * src/raptor_internal.h, src/raptor_json_writer.c: Add size arg to + raptor_json_writer_blank_object + + (raptor_json_writer_blank_object): use len and save a strlen + + (raptor_json_writer_term): Update call to above + + * src/raptor_internal.h, src/raptor_json_writer.c: Add len arg to + raptor_json_writer_literal_object + + (raptor_json_writer_literal_object): Remove use of + raptor_json_writer_quoted for constant string. + + * src/raptor_json_writer.c, src/raptor_serialize_json.c: Use + raptor_json_writer_term() in several places + + (raptor_json_serialize_statement): Use raptor_json_writer_term() + for s, p, o. + + (raptor_json_serialize_avltree_visit): Use + raptor_json_writer_term() for final object. + + * src/raptor_internal.h, src/raptor_json_writer.c: + (raptor_json_writer_term): Added + + * src/raptor_internal.h, src/raptor_json_writer.c, + src/raptor_serialize_json.c: Inline constant args for + raptor_json_writer_literal_object + + (raptor_json_writer_literal_object): Was always called with same + constants so inline them and update callers. + +2013-12-29 Dave Beckett + + * src/raptor_serialize_turtle.c: Use + raptor_turtle_writer_raw_counted to save strlen()s + + * src/raptor_internal.h, src/raptor_serialize_rdfxmla.c, + src/raptor_serialize_turtle.c: Add RAPTOR_DEBUG_ABBREV_NODE for + abbreviated serializing debugging + + Update RDF/XML-Abbrev and Turtle serializer to use it + + * src/ntriples_parse.c: + Allow ' in + + Fixes Issue #0000562 + http://bugs.librdf.org/mantis/view.php?id=562 + + * tests/ntriples/Makefile.am, tests/ntriples/bug-562.nt, + tests/ntriples/bug-562.out: Add bug-562 test files for Issue + #0000562 + +2013-12-13 Dave Beckett + + * src/raptor_term.c: + (raptor_new_term_from_counted_string): Fix memset transposed args. + + * NEWS.html: word + + * CMakeLists.txt, NEWS.html, RELEASE.html, configure.ac: Bumped + version to 2.0.13 * Snapshotted raptor2_2_0_12 for 2.0.12 release (GIT f38f4182b8d90a8f457e856e8eaa93cb1f135322) diff -Nru raptor2-2.0.12/INSTALL.html raptor2-2.0.13/INSTALL.html --- raptor2-2.0.12/INSTALL.html 2013-02-27 04:05:51.000000000 +0000 +++ raptor2-2.0.13/INSTALL.html 2014-01-29 21:45:12.000000000 +0000 @@ -374,7 +374,7 @@
-

Copyright 2000-2013 Dave Beckett
Copyright 2000-2005 University of Bristol

+

Copyright 2000-2014 Dave Beckett
Copyright 2000-2005 University of Bristol

diff -Nru raptor2-2.0.12/LICENSE.html raptor2-2.0.13/LICENSE.html --- raptor2-2.0.12/LICENSE.html 2013-01-23 17:40:05.000000000 +0000 +++ raptor2-2.0.13/LICENSE.html 2014-01-29 21:45:12.000000000 +0000 @@ -23,7 +23,7 @@

-Copyright (C) 2000-2013 David Beckett
+Copyright (C) 2000-2014 David Beckett
Copyright (C) 2000-2005 University of Bristol. All Rights Reserved.

@@ -68,7 +68,7 @@

- Copyright (C) 2000-2013 David Beckett
+ Copyright (C) 2000-2014 David Beckett
Copyright (C) 2000-2005 University of Bristol.

@@ -93,7 +93,7 @@
-

Copyright (C) 2000-2013 David Beckett
Copyright (C) 2000-2005 University of Bristol

+

Copyright (C) 2000-2014 David Beckett
Copyright (C) 2000-2005 University of Bristol

diff -Nru raptor2-2.0.12/LICENSE.txt raptor2-2.0.13/LICENSE.txt --- raptor2-2.0.12/LICENSE.txt 2013-01-25 04:55:42.000000000 +0000 +++ raptor2-2.0.13/LICENSE.txt 2014-01-29 21:45:21.000000000 +0000 @@ -11,7 +11,7 @@ COPYING.LIB for the full LGPL 2.1 license text. __________________________________________________________________ - Copyright (C) 2000-2013 David Beckett + Copyright (C) 2000-2014 David Beckett Copyright (C) 2000-2005 University of Bristol. All Rights Reserved. This package is free software; you can redistribute it and/or modify @@ -43,7 +43,7 @@ See http://www.apache.org/licenses/LICENSE-2.0 or LICENSE-2.0.txt for the full ASL 2.0 license text. - Copyright (C) 2000-2013 David Beckett + Copyright (C) 2000-2014 David Beckett Copyright (C) 2000-2005 University of Bristol. Licensed under the Apache License, Version 2.0 (the "License"); you @@ -62,5 +62,5 @@ section 4(d) of the Apache License, Version 2.0. __________________________________________________________________ - Copyright (C) 2000-2013 David Beckett + Copyright (C) 2000-2014 David Beckett Copyright (C) 2000-2005 University of Bristol diff -Nru raptor2-2.0.12/Makefile.am raptor2-2.0.13/Makefile.am --- raptor2-2.0.12/Makefile.am 2013-11-08 19:34:00.000000000 +0000 +++ raptor2-2.0.13/Makefile.am 2014-01-15 06:54:03.000000000 +0000 @@ -60,10 +60,10 @@ .html.txt: $(HTML_TO_TEXT) $< > $@ -README: README.html +$(srcdir)/README: $(srcdir)/README.html $(HTML_TO_TEXT) $< > $@ -$(srcdir)/NEWS: NEWS.html +$(srcdir)/NEWS: $(srcdir)/NEWS.html $(HTML_TO_TEXT) $< > $@ endif diff -Nru raptor2-2.0.12/Makefile.in raptor2-2.0.13/Makefile.in --- raptor2-2.0.12/Makefile.in 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -198,6 +198,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -294,8 +295,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -899,10 +898,10 @@ @MAINTAINER_MODE_TRUE@.html.txt: @MAINTAINER_MODE_TRUE@ $(HTML_TO_TEXT) $< > $@ -@MAINTAINER_MODE_TRUE@README: README.html +@MAINTAINER_MODE_TRUE@$(srcdir)/README: $(srcdir)/README.html @MAINTAINER_MODE_TRUE@ $(HTML_TO_TEXT) $< > $@ -@MAINTAINER_MODE_TRUE@$(srcdir)/NEWS: NEWS.html +@MAINTAINER_MODE_TRUE@$(srcdir)/NEWS: $(srcdir)/NEWS.html @MAINTAINER_MODE_TRUE@ $(HTML_TO_TEXT) $< > $@ # Some people need a little help ;-) diff -Nru raptor2-2.0.12/NEWS raptor2-2.0.13/NEWS --- raptor2-2.0.12/NEWS 2013-12-13 14:52:41.000000000 +0000 +++ raptor2-2.0.13/NEWS 2014-01-30 03:37:57.000000000 +0000 @@ -1,8 +1,16 @@ Raptor RDF Syntax Library - News +2013-01-29 Raptor2 Version 2.0.13 Released + + Fix configure not finding curl when curl-config --cflags is empty + Fixed reported issue: 0000562. + + See the Raptor2 2.0.13 Release Notes for the full details of the + changes. + 2013-12-13 Raptor2 Version 2.0.12 Released - N-Triples / N-Quads parser updated to pass all the RDF.1 2013 tests + N-Triples / N-Quads parser updated to pass all the RDF 1.1 2013 tests Added raptor_new_term_from_counted_string() See the Raptor2 2.0.12 Release Notes for the full details of the @@ -698,5 +706,5 @@ First release __________________________________________________________________ - Copyright (C) 2001-2013 Dave Beckett + Copyright (C) 2001-2014 Dave Beckett Copyright (C) 2001-2005 University of Bristol diff -Nru raptor2-2.0.12/NEWS.html raptor2-2.0.13/NEWS.html --- raptor2-2.0.12/NEWS.html 2013-12-13 14:52:01.000000000 +0000 +++ raptor2-2.0.13/NEWS.html 2014-01-30 03:37:53.000000000 +0000 @@ -8,9 +8,20 @@

Raptor RDF Syntax Library - News

+

2013-01-29 Raptor2 Version 2.0.13 Released

+ +

Fix configure not finding curl when curl-config --cflags is empty
+Fixed reported issue: +0000562. +

+ +

See the Raptor2 2.0.13 Release Notes +for the full details of the changes.

+ +

2013-12-13 Raptor2 Version 2.0.12 Released

-

N-Triples / N-Quads parser updated to pass all the RDF.1 2013 tests
+

N-Triples / N-Quads parser updated to pass all the RDF 1.1 2013 tests
Added raptor_new_term_from_counted_string()

@@ -856,7 +867,7 @@
-

Copyright (C) 2001-2013 Dave Beckett
Copyright (C) 2001-2005 University of Bristol

+

Copyright (C) 2001-2014 Dave Beckett
Copyright (C) 2001-2005 University of Bristol

diff -Nru raptor2-2.0.12/README raptor2-2.0.13/README --- raptor2-2.0.12/README 2013-12-13 01:38:42.000000000 +0000 +++ raptor2-2.0.13/README 2014-01-29 21:45:21.000000000 +0000 @@ -203,5 +203,5 @@ and Redland as well as future plans and announcement of releases. __________________________________________________________________ - Copyright (C) 2000-2013 Dave Beckett + Copyright (C) 2000-2014 Dave Beckett Copyright (C) 2000-2005 University of Bristol diff -Nru raptor2-2.0.12/README.html raptor2-2.0.13/README.html --- raptor2-2.0.12/README.html 2013-12-13 01:38:38.000000000 +0000 +++ raptor2-2.0.13/README.html 2014-01-29 21:45:12.000000000 +0000 @@ -310,7 +310,7 @@
-

Copyright (C) 2000-2013 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

+

Copyright (C) 2000-2014 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

diff -Nru raptor2-2.0.12/RELEASE.html raptor2-2.0.13/RELEASE.html --- raptor2-2.0.12/RELEASE.html 2013-12-13 14:52:01.000000000 +0000 +++ raptor2-2.0.13/RELEASE.html 2014-01-29 21:45:16.000000000 +0000 @@ -9,6 +9,43 @@

Raptor RDF Syntax Library - Release Notes

+

Raptor2 2.0.13 changes

+ +

Issues Fixed:

+
    +
  • 0000562: N-Quads parsing of URIs with ' fails
  • +
+ +

Parser changes

+ +

The N-Triples / N-Quads parser was updated to allow ' in URIs. +Fixes Issue #0000562. +

+ +

Configuration changes

+ +

Use the discovery of the xml2-config(1) / +curl-config(1) programs as test for presence of the +libraries. This fixes the issue where that after configuring, curl +was present but was not used for WWW fetching. This is seen when +the output of curl-config --cflags is empty / whitespace. +

+ +

Updated to use the AC_CHECK_PROGS macro to find jing +since AC_CHECK_PROG doesn't default to setting it as +found when present! +

+ +

Internal changes

+ +

The Turtle and parsedate parsers and the turtle lexer were updated +to use and require Bison 3.0.0. +

+ +

The JSON and turtle writers were updated to save several expensive +strlen() calls.

+ +

Raptor2 2.0.12 changes

Parser changes

@@ -4462,7 +4499,7 @@
-

Copyright (C) 2003-2013 Dave Beckett
Copyright (C) 2003-2005 University of Bristol

+

Copyright (C) 2003-2014 Dave Beckett
Copyright (C) 2003-2005 University of Bristol

diff -Nru raptor2-2.0.12/UPGRADING.html raptor2-2.0.13/UPGRADING.html --- raptor2-2.0.12/UPGRADING.html 2013-02-27 04:05:51.000000000 +0000 +++ raptor2-2.0.13/UPGRADING.html 2014-01-29 21:45:12.000000000 +0000 @@ -153,7 +153,7 @@
-

Copyright 2010-2013 Dave Beckett

+

Copyright 2010-2014 Dave Beckett

diff -Nru raptor2-2.0.12/autogen.sh raptor2-2.0.13/autogen.sh --- raptor2-2.0.12/autogen.sh 2013-04-05 18:03:36.000000000 +0000 +++ raptor2-2.0.13/autogen.sh 2014-01-15 16:13:11.000000000 +0000 @@ -363,10 +363,12 @@ fi fi - if test ! -f NEWS; then - echo "$program: Creating empty NEWS file to allow configure to work" - $DRYRUN touch -t 200001010000 NEWS - fi + for docs in NEWS README; do + if test ! -f $docs; then + echo "$program: Creating empty $docs file to allow configure to work" + $DRYRUN touch -t 200001010000 $docs + fi + done echo "$program: Running $aclocal $aclocal_args" $DRYRUN $aclocal $aclocal_args diff -Nru raptor2-2.0.12/build/config.guess raptor2-2.0.13/build/config.guess --- raptor2-2.0.12/build/config.guess 2013-12-08 01:58:04.000000000 +0000 +++ raptor2-2.0.13/build/config.guess 2014-01-25 04:55:19.000000000 +0000 @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2014-01-25' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -22,19 +20,17 @@ # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'` @@ -54,9 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -138,6 +132,27 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -200,6 +215,10 @@ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -302,7 +321,7 @@ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -801,6 +820,9 @@ i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; @@ -852,21 +874,21 @@ exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,59 +901,54 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -950,54 +967,63 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1201,6 +1227,9 @@ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1227,19 +1256,31 @@ exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1256,7 +1297,7 @@ NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1330,157 +1371,6 @@ exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <. @@ -26,11 +20,12 @@ # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -73,9 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,7 +116,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) @@ -156,7 +149,7 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; @@ -259,10 +252,12 @@ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ @@ -270,10 +265,11 @@ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -291,16 +287,17 @@ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ - | or32 \ + | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ @@ -328,7 +325,7 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -370,13 +367,13 @@ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -385,11 +382,13 @@ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -407,12 +406,13 @@ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ @@ -788,11 +788,15 @@ basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze*) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -828,7 +832,7 @@ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1019,7 +1023,11 @@ basic_machine=i586-unknown os=-pw32 ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) basic_machine=i386-pc os=-rdos ;; @@ -1346,21 +1354,21 @@ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1492,9 +1500,6 @@ -aros*) os=-aros ;; - -kaos*) - os=-kaos - ;; -zvmoe) os=-zvmoe ;; @@ -1543,6 +1548,9 @@ c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1586,6 +1594,9 @@ mips*-*) os=-elf ;; + or1k-*) + os=-elf + ;; or32-*) os=-coff ;; diff -Nru raptor2-2.0.12/configure raptor2-2.0.13/configure --- raptor2-2.0.12/configure 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/configure 2014-01-27 19:36:10.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Revision: . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Raptor RDF Parser and Serializer library 2.0.12. +# Generated by GNU Autoconf 2.69 for Raptor RDF Parser and Serializer library 2.0.13. # # Report bugs to . # @@ -591,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='Raptor RDF Parser and Serializer library' PACKAGE_TARNAME='raptor2' -PACKAGE_VERSION='2.0.12' -PACKAGE_STRING='Raptor RDF Parser and Serializer library 2.0.12' +PACKAGE_VERSION='2.0.13' +PACKAGE_STRING='Raptor RDF Parser and Serializer library 2.0.13' PACKAGE_BUGREPORT='http://bugs.librdf.org/' PACKAGE_URL='' @@ -746,8 +746,7 @@ JING PERL TAR -YFLAGS -YACC +BISON LEXLIB LEX_OUTPUT_ROOT LEX @@ -906,8 +905,6 @@ LIBS CPPFLAGS CPP -YACC -YFLAGS PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR @@ -1457,7 +1454,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Raptor RDF Parser and Serializer library 2.0.12 to adapt to many kinds of systems. +\`configure' configures Raptor RDF Parser and Serializer library 2.0.13 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1527,7 +1524,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Raptor RDF Parser and Serializer library 2.0.12:";; + short | recursive ) echo "Configuration of Raptor RDF Parser and Serializer library 2.0.13:";; esac cat <<\_ACEOF @@ -1583,12 +1580,6 @@ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor - YACC The `Yet Another Compiler Compiler' implementation to use. - Defaults to the first program found out of: `bison -y', `byacc', - `yacc'. - YFLAGS The list of arguments that will be passed by default to $YACC. - This script will default YFLAGS to the empty string to avoid a - default value of `-d' given by some make applications. PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path @@ -1672,7 +1663,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Raptor RDF Parser and Serializer library configure 2.0.12 +Raptor RDF Parser and Serializer library configure 2.0.13 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2041,7 +2032,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Raptor RDF Parser and Serializer library $as_me 2.0.12, which was +It was created by Raptor RDF Parser and Serializer library $as_me 2.0.13, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2860,7 +2851,7 @@ # Define the identity of the package. PACKAGE='raptor2' - VERSION='2.0.12' + VERSION='2.0.13' cat >>confdefs.h <<_ACEOF @@ -12794,18 +12785,18 @@ fi fi -BISON_MIN_VERSION=2.4 -for ac_prog in 'bison -y' byacc +BISON_MIN_VERSION=3.0.0 +for ac_prog in bison3 bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_YACC+:} false; then : +if ${ac_cv_prog_BISON+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. + if test -n "$BISON"; then + ac_cv_prog_BISON="$BISON" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -12814,7 +12805,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_YACC="$ac_prog" + ac_cv_prog_BISON="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12824,19 +12815,18 @@ fi fi -YACC=$ac_cv_prog_YACC -if test -n "$YACC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 -$as_echo "$YACC" >&6; } +BISON=$ac_cv_prog_BISON +if test -n "$BISON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5 +$as_echo "$BISON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$YACC" && break + test -n "$BISON" && break done -test -n "$YACC" || YACC="yacc" if test "$USE_MAINTAINER_MODE" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU bison" >&5 @@ -12844,7 +12834,7 @@ # Match these styles of versions # GNU Bison version 1.28 # bison (GNU Bison) 1.875 - BISON_VERSION=`$YACC --version 2>&1 | sed -ne 's/^.*GNU Bison[^0-9]*//p'` + BISON_VERSION=`$BISON --version 2>&1 | sed -ne 's/^.*GNU Bison[^0-9]*//p'` if test "X$BISON_VERSION" != X; then BISON_VERSION_DEC=`echo $BISON_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` @@ -12868,7 +12858,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "$YACC is not GNU bison +as_fn_error $? "$BISON is not GNU bison See \`config.log' for more details" "$LINENO" 5; } fi fi @@ -12960,8 +12950,10 @@ done # Used in tests/feeds -# Extract the first word of "jing", so it can be a program name with args. -set dummy jing; ac_word=$2 +for ac_prog in jing +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_JING+:} false; then : @@ -12977,7 +12969,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_JING="" + ac_cv_prog_JING="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12997,6 +12989,9 @@ fi + test -n "$JING" && break +done + ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"} @@ -14761,7 +14756,7 @@ need_libxml=0 oCPPFLAGS="$CPPFLAGS" -if test "X$LIBXML_CFLAGS" != X; then +if test "X$XML_CONFIG" != X; then CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS" LIBS="$LIBS $LIBXML_LIBS" ac_fn_c_check_func "$LINENO" "xmlCreatePushParserCtxt" "ac_cv_func_xmlCreatePushParserCtxt" @@ -15724,7 +15719,7 @@ need_libxml_www=0 need_libfetch=0 -if test "X$LIBCURL_CFLAGS" != X; then +if test "X$CURL_CONFIG" != X; then CPPFLAGS="$CPPFLAGS $LIBCURL_CFLAGS" LIBS="$LIBS $LIBCURL_LIBS" ac_fn_c_check_header_mongrel "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default" @@ -17265,7 +17260,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Raptor RDF Parser and Serializer library $as_me 2.0.12, which was +This file was extended by Raptor RDF Parser and Serializer library $as_me 2.0.13, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17331,7 +17326,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Raptor RDF Parser and Serializer library config.status 2.0.12 +Raptor RDF Parser and Serializer library config.status 2.0.13 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru raptor2-2.0.12/configure.ac raptor2-2.0.13/configure.ac --- raptor2-2.0.12/configure.ac 2013-12-08 03:05:36.000000000 +0000 +++ raptor2-2.0.13/configure.ac 2014-01-27 19:36:04.000000000 +0000 @@ -24,7 +24,7 @@ AC_PREREQ([2.62]) -AC_INIT([Raptor RDF Parser and Serializer library], [2.0.12], [http://bugs.librdf.org/], [raptor2]) +AC_INIT([Raptor RDF Parser and Serializer library], [2.0.13], [http://bugs.librdf.org/], [raptor2]) AC_CONFIG_SRCDIR([src/raptor_general.c]) AC_CONFIG_HEADERS([src/raptor_config.h]) AC_CONFIG_AUX_DIR(build) @@ -123,8 +123,8 @@ fi fi -BISON_MIN_VERSION=2.4 -AC_PROG_YACC +BISON_MIN_VERSION=3.0.0 +AC_CHECK_PROGS(BISON, bison3 bison) if test "$USE_MAINTAINER_MODE" = yes; then AC_MSG_CHECKING(for GNU bison) # Match these styles of versions @@ -132,7 +132,7 @@ # bison (GNU Bison) 1.875 dnl need to change quotes to allow square brackets changequote(<<, >>)dnl - BISON_VERSION=`$YACC --version 2>&1 | sed -ne 's/^.*GNU Bison[^0-9]*//p'` + BISON_VERSION=`$BISON --version 2>&1 | sed -ne 's/^.*GNU Bison[^0-9]*//p'` changequote([, ])dnl if test "X$BISON_VERSION" != X; then BISON_VERSION_DEC=`echo $BISON_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` @@ -148,16 +148,16 @@ AC_MSG_FAILURE(GNU Bison too old) fi else - AC_MSG_FAILURE($YACC is not GNU bison) + AC_MSG_FAILURE($BISON is not GNU bison) fi fi - +AC_SUBST(BISON) # Find a tar command for 'make dist' AC_CHECK_PROGS(TAR, gnutar gtar tar) AC_CHECK_PROGS(PERL, perl) # Used in tests/feeds -AC_CHECK_PROG(JING, jing) +AC_CHECK_PROGS(JING, jing) AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) @@ -585,7 +585,7 @@ need_libxml=0 oCPPFLAGS="$CPPFLAGS" -if test "X$LIBXML_CFLAGS" != X; then +if test "X$XML_CONFIG" != X; then CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS" LIBS="$LIBS $LIBXML_LIBS" AC_CHECK_FUNC(xmlCreatePushParserCtxt, have_xmlCreatePushParserCtxt=yes, have_xmlCreatePushParserCtxt=no) @@ -986,7 +986,7 @@ need_libxml_www=0 need_libfetch=0 -if test "X$LIBCURL_CFLAGS" != X; then +if test "X$CURL_CONFIG" != X; then CPPFLAGS="$CPPFLAGS $LIBCURL_CFLAGS" LIBS="$LIBS $LIBCURL_LIBS" AC_CHECK_HEADER(curl/curl.h) diff -Nru raptor2-2.0.12/data/Makefile.in raptor2-2.0.13/data/Makefile.in --- raptor2-2.0.12/data/Makefile.in 2013-12-08 03:05:41.000000000 +0000 +++ raptor2-2.0.13/data/Makefile.in 2014-01-27 19:36:08.000000000 +0000 @@ -82,6 +82,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -178,8 +179,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/debian/changelog raptor2-2.0.13/debian/changelog --- raptor2-2.0.12/debian/changelog 2014-01-15 06:47:18.000000000 +0000 +++ raptor2-2.0.13/debian/changelog 2014-01-30 18:24:17.000000000 +0000 @@ -1,29 +1,24 @@ -raptor2 (2.0.12-3ubuntu1) trusty; urgency=medium +raptor2 (2.0.13-1) unstable; urgency=medium - * Merge from Debian unstable, remaining changes: - - Use dh-autoreconf for current libtool. - - Build-depend on gtk-doc-tools for m4 macros. - - -- Steve Langasek Tue, 14 Jan 2014 22:47:17 -0800 - -raptor2 (2.0.12-3) unstable; urgency=low - - * Remove versioned build-depends on pkg-config (Closes: #734485) + * New upstream release + * Removed upstream patch 001-memset-transposed.patch - -- Dave Beckett Sun, 12 Jan 2014 19:28:18 -0800 + -- Dave Beckett Thu, 30 Jan 2014 10:22:12 -0800 -raptor2 (2.0.12-2ubuntu2) trusty; urgency=medium +raptor2 (2.0.12-4) unstable; urgency=low - * Really add build-dependency on gtk-doc-tools. + * Use dh-autoreconf at build time to support new ports. + Patch from Steve Langasek - thanks. (Closes: #735400) + * debian/rules: Altered clean target to work with dh_autoreconf + deleting Makefile it needs. - -- Steve Langasek Tue, 17 Dec 2013 01:49:54 -0800 + -- Dave Beckett Sun, 26 Jan 2014 10:54:15 -0800 -raptor2 (2.0.12-2ubuntu1) trusty; urgency=medium +raptor2 (2.0.12-3) unstable; urgency=low - * Use dh-autoreconf for current libtool. - * Build-depend on gtk-doc-tools for m4 macros. + * Remove versioned build-depends on pkg-config (Closes: #734485) - -- Steve Langasek Tue, 17 Dec 2013 01:34:58 -0800 + -- Dave Beckett Sun, 12 Jan 2014 19:28:18 -0800 raptor2 (2.0.12-2) unstable; urgency=low diff -Nru raptor2-2.0.12/debian/control raptor2-2.0.13/debian/control --- raptor2-2.0.12/debian/control 2014-01-15 06:47:58.000000000 +0000 +++ raptor2-2.0.13/debian/control 2014-01-26 17:44:58.000000000 +0000 @@ -1,8 +1,7 @@ Source: raptor2 Section: devel Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Dave Beckett +Maintainer: Dave Beckett Build-Depends: debhelper (>= 8.1.3), dh-autoreconf, cdbs (>= 0.4.93~), libtool (>= 1.5), libxml2-dev (>= 2.5.10), libcurl4-gnutls-dev, libxslt1-dev (>= 1.0.18), libyajl-dev, quilt, gtk-doc-tools Standards-Version: 3.9.5 Homepage: http://librdf.org/raptor/ diff -Nru raptor2-2.0.12/debian/patches/001-memset-transposed.patch raptor2-2.0.13/debian/patches/001-memset-transposed.patch --- raptor2-2.0.12/debian/patches/001-memset-transposed.patch 2014-01-15 03:57:52.000000000 +0000 +++ raptor2-2.0.13/debian/patches/001-memset-transposed.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -Description: Workaround for wrong args for memset - -diff --git a/src/raptor_term.c b/src/raptor_term.c -index 2bda13c..12a340b 100644 ---- a/src/raptor_term.c -+++ b/src/raptor_term.c -@@ -396,7 +396,7 @@ raptor_new_term_from_counted_string(raptor_world* world, - - raptor_world_open(world); - -- memset(&locator, sizeof(locator), '\0'); -+ memset(&locator, '\0', sizeof(locator)); - locator.line = -1; - - bytes_read = raptor_ntriples_parse_term(world, &locator, diff -Nru raptor2-2.0.12/debian/patches/series raptor2-2.0.13/debian/patches/series --- raptor2-2.0.12/debian/patches/series 2014-01-15 03:57:52.000000000 +0000 +++ raptor2-2.0.13/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -001-memset-transposed.patch diff -Nru raptor2-2.0.12/debian/rules raptor2-2.0.13/debian/rules --- raptor2-2.0.12/debian/rules 2014-01-15 03:57:52.000000000 +0000 +++ raptor2-2.0.13/debian/rules 2014-01-26 18:48:54.000000000 +0000 @@ -3,12 +3,25 @@ # Debian rules for packaging Raptor2 # # + +# Replace default CDBS cleanbuilddir rule; has to be before/after definition +cleanbuilddir:: + # raw clean calls distclean deletes the docs/html documentation + if test -r Makefile; then \ + mv docs/html docs/html.saved; \ + fi + include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/rules/patchsys-quilt.mk include /usr/share/cdbs/1/rules/autoreconf.mk include /usr/share/cdbs/1/class/autotools.mk include /usr/share/cdbs/1/class/makefile.mk +cleanbuilddir:: + if test -e docs/html.saved; then \ + mv docs/html.saved docs/html; \ + fi + DEB_INSTALL_DOCS_ALL=README NEWS AUTHORS NOTICE DEB_INSTALL_DOCS_libraptor2-dev=UPGRADING.html docs/raptor1-eol.html @@ -21,15 +34,11 @@ LDFLAGS += -Wl,--default-symver -DEB_MAKE_CLEAN_TARGET := +# do this or autoreconf calling libtoolize destroys the build/ directory contents +LIBTOOLIZE=libtoolize --automake --ltdl -clean:: - # raw distclean deletes the docs/html documentation - if test -r Makefile; then \ - mv docs/html docs/html.saved; \ - $(MAKE) distclean; \ - mv docs/html.saved docs/html; \ - fi +# Show what dh_autoreconf is deleting / moving / restoring +DEB_DH_AUTORECONF_ARGS := --verbose install/libraptor2-dev:: rm -f debian/tmp/usr/lib/*/libraptor2.la diff -Nru raptor2-2.0.12/docs/Makefile.in raptor2-2.0.13/docs/Makefile.in --- raptor2-2.0.12/docs/Makefile.in 2013-12-08 03:05:41.000000000 +0000 +++ raptor2-2.0.13/docs/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -143,6 +143,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -239,8 +240,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/docs/html/index.html raptor2-2.0.13/docs/html/index.html --- raptor2-2.0.12/docs/html/index.html 2013-12-13 14:53:05.000000000 +0000 +++ raptor2-2.0.13/docs/html/index.html 2014-01-30 04:00:54.000000000 +0000 @@ -22,12 +22,12 @@   http://www.dajobe.org/

-

Manual for Raptor 2.0.12 +

Manual for Raptor 2.0.13

-

+

This documentation is Free Software / Open Source - you can redistribute it and/or modify it under the same licenses as Raptor. diff -Nru raptor2-2.0.12/docs/html/ix01.html raptor2-2.0.13/docs/html/ix01.html --- raptor2-2.0.12/docs/html/ix01.html 2013-12-13 14:53:05.000000000 +0000 +++ raptor2-2.0.13/docs/html/ix01.html 2014-01-30 04:00:54.000000000 +0000 @@ -20,7 +20,7 @@

-Index

+Index

R

diff -Nru raptor2-2.0.12/docs/html/raptor2-changes-1-4-21-to-2-0-0.html raptor2-2.0.13/docs/html/raptor2-changes-1-4-21-to-2-0-0.html --- raptor2-2.0.12/docs/html/raptor2-changes-1-4-21-to-2-0-0.html 2013-12-13 14:53:04.000000000 +0000 +++ raptor2-2.0.13/docs/html/raptor2-changes-1-4-21-to-2-0-0.html 2014-01-30 04:00:54.000000000 +0000 @@ -229,7 +229,7 @@

Renamed function and enums

- +
@@ -359,7 +359,7 @@
- +
@@ -514,7 +514,7 @@

Changed functions and types

-
+
@@ -901,7 +901,7 @@
- +
diff -Nru raptor2-2.0.12/docs/html/raptor2-section-general.html raptor2-2.0.13/docs/html/raptor2-section-general.html --- raptor2-2.0.12/docs/html/raptor2-section-general.html 2013-12-13 14:53:04.000000000 +0000 +++ raptor2-2.0.13/docs/html/raptor2-section-general.html 2014-01-30 04:00:54.000000000 +0000 @@ -109,7 +109,7 @@

Details

RAPTOR_VERSION

-
#define RAPTOR_VERSION 20012
+
#define RAPTOR_VERSION 20013
 

Raptor library version number @@ -139,7 +139,7 @@


RAPTOR_VERSION_RELEASE

-
#define RAPTOR_VERSION_RELEASE 12
+
#define RAPTOR_VERSION_RELEASE 13
 

Raptor library release @@ -148,7 +148,7 @@


RAPTOR_VERSION_STRING

-
#define RAPTOR_VERSION_STRING "2.0.12"
+
#define RAPTOR_VERSION_STRING "2.0.13"
 

Raptor library version string diff -Nru raptor2-2.0.12/docs/version.xml raptor2-2.0.13/docs/version.xml --- raptor2-2.0.12/docs/version.xml 2013-12-13 14:52:40.000000000 +0000 +++ raptor2-2.0.13/docs/version.xml 2014-01-30 04:00:29.000000000 +0000 @@ -1 +1 @@ -2.0.12 +2.0.13 diff -Nru raptor2-2.0.12/examples/Makefile.in raptor2-2.0.13/examples/Makefile.in --- raptor2-2.0.12/examples/Makefile.in 2013-12-08 03:05:41.000000000 +0000 +++ raptor2-2.0.13/examples/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -154,6 +154,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -250,8 +251,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/librdfa/Makefile.in raptor2-2.0.13/librdfa/Makefile.in --- raptor2-2.0.12/librdfa/Makefile.in 2013-12-08 03:05:41.000000000 +0000 +++ raptor2-2.0.13/librdfa/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -129,6 +129,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -225,8 +226,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/scripts/Makefile.in raptor2-2.0.13/scripts/Makefile.in --- raptor2-2.0.12/scripts/Makefile.in 2013-12-08 03:05:41.000000000 +0000 +++ raptor2-2.0.13/scripts/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -136,6 +136,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -232,8 +233,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/src/Makefile.am raptor2-2.0.13/src/Makefile.am --- raptor2-2.0.12/src/Makefile.am 2013-11-30 16:11:19.000000000 +0000 +++ raptor2-2.0.13/src/Makefile.am 2014-01-03 04:37:54.000000000 +0000 @@ -206,19 +206,21 @@ turtle_lexer.h: turtle_lexer.c ; @exit 0 turtle_parser.c: $(srcdir)/turtle_parser.y $(top_srcdir)/scripts/fix-bison - $(YACC) -b turtle_parser -p turtle_parser_ -d -v $(srcdir)/turtle_parser.y + $(BISON) $(srcdir)/turtle_parser.y $(PERL) $(top_srcdir)/scripts/fix-bison turtle_parser.tab.c > $@ mv -f turtle_parser.tab.h turtle_parser.h rm -f turtle_parser.tab.c turtle_parser.h: turtle_parser.c ; @exit 0 -parsedate.c: $(srcdir)/parsedate.y - $(YACC) -b parsedate -p raptor_parsedate_ -d -v $(srcdir)/parsedate.y - sed -e '/Suppress GCC warning that yyerrlab1/,/^\#endif/d' -e "s/parsedate.tab.c/$@/" parsedate.tab.c > $@ - mv parsedate.tab.h parsedate.h +parsedate.c: $(srcdir)/parsedate.y $(top_srcdir)/scripts/fix-bison + $(BISON) $(srcdir)/parsedate.y + $(PERL) $(top_srcdir)/scripts/fix-bison parsedate.tab.c > $@ + mv -f parsedate.tab.h parsedate.h rm -f parsedate.tab.c +parsedate.h: parsedate.c ; @exit 0 + endif # Actually it needs turtle_parser.h but nevermind diff -Nru raptor2-2.0.12/src/Makefile.in raptor2-2.0.13/src/Makefile.in --- raptor2-2.0.12/src/Makefile.in 2013-12-08 03:05:41.000000000 +0000 +++ raptor2-2.0.13/src/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -283,6 +283,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -381,8 +382,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -1045,19 +1044,21 @@ @MAINTAINER_MODE_TRUE@turtle_lexer.h: turtle_lexer.c ; @exit 0 @MAINTAINER_MODE_TRUE@turtle_parser.c: $(srcdir)/turtle_parser.y $(top_srcdir)/scripts/fix-bison -@MAINTAINER_MODE_TRUE@ $(YACC) -b turtle_parser -p turtle_parser_ -d -v $(srcdir)/turtle_parser.y +@MAINTAINER_MODE_TRUE@ $(BISON) $(srcdir)/turtle_parser.y @MAINTAINER_MODE_TRUE@ $(PERL) $(top_srcdir)/scripts/fix-bison turtle_parser.tab.c > $@ @MAINTAINER_MODE_TRUE@ mv -f turtle_parser.tab.h turtle_parser.h @MAINTAINER_MODE_TRUE@ rm -f turtle_parser.tab.c @MAINTAINER_MODE_TRUE@turtle_parser.h: turtle_parser.c ; @exit 0 -@MAINTAINER_MODE_TRUE@parsedate.c: $(srcdir)/parsedate.y -@MAINTAINER_MODE_TRUE@ $(YACC) -b parsedate -p raptor_parsedate_ -d -v $(srcdir)/parsedate.y -@MAINTAINER_MODE_TRUE@ sed -e '/Suppress GCC warning that yyerrlab1/,/^\#endif/d' -e "s/parsedate.tab.c/$@/" parsedate.tab.c > $@ -@MAINTAINER_MODE_TRUE@ mv parsedate.tab.h parsedate.h +@MAINTAINER_MODE_TRUE@parsedate.c: $(srcdir)/parsedate.y $(top_srcdir)/scripts/fix-bison +@MAINTAINER_MODE_TRUE@ $(BISON) $(srcdir)/parsedate.y +@MAINTAINER_MODE_TRUE@ $(PERL) $(top_srcdir)/scripts/fix-bison parsedate.tab.c > $@ +@MAINTAINER_MODE_TRUE@ mv -f parsedate.tab.h parsedate.h @MAINTAINER_MODE_TRUE@ rm -f parsedate.tab.c +@MAINTAINER_MODE_TRUE@parsedate.h: parsedate.c ; @exit 0 + # Actually it needs turtle_parser.h but nevermind turtle_lexer_test: $(srcdir)/turtle_lexer.c libraptor2.la $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/turtle_lexer.c libraptor2.la $(LIBS) diff -Nru raptor2-2.0.12/src/ntriples_parse.c raptor2-2.0.13/src/ntriples_parse.c --- raptor2-2.0.12/src/ntriples_parse.c 2013-12-08 01:57:05.000000000 +0000 +++ raptor2-2.0.13/src/ntriples_parse.c 2013-12-30 17:48:13.000000000 +0000 @@ -442,6 +442,7 @@ if(1) { int quote = '\0'; + int in_uri = '\0'; int bq = 0; while(ptr < end_ptr) { if(!bq) { @@ -451,8 +452,13 @@ continue; } + if(*ptr == '<') + in_uri = 1; + else if (in_uri && *ptr == '>') + in_uri = 0; + if(!quote) { - if(*ptr == '\'' || *ptr == '"') + if((!in_uri && *ptr == '\'') || *ptr == '"') quote = *ptr; if(*ptr == '\n' || *ptr == '\r') break; diff -Nru raptor2-2.0.12/src/parsedate.c raptor2-2.0.13/src/parsedate.c --- raptor2-2.0.12/src/parsedate.c 2012-08-31 17:22:42.000000000 +0000 +++ raptor2-2.0.13/src/parsedate.c 2014-01-03 04:38:37.000000000 +0000 @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -58,23 +58,17 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse raptor_parsedate_parse #define yylex raptor_parsedate_lex #define yyerror raptor_parsedate_error -#define yylval raptor_parsedate_lval -#define yychar raptor_parsedate_char #define yydebug raptor_parsedate_debug #define yynerrs raptor_parsedate_nerrs /* Copy the first part of user declarations. */ - -/* Line 268 of yacc.c */ -#line 1 "./parsedate.y" +#line 1 "./parsedate.y" /* yacc.c:339 */ /* * Imported from @@ -169,7 +163,7 @@ #endif /* Prototypes */ -static int raptor_parsedate_error(const char *msg); +static int raptor_parsedate_error(void* parm, const char *msg); #define EPOCH 1970 @@ -236,14 +230,15 @@ static int LookupWord (YYSTYPE *lvalp, char *buff); +#line 234 "parsedate.c" /* yacc.c:339 */ -/* Line 268 of yacc.c */ -#line 242 "parsedate.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -253,75 +248,56 @@ # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 +/* In a future release of Bison, this section will be replaced + by #include "parsedate.tab.h". */ +#ifndef YY_RAPTOR_PARSEDATE_PARSEDATE_TAB_H_INCLUDED +# define YY_RAPTOR_PARSEDATE_PARSEDATE_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int raptor_parsedate_debug; #endif - -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - tAGO = 258, - tDAY = 259, - tDAY_UNIT = 260, - tDAYZONE = 261, - tDST = 262, - tHOUR_UNIT = 263, - tID = 264, - tTZONE = 265, - tWZONE = 266, - tZZONE = 267, - tMERIDIAN = 268, - tMINUTE_UNIT = 269, - tMONTH = 270, - tMONTH_UNIT = 271, - tSEC_UNIT = 272, - tSNUMBER = 273, - tUNUMBER = 274, - tYEAR_UNIT = 275, - tZONE = 276 - }; -#endif -/* Tokens. */ -#define tAGO 258 -#define tDAY 259 -#define tDAY_UNIT 260 -#define tDAYZONE 261 -#define tDST 262 -#define tHOUR_UNIT 263 -#define tID 264 -#define tTZONE 265 -#define tWZONE 266 -#define tZZONE 267 -#define tMERIDIAN 268 -#define tMINUTE_UNIT 269 -#define tMONTH 270 -#define tMONTH_UNIT 271 -#define tSEC_UNIT 272 -#define tSNUMBER 273 -#define tUNUMBER 274 -#define tYEAR_UNIT 275 -#define tZONE 276 - + enum yytokentype + { + tAGO = 258, + tDAY = 259, + tDAY_UNIT = 260, + tDAYZONE = 261, + tDST = 262, + tHOUR_UNIT = 263, + tID = 264, + tTZONE = 265, + tWZONE = 266, + tZZONE = 267, + tMERIDIAN = 268, + tMINUTE_UNIT = 269, + tMONTH = 270, + tMONTH_UNIT = 271, + tSEC_UNIT = 272, + tSNUMBER = 273, + tUNUMBER = 274, + tYEAR_UNIT = 275, + tZONE = 276 + }; +#endif +/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif +int raptor_parsedate_parse (struct date_yy *parm); +#endif /* !YY_RAPTOR_PARSEDATE_PARSEDATE_TAB_H_INCLUDED */ /* Copy the second part of user declarations. */ - -/* Line 343 of yacc.c */ -#line 325 "parsedate.c" +#line 301 "parsedate.c" /* yacc.c:358 */ #ifdef short # undef short @@ -335,11 +311,8 @@ #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -359,8 +332,7 @@ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -374,39 +346,68 @@ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -424,9 +425,9 @@ # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif @@ -436,8 +437,8 @@ # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -453,7 +454,7 @@ # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -461,16 +462,12 @@ # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# if ! defined malloc && ! defined EXIT_SUCCESS # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ +# if ! defined free && ! defined EXIT_SUCCESS # endif # endif # endif @@ -479,7 +476,7 @@ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -504,35 +501,35 @@ elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do +/* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -548,17 +545,19 @@ #define YYNNTS 22 /* YYNRULES -- Number of rules. */ #define YYNRULES 77 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 100 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 276 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -592,63 +591,21 @@ }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 7, 9, 11, 13, 15, 17, - 19, 21, 24, 26, 30, 34, 38, 42, 44, 46, - 48, 49, 52, 53, 55, 59, 63, 67, 69, 71, - 73, 75, 77, 80, 82, 85, 88, 92, 101, 107, - 109, 111, 115, 119, 122, 127, 130, 134, 138, 142, - 146, 149, 152, 155, 159, 161, 165, 168, 170, 173, - 176, 178, 181, 184, 186, 189, 192, 194, 197, 200, - 202, 205, 208, 210, 213, 216, 218, 220 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 27, 0, -1, -1, 27, 28, -1, 29, -1, 37, - -1, 39, -1, 38, -1, 44, -1, 46, -1, 47, - -1, 19, 13, -1, 30, -1, 35, 32, 44, -1, - 36, 32, 44, -1, 35, 32, 31, -1, 36, 32, - 31, -1, 33, -1, 34, -1, 37, -1, -1, 22, - 19, -1, -1, 18, -1, 18, 23, 19, -1, 36, - 23, 19, -1, 19, 23, 19, -1, 10, -1, 11, - -1, 12, -1, 21, -1, 6, -1, 21, 7, -1, - 4, -1, 4, 24, -1, 19, 4, -1, 19, 25, - 19, -1, 15, 19, 19, 23, 19, 23, 19, 19, - -1, 19, 25, 19, 25, 19, -1, 41, -1, 40, - -1, 19, 15, 18, -1, 15, 19, 19, -1, 15, - 19, -1, 15, 19, 24, 19, -1, 19, 15, -1, - 19, 15, 19, -1, 41, 10, 43, -1, 19, 10, - 43, -1, 19, 18, 18, -1, 19, 18, -1, 19, - 42, -1, 11, 19, -1, 11, 19, 18, -1, 30, - -1, 19, 32, 31, -1, 45, 3, -1, 45, -1, - 19, 20, -1, 18, 20, -1, 20, -1, 19, 16, - -1, 18, 16, -1, 16, -1, 19, 5, -1, 18, - 5, -1, 5, -1, 19, 8, -1, 18, 8, -1, - 8, -1, 19, 14, -1, 18, 14, -1, 14, -1, - 19, 17, -1, 18, 17, -1, 17, -1, 19, -1, - 13, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 178, 178, 179, 182, 185, 188, 191, 194, 197, - 198, 201, 207, 211, 214, 218, 221, 227, 230, 233, - 236, 239, 241, 244, 254, 260, 266, 282, 285, 288, - 291, 294, 297, 302, 306, 310, 316, 320, 331, 349, - 350, 353, 359, 364, 372, 377, 385, 392, 393, 412, - 418, 424, 436, 439, 445, 446, 471, 485, 488, 491, - 494, 497, 500, 503, 506, 509, 512, 515, 518, 521, - 524, 527, 530, 533, 536, 539, 544, 579 + 0, 197, 197, 198, 201, 204, 207, 210, 213, 216, + 217, 220, 226, 230, 233, 237, 240, 246, 249, 252, + 255, 258, 260, 263, 273, 279, 285, 301, 304, 307, + 310, 313, 316, 321, 325, 329, 335, 339, 350, 368, + 369, 372, 378, 383, 391, 396, 404, 411, 412, 431, + 437, 443, 455, 458, 464, 465, 490, 504, 507, 510, + 513, 516, 519, 522, 525, 528, 531, 534, 537, 540, + 543, 546, 549, 552, 555, 558, 563, 598 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -661,13 +618,13 @@ "sec_fraction_part", "zonepart_numeric_without_colon", "zonepart_numeric_with_colon", "HMStime_with_colon", "HMtime_with_colon", "zone", "day", "date", "iso8601datetime", "iso8601date", - "iso8601weekspec", "iso8601time", "rel", "relunit", "number", "o_merid", 0 + "iso8601weekspec", "iso8601time", "rel", "relunit", "number", "o_merid", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -676,60 +633,18 @@ }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 26, 27, 27, 28, 28, 28, 28, 28, 28, - 28, 29, 29, 30, 30, 30, 30, 31, 31, 31, - 31, 32, 32, 33, 34, 35, 36, 37, 37, 37, - 37, 37, 37, 38, 38, 38, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 40, 40, 41, - 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 46, 47 -}; +#define YYPACT_NINF -60 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 3, 3, 3, 3, 1, 1, 1, - 0, 2, 0, 1, 3, 3, 3, 1, 1, 1, - 1, 1, 2, 1, 2, 2, 3, 8, 5, 1, - 1, 3, 3, 2, 4, 2, 3, 3, 3, 3, - 2, 2, 2, 3, 1, 3, 2, 1, 2, 2, - 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, - 2, 2, 1, 2, 2, 1, 1, 1 -}; +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-60))) -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 0, 1, 33, 66, 31, 69, 27, 28, 29, - 77, 72, 0, 63, 75, 0, 76, 60, 30, 3, - 4, 12, 22, 22, 5, 7, 6, 40, 39, 8, - 57, 9, 10, 34, 43, 65, 68, 71, 62, 74, - 59, 35, 64, 67, 0, 0, 11, 70, 45, 61, - 73, 50, 58, 0, 0, 51, 32, 0, 20, 0, - 20, 0, 56, 42, 0, 22, 54, 48, 52, 41, - 46, 49, 26, 36, 21, 23, 0, 15, 17, 18, - 19, 13, 25, 16, 14, 47, 0, 44, 20, 53, - 0, 0, 0, 23, 55, 38, 24, 0, 0, 37 -}; +#define YYTABLE_NINF -1 -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 1, 19, 20, 66, 77, 58, 78, 79, 22, - 23, 80, 25, 26, 27, 28, 55, 67, 29, 30, - 31, 32 -}; +#define yytable_value_is_error(Yytable_value) \ + 0 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -60 + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int8 yypact[] = { -60, 2, -60, -13, -60, -60, -60, -60, -60, -60, @@ -744,7 +659,24 @@ 80, 81, 78, 79, -60, -60, -60, 84, 87, -60 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 2, 0, 1, 33, 66, 31, 69, 27, 28, 29, + 77, 72, 0, 63, 75, 0, 76, 60, 30, 3, + 4, 12, 22, 22, 5, 7, 6, 40, 39, 8, + 57, 9, 10, 34, 43, 65, 68, 71, 62, 74, + 59, 35, 64, 67, 0, 0, 11, 70, 45, 61, + 73, 50, 58, 0, 0, 51, 32, 0, 20, 0, + 20, 0, 56, 42, 0, 22, 54, 48, 52, 41, + 46, 49, 26, 36, 21, 23, 0, 15, 17, 18, + 19, 13, 25, 16, 14, 47, 0, 44, 20, 53, + 0, 0, 0, 23, 55, 38, 24, 0, 0, 37 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -60, -60, -60, -60, 104, -59, -23, -60, -60, -60, @@ -752,10 +684,17 @@ -60, -60 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + -1, 1, 19, 20, 66, 77, 58, 78, 79, 22, + 23, 80, 25, 26, 27, 28, 55, 67, 29, 30, + 31, 32 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 60, 83, 2, 81, 63, 84, 3, 4, 5, 64, @@ -772,12 +711,6 @@ 85 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-60)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - static const yytype_int8 yycheck[] = { 23, 60, 0, 58, 19, 60, 4, 5, 6, 24, @@ -794,8 +727,8 @@ 61 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 27, 0, 4, 5, 6, 8, 10, 11, 12, @@ -810,94 +743,67 @@ 25, 23, 19, 18, 31, 19, 19, 23, 19, 19 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 26, 27, 27, 28, 28, 28, 28, 28, 28, + 28, 29, 29, 30, 30, 30, 30, 31, 31, 31, + 31, 32, 32, 33, 34, 35, 36, 37, 37, 37, + 37, 37, 37, 38, 38, 38, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 40, 40, 41, + 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 46, 47 +}; -#define YYRECOVERING() (!!yyerrstatus) + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 3, 3, 3, 3, 1, 1, 1, + 0, 2, 0, 1, 3, 3, 3, 1, 1, 1, + 1, 1, 2, 1, 2, 2, 3, 8, 5, 1, + 1, 3, 3, 2, 4, 2, 3, 3, 3, 3, + 2, 2, 2, 3, 1, 3, 2, 1, 2, 2, + 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, + 2, 2, 1, 2, 2, 1, 1, 1 +}; -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* 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 (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (parm, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval) -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -907,54 +813,47 @@ # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, parm); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, struct date_yy *parm) { + FILE *yyo = yyoutput; + YYUSE (yyo); + YYUSE (parm); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -962,24 +861,13 @@ | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, struct date_yy *parm) { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep); + yy_symbol_value_print (yyoutput, yytype, yyvaluep, parm); YYFPRINTF (yyoutput, ")"); } @@ -988,16 +876,8 @@ | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1008,49 +888,42 @@ YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, struct date_yy *parm) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , parm); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, parm); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1064,7 +937,7 @@ /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1087,15 +960,8 @@ # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1111,16 +977,8 @@ # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1150,27 +1008,27 @@ char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1193,12 +1051,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = 0; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1206,10 +1063,6 @@ int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1258,11 +1111,13 @@ break; } yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } } } } @@ -1282,10 +1137,12 @@ # undef YYCASE_ } - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } if (*yymsg_alloc < yysize) { @@ -1322,81 +1179,39 @@ | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct date_yy *parm) { YYUSE (yyvaluep); - + YYUSE (parm); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ /*----------. | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif +yyparse (struct date_yy *parm) { /* The lookahead symbol. */ int yychar; + /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Number of syntax errors so far. */ int yynerrs; @@ -1406,10 +1221,10 @@ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -1427,7 +1242,7 @@ int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -1445,9 +1260,8 @@ Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1456,14 +1270,6 @@ yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -1484,23 +1290,23 @@ #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); - yyss = yyss1; - yyvs = yyvs1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1508,22 +1314,22 @@ # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1532,10 +1338,10 @@ yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1564,7 +1370,7 @@ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval, parm); } if (yychar <= YYEOF) @@ -1604,7 +1410,9 @@ yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -1627,7 +1435,7 @@ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1641,403 +1449,364 @@ switch (yyn) { case 4: - -/* Line 1806 of yacc.c */ -#line 182 "./parsedate.y" +#line 201 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyHaveTime++; } +#line 1457 "parsedate.c" /* yacc.c:1646 */ break; case 5: - -/* Line 1806 of yacc.c */ -#line 185 "./parsedate.y" +#line 204 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyHaveZone++; } +#line 1465 "parsedate.c" /* yacc.c:1646 */ break; case 6: - -/* Line 1806 of yacc.c */ -#line 188 "./parsedate.y" +#line 207 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyHaveDate++; } +#line 1473 "parsedate.c" /* yacc.c:1646 */ break; case 7: - -/* Line 1806 of yacc.c */ -#line 191 "./parsedate.y" +#line 210 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyHaveDay++; } +#line 1481 "parsedate.c" /* yacc.c:1646 */ break; case 8: - -/* Line 1806 of yacc.c */ -#line 194 "./parsedate.y" +#line 213 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyHaveRel++; } +#line 1489 "parsedate.c" /* yacc.c:1646 */ break; case 11: - -/* Line 1806 of yacc.c */ -#line 201 "./parsedate.y" +#line 220 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyHour = (yyvsp[(1) - (2)].Number); + ((struct date_yy *)parm)->yyHour = (yyvsp[-1].Number); ((struct date_yy *)parm)->yyMinutes = 0; ((struct date_yy *)parm)->yySeconds = 0; - ((struct date_yy *)parm)->yyMeridian = (yyvsp[(2) - (2)].Meridian); + ((struct date_yy *)parm)->yyMeridian = (yyvsp[0].Meridian); } +#line 1500 "parsedate.c" /* yacc.c:1646 */ break; case 13: - -/* Line 1806 of yacc.c */ -#line 211 "./parsedate.y" +#line 230 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyMeridian = MER24; } +#line 1508 "parsedate.c" /* yacc.c:1646 */ break; case 14: - -/* Line 1806 of yacc.c */ -#line 214 "./parsedate.y" +#line 233 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyMeridian = MER24; ((struct date_yy *)parm)->yySeconds = 0; } +#line 1517 "parsedate.c" /* yacc.c:1646 */ break; case 15: - -/* Line 1806 of yacc.c */ -#line 218 "./parsedate.y" +#line 237 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyMeridian = MER24; } +#line 1525 "parsedate.c" /* yacc.c:1646 */ break; case 16: - -/* Line 1806 of yacc.c */ -#line 221 "./parsedate.y" +#line 240 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyMeridian = MER24; ((struct date_yy *)parm)->yySeconds = 0; } +#line 1534 "parsedate.c" /* yacc.c:1646 */ break; case 17: - -/* Line 1806 of yacc.c */ -#line 227 "./parsedate.y" +#line 246 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyHaveZone++; } +#line 1542 "parsedate.c" /* yacc.c:1646 */ break; case 18: - -/* Line 1806 of yacc.c */ -#line 230 "./parsedate.y" +#line 249 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyHaveZone++; } +#line 1550 "parsedate.c" /* yacc.c:1646 */ break; case 19: - -/* Line 1806 of yacc.c */ -#line 233 "./parsedate.y" +#line 252 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyHaveZone++; } +#line 1558 "parsedate.c" /* yacc.c:1646 */ break; case 21: - -/* Line 1806 of yacc.c */ -#line 239 "./parsedate.y" +#line 258 "./parsedate.y" /* yacc.c:1646 */ { } +#line 1565 "parsedate.c" /* yacc.c:1646 */ break; case 23: - -/* Line 1806 of yacc.c */ -#line 244 "./parsedate.y" +#line 263 "./parsedate.y" /* yacc.c:1646 */ { /* format: [+-]hhmm */ - if((yyvsp[(1) - (1)].Number) <= -100 || (yyvsp[(1) - (1)].Number) >= 100) { - ((struct date_yy *)parm)->yyTimezone = (-(yyvsp[(1) - (1)].Number) / 100) * 60 + (-(yyvsp[(1) - (1)].Number) % 100); - } else if((yyvsp[(1) - (1)].Number) >= -99 || (yyvsp[(1) - (1)].Number) <= 99) { - ((struct date_yy *)parm)->yyTimezone = -(yyvsp[(1) - (1)].Number) * 60; + if((yyvsp[0].Number) <= -100 || (yyvsp[0].Number) >= 100) { + ((struct date_yy *)parm)->yyTimezone = (-(yyvsp[0].Number) / 100) * 60 + (-(yyvsp[0].Number) % 100); + } else if((yyvsp[0].Number) >= -99 || (yyvsp[0].Number) <= 99) { + ((struct date_yy *)parm)->yyTimezone = -(yyvsp[0].Number) * 60; } } +#line 1578 "parsedate.c" /* yacc.c:1646 */ break; case 24: - -/* Line 1806 of yacc.c */ -#line 254 "./parsedate.y" +#line 273 "./parsedate.y" /* yacc.c:1646 */ { /* format: [+-]hh:mm */ - ((struct date_yy *)parm)->yyTimezone = -(yyvsp[(1) - (3)].Number) * 60 + ((yyvsp[(1) - (3)].Number) > 0 ? -(yyvsp[(3) - (3)].Number): (yyvsp[(3) - (3)].Number)); + ((struct date_yy *)parm)->yyTimezone = -(yyvsp[-2].Number) * 60 + ((yyvsp[-2].Number) > 0 ? -(yyvsp[0].Number): (yyvsp[0].Number)); } +#line 1587 "parsedate.c" /* yacc.c:1646 */ break; case 25: - -/* Line 1806 of yacc.c */ -#line 260 "./parsedate.y" +#line 279 "./parsedate.y" /* yacc.c:1646 */ { /* format: hh:mm:ss */ - ((struct date_yy *)parm)->yySeconds = (yyvsp[(3) - (3)].Number); + ((struct date_yy *)parm)->yySeconds = (yyvsp[0].Number); } +#line 1596 "parsedate.c" /* yacc.c:1646 */ break; case 26: - -/* Line 1806 of yacc.c */ -#line 266 "./parsedate.y" +#line 285 "./parsedate.y" /* yacc.c:1646 */ { /* format: hh:mm */ - ((struct date_yy *)parm)->yyHour = (yyvsp[(1) - (3)].Number); - ((struct date_yy *)parm)->yyMinutes = (yyvsp[(3) - (3)].Number); + ((struct date_yy *)parm)->yyHour = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyMinutes = (yyvsp[0].Number); } +#line 1606 "parsedate.c" /* yacc.c:1646 */ break; case 27: - -/* Line 1806 of yacc.c */ -#line 282 "./parsedate.y" +#line 301 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyTimezone = (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyTimezone = (yyvsp[0].Number); } +#line 1614 "parsedate.c" /* yacc.c:1646 */ break; case 28: - -/* Line 1806 of yacc.c */ -#line 285 "./parsedate.y" +#line 304 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyTimezone = (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyTimezone = (yyvsp[0].Number); } +#line 1622 "parsedate.c" /* yacc.c:1646 */ break; case 29: - -/* Line 1806 of yacc.c */ -#line 288 "./parsedate.y" +#line 307 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyTimezone = (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyTimezone = (yyvsp[0].Number); } +#line 1630 "parsedate.c" /* yacc.c:1646 */ break; case 30: - -/* Line 1806 of yacc.c */ -#line 291 "./parsedate.y" +#line 310 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyTimezone = (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyTimezone = (yyvsp[0].Number); } +#line 1638 "parsedate.c" /* yacc.c:1646 */ break; case 31: - -/* Line 1806 of yacc.c */ -#line 294 "./parsedate.y" +#line 313 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyTimezone = (yyvsp[(1) - (1)].Number) - 60; + ((struct date_yy *)parm)->yyTimezone = (yyvsp[0].Number) - 60; } +#line 1646 "parsedate.c" /* yacc.c:1646 */ break; case 32: - -/* Line 1806 of yacc.c */ -#line 297 "./parsedate.y" +#line 316 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyTimezone = (yyvsp[(1) - (2)].Number) - 60; + ((struct date_yy *)parm)->yyTimezone = (yyvsp[-1].Number) - 60; } +#line 1654 "parsedate.c" /* yacc.c:1646 */ break; case 33: - -/* Line 1806 of yacc.c */ -#line 302 "./parsedate.y" +#line 321 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyDayOrdinal = 1; - ((struct date_yy *)parm)->yyDayNumber = (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyDayNumber = (yyvsp[0].Number); } +#line 1663 "parsedate.c" /* yacc.c:1646 */ break; case 34: - -/* Line 1806 of yacc.c */ -#line 306 "./parsedate.y" +#line 325 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyDayOrdinal = 1; - ((struct date_yy *)parm)->yyDayNumber = (yyvsp[(1) - (2)].Number); + ((struct date_yy *)parm)->yyDayNumber = (yyvsp[-1].Number); } +#line 1672 "parsedate.c" /* yacc.c:1646 */ break; case 35: - -/* Line 1806 of yacc.c */ -#line 310 "./parsedate.y" +#line 329 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyDayOrdinal = (yyvsp[(1) - (2)].Number); - ((struct date_yy *)parm)->yyDayNumber = (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyDayOrdinal = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyDayNumber = (yyvsp[0].Number); } +#line 1681 "parsedate.c" /* yacc.c:1646 */ break; case 36: - -/* Line 1806 of yacc.c */ -#line 316 "./parsedate.y" +#line 335 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyMonth = (yyvsp[(1) - (3)].Number); - ((struct date_yy *)parm)->yyDay = (yyvsp[(3) - (3)].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[0].Number); } +#line 1690 "parsedate.c" /* yacc.c:1646 */ break; case 37: - -/* Line 1806 of yacc.c */ -#line 320 "./parsedate.y" +#line 339 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyYear = (yyvsp[(8) - (8)].Number); - ((struct date_yy *)parm)->yyMonth = (yyvsp[(1) - (8)].Number); - ((struct date_yy *)parm)->yyDay = (yyvsp[(2) - (8)].Number); - - ((struct date_yy *)parm)->yyHour = (yyvsp[(3) - (8)].Number); - ((struct date_yy *)parm)->yyMinutes = (yyvsp[(5) - (8)].Number); - ((struct date_yy *)parm)->yySeconds = (yyvsp[(7) - (8)].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-7].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-6].Number); + + ((struct date_yy *)parm)->yyHour = (yyvsp[-5].Number); + ((struct date_yy *)parm)->yyMinutes = (yyvsp[-3].Number); + ((struct date_yy *)parm)->yySeconds = (yyvsp[-1].Number); ((struct date_yy *)parm)->yyHaveTime = 1; } +#line 1706 "parsedate.c" /* yacc.c:1646 */ break; case 38: - -/* Line 1806 of yacc.c */ -#line 331 "./parsedate.y" +#line 350 "./parsedate.y" /* yacc.c:1646 */ { /* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY. The goal in recognizing YYYY/MM/DD is solely to support legacy machine-generated dates like those in an RCS log listing. If you want portability, use the ISO 8601 format. */ - if((yyvsp[(1) - (5)].Number) >= 1000) + if((yyvsp[-4].Number) >= 1000) { - ((struct date_yy *)parm)->yyYear = (yyvsp[(1) - (5)].Number); - ((struct date_yy *)parm)->yyMonth = (yyvsp[(3) - (5)].Number); - ((struct date_yy *)parm)->yyDay = (yyvsp[(5) - (5)].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[-4].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[0].Number); } else { - ((struct date_yy *)parm)->yyMonth = (yyvsp[(1) - (5)].Number); - ((struct date_yy *)parm)->yyDay = (yyvsp[(3) - (5)].Number); - ((struct date_yy *)parm)->yyYear = (yyvsp[(5) - (5)].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-4].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); } } +#line 1729 "parsedate.c" /* yacc.c:1646 */ break; case 40: - -/* Line 1806 of yacc.c */ -#line 350 "./parsedate.y" +#line 369 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyHaveTime++; } +#line 1737 "parsedate.c" /* yacc.c:1646 */ break; case 41: - -/* Line 1806 of yacc.c */ -#line 353 "./parsedate.y" +#line 372 "./parsedate.y" /* yacc.c:1646 */ { /* e.g. 17-JUN-1992. */ - ((struct date_yy *)parm)->yyDay = (yyvsp[(1) - (3)].Number); - ((struct date_yy *)parm)->yyMonth = (yyvsp[(2) - (3)].Number); - ((struct date_yy *)parm)->yyYear = -(yyvsp[(3) - (3)].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyYear = -(yyvsp[0].Number); } +#line 1748 "parsedate.c" /* yacc.c:1646 */ break; case 42: - -/* Line 1806 of yacc.c */ -#line 359 "./parsedate.y" +#line 378 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyMonth = (yyvsp[(1) - (3)].Number); - ((struct date_yy *)parm)->yyDay = (yyvsp[(2) - (3)].Number); - ((struct date_yy *)parm)->yyYear = (yyvsp[(3) - (3)].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); } +#line 1758 "parsedate.c" /* yacc.c:1646 */ break; case 43: - -/* Line 1806 of yacc.c */ -#line 364 "./parsedate.y" +#line 383 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyMonth = (yyvsp[(1) - (2)].Number); - if((yyvsp[(2) - (2)].Number) > 1000) { - ((struct date_yy *)parm)->yyYear = (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-1].Number); + if((yyvsp[0].Number) > 1000) { + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); } else { - ((struct date_yy *)parm)->yyDay = (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[0].Number); } } +#line 1771 "parsedate.c" /* yacc.c:1646 */ break; case 44: - -/* Line 1806 of yacc.c */ -#line 372 "./parsedate.y" +#line 391 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyMonth = (yyvsp[(1) - (4)].Number); - ((struct date_yy *)parm)->yyDay = (yyvsp[(2) - (4)].Number); - ((struct date_yy *)parm)->yyYear = (yyvsp[(4) - (4)].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-3].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); } +#line 1781 "parsedate.c" /* yacc.c:1646 */ break; case 45: - -/* Line 1806 of yacc.c */ -#line 377 "./parsedate.y" +#line 396 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyMonth = (yyvsp[(2) - (2)].Number); - if((yyvsp[(1) - (2)].Number) > 1000) { - ((struct date_yy *)parm)->yyYear = (yyvsp[(1) - (2)].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[0].Number); + if((yyvsp[-1].Number) > 1000) { + ((struct date_yy *)parm)->yyYear = (yyvsp[-1].Number); } else { - ((struct date_yy *)parm)->yyDay = (yyvsp[(1) - (2)].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-1].Number); } } +#line 1794 "parsedate.c" /* yacc.c:1646 */ break; case 46: - -/* Line 1806 of yacc.c */ -#line 385 "./parsedate.y" +#line 404 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyMonth = (yyvsp[(2) - (3)].Number); - ((struct date_yy *)parm)->yyDay = (yyvsp[(1) - (3)].Number); - ((struct date_yy *)parm)->yyYear = (yyvsp[(3) - (3)].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); } +#line 1804 "parsedate.c" /* yacc.c:1646 */ break; case 48: - -/* Line 1806 of yacc.c */ -#line 393 "./parsedate.y" +#line 412 "./parsedate.y" /* yacc.c:1646 */ { - int i = (yyvsp[(1) - (3)].Number); + int i = (yyvsp[-2].Number); if(i >= 10000) { /* format: yyyymmdd */ @@ -2053,72 +1822,66 @@ ((struct date_yy *)parm)->yyMonth = 1; } } +#line 1826 "parsedate.c" /* yacc.c:1646 */ break; case 49: - -/* Line 1806 of yacc.c */ -#line 412 "./parsedate.y" +#line 431 "./parsedate.y" /* yacc.c:1646 */ { /* ISO 8601 format. yyyy-mm-dd. */ - ((struct date_yy *)parm)->yyYear = (yyvsp[(1) - (3)].Number); - ((struct date_yy *)parm)->yyMonth = -(yyvsp[(2) - (3)].Number); - ((struct date_yy *)parm)->yyDay = -(yyvsp[(3) - (3)].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyMonth = -(yyvsp[-1].Number); + ((struct date_yy *)parm)->yyDay = -(yyvsp[0].Number); } +#line 1837 "parsedate.c" /* yacc.c:1646 */ break; case 50: - -/* Line 1806 of yacc.c */ -#line 418 "./parsedate.y" +#line 437 "./parsedate.y" /* yacc.c:1646 */ { /* ISO 8601 format yyyy-mm */ - ((struct date_yy *)parm)->yyYear = (yyvsp[(1) - (2)].Number); - ((struct date_yy *)parm)->yyMonth = -(yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyMonth = -(yyvsp[0].Number); ((struct date_yy *)parm)->yyDay = 1; } +#line 1848 "parsedate.c" /* yacc.c:1646 */ break; case 51: - -/* Line 1806 of yacc.c */ -#line 424 "./parsedate.y" +#line 443 "./parsedate.y" /* yacc.c:1646 */ { const int om = (1 + 9) % 12; /* offset month */ - const int oy = (yyvsp[(1) - (2)].Number) - 1; /* offset year */ + const int oy = (yyvsp[-1].Number) - 1; /* offset year */ - ((struct date_yy *)parm)->yyYear = (yyvsp[(1) - (2)].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[-1].Number); ((struct date_yy *)parm)->yyMonth = 1; /* Zeller's formula */ ((struct date_yy *)parm)->yyDay -= ((13 * om + 12) / 5 + oy + oy / 4 + oy / 400 - oy / 100) % 7 - 1; } +#line 1863 "parsedate.c" /* yacc.c:1646 */ break; case 52: - -/* Line 1806 of yacc.c */ -#line 436 "./parsedate.y" +#line 455 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyDay = ((yyvsp[(2) - (2)].Number) / 10) * 7 + ((yyvsp[(2) - (2)].Number) % 10) - 8; + ((struct date_yy *)parm)->yyDay = ((yyvsp[0].Number) / 10) * 7 + ((yyvsp[0].Number) % 10) - 8; } +#line 1871 "parsedate.c" /* yacc.c:1646 */ break; case 53: - -/* Line 1806 of yacc.c */ -#line 439 "./parsedate.y" +#line 458 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyDay = (yyvsp[(2) - (3)].Number) * 7 - (yyvsp[(3) - (3)].Number) - 8; + ((struct date_yy *)parm)->yyDay = (yyvsp[-1].Number) * 7 - (yyvsp[0].Number) - 8; } +#line 1879 "parsedate.c" /* yacc.c:1646 */ break; case 55: - -/* Line 1806 of yacc.c */ -#line 446 "./parsedate.y" +#line 465 "./parsedate.y" /* yacc.c:1646 */ { - int i = (yyvsp[(1) - (3)].Number); + int i = (yyvsp[-2].Number); if(i <= -100000 || i >= 100000) { ((struct date_yy *)parm)->yyHour = i / 10000; @@ -2132,7 +1895,7 @@ ((struct date_yy *)parm)->yyMinutes = i; ((struct date_yy *)parm)->yySeconds = 0; } else if(i >= -99 || i <= 99) { - ((struct date_yy *)parm)->yyHour = (yyvsp[(1) - (3)].Number); + ((struct date_yy *)parm)->yyHour = (yyvsp[-2].Number); ((struct date_yy *)parm)->yyMinutes = 0; ((struct date_yy *)parm)->yySeconds = 0; } else { @@ -2140,12 +1903,11 @@ } ((struct date_yy *)parm)->yyMeridian = MER24; } +#line 1907 "parsedate.c" /* yacc.c:1646 */ break; case 56: - -/* Line 1806 of yacc.c */ -#line 471 "./parsedate.y" +#line 490 "./parsedate.y" /* yacc.c:1646 */ { ((struct date_yy *)parm)->yyRelSeconds = -((struct date_yy *)parm)->yyRelSeconds; @@ -2160,221 +1922,200 @@ ((struct date_yy *)parm)->yyRelYear = -((struct date_yy *)parm)->yyRelYear; } +#line 1926 "parsedate.c" /* yacc.c:1646 */ break; case 58: - -/* Line 1806 of yacc.c */ -#line 488 "./parsedate.y" +#line 507 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelYear += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelYear += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 1934 "parsedate.c" /* yacc.c:1646 */ break; case 59: - -/* Line 1806 of yacc.c */ -#line 491 "./parsedate.y" +#line 510 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelYear += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelYear += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 1942 "parsedate.c" /* yacc.c:1646 */ break; case 60: - -/* Line 1806 of yacc.c */ -#line 494 "./parsedate.y" +#line 513 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelYear += (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyRelYear += (yyvsp[0].Number); } +#line 1950 "parsedate.c" /* yacc.c:1646 */ break; case 61: - -/* Line 1806 of yacc.c */ -#line 497 "./parsedate.y" +#line 516 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelMonth += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 1958 "parsedate.c" /* yacc.c:1646 */ break; case 62: - -/* Line 1806 of yacc.c */ -#line 500 "./parsedate.y" +#line 519 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelMonth += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 1966 "parsedate.c" /* yacc.c:1646 */ break; case 63: - -/* Line 1806 of yacc.c */ -#line 503 "./parsedate.y" +#line 522 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelMonth += (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyRelMonth += (yyvsp[0].Number); } +#line 1974 "parsedate.c" /* yacc.c:1646 */ break; case 64: - -/* Line 1806 of yacc.c */ -#line 506 "./parsedate.y" +#line 525 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelDay += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelDay += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 1982 "parsedate.c" /* yacc.c:1646 */ break; case 65: - -/* Line 1806 of yacc.c */ -#line 509 "./parsedate.y" +#line 528 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelDay += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelDay += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 1990 "parsedate.c" /* yacc.c:1646 */ break; case 66: - -/* Line 1806 of yacc.c */ -#line 512 "./parsedate.y" +#line 531 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelDay += (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyRelDay += (yyvsp[0].Number); } +#line 1998 "parsedate.c" /* yacc.c:1646 */ break; case 67: - -/* Line 1806 of yacc.c */ -#line 515 "./parsedate.y" +#line 534 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelHour += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelHour += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 2006 "parsedate.c" /* yacc.c:1646 */ break; case 68: - -/* Line 1806 of yacc.c */ -#line 518 "./parsedate.y" +#line 537 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelHour += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelHour += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 2014 "parsedate.c" /* yacc.c:1646 */ break; case 69: - -/* Line 1806 of yacc.c */ -#line 521 "./parsedate.y" +#line 540 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelHour += (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyRelHour += (yyvsp[0].Number); } +#line 2022 "parsedate.c" /* yacc.c:1646 */ break; case 70: - -/* Line 1806 of yacc.c */ -#line 524 "./parsedate.y" +#line 543 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelMinutes += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelMinutes += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 2030 "parsedate.c" /* yacc.c:1646 */ break; case 71: - -/* Line 1806 of yacc.c */ -#line 527 "./parsedate.y" +#line 546 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelMinutes += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelMinutes += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 2038 "parsedate.c" /* yacc.c:1646 */ break; case 72: - -/* Line 1806 of yacc.c */ -#line 530 "./parsedate.y" +#line 549 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelMinutes += (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyRelMinutes += (yyvsp[0].Number); } +#line 2046 "parsedate.c" /* yacc.c:1646 */ break; case 73: - -/* Line 1806 of yacc.c */ -#line 533 "./parsedate.y" +#line 552 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelSeconds += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 2054 "parsedate.c" /* yacc.c:1646 */ break; case 74: - -/* Line 1806 of yacc.c */ -#line 536 "./parsedate.y" +#line 555 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelSeconds += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); + ((struct date_yy *)parm)->yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number); } +#line 2062 "parsedate.c" /* yacc.c:1646 */ break; case 75: - -/* Line 1806 of yacc.c */ -#line 539 "./parsedate.y" +#line 558 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyRelSeconds += (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyRelSeconds += (yyvsp[0].Number); } +#line 2070 "parsedate.c" /* yacc.c:1646 */ break; case 76: - -/* Line 1806 of yacc.c */ -#line 545 "./parsedate.y" +#line 564 "./parsedate.y" /* yacc.c:1646 */ { if(((struct date_yy *)parm)->yyHaveTime && ((struct date_yy *)parm)->yyHaveDate && !((struct date_yy *)parm)->yyHaveRel) - ((struct date_yy *)parm)->yyYear = (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); else { - if((yyvsp[(1) - (1)].Number) > 10000) + if((yyvsp[0].Number) > 10000) { ((struct date_yy *)parm)->yyHaveDate++; - ((struct date_yy *)parm)->yyDay= ((yyvsp[(1) - (1)].Number))%100; - ((struct date_yy *)parm)->yyMonth= ((yyvsp[(1) - (1)].Number)/100)%100; - ((struct date_yy *)parm)->yyYear = (yyvsp[(1) - (1)].Number)/10000; + ((struct date_yy *)parm)->yyDay= ((yyvsp[0].Number))%100; + ((struct date_yy *)parm)->yyMonth= ((yyvsp[0].Number)/100)%100; + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number)/10000; } else { ((struct date_yy *)parm)->yyHaveTime++; - if((yyvsp[(1) - (1)].Number) < 100) + if((yyvsp[0].Number) < 100) { - ((struct date_yy *)parm)->yyHour = (yyvsp[(1) - (1)].Number); + ((struct date_yy *)parm)->yyHour = (yyvsp[0].Number); ((struct date_yy *)parm)->yyMinutes = 0; } else { - ((struct date_yy *)parm)->yyHour = (yyvsp[(1) - (1)].Number) / 100; - ((struct date_yy *)parm)->yyMinutes = (yyvsp[(1) - (1)].Number) % 100; + ((struct date_yy *)parm)->yyHour = (yyvsp[0].Number) / 100; + ((struct date_yy *)parm)->yyMinutes = (yyvsp[0].Number) % 100; } ((struct date_yy *)parm)->yySeconds = 0; ((struct date_yy *)parm)->yyMeridian = MER24; } } } +#line 2107 "parsedate.c" /* yacc.c:1646 */ break; case 77: - -/* Line 1806 of yacc.c */ -#line 580 "./parsedate.y" +#line 599 "./parsedate.y" /* yacc.c:1646 */ { - ((struct date_yy *)parm)->yyMeridian = (yyvsp[(1) - (1)].Meridian); + ((struct date_yy *)parm)->yyMeridian = (yyvsp[0].Meridian); } +#line 2115 "parsedate.c" /* yacc.c:1646 */ break; - -/* Line 1806 of yacc.c */ -#line 2378 "parsedate.c" +#line 2119 "parsedate.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2396,7 +2137,7 @@ *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2411,9 +2152,9 @@ goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -2424,7 +2165,7 @@ { ++yynerrs; #if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); + yyerror (parm, YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) @@ -2451,7 +2192,7 @@ yymsgp = yymsg; } } - yyerror (yymsgp); + yyerror (parm, yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } @@ -2464,20 +2205,20 @@ if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, parm); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -2496,7 +2237,7 @@ if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -2509,35 +2250,37 @@ | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp, parm); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -2561,12 +2304,12 @@ yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: - yyerror (YY_("memory exhausted")); + yyerror (parm, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif @@ -2578,16 +2321,16 @@ user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + yytoken, &yylval, parm); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp, parm); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2598,14 +2341,9 @@ if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - - -/* Line 2067 of yacc.c */ -#line 585 "./parsedate.y" +#line 604 "./parsedate.y" /* yacc.c:1906 */ time_t get_date (char *p, time_t *now); @@ -2802,7 +2540,7 @@ /* ARGSUSED */ static int -yyerror(const char *s) +yyerror(void* parm, const char *s) { return 0; } @@ -3096,7 +2834,7 @@ date.yyHaveTime = 0; date.yyHaveZone = 0; - if(yyparse ((void *)&date) + if(yyparse (&date) || date.yyHaveTime > 1 || date.yyHaveZone > 1 || date.yyHaveDate > 1 || date.yyHaveDay > 1) { return -1; @@ -3184,4 +2922,3 @@ return Start; } - diff -Nru raptor2-2.0.12/src/parsedate.y raptor2-2.0.13/src/parsedate.y --- raptor2-2.0.12/src/parsedate.y 2012-08-31 17:12:51.000000000 +0000 +++ raptor2-2.0.13/src/parsedate.y 2014-01-03 04:37:54.000000000 +0000 @@ -92,7 +92,7 @@ #endif /* Prototypes */ -static int raptor_parsedate_error(const char *msg); +static int raptor_parsedate_error(void* parm, const char *msg); #define EPOCH 1970 @@ -160,9 +160,28 @@ %} +/* directives */ + +%require "3.0.0" + +/* File prefix (bison -b) */ +%file-prefix "parsedate" + +/* Symbol prefix (bison -d : deprecated) */ +%name-prefix "raptor_parsedate_" + +/* Write parser header file with macros (bison -d) */ +%defines + +/* Write output file with verbose descriptions of parser states */ +%verbose + +%define api.pure true + /* This grammar has 56 shift/reduce conflicts. */ %expect 56 -%pure_parser + +%param { struct date_yy *parm } %token tAGO tDAY tDAY_UNIT tDAYZONE tDST tHOUR_UNIT tID tTZONE tWZONE tZZONE %token tMERIDIAN tMINUTE_UNIT tMONTH tMONTH_UNIT @@ -778,7 +797,7 @@ /* ARGSUSED */ static int -yyerror(const char *s) +yyerror(void* parm, const char *s) { return 0; } @@ -1072,7 +1091,7 @@ date.yyHaveTime = 0; date.yyHaveZone = 0; - if(yyparse ((void *)&date) + if(yyparse (&date) || date.yyHaveTime > 1 || date.yyHaveZone > 1 || date.yyHaveDate > 1 || date.yyHaveDay > 1) { return -1; diff -Nru raptor2-2.0.12/src/raptor_general.c raptor2-2.0.13/src/raptor_general.c --- raptor2-2.0.12/src/raptor_general.c 2013-11-13 18:38:52.000000000 +0000 +++ raptor2-2.0.13/src/raptor_general.c 2014-01-04 19:36:55.000000000 +0000 @@ -2,7 +2,7 @@ * * raptor_general.c - Raptor general routines * - * Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/ + * Copyright (C) 2000-2014, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ @@ -48,9 +48,9 @@ /* statics */ -const char * const raptor_short_copyright_string = "Copyright 2000-2013 David Beckett. Copyright 2000-2005 University of Bristol"; +const char * const raptor_short_copyright_string = "Copyright 2000-2014 David Beckett. Copyright 2000-2005 University of Bristol"; -const char * const raptor_copyright_string = "Copyright (C) 2000-2013 David Beckett - http://www.dajobe.org/\nCopyright (C) 2000-2005 University of Bristol - http://www.bristol.ac.uk/"; +const char * const raptor_copyright_string = "Copyright (C) 2000-2014 David Beckett - http://www.dajobe.org/\nCopyright (C) 2000-2005 University of Bristol - http://www.bristol.ac.uk/"; const char * const raptor_license_string = "LGPL 2.1 or newer, GPL 2 or newer, Apache 2.0 or newer.\nSee http://librdf.org/raptor/LICENSE.html for full terms."; diff -Nru raptor2-2.0.12/src/raptor_internal.h raptor2-2.0.13/src/raptor_internal.h --- raptor2-2.0.12/src/raptor_internal.h 2013-12-08 03:05:36.000000000 +0000 +++ raptor2-2.0.13/src/raptor_internal.h 2013-12-30 17:48:13.000000000 +0000 @@ -1242,6 +1242,19 @@ raptor_term* term; } raptor_abbrev_node; +#ifdef RAPTOR_DEBUG +#define RAPTOR_DEBUG_ABBREV_NODE(label, node) \ + do { \ + RAPTOR_DEBUG1(label " "); \ + raptor_term_print_as_ntriples(node->term, stderr); \ + fprintf(stderr, " (refcount %d subject %d object %d)\n", \ + node->ref_count, \ + node->count_as_subject, \ + node->count_as_object); \ + } while(0) +#else +#define RAPTOR_DEBUG_ABBREV_NODE(label, node) +#endif typedef struct { raptor_abbrev_node* node; /* node representing the subject of @@ -1328,9 +1341,10 @@ int raptor_json_writer_key_value(raptor_json_writer* json_writer, const char* key, size_t key_len, const char* value, size_t value_len); int raptor_json_writer_start_block(raptor_json_writer* json_writer, char c); int raptor_json_writer_end_block(raptor_json_writer* json_writer, char c); -int raptor_json_writer_literal_object(raptor_json_writer* json_writer, unsigned char* s, unsigned char* lang, raptor_uri* datatype, const char* key, const char* type_key); -int raptor_json_writer_blank_object(raptor_json_writer* json_writer, const unsigned char* blank); +int raptor_json_writer_literal_object(raptor_json_writer* json_writer, unsigned char* s, size_t s_len, unsigned char* lang, raptor_uri* datatype); +int raptor_json_writer_blank_object(raptor_json_writer* json_writer, const unsigned char* blank, size_t blank_len); int raptor_json_writer_uri_object(raptor_json_writer* json_writer, raptor_uri* uri); +int raptor_json_writer_term(raptor_json_writer* json_writer, raptor_term *term); int raptor_json_writer_key_uri_value(raptor_json_writer* json_writer, const char* key, size_t key_len, raptor_uri* uri); /* raptor_memstr.c */ diff -Nru raptor2-2.0.12/src/raptor_json_writer.c raptor2-2.0.13/src/raptor_json_writer.c --- raptor2-2.0.12/src/raptor_json_writer.c 2013-11-30 16:11:19.000000000 +0000 +++ raptor2-2.0.13/src/raptor_json_writer.c 2013-12-30 17:48:13.000000000 +0000 @@ -122,8 +122,6 @@ raptor_iostream_counted_string_write("\"\"", 2, json_writer->iostr); return 0; } - if(!value_len) - value_len = strlen((const char*)value); raptor_iostream_write_byte('\"', json_writer->iostr); rc = raptor_string_escaped_write((const unsigned char*)value, value_len, @@ -218,21 +216,16 @@ int raptor_json_writer_literal_object(raptor_json_writer* json_writer, - unsigned char* s, unsigned char* lang, - raptor_uri* datatype, - const char* key, const char* type_key) + unsigned char* s, size_t s_len, + unsigned char* lang, + raptor_uri* datatype) { - - if(key) { - raptor_json_writer_start_block(json_writer, '{'); - raptor_json_writer_newline(json_writer); + raptor_json_writer_start_block(json_writer, '{'); + raptor_json_writer_newline(json_writer); - raptor_json_writer_quoted(json_writer, key, 0); - - raptor_iostream_counted_string_write(" : ", 3, json_writer->iostr); - } + raptor_iostream_counted_string_write("\"value\" : ", 10, json_writer->iostr); - raptor_json_writer_quoted(json_writer, (const char*)s, 0); + raptor_json_writer_quoted(json_writer, (const char*)s, s_len); if(datatype || lang) { raptor_iostream_write_byte(',', json_writer->iostr); @@ -252,19 +245,15 @@ } } - if(type_key) { - raptor_iostream_write_byte(',', json_writer->iostr); - raptor_json_writer_newline(json_writer); + raptor_iostream_write_byte(',', json_writer->iostr); + raptor_json_writer_newline(json_writer); - raptor_json_writer_key_value(json_writer, type_key, 0, "literal", 0); - } + raptor_json_writer_key_value(json_writer, "type", 4, "literal", 7); raptor_json_writer_newline(json_writer); - if(key) { - raptor_json_writer_end_block(json_writer, '}'); - raptor_json_writer_newline(json_writer); - } + raptor_json_writer_end_block(json_writer, '}'); + raptor_json_writer_newline(json_writer); return 0; } @@ -272,14 +261,16 @@ int raptor_json_writer_blank_object(raptor_json_writer* json_writer, - const unsigned char* blank) + const unsigned char* blank, + size_t blank_len) { raptor_json_writer_start_block(json_writer, '{'); raptor_json_writer_newline(json_writer); raptor_iostream_counted_string_write("\"value\" : \"_:", 13, json_writer->iostr); - raptor_iostream_string_write((const char*)blank, json_writer->iostr); + raptor_iostream_counted_string_write((const char*)blank, blank_len, + json_writer->iostr); raptor_iostream_counted_string_write("\",", 2, json_writer->iostr); raptor_json_writer_newline(json_writer); @@ -312,4 +303,43 @@ return 0; } + +int +raptor_json_writer_term(raptor_json_writer* json_writer, + raptor_term *term) +{ + int rc = 0; + + switch(term->type) { + case RAPTOR_TERM_TYPE_URI: + rc = raptor_json_writer_uri_object(json_writer, term->value.uri); + break; + + case RAPTOR_TERM_TYPE_LITERAL: + rc = raptor_json_writer_literal_object(json_writer, + term->value.literal.string, + term->value.literal.string_len, + term->value.literal.language, + term->value.literal.datatype); + break; + + case RAPTOR_TERM_TYPE_BLANK: + rc = raptor_json_writer_blank_object(json_writer, + term->value.blank.string, + term->value.blank.string_len); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(json_writer->world, RAPTOR_LOG_LEVEL_ERROR, + NULL, + "Triple has unsupported term type %d", + term->type); + rc = 1; + break; + } + + return rc; +} + #endif diff -Nru raptor2-2.0.12/src/raptor_rfc2396.c raptor2-2.0.13/src/raptor_rfc2396.c --- raptor2-2.0.12/src/raptor_rfc2396.c 2013-12-05 22:49:17.000000000 +0000 +++ raptor2-2.0.13/src/raptor_rfc2396.c 2014-01-10 21:54:40.000000000 +0000 @@ -542,7 +542,8 @@ } result.path = path_buffer; result.path_len = ref->path_len; - memcpy(path_buffer, ref->path, result.path_len); + if(ref->path) + memcpy(path_buffer, ref->path, result.path_len); path_buffer[result.path_len] = '\0'; goto normalize; } diff -Nru raptor2-2.0.12/src/raptor_serialize_json.c raptor2-2.0.13/src/raptor_serialize_json.c --- raptor2-2.0.12/src/raptor_serialize_json.c 2013-03-04 17:20:38.000000000 +0000 +++ raptor2-2.0.13/src/raptor_serialize_json.c 2013-12-30 17:48:13.000000000 +0000 @@ -183,67 +183,21 @@ /* subject */ raptor_iostream_string_write((const unsigned char*)"\"subject\" : ", serializer->iostream); - switch(statement->subject->type) { - case RAPTOR_TERM_TYPE_URI: - raptor_json_writer_uri_object(context->json_writer, - statement->subject->value.uri); - break; - - case RAPTOR_TERM_TYPE_BLANK: - raptor_json_writer_blank_object(context->json_writer, - statement->subject->value.blank.string); - break; - - case RAPTOR_TERM_TYPE_LITERAL: - case RAPTOR_TERM_TYPE_UNKNOWN: - default: - raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, - NULL, - "Triple has unsupported subject term type %d", - statement->subject->type); - break; - } + raptor_json_writer_term(context->json_writer, statement->subject); raptor_iostream_write_byte(',', serializer->iostream); raptor_json_writer_newline(context->json_writer); /* predicate */ raptor_iostream_string_write((const unsigned char*)"\"predicate\" : ", serializer->iostream); - raptor_json_writer_uri_object(context->json_writer, - statement->predicate->value.uri); + raptor_json_writer_term(context->json_writer, statement->predicate); raptor_iostream_write_byte(',', serializer->iostream); raptor_json_writer_newline(context->json_writer); /* object */ raptor_iostream_string_write((const unsigned char*)"\"object\" : ", serializer->iostream); - switch(statement->object->type) { - case RAPTOR_TERM_TYPE_URI: - raptor_json_writer_uri_object(context->json_writer, - statement->object->value.uri); - break; - - case RAPTOR_TERM_TYPE_LITERAL: - raptor_json_writer_literal_object(context->json_writer, - statement->object->value.literal.string, - statement->object->value.literal.language, - statement->object->value.literal.datatype, - "value", "type"); - break; - - case RAPTOR_TERM_TYPE_BLANK: - raptor_json_writer_blank_object(context->json_writer, - statement->object->value.blank.string); - break; - - case RAPTOR_TERM_TYPE_UNKNOWN: - default: - raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, - NULL, - "Triple has unsupported object term type %d", - statement->object->type); - break; - } + raptor_json_writer_term(context->json_writer, statement->object); raptor_json_writer_newline(context->json_writer); /* end triple */ @@ -365,35 +319,9 @@ } /* object */ - switch(s1->object->type) { - case RAPTOR_TERM_TYPE_URI: - raptor_json_writer_uri_object(context->json_writer, - s1->object->value.uri); - raptor_json_writer_newline(context->json_writer); - break; - - case RAPTOR_TERM_TYPE_LITERAL: - raptor_json_writer_literal_object(context->json_writer, - s1->object->value.literal.string, - s1->object->value.literal.language, - s1->object->value.literal.datatype, - "value", "type"); - break; - - case RAPTOR_TERM_TYPE_BLANK: - raptor_json_writer_blank_object(context->json_writer, - s1->object->value.blank.string); - raptor_json_writer_newline(context->json_writer); - break; - - case RAPTOR_TERM_TYPE_UNKNOWN: - default: - raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, - NULL, - "Triple has unsupported object term type %d", - s1->object->type); - break; - } + raptor_json_writer_term(context->json_writer, s1->object); + if(s1->object->type != RAPTOR_TERM_TYPE_LITERAL) + raptor_json_writer_newline(context->json_writer); /* end triple */ diff -Nru raptor2-2.0.12/src/raptor_serialize_rdfxmla.c raptor2-2.0.13/src/raptor_serialize_rdfxmla.c --- raptor2-2.0.12/src/raptor_serialize_rdfxmla.c 2012-08-31 17:12:51.000000000 +0000 +++ raptor2-2.0.13/src/raptor_serialize_rdfxmla.c 2013-12-30 17:48:13.000000000 +0000 @@ -214,9 +214,7 @@ { int rc; - RAPTOR_DEBUG5("Emitting resource node %p refcount %d subject %d object %d\n", - node, - node->ref_count, node->count_as_subject, node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting resource node", node); if(node->term->type != RAPTOR_TERM_TYPE_URI) return 1; @@ -224,7 +222,7 @@ rc = raptor_rdfxmla_emit_resource_uri(serializer, element, node->term->value.uri, depth); - RAPTOR_DEBUG2("Emitted resource node %p\n", node); + RAPTOR_DEBUG_ABBREV_NODE("Emitted resource node", node); return rc; } @@ -252,9 +250,7 @@ raptor_qname **attrs; int attrs_count; - RAPTOR_DEBUG5("Emitting literal node %p refcount %d subject %d object %d\n", - node, - node->ref_count, node->count_as_subject, node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting literal node", node); if(node->term->type != RAPTOR_TERM_TYPE_LITERAL) return 1; @@ -301,7 +297,7 @@ raptor_xml_writer_cdata(xml_writer, node->term->value.literal.string); raptor_xml_writer_end_element(xml_writer, element); - RAPTOR_DEBUG2("Emitted %p\n", node); + RAPTOR_DEBUG_ABBREV_NODE("Emitted literal node", node); return 0; @@ -340,9 +336,7 @@ { raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; - RAPTOR_DEBUG5("Emitting blank node %p refcount %d subject %d object %d\n", - node, - node->ref_count, node->count_as_subject, node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting blank node", node); if(node->term->type != RAPTOR_TERM_TYPE_BLANK) return 1; @@ -383,7 +377,7 @@ raptor_xml_writer_end_element(context->xml_writer, element); - RAPTOR_DEBUG2("Emitted %p\n", node); + RAPTOR_DEBUG_ABBREV_NODE("Emitted blank node", node); return 0; } @@ -409,10 +403,7 @@ int i = 0; raptor_uri* base_uri = NULL; - RAPTOR_DEBUG5("Emitting subject list items for node %p refcount %d subject %d object %d\n", - subject->node, - subject->node->ref_count, subject->node->count_as_subject, - subject->node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject list items", subject->node); while(!rv && i < raptor_sequence_size(subject->list_items)) { @@ -495,10 +486,7 @@ raptor_avltree_iterator* iter = NULL; raptor_term* subject_term = subject->node->term; - RAPTOR_DEBUG5("Emitting subject properties for node %p refcount %d subject %d object %d\n", - subject->node, subject->node->ref_count, - subject->node->count_as_subject, - subject->node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject properties", subject->node); /* Emit any rdf:_n properties collected */ if(raptor_sequence_size(subject->list_items) > 0) { @@ -658,17 +646,13 @@ context->single_node)); - RAPTOR_DEBUG5("Emitting subject node %p refcount %d subject %d object %d\n", - subject->node, - subject->node->ref_count, - subject->node->count_as_subject, - subject->node->count_as_object); - + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject node", subject->node); + if(!depth && subject_term->type == RAPTOR_TERM_TYPE_BLANK && subject->node->count_as_subject == 1 && subject->node->count_as_object == 1) { - RAPTOR_DEBUG2("Skipping subject node %p\n", subject->node); + RAPTOR_DEBUG_ABBREV_NODE("Skipping subject node", subject->node); return 0; } diff -Nru raptor2-2.0.12/src/raptor_serialize_turtle.c raptor2-2.0.13/src/raptor_serialize_turtle.c --- raptor2-2.0.12/src/raptor_serialize_turtle.c 2013-11-30 16:11:19.000000000 +0000 +++ raptor2-2.0.13/src/raptor_serialize_turtle.c 2013-12-30 17:48:13.000000000 +0000 @@ -171,9 +171,7 @@ raptor_qname* qname = NULL; - RAPTOR_DEBUG5("Emitting resource node %p refcount %d subject %d object %d\n", - node, - node->ref_count, node->count_as_subject, node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting resource node", node); if(node->term->type != RAPTOR_TERM_TYPE_URI) return 1; @@ -194,7 +192,7 @@ raptor_turtle_writer_reference(turtle_writer, node->term->value.uri); } - RAPTOR_DEBUG2("Emitted %p\n", node); + RAPTOR_DEBUG_ABBREV_NODE("Emitted", node); return 0; } @@ -219,9 +217,7 @@ raptor_turtle_writer *turtle_writer = context->turtle_writer; int rc = 0; - RAPTOR_DEBUG5("Emitting literal node %p refcount %d subject %d object %d\n", - node, - node->ref_count, node->count_as_subject, node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting literal node", node); if(node->term->type != RAPTOR_TERM_TYPE_LITERAL) return 1; @@ -231,7 +227,7 @@ node->term->value.literal.language, node->term->value.literal.datatype); - RAPTOR_DEBUG2("Emitted %p\n", node); + RAPTOR_DEBUG_ABBREV_NODE("Emitted literal node", node); return rc; } @@ -255,9 +251,7 @@ raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; int rc = 0; - RAPTOR_DEBUG5("Emitting blank node %p refcount %d subject %d object %d\n", - node, - node->ref_count, node->count_as_subject, node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting blank node", node); if(node->term->type != RAPTOR_TERM_TYPE_BLANK) return 1; @@ -281,7 +275,7 @@ node->term->value.blank.string_len); } - RAPTOR_DEBUG2("Emitted %p\n", node); + RAPTOR_DEBUG_ABBREV_NODE("Emitted blank node", node); return rc; } @@ -305,10 +299,7 @@ int rv = 0; int i = 0; - RAPTOR_DEBUG5("Emitting subject list items for node %p refcount %d subject %d object %d\n", - subject->node, - subject->node->ref_count, subject->node->count_as_subject, - subject->node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject list items", subject->node); while(!rv && i < raptor_sequence_size(subject->list_items)) { raptor_abbrev_node* object; @@ -367,10 +358,7 @@ int i; int is_new_subject = 0; - RAPTOR_DEBUG5("Emitting subject collection items for node %p refcount %d subject %d object %d\n", - subject->node, - subject->node->ref_count, subject->node->count_as_subject, - subject->node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject collection items", subject->node); /* if just saw a new subject (is_new_subject is true) then there is no need * to advance the iterator - it was just reset @@ -500,10 +488,7 @@ raptor_avltree_iterator* iter = NULL; int i; - RAPTOR_DEBUG5("Emitting subject properties for node %p refcount %d subject %d object %d\n", - subject->node, subject->node->ref_count, - subject->node->count_as_subject, - subject->node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject properties", subject->node); /* Emit any rdf:_n properties collected */ if(raptor_sequence_size(subject->list_items) > 0) @@ -526,7 +511,7 @@ if(!(last_predicate && raptor_abbrev_node_equals(predicate, last_predicate))) { /* no object list abbreviation possible, terminate last object */ if(last_predicate) { - raptor_turtle_writer_raw(turtle_writer, (const unsigned char*)" ;"); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" ;", 2); raptor_turtle_writer_newline(turtle_writer); } @@ -535,18 +520,18 @@ 10); if(raptor_abbrev_node_equals(predicate, context->rdf_type)) - raptor_turtle_writer_raw(turtle_writer, (const unsigned char*)"a"); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"a", 1); else if(qname) raptor_turtle_writer_qname(turtle_writer, qname); else raptor_turtle_writer_reference(turtle_writer, predicate->term->value.uri); - raptor_turtle_writer_raw(turtle_writer, (const unsigned char*)" "); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" ", 1); if(qname) raptor_free_qname(qname); } else - raptor_turtle_writer_raw(turtle_writer, (const unsigned char*)", "); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)", ", 2); switch(object->term->type) { @@ -606,22 +591,18 @@ if(!raptor_abbrev_subject_valid(subject)) return 0; - RAPTOR_DEBUG5("Emitting subject node %p refcount %d subject %d object %d\n", - subject->node, - subject->node->ref_count, - subject->node->count_as_subject, - subject->node->count_as_object); + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject node", subject->node); if(!depth && subject->node->term->type == RAPTOR_TERM_TYPE_BLANK && subject->node->count_as_subject == 1 && subject->node->count_as_object == 1) { - RAPTOR_DEBUG2("Skipping subject node %p\n", subject->node); + RAPTOR_DEBUG_ABBREV_NODE("Skipping subject node - subj & obj count 1", subject->node); return 0; } if(raptor_avltree_size(subject->properties) == 0) { - RAPTOR_DEBUG2("Skipping subject node %p\n", subject->node); + RAPTOR_DEBUG_ABBREV_NODE("Skipping subject node - no props", subject->node); return 0; } @@ -666,27 +647,21 @@ subject->node->count_as_object == 0) && depth > 1) { blank = 1; } else if(subject->node->count_as_object == 0) { - raptor_turtle_writer_raw(turtle_writer, (const unsigned char*)"[]"); + raptor_turtle_writer_raw_counted(turtle_writer, + (const unsigned char*)"[]", 2); blank = 0; } else if(!collection && subject->node->count_as_object > 1) { /* Referred to (used as an object), so needs a nodeID */ - const unsigned char* genid = subject->node->term->value.blank.string; - size_t len = strlen((const char*)genid); - unsigned char* subject_str; - subject_str= RAPTOR_MALLOC(unsigned char*, len + 3); - if(!subject_str) - return 1; - - subject_str[0]='_'; - subject_str[1]=':'; - memcpy(&subject_str[2], genid, len + 1); - raptor_turtle_writer_raw(turtle_writer, subject_str); - RAPTOR_FREE(char*, subject_str); + raptor_turtle_writer_raw_counted(turtle_writer, + (const unsigned char*)"_:", 2); + raptor_turtle_writer_raw_counted(turtle_writer, + subject->node->term->value.blank.string, + subject->node->term->value.blank.string_len); } } if(collection) { - raptor_turtle_writer_raw(turtle_writer, (const unsigned char*)"("); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"(", 1); raptor_turtle_writer_increase_indent(turtle_writer); @@ -695,11 +670,11 @@ raptor_turtle_writer_decrease_indent(turtle_writer); raptor_turtle_writer_newline(turtle_writer); - raptor_turtle_writer_raw(turtle_writer, (const unsigned char*)")"); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)")", 1); } else { if(blank && depth > 1) - raptor_turtle_writer_raw(turtle_writer, (const unsigned char*)"["); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"[", 1); raptor_turtle_writer_increase_indent(turtle_writer); raptor_turtle_writer_newline(turtle_writer); @@ -710,7 +685,7 @@ if(blank && depth > 1) { raptor_turtle_writer_newline(turtle_writer); - raptor_turtle_writer_raw(turtle_writer, (const unsigned char*)"]"); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"]", 1); } } @@ -720,7 +695,7 @@ * (the "." will be parsed as part of the literal and statement * left unterminated) */ - raptor_turtle_writer_raw(turtle_writer, (const unsigned char*)" ."); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" .", 2); raptor_turtle_writer_newline(turtle_writer); raptor_turtle_writer_newline(turtle_writer); } @@ -1036,7 +1011,7 @@ raptor_namespace_stack_start_namespace(context->nstack, ns, 0); } - raptor_turtle_writer_raw(context->turtle_writer, (const unsigned char*)"\n"); + raptor_turtle_writer_newline(context->turtle_writer); context->written_header = 1; } diff -Nru raptor2-2.0.12/src/raptor_term.c raptor2-2.0.13/src/raptor_term.c --- raptor2-2.0.12/src/raptor_term.c 2013-12-13 02:31:01.000000000 +0000 +++ raptor2-2.0.13/src/raptor_term.c 2013-12-30 17:48:13.000000000 +0000 @@ -396,7 +396,7 @@ raptor_world_open(world); - memset(&locator, sizeof(locator), '\0'); + memset(&locator, '\0', sizeof(locator)); locator.line = -1; bytes_read = raptor_ntriples_parse_term(world, &locator, diff -Nru raptor2-2.0.12/src/turtle_common.c raptor2-2.0.13/src/turtle_common.c --- raptor2-2.0.12/src/turtle_common.c 2013-09-29 15:39:48.000000000 +0000 +++ raptor2-2.0.13/src/turtle_common.c 2014-01-03 04:37:54.000000000 +0000 @@ -41,8 +41,8 @@ #include "raptor2.h" #include "raptor_internal.h" -#include #include +#include #include /** diff -Nru raptor2-2.0.12/src/turtle_lexer.c raptor2-2.0.13/src/turtle_lexer.c --- raptor2-2.0.12/src/turtle_lexer.c 2013-11-30 16:16:57.000000000 +0000 +++ raptor2-2.0.13/src/turtle_lexer.c 2014-01-04 19:37:12.000000000 +0000 @@ -692,8 +692,11 @@ /* Never use yyunput */ /* Supply our own alloc/realloc/free functions */ /* Re-entrant scanner */ +/* Makes turtle_lexer_get_lval() turtle_lexer_set_lval() and yylval appear */ +/* Makes yyget_lloc() yyset_lloc() and yylloc appear */ +/* %option bison-locations */ /* definitions */ -#line 77 "./turtle_lexer.l" +#line 81 "./turtle_lexer.l" /* NOTE: These headers are NOT included here but are inserted by * fix-flex since otherwise it appears far too late in the generated C @@ -735,9 +738,6 @@ const char * turtle_token_print(raptor_world* world, int token, YYSTYPE *lval); #endif -int turtle_lexer_lex (YYSTYPE *turtle_parser_lval, yyscan_t yyscanner); -#define YY_DECL int turtle_lexer_lex (YYSTYPE *turtle_parser_lval, yyscan_t yyscanner) - #ifdef __cplusplus #define INPUT_FN yyinput #else @@ -745,7 +745,12 @@ #endif -/* flex version 2.5.36 released 2012-07-20 added the column header prototypes */ +/* debian flex 2.5.35-10.1 added these column header prototypes in + * re-entrant mode. standard flex omits them + */ +void turtle_lexer_set_column(int column_no, yyscan_t yyscanner); +int turtle_lexer_get_column(yyscan_t yyscanner); + static void turtle_lexer_cleanup(yyscan_t yyscanner); #ifdef HAVE_SETJMP @@ -763,6 +768,9 @@ } while(0) #endif +/* Remove the re-fill function since it should never be called */ +#define YY_INPUT(buf,result,max_size) { return YY_NULL; } + static void turtle_lexer_error(yyscan_t yyscanner, raptor_log_level level, yyconst char *message, ...) RAPTOR_PRINTF_FORMAT(3, 4); /* Fatal error handler that returns EOF instead of abort()/longjmp() @@ -776,13 +784,13 @@ #define TURTLE_LEXER_OOM() YY_FATAL_ERROR_EOF(turtle_lexer_oom_text) static char turtle_lexer_oom_text[]="turtle_lexer: Out of memory"; -/* Dot not need input() to to read from stdin */ +/* Do not need input() to to read from stdin */ #define YY_NO_INPUT 1 /* Tokens from Turtle 2013 spec - lex-ifyed to remove unicode ranges */ /* flex: only 1 level of definition expansion so have to expand PLX */ -#line 786 "turtle_lexer.c" +#line 794 "turtle_lexer.c" #define INITIAL 0 #define PREF 1 @@ -833,10 +841,16 @@ int yy_more_flag; int yy_more_len; + YYSTYPE * yylval_r; + }; /* end struct yyguts_t */ static int yy_init_globals (yyscan_t yyscanner ); + /* This must go here because YYSTYPE and YYLTYPE are included + * from bison output in section 1.*/ + # define yylval yyg->yylval_r + int turtle_lexer_lex_init (yyscan_t* scanner); int turtle_lexer_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); @@ -874,6 +888,10 @@ void turtle_lexer_set_column (int column_no ,yyscan_t yyscanner ); +YYSTYPE * turtle_lexer_get_lval (yyscan_t yyscanner ); + +void turtle_lexer_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -984,9 +1002,11 @@ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int turtle_lexer_lex (yyscan_t yyscanner); +extern int turtle_lexer_lex \ + (YYSTYPE * yylval_param ,yyscan_t yyscanner); -#define YY_DECL int turtle_lexer_lex (yyscan_t yyscanner) +#define YY_DECL int turtle_lexer_lex \ + (YYSTYPE * yylval_param , yyscan_t yyscanner) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng @@ -1013,7 +1033,7 @@ register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 192 "./turtle_lexer.l" +#line 201 "./turtle_lexer.l" /* rules */ @@ -1028,7 +1048,9 @@ -#line 1032 "turtle_lexer.c" +#line 1052 "turtle_lexer.c" + + yylval = yylval_param; if ( !yyg->yy_init ) { @@ -1110,121 +1132,121 @@ case 1: /* rule 1 can match eol */ YY_RULE_SETUP -#line 206 "./turtle_lexer.l" +#line 215 "./turtle_lexer.l" { turtle_parser->lineno++; } YY_BREAK case 2: YY_RULE_SETUP -#line 208 "./turtle_lexer.l" +#line 217 "./turtle_lexer.l" { /* empty */ } YY_BREAK case 3: YY_RULE_SETUP -#line 211 "./turtle_lexer.l" +#line 220 "./turtle_lexer.l" { return A; } YY_BREAK case 4: YY_RULE_SETUP -#line 213 "./turtle_lexer.l" +#line 222 "./turtle_lexer.l" { return DOT; } YY_BREAK case 5: YY_RULE_SETUP -#line 214 "./turtle_lexer.l" +#line 223 "./turtle_lexer.l" { return COMMA; } YY_BREAK case 6: YY_RULE_SETUP -#line 215 "./turtle_lexer.l" +#line 224 "./turtle_lexer.l" { return SEMICOLON; } YY_BREAK case 7: YY_RULE_SETUP -#line 216 "./turtle_lexer.l" +#line 225 "./turtle_lexer.l" { return LEFT_SQUARE; } YY_BREAK case 8: YY_RULE_SETUP -#line 217 "./turtle_lexer.l" +#line 226 "./turtle_lexer.l" { return RIGHT_SQUARE; } YY_BREAK case 9: YY_RULE_SETUP -#line 218 "./turtle_lexer.l" +#line 227 "./turtle_lexer.l" { BEGIN(PREF); return PREFIX; } YY_BREAK case 10: YY_RULE_SETUP -#line 219 "./turtle_lexer.l" +#line 228 "./turtle_lexer.l" { BEGIN(PREF); return SPARQL_PREFIX; } YY_BREAK case 11: YY_RULE_SETUP -#line 221 "./turtle_lexer.l" +#line 230 "./turtle_lexer.l" { return BASE; } YY_BREAK case 12: YY_RULE_SETUP -#line 222 "./turtle_lexer.l" +#line 231 "./turtle_lexer.l" { return SPARQL_BASE; } YY_BREAK case 13: YY_RULE_SETUP -#line 223 "./turtle_lexer.l" +#line 232 "./turtle_lexer.l" { return HAT; } YY_BREAK case 14: YY_RULE_SETUP -#line 224 "./turtle_lexer.l" +#line 233 "./turtle_lexer.l" { return LEFT_ROUND; } YY_BREAK case 15: YY_RULE_SETUP -#line 225 "./turtle_lexer.l" +#line 234 "./turtle_lexer.l" { return RIGHT_ROUND; } YY_BREAK case 16: YY_RULE_SETUP -#line 226 "./turtle_lexer.l" +#line 235 "./turtle_lexer.l" { return LEFT_CURLY; } YY_BREAK case 17: YY_RULE_SETUP -#line 227 "./turtle_lexer.l" +#line 236 "./turtle_lexer.l" { return RIGHT_CURLY; } YY_BREAK case 18: YY_RULE_SETUP -#line 228 "./turtle_lexer.l" +#line 237 "./turtle_lexer.l" { return TRUE_TOKEN; } YY_BREAK case 19: YY_RULE_SETUP -#line 229 "./turtle_lexer.l" +#line 238 "./turtle_lexer.l" { return FALSE_TOKEN; } YY_BREAK case 20: YY_RULE_SETUP -#line 232 "./turtle_lexer.l" -{ turtle_parser_lval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ - if(!turtle_parser_lval->string) +#line 241 "./turtle_lexer.l" +{ yylval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ + if(!yylval->string) yyterminate(); return STRING_LITERAL; } YY_BREAK case 21: YY_RULE_SETUP -#line 238 "./turtle_lexer.l" -{ turtle_parser_lval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ - if(!turtle_parser_lval->string) +#line 247 "./turtle_lexer.l" +{ yylval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ + if(!yylval->string) yyterminate(); return STRING_LITERAL; } YY_BREAK case 22: YY_RULE_SETUP -#line 244 "./turtle_lexer.l" +#line 253 "./turtle_lexer.l" { BEGIN(LONG_DLITERAL); turtle_parser->sb = raptor_new_stringbuffer(); if(!turtle_parser->sb) @@ -1233,17 +1255,17 @@ YY_BREAK case 23: YY_RULE_SETUP -#line 250 "./turtle_lexer.l" +#line 259 "./turtle_lexer.l" { size_t len; BEGIN(INITIAL); len = raptor_stringbuffer_length(turtle_parser->sb); - turtle_parser_lval->string = RAPTOR_MALLOC(unsigned char*, len + 1); - if(!turtle_parser_lval->string) + yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!yylval->string) TURTLE_LEXER_OOM(); - raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)turtle_parser_lval->string, len); - turtle_parser_lval->string[len]='\0'; + raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)yylval->string, len); + yylval->string[len]='\0'; raptor_free_stringbuffer(turtle_parser->sb); turtle_parser->sb = NULL; @@ -1252,7 +1274,7 @@ case 24: /* rule 24 can match eol */ YY_RULE_SETUP -#line 265 "./turtle_lexer.l" +#line 274 "./turtle_lexer.l" { char *p; @@ -1280,7 +1302,7 @@ YY_BREAK case 25: YY_RULE_SETUP -#line 290 "./turtle_lexer.l" +#line 299 "./turtle_lexer.l" { /* this should only happen if \ is at the end of the file so the Turtle doc is illegal anyway */ BEGIN(INITIAL); @@ -1291,7 +1313,7 @@ } YY_BREAK case YY_STATE_EOF(LONG_DLITERAL): -#line 299 "./turtle_lexer.l" +#line 308 "./turtle_lexer.l" { BEGIN(INITIAL); raptor_free_stringbuffer(turtle_parser->sb); @@ -1302,7 +1324,7 @@ YY_BREAK case 26: YY_RULE_SETUP -#line 307 "./turtle_lexer.l" +#line 316 "./turtle_lexer.l" { BEGIN(LONG_SLITERAL); turtle_parser->sb = raptor_new_stringbuffer(); if(!turtle_parser->sb) @@ -1311,17 +1333,17 @@ YY_BREAK case 27: YY_RULE_SETUP -#line 313 "./turtle_lexer.l" +#line 322 "./turtle_lexer.l" { size_t len; BEGIN(INITIAL); len = raptor_stringbuffer_length(turtle_parser->sb); - turtle_parser_lval->string = RAPTOR_MALLOC(unsigned char*, len + 1); - if(!turtle_parser_lval->string) + yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!yylval->string) TURTLE_LEXER_OOM(); - raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)turtle_parser_lval->string, len); - turtle_parser_lval->string[len]='\0'; + raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)yylval->string, len); + yylval->string[len]='\0'; raptor_free_stringbuffer(turtle_parser->sb); turtle_parser->sb = NULL; @@ -1330,7 +1352,7 @@ case 28: /* rule 28 can match eol */ YY_RULE_SETUP -#line 328 "./turtle_lexer.l" +#line 337 "./turtle_lexer.l" { char *p; @@ -1358,7 +1380,7 @@ YY_BREAK case 29: YY_RULE_SETUP -#line 353 "./turtle_lexer.l" +#line 362 "./turtle_lexer.l" { /* this should only happen if \ is at the end of the file so the Turtle doc is illegal anyway */ BEGIN(INITIAL); @@ -1369,7 +1391,7 @@ } YY_BREAK case YY_STATE_EOF(LONG_SLITERAL): -#line 362 "./turtle_lexer.l" +#line 371 "./turtle_lexer.l" { BEGIN(INITIAL); raptor_free_stringbuffer(turtle_parser->sb); @@ -1380,17 +1402,17 @@ YY_BREAK case 30: YY_RULE_SETUP -#line 370 "./turtle_lexer.l" -{ turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext+2, yyleng-2); - if(!turtle_parser_lval->string) +#line 379 "./turtle_lexer.l" +{ yylval->string = turtle_copy_token((unsigned char*)yytext+2, yyleng-2); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return BLANK_LITERAL; } YY_BREAK case 31: YY_RULE_SETUP -#line 375 "./turtle_lexer.l" -{ turtle_parser_lval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->uri) { +#line 384 "./turtle_lexer.l" +{ yylval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); + if(!yylval->uri) { turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_ERROR, "Failed to convert qname %s to URI", yytext); yyterminate(); } @@ -1399,57 +1421,57 @@ YY_BREAK case 32: YY_RULE_SETUP -#line 383 "./turtle_lexer.l" -{ turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->string) +#line 392 "./turtle_lexer.l" +{ yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return DECIMAL_LITERAL; } YY_BREAK case 33: YY_RULE_SETUP -#line 389 "./turtle_lexer.l" -{ turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->string) +#line 398 "./turtle_lexer.l" +{ yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return FLOATING_LITERAL; } YY_BREAK case 34: YY_RULE_SETUP -#line 395 "./turtle_lexer.l" -{ turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->string) +#line 404 "./turtle_lexer.l" +{ yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return INTEGER_LITERAL; } YY_BREAK case 35: YY_RULE_SETUP -#line 400 "./turtle_lexer.l" +#line 409 "./turtle_lexer.l" { /* eat up leading whitespace */ } YY_BREAK case 36: YY_RULE_SETUP -#line 401 "./turtle_lexer.l" -{ turtle_parser_lval->string=turtle_copy_token((unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->string) +#line 410 "./turtle_lexer.l" +{ yylval->string=turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); BEGIN(INITIAL); return IDENTIFIER; } YY_BREAK case 37: YY_RULE_SETUP -#line 406 "./turtle_lexer.l" +#line 415 "./turtle_lexer.l" { BEGIN(INITIAL); - turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext, 0); - if(!turtle_parser_lval->string) + yylval->string = turtle_copy_token((unsigned char*)yytext, 0); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return IDENTIFIER; } YY_BREAK case 38: /* rule 38 can match eol */ YY_RULE_SETUP -#line 412 "./turtle_lexer.l" +#line 421 "./turtle_lexer.l" { BEGIN(INITIAL); if(*yytext == EOF) return EOF; @@ -1460,7 +1482,7 @@ case 39: /* rule 39 can match eol */ YY_RULE_SETUP -#line 420 "./turtle_lexer.l" +#line 429 "./turtle_lexer.l" { raptor_stringbuffer* sb; unsigned char* uri_string; @@ -1486,20 +1508,20 @@ turtle_syntax_error(rdf_parser, "URI '%s' contains bad character(s)", uri_string); yyterminate(); } else if(!*uri_string) - turtle_parser_lval->uri = raptor_uri_copy(rdf_parser->base_uri); + yylval->uri = raptor_uri_copy(rdf_parser->base_uri); else - turtle_parser_lval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); + yylval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); raptor_free_stringbuffer(sb); - if(!turtle_parser_lval->uri) + if(!yylval->uri) TURTLE_LEXER_OOM(); return GRAPH_NAME_LEFT_CURLY; } YY_BREAK case 40: /* rule 40 can match eol */ YY_RULE_SETUP -#line 455 "./turtle_lexer.l" +#line 464 "./turtle_lexer.l" { while(1) { int c = yytext[yyleng - 1]; @@ -1511,8 +1533,8 @@ } yytext[yyleng] = '\0'; - turtle_parser_lval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->uri) { + yylval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); + if(!yylval->uri) { turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_ERROR, "Failed to convert qname %s to URI", yytext); yyterminate(); } @@ -1521,9 +1543,9 @@ YY_BREAK case 41: YY_RULE_SETUP -#line 474 "./turtle_lexer.l" +#line 483 "./turtle_lexer.l" { if(yyleng == 2) - turtle_parser_lval->uri = raptor_uri_copy(rdf_parser->base_uri); + yylval->uri = raptor_uri_copy(rdf_parser->base_uri); else { raptor_stringbuffer* sb; unsigned char* uri_string; @@ -1541,8 +1563,8 @@ turtle_syntax_error(rdf_parser, "URI '%s' contains bad character(s)", uri_string); yyterminate(); } else { - turtle_parser_lval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); - if(!turtle_parser_lval->uri) { + yylval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); + if(!yylval->uri) { raptor_free_stringbuffer(sb); TURTLE_LEXER_OOM(); } @@ -1553,29 +1575,29 @@ YY_BREAK case 42: YY_RULE_SETUP -#line 503 "./turtle_lexer.l" -{ turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext+1, yyleng-1); - if(!turtle_parser_lval->string) +#line 512 "./turtle_lexer.l" +{ yylval->string = turtle_copy_token((unsigned char*)yytext+1, yyleng-1); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return LANGTAG; } YY_BREAK case 43: /* rule 43 can match eol */ YY_RULE_SETUP -#line 508 "./turtle_lexer.l" +#line 517 "./turtle_lexer.l" { /* # comment */ turtle_parser->lineno++; } YY_BREAK case 44: YY_RULE_SETUP -#line 512 "./turtle_lexer.l" +#line 521 "./turtle_lexer.l" { /* # comment on the last line with no terminating newline */ } YY_BREAK case 45: YY_RULE_SETUP -#line 515 "./turtle_lexer.l" +#line 524 "./turtle_lexer.l" { if(*yytext == EOF) return EOF; @@ -1585,10 +1607,10 @@ YY_BREAK case 46: YY_RULE_SETUP -#line 522 "./turtle_lexer.l" +#line 531 "./turtle_lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1592 "turtle_lexer.c" +#line 1614 "turtle_lexer.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(PREF): yyterminate(); @@ -2523,6 +2545,18 @@ /* Accessor methods for yylval and yylloc */ +YYSTYPE * turtle_lexer_get_lval (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylval; +} + +void turtle_lexer_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylval = yylval_param; +} + /* User-visible API */ /* turtle_lexer_lex_init is special because it creates the scanner itself, so it is @@ -2678,7 +2712,7 @@ #define YYTABLES_NAME "yytables" -#line 522 "./turtle_lexer.l" +#line 531 "./turtle_lexer.l" /* user code */ @@ -3085,7 +3119,7 @@ return buffer; case INTEGER_LITERAL: - sprintf(buffer, "INTEGER_LITERAL(%d)", lval->integer); + sprintf(buffer, "INTEGER_LITERAL(%s)", lval->string); return buffer; case FLOATING_LITERAL: diff -Nru raptor2-2.0.12/src/turtle_lexer.h raptor2-2.0.13/src/turtle_lexer.h --- raptor2-2.0.12/src/turtle_lexer.h 2013-11-30 16:16:57.000000000 +0000 +++ raptor2-2.0.13/src/turtle_lexer.h 2014-01-04 19:37:12.000000000 +0000 @@ -279,6 +279,10 @@ void turtle_lexer_set_column (int column_no ,yyscan_t yyscanner ); +YYSTYPE * turtle_lexer_get_lval (yyscan_t yyscanner ); + +void turtle_lexer_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -324,9 +328,11 @@ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int turtle_lexer_lex (yyscan_t yyscanner); +extern int turtle_lexer_lex \ + (YYSTYPE * yylval_param ,yyscan_t yyscanner); -#define YY_DECL int turtle_lexer_lex (yyscan_t yyscanner) +#define YY_DECL int turtle_lexer_lex \ + (YYSTYPE * yylval_param , yyscan_t yyscanner) #endif /* !YY_DECL */ /* yy_get_previous_state - get the state just before the EOB char was reached */ @@ -343,9 +349,9 @@ #undef YY_DECL #endif -#line 522 "./turtle_lexer.l" +#line 531 "./turtle_lexer.l" -#line 350 "turtle_lexer.h" +#line 356 "turtle_lexer.h" #undef turtle_lexer_IN_HEADER #endif /* turtle_lexer_HEADER_H */ diff -Nru raptor2-2.0.12/src/turtle_lexer.l raptor2-2.0.13/src/turtle_lexer.l --- raptor2-2.0.12/src/turtle_lexer.l 2013-08-26 02:04:20.000000000 +0000 +++ raptor2-2.0.13/src/turtle_lexer.l 2014-01-04 19:36:55.000000000 +0000 @@ -70,6 +70,10 @@ %option extra-type="raptor_parser*" +/* Makes yyget_lval() yyset_lval() and yylval appear */ +%option bison-bridge +/* Makes yyget_lloc() yyset_lloc() and yylloc appear */ +/* %option bison-locations */ /* definitions */ @@ -115,9 +119,6 @@ const char * turtle_token_print(raptor_world* world, int token, YYSTYPE *lval); #endif -int turtle_lexer_lex (YYSTYPE *turtle_parser_lval, yyscan_t yyscanner); -#define YY_DECL int turtle_lexer_lex (YYSTYPE *turtle_parser_lval, yyscan_t yyscanner) - #ifdef __cplusplus #define INPUT_FN yyinput #else @@ -125,7 +126,12 @@ #endif -/* flex version 2.5.36 released 2012-07-20 added the column header prototypes */ +/* debian flex 2.5.35-10.1 added these column header prototypes in + * re-entrant mode. standard flex omits them + */ +void turtle_lexer_set_column(int column_no, yyscan_t yyscanner); +int turtle_lexer_get_column(yyscan_t yyscanner); + static void turtle_lexer_cleanup(yyscan_t yyscanner); #ifdef HAVE_SETJMP @@ -143,6 +149,9 @@ } while(0) #endif +/* Remove the re-fill function since it should never be called */ +#define YY_INPUT(buf,result,max_size) { return YY_NULL; } + static void turtle_lexer_error(yyscan_t yyscanner, raptor_log_level level, yyconst char *message, ...) RAPTOR_PRINTF_FORMAT(3, 4); /* Fatal error handler that returns EOF instead of abort()/longjmp() @@ -156,7 +165,7 @@ #define TURTLE_LEXER_OOM() YY_FATAL_ERROR_EOF(turtle_lexer_oom_text) static char turtle_lexer_oom_text[]="turtle_lexer: Out of memory"; -/* Dot not need input() to to read from stdin */ +/* Do not need input() to to read from stdin */ #define YY_NO_INPUT 1 %} @@ -229,14 +238,14 @@ "false" { return FALSE_TOKEN; } -\"([^\"\\\n\r]|\\[^\n\r])*\" { turtle_parser_lval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ - if(!turtle_parser_lval->string) +\"([^\"\\\n\r]|\\[^\n\r])*\" { yylval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ + if(!yylval->string) yyterminate(); return STRING_LITERAL; } -\'([^\'\\\n\r]|\\[^\n\r])*\' { turtle_parser_lval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ - if(!turtle_parser_lval->string) +\'([^\'\\\n\r]|\\[^\n\r])*\' { yylval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ + if(!yylval->string) yyterminate(); return STRING_LITERAL; } @@ -252,11 +261,11 @@ BEGIN(INITIAL); len = raptor_stringbuffer_length(turtle_parser->sb); - turtle_parser_lval->string = RAPTOR_MALLOC(unsigned char*, len + 1); - if(!turtle_parser_lval->string) + yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!yylval->string) TURTLE_LEXER_OOM(); - raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)turtle_parser_lval->string, len); - turtle_parser_lval->string[len]='\0'; + raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)yylval->string, len); + yylval->string[len]='\0'; raptor_free_stringbuffer(turtle_parser->sb); turtle_parser->sb = NULL; @@ -315,11 +324,11 @@ BEGIN(INITIAL); len = raptor_stringbuffer_length(turtle_parser->sb); - turtle_parser_lval->string = RAPTOR_MALLOC(unsigned char*, len + 1); - if(!turtle_parser_lval->string) + yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!yylval->string) TURTLE_LEXER_OOM(); - raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)turtle_parser_lval->string, len); - turtle_parser_lval->string[len]='\0'; + raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)yylval->string, len); + yylval->string[len]='\0'; raptor_free_stringbuffer(turtle_parser->sb); turtle_parser->sb = NULL; @@ -367,45 +376,45 @@ yyterminate(); } -"_:"{BN_LABEL} { turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext+2, yyleng-2); - if(!turtle_parser_lval->string) +"_:"{BN_LABEL} { yylval->string = turtle_copy_token((unsigned char*)yytext+2, yyleng-2); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return BLANK_LITERAL; } -{QNAME} { turtle_parser_lval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->uri) { +{QNAME} { yylval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); + if(!yylval->uri) { turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_ERROR, "Failed to convert qname %s to URI", yytext); yyterminate(); } return QNAME_LITERAL; } -{DECIMAL} { turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->string) +{DECIMAL} { yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return DECIMAL_LITERAL; } -{DOUBLE} { turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->string) +{DOUBLE} { yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return FLOATING_LITERAL; } -{INTEGER} { turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->string) +{INTEGER} { yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return INTEGER_LITERAL; } [\ \t\v]+ { /* eat up leading whitespace */ } -{PN_PREFIX}":" { turtle_parser_lval->string=turtle_copy_token((unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->string) +{PN_PREFIX}":" { yylval->string=turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); BEGIN(INITIAL); return IDENTIFIER; } ":" { BEGIN(INITIAL); - turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext, 0); - if(!turtle_parser_lval->string) + yylval->string = turtle_copy_token((unsigned char*)yytext, 0); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return IDENTIFIER; } @@ -442,13 +451,13 @@ turtle_syntax_error(rdf_parser, "URI '%s' contains bad character(s)", uri_string); yyterminate(); } else if(!*uri_string) - turtle_parser_lval->uri = raptor_uri_copy(rdf_parser->base_uri); + yylval->uri = raptor_uri_copy(rdf_parser->base_uri); else - turtle_parser_lval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); + yylval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); raptor_free_stringbuffer(sb); - if(!turtle_parser_lval->uri) + if(!yylval->uri) TURTLE_LEXER_OOM(); return GRAPH_NAME_LEFT_CURLY; } @@ -463,8 +472,8 @@ } yytext[yyleng] = '\0'; - turtle_parser_lval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); - if(!turtle_parser_lval->uri) { + yylval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); + if(!yylval->uri) { turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_ERROR, "Failed to convert qname %s to URI", yytext); yyterminate(); } @@ -472,7 +481,7 @@ return GRAPH_NAME_LEFT_CURLY; } {IRI} { if(yyleng == 2) - turtle_parser_lval->uri = raptor_uri_copy(rdf_parser->base_uri); + yylval->uri = raptor_uri_copy(rdf_parser->base_uri); else { raptor_stringbuffer* sb; unsigned char* uri_string; @@ -490,8 +499,8 @@ turtle_syntax_error(rdf_parser, "URI '%s' contains bad character(s)", uri_string); yyterminate(); } else { - turtle_parser_lval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); - if(!turtle_parser_lval->uri) { + yylval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); + if(!yylval->uri) { raptor_free_stringbuffer(sb); TURTLE_LEXER_OOM(); } @@ -500,8 +509,8 @@ } return URI_LITERAL; } -{LANGTAG} { turtle_parser_lval->string = turtle_copy_token((unsigned char*)yytext+1, yyleng-1); - if(!turtle_parser_lval->string) +{LANGTAG} { yylval->string = turtle_copy_token((unsigned char*)yytext+1, yyleng-1); + if(!yylval->string) YY_FATAL_ERROR_EOF("turtle_copy_token failed"); return LANGTAG; } @@ -924,7 +933,7 @@ return buffer; case INTEGER_LITERAL: - sprintf(buffer, "INTEGER_LITERAL(%d)", lval->integer); + sprintf(buffer, "INTEGER_LITERAL(%s)", lval->string); return buffer; case FLOATING_LITERAL: diff -Nru raptor2-2.0.12/src/turtle_parser.c raptor2-2.0.13/src/turtle_parser.c --- raptor2-2.0.12/src/turtle_parser.c 2013-11-30 16:16:57.000000000 +0000 +++ raptor2-2.0.13/src/turtle_parser.c 2014-01-03 04:38:37.000000000 +0000 @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,13 +44,13 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ -#define YYPURE 1 +#define YYPURE 2 /* Push parsers. */ #define YYPUSH 0 @@ -58,23 +58,17 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse turtle_parser_parse #define yylex turtle_parser_lex #define yyerror turtle_parser_error -#define yylval turtle_parser_lval -#define yychar turtle_parser_char #define yydebug turtle_parser_debug #define yynerrs turtle_parser_nerrs /* Copy the first part of user declarations. */ - -/* Line 268 of yacc.c */ -#line 31 "./turtle_parser.y" +#line 31 "./turtle_parser.y" /* yacc.c:339 */ #ifdef HAVE_CONFIG_H #include @@ -96,7 +90,6 @@ #include -#define YY_DECL int turtle_lexer_lex (YYSTYPE *turtle_parser_lval, yyscan_t yyscanner) #define YY_NO_UNISTD_H 1 #include @@ -123,35 +116,31 @@ /* the lexer does not seem to track this */ #undef RAPTOR_TURTLE_USE_ERROR_COLUMNS -/* set api.push_pull to "push" if this is defined */ +/* set api.push-pull to "push" if this is defined */ #undef TURTLE_PUSH_PARSE /* Prototypes */ -int turtle_parser_error(void* rdf_parser, const char *msg); +int turtle_parser_error(raptor_parser* rdf_parser, void* scanner, const char *msg); /* flex version 2.5.36 released 2012-07-20 added the column header prototypes */ -/* What the lexer wants */ -extern int turtle_lexer_lex (YYSTYPE *turtle_parser_lval, yyscan_t scanner); - /* Make lex/yacc interface as small as possible */ #undef yylex #define yylex turtle_lexer_lex -#define YYLEX_PARAM ((raptor_turtle_parser*)(((raptor_parser*)rdf_parser)->context))->scanner - /* Prototypes for local functions */ static void raptor_turtle_generate_statement(raptor_parser *parser, raptor_statement *triple); +#line 136 "turtle_parser.c" /* yacc.c:339 */ -/* Line 268 of yacc.c */ -#line 150 "turtle_parser.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -161,110 +150,81 @@ # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 +/* In a future release of Bison, this section will be replaced + by #include "turtle_parser.tab.h". */ +#ifndef YY_TURTLE_PARSER_TURTLE_PARSER_TAB_H_INCLUDED +# define YY_TURTLE_PARSER_TURTLE_PARSER_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int turtle_parser_debug; #endif - -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - A = 258, - HAT = 259, - DOT = 260, - COMMA = 261, - SEMICOLON = 262, - LEFT_SQUARE = 263, - RIGHT_SQUARE = 264, - LEFT_ROUND = 265, - RIGHT_ROUND = 266, - LEFT_CURLY = 267, - RIGHT_CURLY = 268, - TRUE_TOKEN = 269, - FALSE_TOKEN = 270, - PREFIX = 271, - BASE = 272, - SPARQL_PREFIX = 273, - SPARQL_BASE = 274, - STRING_LITERAL = 275, - URI_LITERAL = 276, - GRAPH_NAME_LEFT_CURLY = 277, - BLANK_LITERAL = 278, - QNAME_LITERAL = 279, - IDENTIFIER = 280, - LANGTAG = 281, - INTEGER_LITERAL = 282, - FLOATING_LITERAL = 283, - DECIMAL_LITERAL = 284, - ERROR_TOKEN = 285 - }; -#endif -/* Tokens. */ -#define A 258 -#define HAT 259 -#define DOT 260 -#define COMMA 261 -#define SEMICOLON 262 -#define LEFT_SQUARE 263 -#define RIGHT_SQUARE 264 -#define LEFT_ROUND 265 -#define RIGHT_ROUND 266 -#define LEFT_CURLY 267 -#define RIGHT_CURLY 268 -#define TRUE_TOKEN 269 -#define FALSE_TOKEN 270 -#define PREFIX 271 -#define BASE 272 -#define SPARQL_PREFIX 273 -#define SPARQL_BASE 274 -#define STRING_LITERAL 275 -#define URI_LITERAL 276 -#define GRAPH_NAME_LEFT_CURLY 277 -#define BLANK_LITERAL 278 -#define QNAME_LITERAL 279 -#define IDENTIFIER 280 -#define LANGTAG 281 -#define INTEGER_LITERAL 282 -#define FLOATING_LITERAL 283 -#define DECIMAL_LITERAL 284 -#define ERROR_TOKEN 285 - - - + enum yytokentype + { + A = 258, + HAT = 259, + DOT = 260, + COMMA = 261, + SEMICOLON = 262, + LEFT_SQUARE = 263, + RIGHT_SQUARE = 264, + LEFT_ROUND = 265, + RIGHT_ROUND = 266, + LEFT_CURLY = 267, + RIGHT_CURLY = 268, + TRUE_TOKEN = 269, + FALSE_TOKEN = 270, + PREFIX = 271, + BASE = 272, + SPARQL_PREFIX = 273, + SPARQL_BASE = 274, + STRING_LITERAL = 275, + URI_LITERAL = 276, + GRAPH_NAME_LEFT_CURLY = 277, + BLANK_LITERAL = 278, + QNAME_LITERAL = 279, + IDENTIFIER = 280, + LANGTAG = 281, + INTEGER_LITERAL = 282, + FLOATING_LITERAL = 283, + DECIMAL_LITERAL = 284, + ERROR_TOKEN = 285 + }; +#endif +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - -/* Line 293 of yacc.c */ -#line 115 "./turtle_parser.y" +#line 126 "./turtle_parser.y" /* yacc.c:355 */ unsigned char *string; raptor_term *identifier; raptor_sequence *sequence; raptor_uri *uri; - int integer; /* 0+ for a xsd:integer datatyped RDF literal */ - - -/* Line 293 of yacc.c */ -#line 256 "turtle_parser.c" -} YYSTYPE; +#line 214 "turtle_parser.c" /* yacc.c:355 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif -/* Copy the second part of user declarations. */ +int turtle_parser_parse (raptor_parser* rdf_parser, void* yyscanner); + +#endif /* !YY_TURTLE_PARSER_TURTLE_PARSER_TAB_H_INCLUDED */ + +/* Copy the second part of user declarations. */ -/* Line 343 of yacc.c */ -#line 268 "turtle_parser.c" +#line 228 "turtle_parser.c" /* yacc.c:358 */ #ifdef short # undef short @@ -278,11 +238,8 @@ #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -302,8 +259,7 @@ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -317,38 +273,67 @@ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + #if ! defined yyoverflow || YYERROR_VERBOSE @@ -367,9 +352,9 @@ # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif @@ -379,8 +364,8 @@ # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -396,7 +381,7 @@ # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -404,14 +389,12 @@ # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS # endif # endif # endif @@ -420,7 +403,7 @@ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -445,35 +428,35 @@ elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do +/* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -489,17 +472,19 @@ #define YYNNTS 27 /* YYNRULES -- Number of rules. */ #define YYNRULES 63 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 87 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 285 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -534,55 +519,20 @@ }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 5, 6, 11, 12, 17, 19, 20, - 22, 25, 27, 31, 34, 35, 37, 39, 42, 45, - 48, 51, 55, 57, 60, 62, 64, 66, 71, 74, - 77, 79, 81, 86, 90, 94, 97, 99, 101, 103, - 105, 107, 109, 111, 113, 115, 118, 123, 128, 132, - 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, - 155, 157, 161, 165 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 32, 0, -1, 39, -1, -1, 22, 34, 36, 13, - -1, -1, 12, 35, 36, 13, -1, 37, -1, -1, - 38, -1, 38, 5, -1, 41, -1, 38, 5, 41, - -1, 39, 40, -1, -1, 46, -1, 33, -1, 41, - 5, -1, 49, 45, -1, 56, 54, -1, 1, 5, - -1, 42, 6, 51, -1, 51, -1, 43, 51, -1, - 51, -1, 50, -1, 3, -1, 45, 7, 44, 42, - -1, 44, 42, -1, 45, 7, -1, 47, -1, 48, - -1, 16, 25, 21, 5, -1, 18, 25, 21, -1, - 17, 21, 5, -1, 19, 21, -1, 53, -1, 55, - -1, 57, -1, 53, -1, 53, -1, 55, -1, 57, - -1, 56, -1, 52, -1, 20, 26, -1, 20, 26, - 4, 21, -1, 20, 26, 4, 24, -1, 20, 4, - 21, -1, 20, 4, 24, -1, 20, -1, 27, -1, - 28, -1, 29, -1, 14, -1, 15, -1, 21, -1, - 24, -1, 45, -1, -1, 23, -1, 8, 54, 9, - -1, 10, 43, 11, -1, 10, 11, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 186, 186, 191, 190, 223, 222, 250, 251, 255, - 256, 259, 260, 263, 264, 267, 268, 269, 272, 313, - 354, 358, 398, 442, 482, 526, 536, 549, 610, 642, - 653, 653, 656, 690, 727, 736, 747, 751, 755, 762, - 769, 773, 777, 781, 785, 798, 811, 835, 859, 876, - 892, 904, 918, 932, 950, 963, 979, 993, 1010, 1015, - 1020, 1039, 1093, 1195 + 0, 196, 196, 201, 200, 233, 232, 258, 259, 262, + 263, 266, 267, 270, 271, 274, 275, 276, 279, 320, + 361, 365, 405, 449, 489, 533, 543, 556, 617, 649, + 660, 660, 663, 697, 734, 742, 752, 756, 760, 767, + 774, 778, 782, 786, 790, 803, 815, 838, 861, 877, + 892, 903, 916, 929, 946, 959, 975, 989, 1006, 1010, + 1017, 1035, 1089, 1191 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -599,13 +549,13 @@ "itemList", "verb", "predicateObjectList", "directive", "prefix", "base", "subject", "predicate", "object", "literal", "resource", "predicateObjectListOpt", "blankNode", "blankNodePropertyList", - "collection", 0 + "collection", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -615,57 +565,18 @@ }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 31, 32, 34, 33, 35, 33, 36, 36, 37, - 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, - 41, 42, 42, 43, 43, 44, 44, 45, 45, 45, - 46, 46, 47, 47, 48, 48, 49, 49, 49, 50, - 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, - 52, 52, 52, 52, 52, 52, 53, 53, 54, 54, - 55, 56, 57, 57 -}; +#define YYPACT_NINF -14 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 0, 4, 0, 4, 1, 0, 1, - 2, 1, 3, 2, 0, 1, 1, 2, 2, 2, - 2, 3, 1, 2, 1, 1, 1, 4, 2, 2, - 1, 1, 4, 3, 3, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 4, 4, 3, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 3, 3, 2 -}; +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-14))) -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 14, 0, 0, 1, 0, 59, 0, 5, 0, 0, - 0, 0, 56, 3, 60, 57, 16, 13, 0, 15, - 30, 31, 0, 36, 37, 59, 38, 20, 26, 0, - 58, 25, 39, 0, 63, 54, 55, 50, 51, 52, - 53, 0, 24, 44, 40, 41, 43, 42, 0, 0, - 0, 0, 35, 0, 17, 18, 19, 28, 22, 29, - 61, 0, 45, 62, 23, 0, 7, 9, 11, 0, - 34, 33, 0, 0, 0, 48, 49, 0, 6, 0, - 32, 4, 21, 27, 46, 47, 12 -}; +#define YYTABLE_NINF -11 -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 1, 16, 53, 48, 65, 66, 67, 2, 17, - 68, 57, 41, 29, 30, 19, 20, 21, 22, 31, - 58, 43, 44, 33, 45, 46, 47 -}; +#define yytable_value_is_error(Yytable_value) \ + 0 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -14 + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { -14, 6, 9, -14, 10, 15, 92, -14, -11, 14, @@ -679,7 +590,23 @@ -14, -14, -14, 37, -14, -14, -14 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 14, 0, 0, 1, 0, 59, 0, 5, 0, 0, + 0, 0, 56, 3, 60, 57, 16, 13, 0, 15, + 30, 31, 0, 36, 37, 59, 38, 20, 26, 0, + 58, 25, 39, 0, 63, 54, 55, 50, 51, 52, + 53, 0, 24, 44, 40, 41, 43, 42, 0, 0, + 0, 0, 35, 0, 17, 18, 19, 28, 22, 29, + 61, 0, 45, 62, 23, 0, 7, 9, 11, 0, + 34, 33, 0, 0, 0, 48, 49, 0, 6, 0, + 32, 4, 21, 27, 46, 47, 12 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -14, -14, -14, -14, -14, 11, -14, -14, -14, -14, @@ -687,10 +614,17 @@ 1, -14, -2, 42, -1, 0, 2 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -11 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + -1, 1, 16, 53, 48, 65, 66, 67, 2, 17, + 68, 57, 41, 29, 30, 19, 20, 21, 22, 31, + 58, 43, 44, 33, 45, 46, 47 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int8 yytable[] = { 23, 24, 25, 32, 26, 18, 3, 42, 75, -2, @@ -712,12 +646,6 @@ 15, 0, 0, 38, 39, 40 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-14)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - static const yytype_int8 yycheck[] = { 2, 2, 2, 5, 2, 2, 0, 6, 21, 0, @@ -739,8 +667,8 @@ 24, -1, -1, 27, 28, 29 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 32, 39, 0, 1, 8, 10, 12, 16, 17, @@ -754,94 +682,65 @@ 5, 13, 51, 42, 21, 24, 41 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 31, 32, 34, 33, 35, 33, 36, 36, 37, + 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, + 41, 42, 42, 43, 43, 44, 44, 45, 45, 45, + 46, 46, 47, 47, 48, 48, 49, 49, 49, 50, + 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 53, 53, 54, 54, + 55, 56, 57, 57 +}; -#define YYRECOVERING() (!!yyerrstatus) + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 0, 4, 0, 4, 1, 0, 1, + 2, 1, 3, 2, 0, 1, 1, 2, 2, 2, + 2, 3, 1, 2, 1, 1, 1, 4, 2, 2, + 1, 1, 4, 3, 3, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 4, 4, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 1, 3, 3, 2 +}; -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (rdf_parser, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* 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 (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (rdf_parser, yyscanner, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval) -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -851,56 +750,48 @@ # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, rdf_parser); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, raptor_parser* rdf_parser) -#else +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, rdf_parser, yyscanner); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, rdf_parser) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - raptor_parser* rdf_parser; -#endif +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, raptor_parser* rdf_parser, void* yyscanner) { + FILE *yyo = yyoutput; + YYUSE (yyo); + YYUSE (rdf_parser); + YYUSE (yyscanner); if (!yyvaluep) return; - YYUSE (rdf_parser); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -908,25 +799,13 @@ | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, raptor_parser* rdf_parser) -#else static void -yy_symbol_print (yyoutput, yytype, yyvaluep, rdf_parser) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - raptor_parser* rdf_parser; -#endif +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, raptor_parser* rdf_parser, void* yyscanner) { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep, rdf_parser); + yy_symbol_value_print (yyoutput, yytype, yyvaluep, rdf_parser, yyscanner); YYFPRINTF (yyoutput, ")"); } @@ -935,16 +814,8 @@ | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -955,50 +826,42 @@ YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule, raptor_parser* rdf_parser) -#else static void -yy_reduce_print (yyvsp, yyrule, rdf_parser) - YYSTYPE *yyvsp; - int yyrule; - raptor_parser* rdf_parser; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, raptor_parser* rdf_parser, void* yyscanner) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , rdf_parser); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , rdf_parser, yyscanner); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule, rdf_parser); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, rdf_parser, yyscanner); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1012,7 +875,7 @@ /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1035,15 +898,8 @@ # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1059,16 +915,8 @@ # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1098,27 +946,27 @@ char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1141,12 +989,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = 0; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1154,10 +1001,6 @@ int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1206,11 +1049,13 @@ break; } yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } } } } @@ -1230,10 +1075,12 @@ # undef YYCASE_ } - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } if (*yymsg_alloc < yysize) { @@ -1270,335 +1117,234 @@ | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, raptor_parser* rdf_parser) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, rdf_parser) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - raptor_parser* rdf_parser; -#endif +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, raptor_parser* rdf_parser, void* yyscanner) { YYUSE (yyvaluep); YYUSE (rdf_parser); - + YYUSE (yyscanner); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN switch (yytype) { - case 20: /* "\"string literal\"" */ - -/* Line 1391 of yacc.c */ -#line 164 "./turtle_parser.y" - { - if((yyvaluep->string)) - RAPTOR_FREE(char*, (yyvaluep->string)); -}; + case 20: /* "string literal" */ +#line 174 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1140 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1307 "turtle_parser.c" - break; - case 21: /* "\"URI literal\"" */ - -/* Line 1391 of yacc.c */ -#line 169 "./turtle_parser.y" - { - if((yyvaluep->uri)) - raptor_free_uri((yyvaluep->uri)); -}; + case 21: /* "URI literal" */ +#line 179 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).uri)) + raptor_free_uri(((*yyvaluep).uri)); +} +#line 1149 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1319 "turtle_parser.c" - break; - case 23: /* "\"blank node\"" */ - -/* Line 1391 of yacc.c */ -#line 164 "./turtle_parser.y" - { - if((yyvaluep->string)) - RAPTOR_FREE(char*, (yyvaluep->string)); -}; + case 23: /* "blank node" */ +#line 174 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1158 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1331 "turtle_parser.c" - break; - case 24: /* "\"QName\"" */ - -/* Line 1391 of yacc.c */ -#line 169 "./turtle_parser.y" - { - if((yyvaluep->uri)) - raptor_free_uri((yyvaluep->uri)); -}; + case 24: /* "QName" */ +#line 179 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).uri)) + raptor_free_uri(((*yyvaluep).uri)); +} +#line 1167 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1343 "turtle_parser.c" - break; - case 25: /* "\"identifier\"" */ - -/* Line 1391 of yacc.c */ -#line 164 "./turtle_parser.y" - { - if((yyvaluep->string)) - RAPTOR_FREE(char*, (yyvaluep->string)); -}; + case 25: /* "identifier" */ +#line 174 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1176 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1355 "turtle_parser.c" - break; - case 26: /* "\"langtag\"" */ - -/* Line 1391 of yacc.c */ -#line 164 "./turtle_parser.y" - { - if((yyvaluep->string)) - RAPTOR_FREE(char*, (yyvaluep->string)); -}; + case 26: /* "langtag" */ +#line 174 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1185 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1367 "turtle_parser.c" - break; - case 27: /* "\"integer literal\"" */ - -/* Line 1391 of yacc.c */ -#line 164 "./turtle_parser.y" - { - if((yyvaluep->string)) - RAPTOR_FREE(char*, (yyvaluep->string)); -}; + case 27: /* "integer literal" */ +#line 174 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1194 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1379 "turtle_parser.c" - break; - case 28: /* "\"floating point literal\"" */ - -/* Line 1391 of yacc.c */ -#line 164 "./turtle_parser.y" - { - if((yyvaluep->string)) - RAPTOR_FREE(char*, (yyvaluep->string)); -}; + case 28: /* "floating point literal" */ +#line 174 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1203 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1391 "turtle_parser.c" - break; - case 29: /* "\"decimal literal\"" */ - -/* Line 1391 of yacc.c */ -#line 164 "./turtle_parser.y" - { - if((yyvaluep->string)) - RAPTOR_FREE(char*, (yyvaluep->string)); -}; + case 29: /* "decimal literal" */ +#line 174 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1212 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1403 "turtle_parser.c" - break; - case 42: /* "objectList" */ - -/* Line 1391 of yacc.c */ -#line 179 "./turtle_parser.y" - { - if((yyvaluep->sequence)) - raptor_free_sequence((yyvaluep->sequence)); -}; + case 42: /* objectList */ +#line 189 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).sequence)) + raptor_free_sequence(((*yyvaluep).sequence)); +} +#line 1221 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1415 "turtle_parser.c" - break; - case 43: /* "itemList" */ - -/* Line 1391 of yacc.c */ -#line 179 "./turtle_parser.y" - { - if((yyvaluep->sequence)) - raptor_free_sequence((yyvaluep->sequence)); -}; + case 43: /* itemList */ +#line 189 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).sequence)) + raptor_free_sequence(((*yyvaluep).sequence)); +} +#line 1230 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1427 "turtle_parser.c" - break; - case 44: /* "verb" */ - -/* Line 1391 of yacc.c */ -#line 174 "./turtle_parser.y" - { - if((yyvaluep->identifier)) - raptor_free_term((yyvaluep->identifier)); -}; + case 44: /* verb */ +#line 184 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1239 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1439 "turtle_parser.c" - break; - case 45: /* "predicateObjectList" */ - -/* Line 1391 of yacc.c */ -#line 179 "./turtle_parser.y" - { - if((yyvaluep->sequence)) - raptor_free_sequence((yyvaluep->sequence)); -}; + case 45: /* predicateObjectList */ +#line 189 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).sequence)) + raptor_free_sequence(((*yyvaluep).sequence)); +} +#line 1248 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1451 "turtle_parser.c" - break; - case 49: /* "subject" */ - -/* Line 1391 of yacc.c */ -#line 174 "./turtle_parser.y" - { - if((yyvaluep->identifier)) - raptor_free_term((yyvaluep->identifier)); -}; + case 49: /* subject */ +#line 184 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1257 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1463 "turtle_parser.c" - break; - case 50: /* "predicate" */ - -/* Line 1391 of yacc.c */ -#line 174 "./turtle_parser.y" - { - if((yyvaluep->identifier)) - raptor_free_term((yyvaluep->identifier)); -}; + case 50: /* predicate */ +#line 184 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1266 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1475 "turtle_parser.c" - break; - case 51: /* "object" */ - -/* Line 1391 of yacc.c */ -#line 174 "./turtle_parser.y" - { - if((yyvaluep->identifier)) - raptor_free_term((yyvaluep->identifier)); -}; + case 51: /* object */ +#line 184 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1275 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1487 "turtle_parser.c" - break; - case 52: /* "literal" */ - -/* Line 1391 of yacc.c */ -#line 174 "./turtle_parser.y" - { - if((yyvaluep->identifier)) - raptor_free_term((yyvaluep->identifier)); -}; + case 52: /* literal */ +#line 184 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1284 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1499 "turtle_parser.c" - break; - case 53: /* "resource" */ - -/* Line 1391 of yacc.c */ -#line 174 "./turtle_parser.y" - { - if((yyvaluep->identifier)) - raptor_free_term((yyvaluep->identifier)); -}; + case 53: /* resource */ +#line 184 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1293 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1511 "turtle_parser.c" - break; - case 54: /* "predicateObjectListOpt" */ - -/* Line 1391 of yacc.c */ -#line 179 "./turtle_parser.y" - { - if((yyvaluep->sequence)) - raptor_free_sequence((yyvaluep->sequence)); -}; + case 54: /* predicateObjectListOpt */ +#line 189 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).sequence)) + raptor_free_sequence(((*yyvaluep).sequence)); +} +#line 1302 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1523 "turtle_parser.c" - break; - case 55: /* "blankNode" */ - -/* Line 1391 of yacc.c */ -#line 174 "./turtle_parser.y" - { - if((yyvaluep->identifier)) - raptor_free_term((yyvaluep->identifier)); -}; + case 55: /* blankNode */ +#line 184 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1311 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1535 "turtle_parser.c" - break; - case 57: /* "collection" */ - -/* Line 1391 of yacc.c */ -#line 174 "./turtle_parser.y" - { - if((yyvaluep->identifier)) - raptor_free_term((yyvaluep->identifier)); -}; + case 57: /* collection */ +#line 184 "./turtle_parser.y" /* yacc.c:1257 */ + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1320 "turtle_parser.c" /* yacc.c:1257 */ + break; -/* Line 1391 of yacc.c */ -#line 1547 "turtle_parser.c" - break; default: - break; + break; } + YY_IGNORE_MAYBE_UNINITIALIZED_END } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (raptor_parser* rdf_parser); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ /*----------. | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (raptor_parser* rdf_parser) -#else -int -yyparse (rdf_parser) - raptor_parser* rdf_parser; -#endif -#endif +yyparse (raptor_parser* rdf_parser, void* yyscanner) { /* The lookahead symbol. */ int yychar; + /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Number of syntax errors so far. */ int yynerrs; @@ -1608,10 +1354,10 @@ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -1629,7 +1375,7 @@ int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -1647,9 +1393,8 @@ Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1658,14 +1403,6 @@ yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -1686,23 +1423,23 @@ #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); - yyss = yyss1; - yyvs = yyvs1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1710,22 +1447,22 @@ # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1734,10 +1471,10 @@ yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1766,7 +1503,7 @@ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval, yyscanner); } if (yychar <= YYEOF) @@ -1806,7 +1543,9 @@ yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -1829,7 +1568,7 @@ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1843,209 +1582,199 @@ switch (yyn) { case 3: - -/* Line 1806 of yacc.c */ -#line 191 "./turtle_parser.y" +#line 201 "./turtle_parser.y" /* yacc.c:1646 */ { /* action in mid-rule so this is run BEFORE the triples in graphBody */ - raptor_parser* parser = (raptor_parser *)rdf_parser; raptor_turtle_parser* turtle_parser; - turtle_parser = (raptor_turtle_parser*)parser->context; + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; if(!turtle_parser->trig) - turtle_parser_error(rdf_parser, "{ ... } is not allowed in Turtle"); + turtle_parser_error(rdf_parser, yyscanner, "{ ... } is not allowed in Turtle"); else { if(turtle_parser->graph_name) raptor_free_term(turtle_parser->graph_name); - turtle_parser->graph_name = raptor_new_term_from_uri(((raptor_parser*)rdf_parser)->world, (yyvsp[(1) - (1)].uri)); - raptor_free_uri((yyvsp[(1) - (1)].uri)); - raptor_parser_start_graph(parser, turtle_parser->graph_name->value.uri, 1); + turtle_parser->graph_name = raptor_new_term_from_uri(rdf_parser->world, (yyvsp[0].uri)); + raptor_free_uri((yyvsp[0].uri)); + raptor_parser_start_graph(rdf_parser, + turtle_parser->graph_name->value.uri, 1); } } +#line 1603 "turtle_parser.c" /* yacc.c:1646 */ break; case 4: - -/* Line 1806 of yacc.c */ -#line 208 "./turtle_parser.y" +#line 218 "./turtle_parser.y" /* yacc.c:1646 */ { - raptor_parser* parser = (raptor_parser *)rdf_parser; raptor_turtle_parser* turtle_parser; - turtle_parser = (raptor_turtle_parser*)parser->context; + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; if(turtle_parser->trig) { - raptor_parser_end_graph(parser, turtle_parser->graph_name->value.uri, 1); + raptor_parser_end_graph(rdf_parser, + turtle_parser->graph_name->value.uri, 1); raptor_free_term(turtle_parser->graph_name); turtle_parser->graph_name = NULL; - parser->emitted_default_graph = 0; + rdf_parser->emitted_default_graph = 0; } } +#line 1621 "turtle_parser.c" /* yacc.c:1646 */ break; case 5: - -/* Line 1806 of yacc.c */ -#line 223 "./turtle_parser.y" +#line 233 "./turtle_parser.y" /* yacc.c:1646 */ { /* action in mid-rule so this is run BEFORE the triples in graphBody */ - raptor_parser* parser = (raptor_parser *)rdf_parser; raptor_turtle_parser* turtle_parser; - turtle_parser = (raptor_turtle_parser*)parser->context; + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; if(!turtle_parser->trig) - turtle_parser_error(rdf_parser, "{ ... } is not allowed in Turtle"); + turtle_parser_error(rdf_parser, yyscanner, "{ ... } is not allowed in Turtle"); else { - raptor_parser_start_graph(parser, NULL, 1); - parser->emitted_default_graph++; + raptor_parser_start_graph(rdf_parser, NULL, 1); + rdf_parser->emitted_default_graph++; } } +#line 1638 "turtle_parser.c" /* yacc.c:1646 */ break; case 6: - -/* Line 1806 of yacc.c */ -#line 237 "./turtle_parser.y" +#line 246 "./turtle_parser.y" /* yacc.c:1646 */ { - raptor_parser* parser = (raptor_parser *)rdf_parser; raptor_turtle_parser* turtle_parser; - turtle_parser = (raptor_turtle_parser*)parser->context; + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; if(turtle_parser->trig) { - raptor_parser_end_graph(parser, NULL, 1); - parser->emitted_default_graph = 0; + raptor_parser_end_graph(rdf_parser, NULL, 1); + rdf_parser->emitted_default_graph = 0; } } +#line 1652 "turtle_parser.c" /* yacc.c:1646 */ break; case 18: - -/* Line 1806 of yacc.c */ -#line 273 "./turtle_parser.y" +#line 280 "./turtle_parser.y" /* yacc.c:1646 */ { int i; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("triples 1\n subject="); - if((yyvsp[(1) - (2)].identifier)) - raptor_term_print_as_ntriples((yyvsp[(1) - (2)].identifier), stdout); + if((yyvsp[-1].identifier)) + raptor_term_print_as_ntriples((yyvsp[-1].identifier), stdout); else fputs("NULL", stdout); - if((yyvsp[(2) - (2)].sequence)) { + if((yyvsp[0].sequence)) { printf("\n predicateObjectList (reverse order to syntax)="); - raptor_sequence_print((yyvsp[(2) - (2)].sequence), stdout); + raptor_sequence_print((yyvsp[0].sequence), stdout); printf("\n"); } else printf("\n and empty predicateObjectList\n"); #endif - if((yyvsp[(1) - (2)].identifier) && (yyvsp[(2) - (2)].sequence)) { + if((yyvsp[-1].identifier) && (yyvsp[0].sequence)) { /* have subject and non-empty property list, handle it */ - for(i = 0; i < raptor_sequence_size((yyvsp[(2) - (2)].sequence)); i++) { - raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[(2) - (2)].sequence), i); - t2->subject = raptor_term_copy((yyvsp[(1) - (2)].identifier)); + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + t2->subject = raptor_term_copy((yyvsp[-1].identifier)); } #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf(" after substitution predicateObjectList="); - raptor_sequence_print((yyvsp[(2) - (2)].sequence), stdout); + raptor_sequence_print((yyvsp[0].sequence), stdout); printf("\n\n"); #endif - for(i = 0; i < raptor_sequence_size((yyvsp[(2) - (2)].sequence)); i++) { - raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[(2) - (2)].sequence), i); - raptor_turtle_generate_statement((raptor_parser*)rdf_parser, t2); + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + raptor_turtle_generate_statement(rdf_parser, t2); } } - if((yyvsp[(2) - (2)].sequence)) - raptor_free_sequence((yyvsp[(2) - (2)].sequence)); + if((yyvsp[0].sequence)) + raptor_free_sequence((yyvsp[0].sequence)); - if((yyvsp[(1) - (2)].identifier)) - raptor_free_term((yyvsp[(1) - (2)].identifier)); + if((yyvsp[-1].identifier)) + raptor_free_term((yyvsp[-1].identifier)); } +#line 1697 "turtle_parser.c" /* yacc.c:1646 */ break; case 19: - -/* Line 1806 of yacc.c */ -#line 314 "./turtle_parser.y" +#line 321 "./turtle_parser.y" /* yacc.c:1646 */ { int i; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("triples 2\n blankNodePropertyList="); - if((yyvsp[(1) - (2)].identifier)) - raptor_term_print_as_ntriples((yyvsp[(1) - (2)].identifier), stdout); + if((yyvsp[-1].identifier)) + raptor_term_print_as_ntriples((yyvsp[-1].identifier), stdout); else fputs("NULL", stdout); - if((yyvsp[(2) - (2)].sequence)) { + if((yyvsp[0].sequence)) { printf("\n predicateObjectListOpt (reverse order to syntax)="); - raptor_sequence_print((yyvsp[(2) - (2)].sequence), stdout); + raptor_sequence_print((yyvsp[0].sequence), stdout); printf("\n"); } else printf("\n and empty predicateObjectListOpt\n"); #endif - if((yyvsp[(1) - (2)].identifier) && (yyvsp[(2) - (2)].sequence)) { + if((yyvsp[-1].identifier) && (yyvsp[0].sequence)) { /* have subject and non-empty predicate object list, handle it */ - for(i = 0; i < raptor_sequence_size((yyvsp[(2) - (2)].sequence)); i++) { - raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[(2) - (2)].sequence), i); - t2->subject = raptor_term_copy((yyvsp[(1) - (2)].identifier)); + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + t2->subject = raptor_term_copy((yyvsp[-1].identifier)); } #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf(" after substitution predicateObjectListOpt="); - raptor_sequence_print((yyvsp[(2) - (2)].sequence), stdout); + raptor_sequence_print((yyvsp[0].sequence), stdout); printf("\n\n"); #endif - for(i = 0; i < raptor_sequence_size((yyvsp[(2) - (2)].sequence)); i++) { - raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[(2) - (2)].sequence), i); - raptor_turtle_generate_statement((raptor_parser*)rdf_parser, t2); + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + raptor_turtle_generate_statement(rdf_parser, t2); } } - if((yyvsp[(2) - (2)].sequence)) - raptor_free_sequence((yyvsp[(2) - (2)].sequence)); + if((yyvsp[0].sequence)) + raptor_free_sequence((yyvsp[0].sequence)); - if((yyvsp[(1) - (2)].identifier)) - raptor_free_term((yyvsp[(1) - (2)].identifier)); + if((yyvsp[-1].identifier)) + raptor_free_term((yyvsp[-1].identifier)); } +#line 1742 "turtle_parser.c" /* yacc.c:1646 */ break; case 21: - -/* Line 1806 of yacc.c */ -#line 359 "./turtle_parser.y" +#line 366 "./turtle_parser.y" /* yacc.c:1646 */ { raptor_statement *triple; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("objectList 1\n"); - if((yyvsp[(3) - (3)].identifier)) { + if((yyvsp[0].identifier)) { printf(" object=\n"); - raptor_term_print_as_ntriples((yyvsp[(3) - (3)].identifier), stdout); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); printf("\n"); } else printf(" and empty object\n"); - if((yyvsp[(1) - (3)].sequence)) { + if((yyvsp[-2].sequence)) { printf(" objectList="); - raptor_sequence_print((yyvsp[(1) - (3)].sequence), stdout); + raptor_sequence_print((yyvsp[-2].sequence), stdout); printf("\n"); } else printf(" and empty objectList\n"); #endif - if(!(yyvsp[(3) - (3)].identifier)) + if(!(yyvsp[0].identifier)) (yyval.sequence) = NULL; else { - triple = raptor_new_statement_from_nodes(((raptor_parser*)rdf_parser)->world, NULL, NULL, (yyvsp[(3) - (3)].identifier), NULL); + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, (yyvsp[0].identifier), NULL); if(!triple) { - raptor_free_sequence((yyvsp[(1) - (3)].sequence)); + raptor_free_sequence((yyvsp[-2].sequence)); YYERROR; } - if(raptor_sequence_push((yyvsp[(1) - (3)].sequence), triple)) { - raptor_free_sequence((yyvsp[(1) - (3)].sequence)); + if(raptor_sequence_push((yyvsp[-2].sequence), triple)) { + raptor_free_sequence((yyvsp[-2].sequence)); YYERROR; } - (yyval.sequence) = (yyvsp[(1) - (3)].sequence); + (yyval.sequence) = (yyvsp[-2].sequence); #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf(" objectList is now "); raptor_sequence_print((yyval.sequence), stdout); @@ -2053,29 +1782,28 @@ #endif } } +#line 1786 "turtle_parser.c" /* yacc.c:1646 */ break; case 22: - -/* Line 1806 of yacc.c */ -#line 399 "./turtle_parser.y" +#line 406 "./turtle_parser.y" /* yacc.c:1646 */ { raptor_statement *triple; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("objectList 2\n"); - if((yyvsp[(1) - (1)].identifier)) { + if((yyvsp[0].identifier)) { printf(" object=\n"); - raptor_term_print_as_ntriples((yyvsp[(1) - (1)].identifier), stdout); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); printf("\n"); } else printf(" and empty object\n"); #endif - if(!(yyvsp[(1) - (1)].identifier)) + if(!(yyvsp[0].identifier)) (yyval.sequence) = NULL; else { - triple = raptor_new_statement_from_nodes(((raptor_parser*)rdf_parser)->world, NULL, NULL, (yyvsp[(1) - (1)].identifier), NULL); + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, (yyvsp[0].identifier), NULL); if(!triple) YYERROR; #ifdef RAPTOR_DEBUG @@ -2100,44 +1828,43 @@ #endif } } +#line 1832 "turtle_parser.c" /* yacc.c:1646 */ break; case 23: - -/* Line 1806 of yacc.c */ -#line 443 "./turtle_parser.y" +#line 450 "./turtle_parser.y" /* yacc.c:1646 */ { raptor_statement *triple; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("objectList 1\n"); - if((yyvsp[(2) - (2)].identifier)) { + if((yyvsp[0].identifier)) { printf(" object=\n"); - raptor_term_print_as_ntriples((yyvsp[(2) - (2)].identifier), stdout); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); printf("\n"); } else printf(" and empty object\n"); - if((yyvsp[(1) - (2)].sequence)) { + if((yyvsp[-1].sequence)) { printf(" objectList="); - raptor_sequence_print((yyvsp[(1) - (2)].sequence), stdout); + raptor_sequence_print((yyvsp[-1].sequence), stdout); printf("\n"); } else printf(" and empty objectList\n"); #endif - if(!(yyvsp[(2) - (2)].identifier)) + if(!(yyvsp[0].identifier)) (yyval.sequence) = NULL; else { - triple = raptor_new_statement_from_nodes(((raptor_parser*)rdf_parser)->world, NULL, NULL, (yyvsp[(2) - (2)].identifier), NULL); + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, (yyvsp[0].identifier), NULL); if(!triple) { - raptor_free_sequence((yyvsp[(1) - (2)].sequence)); + raptor_free_sequence((yyvsp[-1].sequence)); YYERROR; } - if(raptor_sequence_push((yyvsp[(1) - (2)].sequence), triple)) { - raptor_free_sequence((yyvsp[(1) - (2)].sequence)); + if(raptor_sequence_push((yyvsp[-1].sequence), triple)) { + raptor_free_sequence((yyvsp[-1].sequence)); YYERROR; } - (yyval.sequence) = (yyvsp[(1) - (2)].sequence); + (yyval.sequence) = (yyvsp[-1].sequence); #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf(" objectList is now "); raptor_sequence_print((yyval.sequence), stdout); @@ -2145,29 +1872,28 @@ #endif } } +#line 1876 "turtle_parser.c" /* yacc.c:1646 */ break; case 24: - -/* Line 1806 of yacc.c */ -#line 483 "./turtle_parser.y" +#line 490 "./turtle_parser.y" /* yacc.c:1646 */ { raptor_statement *triple; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("objectList 2\n"); - if((yyvsp[(1) - (1)].identifier)) { + if((yyvsp[0].identifier)) { printf(" object=\n"); - raptor_term_print_as_ntriples((yyvsp[(1) - (1)].identifier), stdout); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); printf("\n"); } else printf(" and empty object\n"); #endif - if(!(yyvsp[(1) - (1)].identifier)) + if(!(yyvsp[0].identifier)) (yyval.sequence) = NULL; else { - triple = raptor_new_statement_from_nodes(((raptor_parser*)rdf_parser)->world, NULL, NULL, (yyvsp[(1) - (1)].identifier), NULL); + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, (yyvsp[0].identifier), NULL); if(!triple) YYERROR; #ifdef RAPTOR_DEBUG @@ -2192,166 +1918,160 @@ #endif } } +#line 1922 "turtle_parser.c" /* yacc.c:1646 */ break; case 25: - -/* Line 1806 of yacc.c */ -#line 527 "./turtle_parser.y" +#line 534 "./turtle_parser.y" /* yacc.c:1646 */ { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("verb predicate="); - raptor_term_print_as_ntriples((yyvsp[(1) - (1)].identifier), stdout); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); printf("\n"); #endif - (yyval.identifier) = (yyvsp[(1) - (1)].identifier); + (yyval.identifier) = (yyvsp[0].identifier); } +#line 1936 "turtle_parser.c" /* yacc.c:1646 */ break; case 26: - -/* Line 1806 of yacc.c */ -#line 537 "./turtle_parser.y" +#line 544 "./turtle_parser.y" /* yacc.c:1646 */ { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("verb predicate = rdf:type (a)\n"); #endif - (yyval.identifier) = raptor_term_copy(RAPTOR_RDF_type_term(((raptor_parser*)rdf_parser)->world)); + (yyval.identifier) = raptor_term_copy(RAPTOR_RDF_type_term(rdf_parser->world)); if(!(yyval.identifier)) YYERROR; } +#line 1950 "turtle_parser.c" /* yacc.c:1646 */ break; case 27: - -/* Line 1806 of yacc.c */ -#line 550 "./turtle_parser.y" +#line 557 "./turtle_parser.y" /* yacc.c:1646 */ { int i; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("predicateObjectList 1\n verb="); - raptor_term_print_as_ntriples((yyvsp[(3) - (4)].identifier), stdout); + raptor_term_print_as_ntriples((yyvsp[-1].identifier), stdout); printf("\n objectList="); - raptor_sequence_print((yyvsp[(4) - (4)].sequence), stdout); + raptor_sequence_print((yyvsp[0].sequence), stdout); printf("\n predicateObjectList="); - raptor_sequence_print((yyvsp[(1) - (4)].sequence), stdout); + raptor_sequence_print((yyvsp[-3].sequence), stdout); printf("\n\n"); #endif - if((yyvsp[(4) - (4)].sequence) == NULL) { + if((yyvsp[0].sequence) == NULL) { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf(" empty objectList not processed\n"); #endif - } else if((yyvsp[(3) - (4)].identifier) && (yyvsp[(4) - (4)].sequence)) { + } else if((yyvsp[-1].identifier) && (yyvsp[0].sequence)) { /* non-empty property list, handle it */ - for(i = 0; i < raptor_sequence_size((yyvsp[(4) - (4)].sequence)); i++) { - raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[(4) - (4)].sequence), i); - t2->predicate = raptor_term_copy((yyvsp[(3) - (4)].identifier)); + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + t2->predicate = raptor_term_copy((yyvsp[-1].identifier)); } #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf(" after substitution objectList="); - raptor_sequence_print((yyvsp[(4) - (4)].sequence), stdout); + raptor_sequence_print((yyvsp[0].sequence), stdout); printf("\n"); #endif } - if((yyvsp[(1) - (4)].sequence) == NULL) { + if((yyvsp[-3].sequence) == NULL) { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf(" empty predicateObjectList not copied\n\n"); #endif - } else if((yyvsp[(3) - (4)].identifier) && (yyvsp[(4) - (4)].sequence) && (yyvsp[(1) - (4)].sequence)) { - while(raptor_sequence_size((yyvsp[(4) - (4)].sequence))) { - raptor_statement* t2 = (raptor_statement*)raptor_sequence_unshift((yyvsp[(4) - (4)].sequence)); - if(raptor_sequence_push((yyvsp[(1) - (4)].sequence), t2)) { - raptor_free_sequence((yyvsp[(1) - (4)].sequence)); - raptor_free_term((yyvsp[(3) - (4)].identifier)); - raptor_free_sequence((yyvsp[(4) - (4)].sequence)); + } else if((yyvsp[-1].identifier) && (yyvsp[0].sequence) && (yyvsp[-3].sequence)) { + while(raptor_sequence_size((yyvsp[0].sequence))) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_unshift((yyvsp[0].sequence)); + if(raptor_sequence_push((yyvsp[-3].sequence), t2)) { + raptor_free_sequence((yyvsp[-3].sequence)); + raptor_free_term((yyvsp[-1].identifier)); + raptor_free_sequence((yyvsp[0].sequence)); YYERROR; } } #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf(" after appending objectList (reverse order)="); - raptor_sequence_print((yyvsp[(1) - (4)].sequence), stdout); + raptor_sequence_print((yyvsp[-3].sequence), stdout); printf("\n\n"); #endif - raptor_free_sequence((yyvsp[(4) - (4)].sequence)); + raptor_free_sequence((yyvsp[0].sequence)); } - if((yyvsp[(3) - (4)].identifier)) - raptor_free_term((yyvsp[(3) - (4)].identifier)); + if((yyvsp[-1].identifier)) + raptor_free_term((yyvsp[-1].identifier)); - (yyval.sequence) = (yyvsp[(1) - (4)].sequence); + (yyval.sequence) = (yyvsp[-3].sequence); } +#line 2015 "turtle_parser.c" /* yacc.c:1646 */ break; case 28: - -/* Line 1806 of yacc.c */ -#line 611 "./turtle_parser.y" +#line 618 "./turtle_parser.y" /* yacc.c:1646 */ { int i; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("predicateObjectList 2\n verb="); - raptor_term_print_as_ntriples((yyvsp[(1) - (2)].identifier), stdout); - if((yyvsp[(2) - (2)].sequence)) { + raptor_term_print_as_ntriples((yyvsp[-1].identifier), stdout); + if((yyvsp[0].sequence)) { printf("\n objectList="); - raptor_sequence_print((yyvsp[(2) - (2)].sequence), stdout); + raptor_sequence_print((yyvsp[0].sequence), stdout); printf("\n"); } else printf("\n and empty objectList\n"); #endif - if((yyvsp[(1) - (2)].identifier) && (yyvsp[(2) - (2)].sequence)) { - for(i = 0; i < raptor_sequence_size((yyvsp[(2) - (2)].sequence)); i++) { - raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[(2) - (2)].sequence), i); - t2->predicate = raptor_term_copy((yyvsp[(1) - (2)].identifier)); + if((yyvsp[-1].identifier) && (yyvsp[0].sequence)) { + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + t2->predicate = raptor_term_copy((yyvsp[-1].identifier)); } #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf(" after substitution objectList="); - raptor_sequence_print((yyvsp[(2) - (2)].sequence), stdout); + raptor_sequence_print((yyvsp[0].sequence), stdout); printf("\n\n"); #endif } - if((yyvsp[(1) - (2)].identifier)) - raptor_free_term((yyvsp[(1) - (2)].identifier)); + if((yyvsp[-1].identifier)) + raptor_free_term((yyvsp[-1].identifier)); - (yyval.sequence) = (yyvsp[(2) - (2)].sequence); + (yyval.sequence) = (yyvsp[0].sequence); } +#line 2051 "turtle_parser.c" /* yacc.c:1646 */ break; case 29: - -/* Line 1806 of yacc.c */ -#line 643 "./turtle_parser.y" +#line 650 "./turtle_parser.y" /* yacc.c:1646 */ { - (yyval.sequence) = (yyvsp[(1) - (2)].sequence); + (yyval.sequence) = (yyvsp[-1].sequence); #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("predicateObjectList 5\n trailing semicolon returning existing list "); raptor_sequence_print((yyval.sequence), stdout); printf("\n\n"); #endif } +#line 2064 "turtle_parser.c" /* yacc.c:1646 */ break; case 32: - -/* Line 1806 of yacc.c */ -#line 657 "./turtle_parser.y" +#line 664 "./turtle_parser.y" /* yacc.c:1646 */ { - unsigned char *prefix = (yyvsp[(2) - (4)].string); - raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(((raptor_parser*)rdf_parser)->context); + unsigned char *prefix = (yyvsp[-2].string); + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(rdf_parser->context); raptor_namespace *ns; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("directive PREFIX %s %s\n",((yyvsp[(2) - (4)].string) ? (char*)(yyvsp[(2) - (4)].string) : "(default)"), raptor_uri_as_string((yyvsp[(3) - (4)].uri))); + printf("directive PREFIX %s %s\n",((yyvsp[-2].string) ? (char*)(yyvsp[-2].string) : "(default)"), raptor_uri_as_string((yyvsp[-1].uri))); #endif if(prefix) { @@ -2365,32 +2085,31 @@ } } - ns = raptor_new_namespace_from_uri(&turtle_parser->namespaces, prefix, (yyvsp[(3) - (4)].uri), 0); + ns = raptor_new_namespace_from_uri(&turtle_parser->namespaces, prefix, (yyvsp[-1].uri), 0); if(ns) { raptor_namespaces_start_namespace(&turtle_parser->namespaces, ns); - raptor_parser_start_namespace((raptor_parser*)rdf_parser, ns); + raptor_parser_start_namespace(rdf_parser, ns); } - if((yyvsp[(2) - (4)].string)) - RAPTOR_FREE(char*, (yyvsp[(2) - (4)].string)); - raptor_free_uri((yyvsp[(3) - (4)].uri)); + if((yyvsp[-2].string)) + RAPTOR_FREE(char*, (yyvsp[-2].string)); + raptor_free_uri((yyvsp[-1].uri)); if(!ns) YYERROR; } +#line 2102 "turtle_parser.c" /* yacc.c:1646 */ break; case 33: - -/* Line 1806 of yacc.c */ -#line 691 "./turtle_parser.y" +#line 698 "./turtle_parser.y" /* yacc.c:1646 */ { - unsigned char *prefix = (yyvsp[(2) - (3)].string); - raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(((raptor_parser*)rdf_parser)->context); + unsigned char *prefix = (yyvsp[-1].string); + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(rdf_parser->context); raptor_namespace *ns; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("directive @prefix %s %s.\n",((yyvsp[(2) - (3)].string) ? (char*)(yyvsp[(2) - (3)].string) : "(default)"), raptor_uri_as_string((yyvsp[(3) - (3)].uri))); + printf("directive @prefix %s %s.\n",((yyvsp[-1].string) ? (char*)(yyvsp[-1].string) : "(default)"), raptor_uri_as_string((yyvsp[0].uri))); #endif if(prefix) { @@ -2404,471 +2123,431 @@ } } - ns = raptor_new_namespace_from_uri(&turtle_parser->namespaces, prefix, (yyvsp[(3) - (3)].uri), 0); + ns = raptor_new_namespace_from_uri(&turtle_parser->namespaces, prefix, (yyvsp[0].uri), 0); if(ns) { raptor_namespaces_start_namespace(&turtle_parser->namespaces, ns); - raptor_parser_start_namespace((raptor_parser*)rdf_parser, ns); + raptor_parser_start_namespace(rdf_parser, ns); } - if((yyvsp[(2) - (3)].string)) - RAPTOR_FREE(char*, (yyvsp[(2) - (3)].string)); - raptor_free_uri((yyvsp[(3) - (3)].uri)); + if((yyvsp[-1].string)) + RAPTOR_FREE(char*, (yyvsp[-1].string)); + raptor_free_uri((yyvsp[0].uri)); if(!ns) YYERROR; } +#line 2140 "turtle_parser.c" /* yacc.c:1646 */ break; case 34: - -/* Line 1806 of yacc.c */ -#line 728 "./turtle_parser.y" +#line 735 "./turtle_parser.y" /* yacc.c:1646 */ { - raptor_uri *uri=(yyvsp[(2) - (3)].uri); - raptor_parser* parser = (raptor_parser*)rdf_parser; + raptor_uri *uri=(yyvsp[-1].uri); - if(parser->base_uri) - raptor_free_uri(parser->base_uri); - parser->base_uri = uri; + if(rdf_parser->base_uri) + raptor_free_uri(rdf_parser->base_uri); + rdf_parser->base_uri = uri; } +#line 2152 "turtle_parser.c" /* yacc.c:1646 */ break; case 35: - -/* Line 1806 of yacc.c */ -#line 737 "./turtle_parser.y" +#line 743 "./turtle_parser.y" /* yacc.c:1646 */ { - raptor_uri *uri=(yyvsp[(2) - (2)].uri); - raptor_parser* parser = (raptor_parser*)rdf_parser; + raptor_uri *uri=(yyvsp[0].uri); - if(parser->base_uri) - raptor_free_uri(parser->base_uri); - parser->base_uri = uri; + if(rdf_parser->base_uri) + raptor_free_uri(rdf_parser->base_uri); + rdf_parser->base_uri = uri; } +#line 2164 "turtle_parser.c" /* yacc.c:1646 */ break; case 36: - -/* Line 1806 of yacc.c */ -#line 748 "./turtle_parser.y" +#line 753 "./turtle_parser.y" /* yacc.c:1646 */ { - (yyval.identifier) = (yyvsp[(1) - (1)].identifier); + (yyval.identifier) = (yyvsp[0].identifier); } +#line 2172 "turtle_parser.c" /* yacc.c:1646 */ break; case 37: - -/* Line 1806 of yacc.c */ -#line 752 "./turtle_parser.y" +#line 757 "./turtle_parser.y" /* yacc.c:1646 */ { - (yyval.identifier) = (yyvsp[(1) - (1)].identifier); + (yyval.identifier) = (yyvsp[0].identifier); } +#line 2180 "turtle_parser.c" /* yacc.c:1646 */ break; case 38: - -/* Line 1806 of yacc.c */ -#line 756 "./turtle_parser.y" +#line 761 "./turtle_parser.y" /* yacc.c:1646 */ { - (yyval.identifier) = (yyvsp[(1) - (1)].identifier); + (yyval.identifier) = (yyvsp[0].identifier); } +#line 2188 "turtle_parser.c" /* yacc.c:1646 */ break; case 39: - -/* Line 1806 of yacc.c */ -#line 763 "./turtle_parser.y" +#line 768 "./turtle_parser.y" /* yacc.c:1646 */ { - (yyval.identifier) = (yyvsp[(1) - (1)].identifier); + (yyval.identifier) = (yyvsp[0].identifier); } +#line 2196 "turtle_parser.c" /* yacc.c:1646 */ break; case 40: - -/* Line 1806 of yacc.c */ -#line 770 "./turtle_parser.y" +#line 775 "./turtle_parser.y" /* yacc.c:1646 */ { - (yyval.identifier) = (yyvsp[(1) - (1)].identifier); + (yyval.identifier) = (yyvsp[0].identifier); } +#line 2204 "turtle_parser.c" /* yacc.c:1646 */ break; case 41: - -/* Line 1806 of yacc.c */ -#line 774 "./turtle_parser.y" +#line 779 "./turtle_parser.y" /* yacc.c:1646 */ { - (yyval.identifier) = (yyvsp[(1) - (1)].identifier); + (yyval.identifier) = (yyvsp[0].identifier); } +#line 2212 "turtle_parser.c" /* yacc.c:1646 */ break; case 42: - -/* Line 1806 of yacc.c */ -#line 778 "./turtle_parser.y" +#line 783 "./turtle_parser.y" /* yacc.c:1646 */ { - (yyval.identifier) = (yyvsp[(1) - (1)].identifier); + (yyval.identifier) = (yyvsp[0].identifier); } +#line 2220 "turtle_parser.c" /* yacc.c:1646 */ break; case 43: - -/* Line 1806 of yacc.c */ -#line 782 "./turtle_parser.y" +#line 787 "./turtle_parser.y" /* yacc.c:1646 */ { - (yyval.identifier) = (yyvsp[(1) - (1)].identifier); + (yyval.identifier) = (yyvsp[0].identifier); } +#line 2228 "turtle_parser.c" /* yacc.c:1646 */ break; case 44: - -/* Line 1806 of yacc.c */ -#line 786 "./turtle_parser.y" +#line 791 "./turtle_parser.y" /* yacc.c:1646 */ { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("object literal="); - raptor_term_print_as_ntriples((yyvsp[(1) - (1)].identifier), stdout); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); printf("\n"); #endif - (yyval.identifier) = (yyvsp[(1) - (1)].identifier); + (yyval.identifier) = (yyvsp[0].identifier); } +#line 2242 "turtle_parser.c" /* yacc.c:1646 */ break; case 45: - -/* Line 1806 of yacc.c */ -#line 799 "./turtle_parser.y" +#line 804 "./turtle_parser.y" /* yacc.c:1646 */ { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("literal + language string=\"%s\"\n", (yyvsp[(1) - (2)].string)); + printf("literal + language string=\"%s\"\n", (yyvsp[-1].string)); #endif - (yyval.identifier) = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - (yyvsp[(1) - (2)].string), NULL, (yyvsp[(2) - (2)].string)); - RAPTOR_FREE(char*, (yyvsp[(1) - (2)].string)); - RAPTOR_FREE(char*, (yyvsp[(2) - (2)].string)); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[-1].string), NULL, (yyvsp[0].string)); + RAPTOR_FREE(char*, (yyvsp[-1].string)); + RAPTOR_FREE(char*, (yyvsp[0].string)); if(!(yyval.identifier)) YYERROR; } +#line 2258 "turtle_parser.c" /* yacc.c:1646 */ break; case 46: - -/* Line 1806 of yacc.c */ -#line 812 "./turtle_parser.y" +#line 816 "./turtle_parser.y" /* yacc.c:1646 */ { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("literal + language=\"%s\" datatype string=\"%s\" uri=\"%s\"\n", (yyvsp[(1) - (4)].string), (yyvsp[(2) - (4)].string), raptor_uri_as_string((yyvsp[(4) - (4)].uri))); + printf("literal + language=\"%s\" datatype string=\"%s\" uri=\"%s\"\n", (yyvsp[-3].string), (yyvsp[-2].string), raptor_uri_as_string((yyvsp[0].uri))); #endif - if((yyvsp[(4) - (4)].uri)) { - if((yyvsp[(2) - (4)].string)) { - raptor_parser_error((raptor_parser*)rdf_parser, + if((yyvsp[0].uri)) { + if((yyvsp[-2].string)) { + raptor_parser_error(rdf_parser, "Language not allowed with datatyped literal"); - RAPTOR_FREE(char*, (yyvsp[(2) - (4)].string)); - (yyvsp[(2) - (4)].string) = NULL; + RAPTOR_FREE(char*, (yyvsp[-2].string)); + (yyvsp[-2].string) = NULL; } - (yyval.identifier) = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - (yyvsp[(1) - (4)].string), (yyvsp[(4) - (4)].uri), NULL); - RAPTOR_FREE(char*, (yyvsp[(1) - (4)].string)); - raptor_free_uri((yyvsp[(4) - (4)].uri)); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[-3].string), (yyvsp[0].uri), NULL); + RAPTOR_FREE(char*, (yyvsp[-3].string)); + raptor_free_uri((yyvsp[0].uri)); if(!(yyval.identifier)) YYERROR; } else (yyval.identifier) = NULL; } +#line 2285 "turtle_parser.c" /* yacc.c:1646 */ break; case 47: - -/* Line 1806 of yacc.c */ -#line 836 "./turtle_parser.y" +#line 839 "./turtle_parser.y" /* yacc.c:1646 */ { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("literal + language=\"%s\" datatype string=\"%s\" qname URI=<%s>\n", (yyvsp[(1) - (4)].string), (yyvsp[(2) - (4)].string), raptor_uri_as_string((yyvsp[(4) - (4)].uri))); + printf("literal + language=\"%s\" datatype string=\"%s\" qname URI=<%s>\n", (yyvsp[-3].string), (yyvsp[-2].string), raptor_uri_as_string((yyvsp[0].uri))); #endif - if((yyvsp[(4) - (4)].uri)) { - if((yyvsp[(2) - (4)].string)) { - raptor_parser_error((raptor_parser*)rdf_parser, + if((yyvsp[0].uri)) { + if((yyvsp[-2].string)) { + raptor_parser_error(rdf_parser, "Language not allowed with datatyped literal"); - RAPTOR_FREE(char*, (yyvsp[(2) - (4)].string)); - (yyvsp[(2) - (4)].string) = NULL; + RAPTOR_FREE(char*, (yyvsp[-2].string)); + (yyvsp[-2].string) = NULL; } - (yyval.identifier) = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - (yyvsp[(1) - (4)].string), (yyvsp[(4) - (4)].uri), NULL); - RAPTOR_FREE(char*, (yyvsp[(1) - (4)].string)); - raptor_free_uri((yyvsp[(4) - (4)].uri)); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[-3].string), (yyvsp[0].uri), NULL); + RAPTOR_FREE(char*, (yyvsp[-3].string)); + raptor_free_uri((yyvsp[0].uri)); if(!(yyval.identifier)) YYERROR; } else (yyval.identifier) = NULL; } +#line 2312 "turtle_parser.c" /* yacc.c:1646 */ break; case 48: - -/* Line 1806 of yacc.c */ -#line 860 "./turtle_parser.y" +#line 862 "./turtle_parser.y" /* yacc.c:1646 */ { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("literal + datatype string=\"%s\" uri=\"%s\"\n", (yyvsp[(1) - (3)].string), raptor_uri_as_string((yyvsp[(3) - (3)].uri))); + printf("literal + datatype string=\"%s\" uri=\"%s\"\n", (yyvsp[-2].string), raptor_uri_as_string((yyvsp[0].uri))); #endif - if((yyvsp[(3) - (3)].uri)) { - (yyval.identifier) = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].uri), NULL); - RAPTOR_FREE(char*, (yyvsp[(1) - (3)].string)); - raptor_free_uri((yyvsp[(3) - (3)].uri)); + if((yyvsp[0].uri)) { + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[-2].string), (yyvsp[0].uri), NULL); + RAPTOR_FREE(char*, (yyvsp[-2].string)); + raptor_free_uri((yyvsp[0].uri)); if(!(yyval.identifier)) YYERROR; } else (yyval.identifier) = NULL; } +#line 2332 "turtle_parser.c" /* yacc.c:1646 */ break; case 49: - -/* Line 1806 of yacc.c */ -#line 877 "./turtle_parser.y" +#line 878 "./turtle_parser.y" /* yacc.c:1646 */ { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("literal + datatype string=\"%s\" qname URI=<%s>\n", (yyvsp[(1) - (3)].string), raptor_uri_as_string((yyvsp[(3) - (3)].uri))); + printf("literal + datatype string=\"%s\" qname URI=<%s>\n", (yyvsp[-2].string), raptor_uri_as_string((yyvsp[0].uri))); #endif - if((yyvsp[(3) - (3)].uri)) { - (yyval.identifier) = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].uri), NULL); - RAPTOR_FREE(char*, (yyvsp[(1) - (3)].string)); - raptor_free_uri((yyvsp[(3) - (3)].uri)); + if((yyvsp[0].uri)) { + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[-2].string), (yyvsp[0].uri), NULL); + RAPTOR_FREE(char*, (yyvsp[-2].string)); + raptor_free_uri((yyvsp[0].uri)); if(!(yyval.identifier)) YYERROR; } else (yyval.identifier) = NULL; } +#line 2351 "turtle_parser.c" /* yacc.c:1646 */ break; case 50: - -/* Line 1806 of yacc.c */ -#line 893 "./turtle_parser.y" +#line 893 "./turtle_parser.y" /* yacc.c:1646 */ { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("literal string=\"%s\"\n", (yyvsp[(1) - (1)].string)); + printf("literal string=\"%s\"\n", (yyvsp[0].string)); #endif - (yyval.identifier) = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - (yyvsp[(1) - (1)].string), NULL, NULL); - RAPTOR_FREE(char*, (yyvsp[(1) - (1)].string)); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[0].string), NULL, NULL); + RAPTOR_FREE(char*, (yyvsp[0].string)); if(!(yyval.identifier)) YYERROR; } +#line 2366 "turtle_parser.c" /* yacc.c:1646 */ break; case 51: - -/* Line 1806 of yacc.c */ -#line 905 "./turtle_parser.y" +#line 904 "./turtle_parser.y" /* yacc.c:1646 */ { raptor_uri *uri; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("resource integer=%s\n", (yyvsp[(1) - (1)].string)); + printf("resource integer=%s\n", (yyvsp[0].string)); #endif - uri = raptor_uri_copy(((raptor_parser*)rdf_parser)->world->xsd_integer_uri); - (yyval.identifier) = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - (yyvsp[(1) - (1)].string), uri, NULL); - RAPTOR_FREE(char*, (yyvsp[(1) - (1)].string)); + uri = raptor_uri_copy(rdf_parser->world->xsd_integer_uri); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[0].string), uri, NULL); + RAPTOR_FREE(char*, (yyvsp[0].string)); raptor_free_uri(uri); if(!(yyval.identifier)) YYERROR; } +#line 2383 "turtle_parser.c" /* yacc.c:1646 */ break; case 52: - -/* Line 1806 of yacc.c */ -#line 919 "./turtle_parser.y" +#line 917 "./turtle_parser.y" /* yacc.c:1646 */ { raptor_uri *uri; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("resource double=%s\n", (yyvsp[(1) - (1)].string)); + printf("resource double=%s\n", (yyvsp[0].string)); #endif - uri = raptor_uri_copy(((raptor_parser*)rdf_parser)->world->xsd_double_uri); - (yyval.identifier) = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - (yyvsp[(1) - (1)].string), uri, NULL); - RAPTOR_FREE(char*, (yyvsp[(1) - (1)].string)); + uri = raptor_uri_copy(rdf_parser->world->xsd_double_uri); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[0].string), uri, NULL); + RAPTOR_FREE(char*, (yyvsp[0].string)); raptor_free_uri(uri); if(!(yyval.identifier)) YYERROR; } +#line 2400 "turtle_parser.c" /* yacc.c:1646 */ break; case 53: - -/* Line 1806 of yacc.c */ -#line 933 "./turtle_parser.y" +#line 930 "./turtle_parser.y" /* yacc.c:1646 */ { raptor_uri *uri; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("resource decimal=%s\n", (yyvsp[(1) - (1)].string)); + printf("resource decimal=%s\n", (yyvsp[0].string)); #endif - uri = raptor_uri_copy(((raptor_parser*)rdf_parser)->world->xsd_decimal_uri); + uri = raptor_uri_copy(rdf_parser->world->xsd_decimal_uri); if(!uri) { - RAPTOR_FREE(char*, (yyvsp[(1) - (1)].string)); + RAPTOR_FREE(char*, (yyvsp[0].string)); YYERROR; } - (yyval.identifier) = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - (yyvsp[(1) - (1)].string), uri, NULL); - RAPTOR_FREE(char*, (yyvsp[(1) - (1)].string)); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[0].string), uri, NULL); + RAPTOR_FREE(char*, (yyvsp[0].string)); raptor_free_uri(uri); if(!(yyval.identifier)) YYERROR; } +#line 2421 "turtle_parser.c" /* yacc.c:1646 */ break; case 54: - -/* Line 1806 of yacc.c */ -#line 951 "./turtle_parser.y" +#line 947 "./turtle_parser.y" /* yacc.c:1646 */ { raptor_uri *uri; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 fputs("resource boolean true\n", stderr); #endif - uri = raptor_uri_copy(((raptor_parser*)rdf_parser)->world->xsd_boolean_uri); - (yyval.identifier) = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, + uri = raptor_uri_copy(rdf_parser->world->xsd_boolean_uri); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (const unsigned char*)"true", uri, NULL); raptor_free_uri(uri); if(!(yyval.identifier)) YYERROR; } +#line 2438 "turtle_parser.c" /* yacc.c:1646 */ break; case 55: - -/* Line 1806 of yacc.c */ -#line 964 "./turtle_parser.y" +#line 960 "./turtle_parser.y" /* yacc.c:1646 */ { raptor_uri *uri; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 fputs("resource boolean false\n", stderr); #endif - uri = raptor_uri_copy(((raptor_parser*)rdf_parser)->world->xsd_boolean_uri); - (yyval.identifier) = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, + uri = raptor_uri_copy(rdf_parser->world->xsd_boolean_uri); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (const unsigned char*)"false", uri, NULL); raptor_free_uri(uri); if(!(yyval.identifier)) YYERROR; } +#line 2455 "turtle_parser.c" /* yacc.c:1646 */ break; case 56: - -/* Line 1806 of yacc.c */ -#line 980 "./turtle_parser.y" +#line 976 "./turtle_parser.y" /* yacc.c:1646 */ { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("resource URI=<%s>\n", raptor_uri_as_string((yyvsp[(1) - (1)].uri))); + printf("resource URI=<%s>\n", raptor_uri_as_string((yyvsp[0].uri))); #endif - if((yyvsp[(1) - (1)].uri)) { - (yyval.identifier) = raptor_new_term_from_uri(((raptor_parser*)rdf_parser)->world, (yyvsp[(1) - (1)].uri)); - raptor_free_uri((yyvsp[(1) - (1)].uri)); + if((yyvsp[0].uri)) { + (yyval.identifier) = raptor_new_term_from_uri(rdf_parser->world, (yyvsp[0].uri)); + raptor_free_uri((yyvsp[0].uri)); if(!(yyval.identifier)) YYERROR; } else (yyval.identifier) = NULL; } +#line 2473 "turtle_parser.c" /* yacc.c:1646 */ break; case 57: - -/* Line 1806 of yacc.c */ -#line 994 "./turtle_parser.y" +#line 990 "./turtle_parser.y" /* yacc.c:1646 */ { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("resource qname URI=<%s>\n", raptor_uri_as_string((yyvsp[(1) - (1)].uri))); + printf("resource qname URI=<%s>\n", raptor_uri_as_string((yyvsp[0].uri))); #endif - if((yyvsp[(1) - (1)].uri)) { - (yyval.identifier) = raptor_new_term_from_uri(((raptor_parser*)rdf_parser)->world, (yyvsp[(1) - (1)].uri)); - raptor_free_uri((yyvsp[(1) - (1)].uri)); + if((yyvsp[0].uri)) { + (yyval.identifier) = raptor_new_term_from_uri(rdf_parser->world, (yyvsp[0].uri)); + raptor_free_uri((yyvsp[0].uri)); if(!(yyval.identifier)) YYERROR; } else (yyval.identifier) = NULL; } +#line 2491 "turtle_parser.c" /* yacc.c:1646 */ break; case 58: - -/* Line 1806 of yacc.c */ -#line 1011 "./turtle_parser.y" +#line 1007 "./turtle_parser.y" /* yacc.c:1646 */ { - (yyval.sequence) = (yyvsp[(1) - (1)].sequence); + (yyval.sequence) = (yyvsp[0].sequence); } +#line 2499 "turtle_parser.c" /* yacc.c:1646 */ break; case 59: - -/* Line 1806 of yacc.c */ -#line 1015 "./turtle_parser.y" +#line 1011 "./turtle_parser.y" /* yacc.c:1646 */ { (yyval.sequence) = NULL; } +#line 2507 "turtle_parser.c" /* yacc.c:1646 */ break; case 60: - -/* Line 1806 of yacc.c */ -#line 1021 "./turtle_parser.y" +#line 1018 "./turtle_parser.y" /* yacc.c:1646 */ { const unsigned char *id; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 - printf("subject blank=\"%s\"\n", (yyvsp[(1) - (1)].string)); + printf("subject blank=\"%s\"\n", (yyvsp[0].string)); #endif - id = raptor_world_internal_generate_id(((raptor_parser*)rdf_parser)->world, - (yyvsp[(1) - (1)].string)); + id = raptor_world_internal_generate_id(rdf_parser->world, (yyvsp[0].string)); if(!id) YYERROR; - (yyval.identifier) = raptor_new_term_from_blank(((raptor_parser*)rdf_parser)->world, id); + (yyval.identifier) = raptor_new_term_from_blank(rdf_parser->world, id); RAPTOR_FREE(char*, id); if(!(yyval.identifier)) YYERROR; } +#line 2527 "turtle_parser.c" /* yacc.c:1646 */ break; case 61: - -/* Line 1806 of yacc.c */ -#line 1040 "./turtle_parser.y" +#line 1036 "./turtle_parser.y" /* yacc.c:1646 */ { int i; const unsigned char *id; - id = raptor_world_generate_bnodeid(((raptor_parser*)rdf_parser)->world); + id = raptor_world_generate_bnodeid(rdf_parser->world); if(!id) { - if((yyvsp[(2) - (3)].sequence)) - raptor_free_sequence((yyvsp[(2) - (3)].sequence)); + if((yyvsp[-1].sequence)) + raptor_free_sequence((yyvsp[-1].sequence)); YYERROR; } - (yyval.identifier) = raptor_new_term_from_blank(((raptor_parser*)rdf_parser)->world, id); + (yyval.identifier) = raptor_new_term_from_blank(rdf_parser->world, id); RAPTOR_FREE(char*, id); if(!(yyval.identifier)) { - if((yyvsp[(2) - (3)].sequence)) - raptor_free_sequence((yyvsp[(2) - (3)].sequence)); + if((yyvsp[-1].sequence)) + raptor_free_sequence((yyvsp[-1].sequence)); YYERROR; } - if((yyvsp[(2) - (3)].sequence) == NULL) { + if((yyvsp[-1].sequence) == NULL) { #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("resource\n predicateObjectList="); raptor_term_print_as_ntriples((yyval.identifier), stdout); @@ -2878,36 +2557,35 @@ /* non-empty property list, handle it */ #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("resource\n predicateObjectList="); - raptor_sequence_print((yyvsp[(2) - (3)].sequence), stdout); + raptor_sequence_print((yyvsp[-1].sequence), stdout); printf("\n"); #endif - for(i = 0; i < raptor_sequence_size((yyvsp[(2) - (3)].sequence)); i++) { - raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[(2) - (3)].sequence), i); + for(i = 0; i < raptor_sequence_size((yyvsp[-1].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[-1].sequence), i); t2->subject = raptor_term_copy((yyval.identifier)); - raptor_turtle_generate_statement((raptor_parser*)rdf_parser, t2); + raptor_turtle_generate_statement(rdf_parser, t2); } #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf(" after substitution objectList="); - raptor_sequence_print((yyvsp[(2) - (3)].sequence), stdout); + raptor_sequence_print((yyvsp[-1].sequence), stdout); printf("\n\n"); #endif - raptor_free_sequence((yyvsp[(2) - (3)].sequence)); + raptor_free_sequence((yyvsp[-1].sequence)); } } +#line 2582 "turtle_parser.c" /* yacc.c:1646 */ break; case 62: - -/* Line 1806 of yacc.c */ -#line 1094 "./turtle_parser.y" +#line 1090 "./turtle_parser.y" /* yacc.c:1646 */ { int i; - raptor_world* world = ((raptor_parser*)rdf_parser)->world; + raptor_world* world = rdf_parser->world; raptor_term* first_identifier = NULL; raptor_term* rest_identifier = NULL; raptor_term* object = NULL; @@ -2915,7 +2593,7 @@ #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("collection\n objectList="); - raptor_sequence_print((yyvsp[(2) - (3)].sequence), stdout); + raptor_sequence_print((yyvsp[-1].sequence), stdout); printf("\n"); #endif @@ -2929,7 +2607,7 @@ /* non-empty property list, handle it */ #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("resource\n predicateObjectList="); - raptor_sequence_print((yyvsp[(2) - (3)].sequence), stdout); + raptor_sequence_print((yyvsp[-1].sequence), stdout); printf("\n"); #endif @@ -2937,16 +2615,16 @@ if(!object) goto err_collection; - for(i = raptor_sequence_size((yyvsp[(2) - (3)].sequence))-1; i>=0; i--) { + for(i = raptor_sequence_size((yyvsp[-1].sequence))-1; i>=0; i--) { raptor_term* temp; - raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[(2) - (3)].sequence), i); + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[-1].sequence), i); const unsigned char *blank_id; - blank_id = raptor_world_generate_bnodeid(((raptor_parser*)rdf_parser)->world); + blank_id = raptor_world_generate_bnodeid(rdf_parser->world); if(!blank_id) goto err_collection; - blank = raptor_new_term_from_blank(((raptor_parser*)rdf_parser)->world, + blank = raptor_new_term_from_blank(rdf_parser->world, blank_id); RAPTOR_FREE(char*, blank_id); if(!blank) @@ -2975,11 +2653,11 @@ #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf(" after substitution objectList="); - raptor_sequence_print((yyvsp[(2) - (3)].sequence), stdout); + raptor_sequence_print((yyvsp[-1].sequence), stdout); printf("\n\n"); #endif - raptor_free_sequence((yyvsp[(2) - (3)].sequence)); + raptor_free_sequence((yyvsp[-1].sequence)); raptor_free_term(first_identifier); raptor_free_term(rest_identifier); @@ -3002,18 +2680,17 @@ if(first_identifier) raptor_free_term(first_identifier); - raptor_free_sequence((yyvsp[(2) - (3)].sequence)); + raptor_free_sequence((yyvsp[-1].sequence)); YYERROR; } +#line 2688 "turtle_parser.c" /* yacc.c:1646 */ break; case 63: - -/* Line 1806 of yacc.c */ -#line 1196 "./turtle_parser.y" +#line 1192 "./turtle_parser.y" /* yacc.c:1646 */ { - raptor_world* world = ((raptor_parser*)rdf_parser)->world; + raptor_world* world = rdf_parser->world; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("collection\n empty\n"); @@ -3023,12 +2700,11 @@ if(!(yyval.identifier)) YYERROR; } +#line 2704 "turtle_parser.c" /* yacc.c:1646 */ break; - -/* Line 1806 of yacc.c */ -#line 3032 "turtle_parser.c" +#line 2708 "turtle_parser.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3050,7 +2726,7 @@ *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -3065,9 +2741,9 @@ goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -3078,7 +2754,7 @@ { ++yynerrs; #if ! YYERROR_VERBOSE - yyerror (rdf_parser, YY_("syntax error")); + yyerror (rdf_parser, yyscanner, YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) @@ -3105,7 +2781,7 @@ yymsgp = yymsg; } } - yyerror (rdf_parser, yymsgp); + yyerror (rdf_parser, yyscanner, yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } @@ -3118,20 +2794,20 @@ if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, rdf_parser); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, rdf_parser, yyscanner); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -3150,7 +2826,7 @@ if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -3163,35 +2839,37 @@ | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp, rdf_parser); + yystos[yystate], yyvsp, rdf_parser, yyscanner); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -3215,12 +2893,12 @@ yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: - yyerror (rdf_parser, YY_("memory exhausted")); + yyerror (rdf_parser, yyscanner, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif @@ -3232,16 +2910,16 @@ user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, rdf_parser); + yytoken, &yylval, rdf_parser, yyscanner); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, rdf_parser); + yystos[*yyssp], yyvsp, rdf_parser, yyscanner); YYPOPSTACK (1); } #ifndef yyoverflow @@ -3252,23 +2930,17 @@ if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - - -/* Line 2067 of yacc.c */ -#line 1210 "./turtle_parser.y" +#line 1206 "./turtle_parser.y" /* yacc.c:1906 */ /* Support functions */ int -turtle_parser_error(void* ctx, const char *msg) +turtle_parser_error(raptor_parser* rdf_parser, void* scanner, const char *msg) { - raptor_parser* rdf_parser = (raptor_parser *)ctx; raptor_turtle_parser* turtle_parser; turtle_parser = (raptor_turtle_parser*)rdf_parser->context; @@ -3361,7 +3033,7 @@ turtle_lexer_set_extra(rdf_parser, turtle_parser->scanner); (void)turtle_lexer__scan_bytes((char *)string, (int)length, turtle_parser->scanner); - rc = turtle_parser_parse(rdf_parser); + rc = turtle_parser_parse(rdf_parser, turtle_parser->scanner); turtle_lexer_lex_destroy(turtle_parser->scanner); turtle_parser->scanner_set = 0; @@ -3418,7 +3090,7 @@ printf("token %s\n", turtle_token_print(world, token, &lval)); #endif - status = yypush_parse(ps, token, &lval, rdf_parser); + status = yypush_parse(ps, token, &lval, rdf_parser, turtle_parser->scanner); /* turtle_token_free(world, token, &lval); */ @@ -3958,4 +3630,3 @@ return (0); } #endif - diff -Nru raptor2-2.0.12/src/turtle_parser.h raptor2-2.0.13/src/turtle_parser.h --- raptor2-2.0.12/src/turtle_parser.h 2013-11-30 16:16:57.000000000 +0000 +++ raptor2-2.0.13/src/turtle_parser.h 2014-01-03 04:38:37.000000000 +0000 @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,103 +26,76 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +#ifndef YY_TURTLE_PARSER_TURTLE_PARSER_TAB_H_INCLUDED +# define YY_TURTLE_PARSER_TURTLE_PARSER_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int turtle_parser_debug; +#endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - A = 258, - HAT = 259, - DOT = 260, - COMMA = 261, - SEMICOLON = 262, - LEFT_SQUARE = 263, - RIGHT_SQUARE = 264, - LEFT_ROUND = 265, - RIGHT_ROUND = 266, - LEFT_CURLY = 267, - RIGHT_CURLY = 268, - TRUE_TOKEN = 269, - FALSE_TOKEN = 270, - PREFIX = 271, - BASE = 272, - SPARQL_PREFIX = 273, - SPARQL_BASE = 274, - STRING_LITERAL = 275, - URI_LITERAL = 276, - GRAPH_NAME_LEFT_CURLY = 277, - BLANK_LITERAL = 278, - QNAME_LITERAL = 279, - IDENTIFIER = 280, - LANGTAG = 281, - INTEGER_LITERAL = 282, - FLOATING_LITERAL = 283, - DECIMAL_LITERAL = 284, - ERROR_TOKEN = 285 - }; + enum yytokentype + { + A = 258, + HAT = 259, + DOT = 260, + COMMA = 261, + SEMICOLON = 262, + LEFT_SQUARE = 263, + RIGHT_SQUARE = 264, + LEFT_ROUND = 265, + RIGHT_ROUND = 266, + LEFT_CURLY = 267, + RIGHT_CURLY = 268, + TRUE_TOKEN = 269, + FALSE_TOKEN = 270, + PREFIX = 271, + BASE = 272, + SPARQL_PREFIX = 273, + SPARQL_BASE = 274, + STRING_LITERAL = 275, + URI_LITERAL = 276, + GRAPH_NAME_LEFT_CURLY = 277, + BLANK_LITERAL = 278, + QNAME_LITERAL = 279, + IDENTIFIER = 280, + LANGTAG = 281, + INTEGER_LITERAL = 282, + FLOATING_LITERAL = 283, + DECIMAL_LITERAL = 284, + ERROR_TOKEN = 285 + }; #endif -/* Tokens. */ -#define A 258 -#define HAT 259 -#define DOT 260 -#define COMMA 261 -#define SEMICOLON 262 -#define LEFT_SQUARE 263 -#define RIGHT_SQUARE 264 -#define LEFT_ROUND 265 -#define RIGHT_ROUND 266 -#define LEFT_CURLY 267 -#define RIGHT_CURLY 268 -#define TRUE_TOKEN 269 -#define FALSE_TOKEN 270 -#define PREFIX 271 -#define BASE 272 -#define SPARQL_PREFIX 273 -#define SPARQL_BASE 274 -#define STRING_LITERAL 275 -#define URI_LITERAL 276 -#define GRAPH_NAME_LEFT_CURLY 277 -#define BLANK_LITERAL 278 -#define QNAME_LITERAL 279 -#define IDENTIFIER 280 -#define LANGTAG 281 -#define INTEGER_LITERAL 282 -#define FLOATING_LITERAL 283 -#define DECIMAL_LITERAL 284 -#define ERROR_TOKEN 285 - - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - -/* Line 2068 of yacc.c */ -#line 115 "./turtle_parser.y" +#line 126 "./turtle_parser.y" /* yacc.c:1909 */ unsigned char *string; raptor_term *identifier; raptor_sequence *sequence; raptor_uri *uri; - int integer; /* 0+ for a xsd:integer datatyped RDF literal */ - - -/* Line 2068 of yacc.c */ -#line 120 "turtle_parser.tab.h" -} YYSTYPE; +#line 92 "turtle_parser.tab.h" /* yacc.c:1909 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +int turtle_parser_parse (raptor_parser* rdf_parser, void* yyscanner); +#endif /* !YY_TURTLE_PARSER_TURTLE_PARSER_TAB_H_INCLUDED */ diff -Nru raptor2-2.0.12/src/turtle_parser.y raptor2-2.0.13/src/turtle_parser.y --- raptor2-2.0.12/src/turtle_parser.y 2013-11-30 16:11:19.000000000 +0000 +++ raptor2-2.0.13/src/turtle_parser.y 2014-01-03 04:37:54.000000000 +0000 @@ -49,7 +49,6 @@ #include -#define YY_DECL int turtle_lexer_lex (YYSTYPE *turtle_parser_lval, yyscan_t yyscanner) #define YY_NO_UNISTD_H 1 #include @@ -76,22 +75,17 @@ /* the lexer does not seem to track this */ #undef RAPTOR_TURTLE_USE_ERROR_COLUMNS -/* set api.push_pull to "push" if this is defined */ +/* set api.push-pull to "push" if this is defined */ #undef TURTLE_PUSH_PARSE /* Prototypes */ -int turtle_parser_error(void* rdf_parser, const char *msg); +int turtle_parser_error(raptor_parser* rdf_parser, void* scanner, const char *msg); /* flex version 2.5.36 released 2012-07-20 added the column header prototypes */ -/* What the lexer wants */ -extern int turtle_lexer_lex (YYSTYPE *turtle_parser_lval, yyscan_t scanner); - /* Make lex/yacc interface as small as possible */ #undef yylex #define yylex turtle_lexer_lex -#define YYLEX_PARAM ((raptor_turtle_parser*)(((raptor_parser*)rdf_parser)->context))->scanner - /* Prototypes for local functions */ static void raptor_turtle_generate_statement(raptor_parser *parser, raptor_statement *triple); @@ -101,15 +95,32 @@ /* directives */ +%require "3.0.0" + +/* File prefix (bison -b) */ +%file-prefix "turtle_parser" + +/* Symbol prefix (bison -d : deprecated) */ +%name-prefix "turtle_parser_" + +/* Write parser header file with macros (bison -d) */ +%defines + +/* Write output file with verbose descriptions of parser states */ +%verbose + +/* Generate code processing locations */ + /* %locations */ /* Pure parser - want a reentrant parser */ -%define api.pure +%define api.pure full /* Push or pull parser? */ -%define api.push_pull "pull" +%define api.push-pull pull -/* Pure parser argument */ -%parse-param { raptor_parser* rdf_parser } +/* Pure parser argument: lexer - yylex() and parser - yyparse() */ +%lex-param { yyscan_t yyscanner } +%parse-param { raptor_parser* rdf_parser } { void* yyscanner } /* Interface between lexer and parser */ %union { @@ -117,7 +128,6 @@ raptor_term *identifier; raptor_sequence *sequence; raptor_uri *uri; - int integer; /* 0+ for a xsd:integer datatyped RDF literal */ } @@ -190,66 +200,63 @@ graph: GRAPH_NAME_LEFT_CURLY { /* action in mid-rule so this is run BEFORE the triples in graphBody */ - raptor_parser* parser = (raptor_parser *)rdf_parser; raptor_turtle_parser* turtle_parser; - turtle_parser = (raptor_turtle_parser*)parser->context; + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; if(!turtle_parser->trig) - turtle_parser_error(rdf_parser, "{ ... } is not allowed in Turtle"); + turtle_parser_error(rdf_parser, yyscanner, "{ ... } is not allowed in Turtle"); else { if(turtle_parser->graph_name) raptor_free_term(turtle_parser->graph_name); - turtle_parser->graph_name = raptor_new_term_from_uri(((raptor_parser*)rdf_parser)->world, $1); + turtle_parser->graph_name = raptor_new_term_from_uri(rdf_parser->world, $1); raptor_free_uri($1); - raptor_parser_start_graph(parser, turtle_parser->graph_name->value.uri, 1); + raptor_parser_start_graph(rdf_parser, + turtle_parser->graph_name->value.uri, 1); } } graphBody RIGHT_CURLY { - raptor_parser* parser = (raptor_parser *)rdf_parser; raptor_turtle_parser* turtle_parser; - turtle_parser = (raptor_turtle_parser*)parser->context; + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; if(turtle_parser->trig) { - raptor_parser_end_graph(parser, turtle_parser->graph_name->value.uri, 1); + raptor_parser_end_graph(rdf_parser, + turtle_parser->graph_name->value.uri, 1); raptor_free_term(turtle_parser->graph_name); turtle_parser->graph_name = NULL; - parser->emitted_default_graph = 0; + rdf_parser->emitted_default_graph = 0; } } | LEFT_CURLY { /* action in mid-rule so this is run BEFORE the triples in graphBody */ - raptor_parser* parser = (raptor_parser *)rdf_parser; raptor_turtle_parser* turtle_parser; - turtle_parser = (raptor_turtle_parser*)parser->context; + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; if(!turtle_parser->trig) - turtle_parser_error(rdf_parser, "{ ... } is not allowed in Turtle"); + turtle_parser_error(rdf_parser, yyscanner, "{ ... } is not allowed in Turtle"); else { - raptor_parser_start_graph(parser, NULL, 1); - parser->emitted_default_graph++; + raptor_parser_start_graph(rdf_parser, NULL, 1); + rdf_parser->emitted_default_graph++; } } graphBody RIGHT_CURLY { - raptor_parser* parser = (raptor_parser *)rdf_parser; raptor_turtle_parser* turtle_parser; - turtle_parser = (raptor_turtle_parser*)parser->context; + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; if(turtle_parser->trig) { - raptor_parser_end_graph(parser, NULL, 1); - parser->emitted_default_graph = 0; + raptor_parser_end_graph(rdf_parser, NULL, 1); + rdf_parser->emitted_default_graph = 0; } } ; graphBody: triplesList -| -/* empty */ +| %empty ; triplesList: dotTriplesList @@ -261,7 +268,7 @@ ; statementList: statementList statement -| /* empty */ +| %empty ; statement: directive @@ -300,7 +307,7 @@ #endif for(i = 0; i < raptor_sequence_size($2); i++) { raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($2, i); - raptor_turtle_generate_statement((raptor_parser*)rdf_parser, t2); + raptor_turtle_generate_statement(rdf_parser, t2); } } @@ -341,7 +348,7 @@ #endif for(i = 0; i < raptor_sequence_size($2); i++) { raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($2, i); - raptor_turtle_generate_statement((raptor_parser*)rdf_parser, t2); + raptor_turtle_generate_statement(rdf_parser, t2); } } @@ -378,7 +385,7 @@ if(!$3) $$ = NULL; else { - triple = raptor_new_statement_from_nodes(((raptor_parser*)rdf_parser)->world, NULL, NULL, $3, NULL); + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, $3, NULL); if(!triple) { raptor_free_sequence($1); YYERROR; @@ -412,7 +419,7 @@ if(!$1) $$ = NULL; else { - triple = raptor_new_statement_from_nodes(((raptor_parser*)rdf_parser)->world, NULL, NULL, $1, NULL); + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, $1, NULL); if(!triple) YYERROR; #ifdef RAPTOR_DEBUG @@ -462,7 +469,7 @@ if(!$2) $$ = NULL; else { - triple = raptor_new_statement_from_nodes(((raptor_parser*)rdf_parser)->world, NULL, NULL, $2, NULL); + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, $2, NULL); if(!triple) { raptor_free_sequence($1); YYERROR; @@ -496,7 +503,7 @@ if(!$1) $$ = NULL; else { - triple = raptor_new_statement_from_nodes(((raptor_parser*)rdf_parser)->world, NULL, NULL, $1, NULL); + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, $1, NULL); if(!triple) YYERROR; #ifdef RAPTOR_DEBUG @@ -539,7 +546,7 @@ printf("verb predicate = rdf:type (a)\n"); #endif - $$ = raptor_term_copy(RAPTOR_RDF_type_term(((raptor_parser*)rdf_parser)->world)); + $$ = raptor_term_copy(RAPTOR_RDF_type_term(rdf_parser->world)); if(!$$) YYERROR; } @@ -656,7 +663,7 @@ prefix: PREFIX IDENTIFIER URI_LITERAL DOT { unsigned char *prefix = $2; - raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(((raptor_parser*)rdf_parser)->context); + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(rdf_parser->context); raptor_namespace *ns; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 @@ -677,7 +684,7 @@ ns = raptor_new_namespace_from_uri(&turtle_parser->namespaces, prefix, $3, 0); if(ns) { raptor_namespaces_start_namespace(&turtle_parser->namespaces, ns); - raptor_parser_start_namespace((raptor_parser*)rdf_parser, ns); + raptor_parser_start_namespace(rdf_parser, ns); } if($2) @@ -690,7 +697,7 @@ | SPARQL_PREFIX IDENTIFIER URI_LITERAL { unsigned char *prefix = $2; - raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(((raptor_parser*)rdf_parser)->context); + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(rdf_parser->context); raptor_namespace *ns; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 @@ -711,7 +718,7 @@ ns = raptor_new_namespace_from_uri(&turtle_parser->namespaces, prefix, $3, 0); if(ns) { raptor_namespaces_start_namespace(&turtle_parser->namespaces, ns); - raptor_parser_start_namespace((raptor_parser*)rdf_parser, ns); + raptor_parser_start_namespace(rdf_parser, ns); } if($2) @@ -727,20 +734,18 @@ base: BASE URI_LITERAL DOT { raptor_uri *uri=$2; - raptor_parser* parser = (raptor_parser*)rdf_parser; - if(parser->base_uri) - raptor_free_uri(parser->base_uri); - parser->base_uri = uri; + if(rdf_parser->base_uri) + raptor_free_uri(rdf_parser->base_uri); + rdf_parser->base_uri = uri; } | SPARQL_BASE URI_LITERAL { raptor_uri *uri=$2; - raptor_parser* parser = (raptor_parser*)rdf_parser; - if(parser->base_uri) - raptor_free_uri(parser->base_uri); - parser->base_uri = uri; + if(rdf_parser->base_uri) + raptor_free_uri(rdf_parser->base_uri); + rdf_parser->base_uri = uri; } ; @@ -801,8 +806,7 @@ printf("literal + language string=\"%s\"\n", $1); #endif - $$ = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - $1, NULL, $2); + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, NULL, $2); RAPTOR_FREE(char*, $1); RAPTOR_FREE(char*, $2); if(!$$) @@ -816,14 +820,13 @@ if($4) { if($2) { - raptor_parser_error((raptor_parser*)rdf_parser, + raptor_parser_error(rdf_parser, "Language not allowed with datatyped literal"); RAPTOR_FREE(char*, $2); $2 = NULL; } - $$ = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - $1, $4, NULL); + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, $4, NULL); RAPTOR_FREE(char*, $1); raptor_free_uri($4); if(!$$) @@ -840,14 +843,13 @@ if($4) { if($2) { - raptor_parser_error((raptor_parser*)rdf_parser, + raptor_parser_error(rdf_parser, "Language not allowed with datatyped literal"); RAPTOR_FREE(char*, $2); $2 = NULL; } - $$ = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - $1, $4, NULL); + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, $4, NULL); RAPTOR_FREE(char*, $1); raptor_free_uri($4); if(!$$) @@ -863,8 +865,7 @@ #endif if($3) { - $$ = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - $1, $3, NULL); + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, $3, NULL); RAPTOR_FREE(char*, $1); raptor_free_uri($3); if(!$$) @@ -880,8 +881,7 @@ #endif if($3) { - $$ = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - $1, $3, NULL); + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, $3, NULL); RAPTOR_FREE(char*, $1); raptor_free_uri($3); if(!$$) @@ -895,8 +895,7 @@ printf("literal string=\"%s\"\n", $1); #endif - $$ = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - $1, NULL, NULL); + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, NULL, NULL); RAPTOR_FREE(char*, $1); if(!$$) YYERROR; @@ -907,9 +906,8 @@ #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("resource integer=%s\n", $1); #endif - uri = raptor_uri_copy(((raptor_parser*)rdf_parser)->world->xsd_integer_uri); - $$ = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - $1, uri, NULL); + uri = raptor_uri_copy(rdf_parser->world->xsd_integer_uri); + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, uri, NULL); RAPTOR_FREE(char*, $1); raptor_free_uri(uri); if(!$$) @@ -921,9 +919,8 @@ #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("resource double=%s\n", $1); #endif - uri = raptor_uri_copy(((raptor_parser*)rdf_parser)->world->xsd_double_uri); - $$ = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - $1, uri, NULL); + uri = raptor_uri_copy(rdf_parser->world->xsd_double_uri); + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, uri, NULL); RAPTOR_FREE(char*, $1); raptor_free_uri(uri); if(!$$) @@ -935,13 +932,12 @@ #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("resource decimal=%s\n", $1); #endif - uri = raptor_uri_copy(((raptor_parser*)rdf_parser)->world->xsd_decimal_uri); + uri = raptor_uri_copy(rdf_parser->world->xsd_decimal_uri); if(!uri) { RAPTOR_FREE(char*, $1); YYERROR; } - $$ = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, - $1, uri, NULL); + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, uri, NULL); RAPTOR_FREE(char*, $1); raptor_free_uri(uri); if(!$$) @@ -953,8 +949,8 @@ #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 fputs("resource boolean true\n", stderr); #endif - uri = raptor_uri_copy(((raptor_parser*)rdf_parser)->world->xsd_boolean_uri); - $$ = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, + uri = raptor_uri_copy(rdf_parser->world->xsd_boolean_uri); + $$ = raptor_new_term_from_literal(rdf_parser->world, (const unsigned char*)"true", uri, NULL); raptor_free_uri(uri); if(!$$) @@ -966,8 +962,8 @@ #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 fputs("resource boolean false\n", stderr); #endif - uri = raptor_uri_copy(((raptor_parser*)rdf_parser)->world->xsd_boolean_uri); - $$ = raptor_new_term_from_literal(((raptor_parser*)rdf_parser)->world, + uri = raptor_uri_copy(rdf_parser->world->xsd_boolean_uri); + $$ = raptor_new_term_from_literal(rdf_parser->world, (const unsigned char*)"false", uri, NULL); raptor_free_uri(uri); if(!$$) @@ -983,7 +979,7 @@ #endif if($1) { - $$ = raptor_new_term_from_uri(((raptor_parser*)rdf_parser)->world, $1); + $$ = raptor_new_term_from_uri(rdf_parser->world, $1); raptor_free_uri($1); if(!$$) YYERROR; @@ -997,7 +993,7 @@ #endif if($1) { - $$ = raptor_new_term_from_uri(((raptor_parser*)rdf_parser)->world, $1); + $$ = raptor_new_term_from_uri(rdf_parser->world, $1); raptor_free_uri($1); if(!$$) YYERROR; @@ -1011,10 +1007,11 @@ { $$ = $1; } -| /* empty */ +| %empty { $$ = NULL; } +; blankNode: BLANK_LITERAL @@ -1023,12 +1020,11 @@ #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("subject blank=\"%s\"\n", $1); #endif - id = raptor_world_internal_generate_id(((raptor_parser*)rdf_parser)->world, - $1); + id = raptor_world_internal_generate_id(rdf_parser->world, $1); if(!id) YYERROR; - $$ = raptor_new_term_from_blank(((raptor_parser*)rdf_parser)->world, id); + $$ = raptor_new_term_from_blank(rdf_parser->world, id); RAPTOR_FREE(char*, id); if(!$$) @@ -1041,14 +1037,14 @@ int i; const unsigned char *id; - id = raptor_world_generate_bnodeid(((raptor_parser*)rdf_parser)->world); + id = raptor_world_generate_bnodeid(rdf_parser->world); if(!id) { if($2) raptor_free_sequence($2); YYERROR; } - $$ = raptor_new_term_from_blank(((raptor_parser*)rdf_parser)->world, id); + $$ = raptor_new_term_from_blank(rdf_parser->world, id); RAPTOR_FREE(char*, id); if(!$$) { if($2) @@ -1073,7 +1069,7 @@ for(i = 0; i < raptor_sequence_size($2); i++) { raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($2, i); t2->subject = raptor_term_copy($$); - raptor_turtle_generate_statement((raptor_parser*)rdf_parser, t2); + raptor_turtle_generate_statement(rdf_parser, t2); } #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 @@ -1093,7 +1089,7 @@ collection: LEFT_ROUND itemList RIGHT_ROUND { int i; - raptor_world* world = ((raptor_parser*)rdf_parser)->world; + raptor_world* world = rdf_parser->world; raptor_term* first_identifier = NULL; raptor_term* rest_identifier = NULL; raptor_term* object = NULL; @@ -1128,11 +1124,11 @@ raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($2, i); const unsigned char *blank_id; - blank_id = raptor_world_generate_bnodeid(((raptor_parser*)rdf_parser)->world); + blank_id = raptor_world_generate_bnodeid(rdf_parser->world); if(!blank_id) goto err_collection; - blank = raptor_new_term_from_blank(((raptor_parser*)rdf_parser)->world, + blank = raptor_new_term_from_blank(rdf_parser->world, blank_id); RAPTOR_FREE(char*, blank_id); if(!blank) @@ -1194,7 +1190,7 @@ } | LEFT_ROUND RIGHT_ROUND { - raptor_world* world = ((raptor_parser*)rdf_parser)->world; + raptor_world* world = rdf_parser->world; #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 printf("collection\n empty\n"); @@ -1213,9 +1209,8 @@ /* Support functions */ int -turtle_parser_error(void* ctx, const char *msg) +turtle_parser_error(raptor_parser* rdf_parser, void* scanner, const char *msg) { - raptor_parser* rdf_parser = (raptor_parser *)ctx; raptor_turtle_parser* turtle_parser; turtle_parser = (raptor_turtle_parser*)rdf_parser->context; @@ -1308,7 +1303,7 @@ turtle_lexer_set_extra(rdf_parser, turtle_parser->scanner); (void)turtle_lexer__scan_bytes((char *)string, (int)length, turtle_parser->scanner); - rc = turtle_parser_parse(rdf_parser); + rc = turtle_parser_parse(rdf_parser, turtle_parser->scanner); turtle_lexer_lex_destroy(turtle_parser->scanner); turtle_parser->scanner_set = 0; @@ -1365,7 +1360,7 @@ printf("token %s\n", turtle_token_print(world, token, &lval)); #endif - status = yypush_parse(ps, token, &lval, rdf_parser); + status = yypush_parse(ps, token, &lval, rdf_parser, turtle_parser->scanner); /* turtle_token_free(world, token, &lval); */ diff -Nru raptor2-2.0.12/tests/Makefile.in raptor2-2.0.13/tests/Makefile.in --- raptor2-2.0.12/tests/Makefile.in 2013-12-08 03:05:41.000000000 +0000 +++ raptor2-2.0.13/tests/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -173,6 +173,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -269,8 +270,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/tests/feeds/Makefile.in raptor2-2.0.13/tests/feeds/Makefile.in --- raptor2-2.0.12/tests/feeds/Makefile.in 2013-12-08 03:05:41.000000000 +0000 +++ raptor2-2.0.13/tests/feeds/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -204,8 +205,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/tests/grddl/Makefile.in raptor2-2.0.13/tests/grddl/Makefile.in --- raptor2-2.0.12/tests/grddl/Makefile.in 2013-12-08 03:05:41.000000000 +0000 +++ raptor2-2.0.13/tests/grddl/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -104,6 +104,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -200,8 +201,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/tests/json/Makefile.in raptor2-2.0.13/tests/json/Makefile.in --- raptor2-2.0.12/tests/json/Makefile.in 2013-12-08 03:05:41.000000000 +0000 +++ raptor2-2.0.13/tests/json/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -104,6 +104,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -200,8 +201,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/tests/nquads-2013/Makefile.in raptor2-2.0.13/tests/nquads-2013/Makefile.in --- raptor2-2.0.12/tests/nquads-2013/Makefile.in 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/tests/nquads-2013/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -104,6 +104,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -200,8 +201,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/tests/ntriples/Makefile.am raptor2-2.0.13/tests/ntriples/Makefile.am --- raptor2-2.0.12/tests/ntriples/Makefile.am 2013-11-27 17:44:28.000000000 +0000 +++ raptor2-2.0.13/tests/ntriples/Makefile.am 2013-12-30 17:58:16.000000000 +0000 @@ -25,13 +25,15 @@ nt2013-ex1.nt \ nt2013-ex2.nt \ nt2013-ex3.nt \ -nt2013-ex4.nt +nt2013-ex4.nt \ +bug-562.nt NT_OUT_FILES = test.out \ nt2013-ex1.out \ nt2013-ex2.out \ nt2013-ex3.out \ -nt2013-ex4.out +nt2013-ex4.out \ +bug-562.out NT_BAD_TEST_FILES=bad-00.nt bad-02.nt bad-03.nt bad-04.nt \ bad-05.nt bad-06.nt bad-07.nt diff -Nru raptor2-2.0.12/tests/ntriples/Makefile.in raptor2-2.0.13/tests/ntriples/Makefile.in --- raptor2-2.0.12/tests/ntriples/Makefile.in 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/tests/ntriples/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -105,6 +105,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -201,8 +202,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -259,13 +258,15 @@ nt2013-ex1.nt \ nt2013-ex2.nt \ nt2013-ex3.nt \ -nt2013-ex4.nt +nt2013-ex4.nt \ +bug-562.nt NT_OUT_FILES = test.out \ nt2013-ex1.out \ nt2013-ex2.out \ nt2013-ex3.out \ -nt2013-ex4.out +nt2013-ex4.out \ +bug-562.out NT_BAD_TEST_FILES = bad-00.nt bad-02.nt bad-03.nt bad-04.nt \ bad-05.nt bad-06.nt bad-07.nt diff -Nru raptor2-2.0.12/tests/ntriples/bug-562.nt raptor2-2.0.13/tests/ntriples/bug-562.nt --- raptor2-2.0.12/tests/ntriples/bug-562.nt 1970-01-01 00:00:00.000000000 +0000 +++ raptor2-2.0.13/tests/ntriples/bug-562.nt 2013-12-30 17:48:13.000000000 +0000 @@ -0,0 +1,2 @@ +_:b . +_:b _:c . diff -Nru raptor2-2.0.12/tests/ntriples/bug-562.out raptor2-2.0.13/tests/ntriples/bug-562.out --- raptor2-2.0.12/tests/ntriples/bug-562.out 1970-01-01 00:00:00.000000000 +0000 +++ raptor2-2.0.13/tests/ntriples/bug-562.out 2013-12-30 17:48:13.000000000 +0000 @@ -0,0 +1,2 @@ +_:b . +_:b _:c . diff -Nru raptor2-2.0.12/tests/ntriples-2013/Makefile.in raptor2-2.0.13/tests/ntriples-2013/Makefile.in --- raptor2-2.0.12/tests/ntriples-2013/Makefile.in 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/tests/ntriples-2013/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -104,6 +104,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -200,8 +201,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/tests/rdfa/Makefile.in raptor2-2.0.13/tests/rdfa/Makefile.in --- raptor2-2.0.12/tests/rdfa/Makefile.in 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/tests/rdfa/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -104,6 +104,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -200,8 +201,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/tests/rdfa11/Makefile.in raptor2-2.0.13/tests/rdfa11/Makefile.in --- raptor2-2.0.12/tests/rdfa11/Makefile.in 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/tests/rdfa11/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -104,6 +104,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -200,8 +201,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/tests/rdfxml/Makefile.in raptor2-2.0.13/tests/rdfxml/Makefile.in --- raptor2-2.0.12/tests/rdfxml/Makefile.in 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/tests/rdfxml/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -105,6 +105,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -201,8 +202,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/tests/trig/Makefile.in raptor2-2.0.13/tests/trig/Makefile.in --- raptor2-2.0.12/tests/trig/Makefile.in 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/tests/trig/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -104,6 +104,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -200,8 +201,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/tests/turtle/Makefile.in raptor2-2.0.13/tests/turtle/Makefile.in --- raptor2-2.0.12/tests/turtle/Makefile.in 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/tests/turtle/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -105,6 +105,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -201,8 +202,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/tests/turtle-2013/Makefile.in raptor2-2.0.13/tests/turtle-2013/Makefile.in --- raptor2-2.0.12/tests/turtle-2013/Makefile.in 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/tests/turtle-2013/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -104,6 +104,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -200,8 +201,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru raptor2-2.0.12/utils/Makefile.in raptor2-2.0.13/utils/Makefile.in --- raptor2-2.0.12/utils/Makefile.in 2013-12-08 03:05:42.000000000 +0000 +++ raptor2-2.0.13/utils/Makefile.in 2014-01-27 19:36:09.000000000 +0000 @@ -176,6 +176,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BISON = @BISON@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -274,8 +275,6 @@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XSLT_CONFIG = @XSLT_CONFIG@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@