Merge pull request #1501 from jow-/diffutils-fortify-source-compat
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 1 Jul 2015 08:25:35 +0000 (10:25 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 1 Jul 2015 08:25:35 +0000 (10:25 +0200)
diffutils: fix fortify source compat

62 files changed:
ipv6/aiccu/Makefile
ipv6/aiccu/patches/300-resolver-uclibc.patch
ipv6/aiccu/patches/400-musl-compat.patch
lang/perl-cgi/Makefile [new file with mode: 0644]
lang/perl-compress-bzip2/Makefile
lang/perl-dbi/Makefile
lang/perl-device-serialport/Makefile
lang/perl-encode-locale/Makefile [new file with mode: 0644]
lang/perl-file-listing/Makefile [new file with mode: 0644]
lang/perl-html-form/Makefile [new file with mode: 0644]
lang/perl-html-parser/Makefile
lang/perl-html-tagset/Makefile
lang/perl-html-tree/Makefile
lang/perl-http-cookies/Makefile [new file with mode: 0644]
lang/perl-http-daemon/Makefile [new file with mode: 0644]
lang/perl-http-date/Makefile [new file with mode: 0644]
lang/perl-http-message/Makefile [new file with mode: 0644]
lang/perl-http-negotiate/Makefile [new file with mode: 0644]
lang/perl-http-server-simple/Makefile [new file with mode: 0644]
lang/perl-io-html/Makefile [new file with mode: 0644]
lang/perl-lockfile-simple/Makefile
lang/perl-lwp-mediatypes/Makefile [new file with mode: 0644]
lang/perl-net-http/Makefile [new file with mode: 0644]
lang/perl-net-telnet/Makefile
lang/perl-sub-uplevel/Makefile [new file with mode: 0644]
lang/perl-test-harness/Makefile
lang/perl-test-warn/Makefile [new file with mode: 0644]
lang/perl-uri/Makefile
lang/perl-www-curl/Makefile
lang/perl-www-mechanize/Makefile
lang/perl-www-robotrules/Makefile [new file with mode: 0644]
lang/perl-www/Makefile
lang/perl-www/patches/010-lwp-https-call-verify-hostname-when-avail.patch [deleted file]
lang/perl-www/patches/020-lwp-https-verify-hostnames-by-default.patch [deleted file]
libs/boost/Makefile
libs/libevdev/Makefile
libs/libinput/Makefile
libs/libnet-1.2.x/Makefile
libs/libnet-1.2.x/patches/100-musl-compat.patch
libs/pthsem/Makefile
net/ctorrent-svn/Makefile
net/ctorrent-svn/patches/400-musl-compat.patch [new file with mode: 0644]
net/davfs2/Makefile
net/davfs2/patches/100-musl-compat.patch [new file with mode: 0644]
net/gnunet/Makefile
net/gnurl/Makefile
net/gnurl/patches/010-backport-gtls-add-support-for-CURLOPT_CAPATH.patch [new file with mode: 0644]
net/knxd/Makefile
net/knxd/patches/0100-musl-compat [new file with mode: 0644]
net/linknx/Makefile
net/linknx/patches/010-musl-compat [new file with mode: 0644]
net/linknx/patches/012-fix-linknx.cpp [new file with mode: 0644]
net/mtr/Makefile
net/mtr/patches/100-disabled-ipv6-fix.patch [new file with mode: 0644]
net/net-snmp/Makefile
net/ntpd/Makefile
net/ntripclient/Makefile
net/ntripclient/patches/100-musl-compat.patch [new file with mode: 0644]
net/vsftpd/Makefile
net/vsftpd/patches/007-CVE-2015-1419.patch [new file with mode: 0644]
sound/forked-daapd/patches/010-include_pregen.patch
utils/screen/Makefile

index 0034c0b7091eeb1263ac628dee6f78b13a296d73..dae693839d27ac30acb6fae95b366f52e6eb5500 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=aiccu
 PKG_VERSION:=20070115
-PKG_RELEASE:=13
+PKG_RELEASE:=14
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.sixxs.net/archive/sixxs/aiccu/unix
index 1a5f11626e057779aaef6afe115c65b42e721879..b88ef5c1a357f1fa09823e201effb15b125c2da1 100644 (file)
@@ -5,7 +5,7 @@
  int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record))
  {
 -#ifdef _LINUX
-+#if defined(_LINUX) && defined(__GLIBC__)
++#if defined(_LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)
        struct __res_state      res;
  #endif
        unsigned char           answer[8192];
@@ -14,7 +14,7 @@
        uint32_t                ttl = 0;
  
 -#ifdef _LINUX
-+#if defined(_LINUX) && defined(__GLIBC__)
++#if defined(_LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)
        memset(&res, 0, sizeof(res));
        res.options = RES_DEBUG;
        res_ninit(&res);
  
        memset(answer, 0, sizeof(answer));
 -#ifdef _LINUX
-+#if defined(_LINUX) && defined(__GLIBC__)
++#if defined(_LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)
        ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer));
  #else
        ret = res_query(label, C_IN, rrtype, answer, sizeof(answer));
---- a/common/dn_skipname.c
-+++ b/common/dn_skipname.c
-@@ -9,7 +9,7 @@
-  * return:
-  *      0 on success, -1 (with errno set) on failure.
-  */
--int ns_name_skip(const u_char **ptrptr, const u_char *eom)
-+static int ns_name_skip(const u_char **ptrptr, const u_char *eom)
- {
-       const u_char *cp;
-       u_int n;
index 2e732d8a2ed8f14bc4a40c94ad69f14e14583e15..b6e0c3236e8442ddfd8b29fa4a25559eaef3de13 100644 (file)
        #include <linux/if_tun.h>
 --- a/common/dn_skipname.c
 +++ b/common/dn_skipname.c
-@@ -1,5 +1,6 @@
+@@ -1,6 +1,8 @@
  #include <errno.h>
  #include <resolv.h>
-+#include <sys/types.h>
  
++#include <sys/types.h>
++
  /* Ripped from glibc 2.4 sources. */
  
+ /*
diff --git a/lang/perl-cgi/Makefile b/lang/perl-cgi/Makefile
new file mode 100644 (file)
index 0000000..b23c783
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-cgi
+PKG_VERSION:=4.21
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/L/LE/LEEJO
+PKG_SOURCE:=CGI-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=78b427bfee2dd21b2e612b5bfe5f038c
+
+PKG_LICENSE:=GPL Artistic-2.0
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/CGI-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-cgi
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Handle Common Gateway Interface requests and responses
+  URL:=http://search.cpan.org/dist/CGI/
+  DEPENDS:=perl +perl-html-parser +perlbase-base +perlbase-config +perlbase-encode +perlbase-essential +perlbase-file +perlbase-if +perlbase-utf8
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-cgi/install
+        $(call perlmod/Install,$(1),CGI auto/CGI)
+endef
+
+
+$(eval $(call BuildPackage,perl-cgi))
index fbb388f181f9d59576395ad9949f4ed834a0c75f..e6c7c8fd6aef04d30df93c55553e81bec6e37b6d 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-compress-bzip2
 PKG_VERSION:=2.22
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/R/RU/RURBAN/
 PKG_SOURCE:=Compress-Bzip2-$(PKG_VERSION).tar.gz
@@ -29,7 +29,7 @@ define Package/perl-compress-bzip2
   CATEGORY:=Languages
   TITLE:=Perl interface to bzip2 compression library
   URL:=http://search.cpan.org/dist/Compress-Bzip2/
-  DEPENDS:=perl +libbz2
+  DEPENDS:=perl +libbz2 +perlbase-autoloader +perlbase-config +perlbase-essential +perlbase-fcntl +perlbase-file +perlbase-getopt +perlbase-test +perlbase-xsloader
 endef
 
 define Build/Configure
index c752e96029fa48d33d915251e318a3706a0eb58d..b13c3a673eb6e0818067e9cb5277da1307ac498e 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-dbi
 PKG_VERSION:=1.633
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TI/TIMB/
 PKG_SOURCE:=DBI-$(PKG_VERSION).tar.gz
@@ -31,7 +31,7 @@ define Package/perl-dbi
   CATEGORY:=Languages
   TITLE:=Database independent interface for Perl
   URL:=http://search.cpan.org/dist/DBI/
-  DEPENDS:=perl +perlbase-essential
+  DEPENDS:=perl +perlbase-base +perlbase-config +perlbase-cwd +perlbase-data +perlbase-dynaloader +perlbase-errno +perlbase-essential +perlbase-fcntl +perlbase-file +perlbase-io +perlbase-ipc +perlbase-scalar +perlbase-storable +perlbase-symbol +perlbase-tie +perlbase-universal +perlbase-utf8
 endef
 
 define Build/Configure
index 22297ae9b578f2b8b5740d7521249794d8e89769..2069bed96f9cda2cc13ce4cc3a07b3efa4c59376 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-device-serialport
 PKG_VERSION:=1.04
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/C/CO/COOK/
 PKG_SOURCE:=Device-SerialPort-$(PKG_VERSION).tar.gz
@@ -29,7 +29,7 @@ define Package/perl-device-serialport
   CATEGORY:=Languages
   TITLE:=A POSIX-based version of the Win32::SerialPort module
   URL:=http://search.cpan.org/dist/Device-SerialPort/
-  DEPENDS:=perl +perlbase-essential
+  DEPENDS:=perl +perlbase-essential +perlbase-io +perlbase-posix +perlbase-test +perlbase-xsloader
 endef
 
 define Package/perl-device-serialport/description
diff --git a/lang/perl-encode-locale/Makefile b/lang/perl-encode-locale/Makefile
new file mode 100644 (file)
index 0000000..54071dc
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-encode-locale
+PKG_VERSION:=1.05
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
+PKG_SOURCE:=Encode-Locale-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=fcfdb8e4ee34bcf62aed429b4a23db27
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Encode-Locale-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-encode-locale
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Determine the locale encoding
+  URL:=http://search.cpan.org/dist/Encode-Locale/
+  DEPENDS:=perl +perlbase-base +perlbase-encode +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-encode-locale/install
+        $(call perlmod/Install,$(1),Encode auto/Encode)
+endef
+
+
+$(eval $(call BuildPackage,perl-encode-locale))
diff --git a/lang/perl-file-listing/Makefile b/lang/perl-file-listing/Makefile
new file mode 100644 (file)
index 0000000..19a6938
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-file-listing
+PKG_VERSION:=6.04
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
+PKG_SOURCE:=File-Listing-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=83f636b477741f3a014585bb9cc079a6
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/File-Listing-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-file-listing
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Parse directory listing
+  URL:=http://search.cpan.org/dist/File-Listing/
+  DEPENDS:=perl +perl-http-date +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-file-listing/install
+        $(call perlmod/Install,$(1),File auto/File)
+endef
+
+
+$(eval $(call BuildPackage,perl-file-listing))
diff --git a/lang/perl-html-form/Makefile b/lang/perl-html-form/Makefile
new file mode 100644 (file)
index 0000000..d412a1f
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-html-form
+PKG_VERSION:=6.03
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
+PKG_SOURCE:=HTML-Form-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=fa6c2680207ed4fef5ea2ef09c210614
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTML-Form-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-html-form
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Class that represents an HTML form element
+  URL:=http://search.cpan.org/dist/HTML-Form/
+  DEPENDS:=perl +perl-html-parser +perl-http-message +perl-uri +perlbase-encode +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-html-form/install
+        $(call perlmod/Install,$(1),HTML auto/HTML)
+endef
+
+
+$(eval $(call BuildPackage,perl-html-form))
index d1c86af6183da03249bac92885db05d7b44be638..c248a615c1ce23aef50660abb93920710f082a3d 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-html-parser
 PKG_VERSION:=3.71
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS/
 PKG_SOURCE:=HTML-Parser-$(PKG_VERSION).tar.gz
@@ -29,7 +29,7 @@ define Package/perl-html-parser
   CATEGORY:=Languages
   TITLE:=A collection of modules that parse HTML text documents
   URL:=http://search.cpan.org/dist/HTML-Parser/
-  DEPENDS:=perl +perl-html-tagset +perl-uri
+  DEPENDS:=perl +perl-html-tagset +perlbase-essential +perlbase-xsloader
 endef
 
 define Build/Configure
index d7b0b0c83b861c304b0b4cb54e6353873d03c63e..4bcd10c714d9ac0c467927bcea4cf3afed4640b5 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-html-tagset
 PKG_VERSION:=3.20
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/P/PE/PETDANCE/
 PKG_SOURCE:=HTML-Tagset-$(PKG_VERSION).tar.gz
@@ -29,7 +29,7 @@ define Package/perl-html-tagset
   CATEGORY:=Languages
   TITLE:=Data tables pertaining to HTML
   URL:=http://search.cpan.org/dist/HTML-Tagset/
-  DEPENDS:=perl
+  DEPENDS:=perl +perlbase-essential
 endef
 
 define Build/Configure
index 942e3bf224012ace93b3b5a705f0a9eea773b494..d1b4ac9ac4eeab2f07c2395525e5fed36cd3c168 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-html-tree
 PKG_VERSION:=3.23
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 PKG_MD5SUM:=6352f50be402301f79b580dd235d7762
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/P/PE/PETEK/
@@ -28,9 +28,9 @@ define Package/perl-html-tree
   SUBMENU:=Perl
   SECTION:=lang
   CATEGORY:=Languages
-  TITLE:=represent and create HTML syntax trees
+  TITLE:=Represent and create HTML syntax trees
   URL:=http://search.cpan.org/dist/HTML-Tree/
-  DEPENDS:=perl +perl-html-parser +perl-html-tagset
+  DEPENDS:=perl +perl-html-parser +perl-html-tagset +perlbase-essential +perlbase-integer
 endef
 
 define Build/Configure
diff --git a/lang/perl-http-cookies/Makefile b/lang/perl-http-cookies/Makefile
new file mode 100644 (file)
index 0000000..329767a
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-http-cookies
+PKG_VERSION:=6.01
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
+PKG_SOURCE:=HTTP-Cookies-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=ecfd0eeb88512033352c2f13c9580f03
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Cookies-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-cookies
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=HTTP cookie jars
+  URL:=http://search.cpan.org/dist/HTTP-Cookies/
+  DEPENDS:=perl +perl-http-date +perl-http-message +perlbase-essential +perlbase-time
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-cookies/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-cookies))
diff --git a/lang/perl-http-daemon/Makefile b/lang/perl-http-daemon/Makefile
new file mode 100644 (file)
index 0000000..178573d
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-http-daemon
+PKG_VERSION:=6.01
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
+PKG_SOURCE:=HTTP-Daemon-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=ed0ae02d25d7f1e89456d4d69732adc2
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Daemon-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-daemon
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=A simple http server class
+  URL:=http://search.cpan.org/dist/HTTP-Daemon/
+  DEPENDS:=perl +perl-http-date +perl-http-message +perl-lwp-mediatypes +perlbase-essential +perlbase-io +perlbase-sys
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-daemon/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-daemon))
diff --git a/lang/perl-http-date/Makefile b/lang/perl-http-date/Makefile
new file mode 100644 (file)
index 0000000..bf0bd40
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-http-date
+PKG_VERSION:=6.02
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
+PKG_SOURCE:=HTTP-Date-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=52b7a0d5982d61be1edb217751d7daba
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Date-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-date
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Date conversion routines
+  URL:=http://search.cpan.org/dist/HTTP-Date/
+  DEPENDS:=perl +perlbase-essential +perlbase-time
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-date/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-date))
diff --git a/lang/perl-http-message/Makefile b/lang/perl-http-message/Makefile
new file mode 100644 (file)
index 0000000..ecbb31f
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-http-message
+PKG_VERSION:=6.06
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
+PKG_SOURCE:=HTTP-Message-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=e563ac516e28d33f65bc0f295f625f85
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Message-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-message
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=HTTP style messages
+  URL:=http://search.cpan.org/dist/HTTP-Message/
+  DEPENDS:=perl +perl-encode-locale +perl-http-date +perl-io-html +perl-lwp-mediatypes +perl-uri +perlbase-compress +perlbase-encode +perlbase-essential +perlbase-io +perlbase-mime
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-message/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-message))
diff --git a/lang/perl-http-negotiate/Makefile b/lang/perl-http-negotiate/Makefile
new file mode 100644 (file)
index 0000000..a72893a
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-http-negotiate
+PKG_VERSION:=6.01
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
+PKG_SOURCE:=HTTP-Negotiate-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=1236195250e264d7436e7bb02031671b
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Negotiate-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-negotiate
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Choose a variant to serve
+  URL:=http://search.cpan.org/dist/HTTP-Negotiate/
+  DEPENDS:=perl +perl-http-message +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-negotiate/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-negotiate))
diff --git a/lang/perl-http-server-simple/Makefile b/lang/perl-http-server-simple/Makefile
new file mode 100644 (file)
index 0000000..a967138
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-http-server-simple
+PKG_VERSION:=0.50
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/F/FA/FALCONE
+PKG_SOURCE:=HTTP-Server-Simple-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=09704b016bc276ca78df6ad4a7d36af6
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Server-Simple-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-server-simple
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lightweight HTTP server
+  URL:=http://search.cpan.org/dist/HTTP-Server-Simple/
+  DEPENDS:=perl +perl-cgi +perlbase-base +perlbase-essential +perlbase-filehandle +perlbase-socket +perlbase-test
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-server-simple/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-server-simple))
diff --git a/lang/perl-io-html/Makefile b/lang/perl-io-html/Makefile
new file mode 100644 (file)
index 0000000..9390c36
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-io-html
+PKG_VERSION:=1.001
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/C/CJ/CJM
+PKG_SOURCE:=IO-HTML-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=3f8958718844dc96b9f6946f21d70d22
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/IO-HTML-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-io-html
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Open an HTML file with automatic charset detection
+  URL:=http://search.cpan.org/dist/IO-HTML/
+  DEPENDS:=perl +perlbase-encode +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-io-html/install
+        $(call perlmod/Install,$(1),IO auto/IO)
+endef
+
+
+$(eval $(call BuildPackage,perl-io-html))
index 97e3c568ab22e386c1157ec87023f8f664b458d2..b81e678d1dadd272d28315e1f1632a6fe19abc69 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-lockfile-simple
 PKG_VERSION:=0.208
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/S/SC/SCHWIGON/lockfile-simple/
 PKG_SOURCE:=LockFile-Simple-$(PKG_VERSION).tar.gz
@@ -29,7 +29,7 @@ define Package/perl-lockfile-simple
   CATEGORY:=Languages
   TITLE:=Simple advisory file locking
   URL:=http://search.cpan.org/dist/LockFile-Simple/
-  DEPENDS:=perl
+  DEPENDS:=perl +perlbase-essential +perlbase-sys
 endef
 
 define Build/Configure
diff --git a/lang/perl-lwp-mediatypes/Makefile b/lang/perl-lwp-mediatypes/Makefile
new file mode 100644 (file)
index 0000000..6985431
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-lwp-mediatypes
+PKG_VERSION:=6.02
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
+PKG_SOURCE:=LWP-MediaTypes-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=8c5f25fb64b974d22aff424476ba13c9
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/LWP-MediaTypes-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-lwp-mediatypes
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Guess media type for a file or a URL
+  URL:=http://search.cpan.org/dist/LWP-MediaTypes/
+  DEPENDS:=perl +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-lwp-mediatypes/install
+        $(call perlmod/Install,$(1),LWP auto/LWP)
+endef
+
+
+$(eval $(call BuildPackage,perl-lwp-mediatypes))
diff --git a/lang/perl-net-http/Makefile b/lang/perl-net-http/Makefile
new file mode 100644 (file)
index 0000000..058ac16
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-net-http
+PKG_VERSION:=6.09
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER
+PKG_SOURCE:=Net-HTTP-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=3d84d17f64c7316d69e7eb7b4e292b9a
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Net-HTTP-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-net-http
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Low-level HTTP connection (client)
+  URL:=http://search.cpan.org/dist/Net-HTTP/
+  DEPENDS:=perl +perl-uri +perlbase-compress +perlbase-essential +perlbase-io
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-net-http/install
+        $(call perlmod/Install,$(1),Net auto/Net)
+endef
+
+
+$(eval $(call BuildPackage,perl-net-http))
index f1823fc92165f566c9596416dfa05e6d26dd125b..c915064997790befba05c8197908a5325d79c418 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-net-telnet
 PKG_VERSION:=3.04
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/J/JR/JROGERS/
 PKG_SOURCE:=Net-Telnet-$(PKG_VERSION).tar.gz
@@ -29,7 +29,7 @@ define Package/perl-net-telnet
   CATEGORY:=Languages
   TITLE:=Telnet client
   URL:=http://search.cpan.org/dist/Net-Telnet/
-  DEPENDS:=perl
+  DEPENDS:=perl +perlbase-essential +perlbase-socket +perlbase-symbol
 endef
 
 define Build/Configure
diff --git a/lang/perl-sub-uplevel/Makefile b/lang/perl-sub-uplevel/Makefile
new file mode 100644 (file)
index 0000000..266bce4
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-sub-uplevel
+PKG_VERSION:=0.25
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/D/DA/DAGOLDEN
+PKG_SOURCE:=Sub-Uplevel-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=5d0752dbfa94d0c91b25a264f47f5675
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Sub-Uplevel-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-sub-uplevel
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Apparently run a function in a higher stack frame
+  URL:=http://search.cpan.org/dist/Sub-Uplevel/
+  DEPENDS:=perl +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-sub-uplevel/install
+        $(call perlmod/Install,$(1),Sub auto/Sub)
+endef
+
+
+$(eval $(call BuildPackage,perl-sub-uplevel))
index aa08dec9465a51f22536df8df3e1050e4d7e98c4..fd2b4f63482d94480669db2067bc97212581a0ce 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-test-harness
 PKG_VERSION:=3.35
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/L/LE/LEONT/
 PKG_SOURCE:=Test-Harness-$(PKG_VERSION).tar.gz
@@ -29,7 +29,7 @@ define Package/perl-test-harness
   CATEGORY:=Languages
   TITLE:=Perl Test Harness
   URL:=http://search.cpan.org/dist/Test-Harness/
-  DEPENDS:=perl
+  DEPENDS:=perl +perlbase-base +perlbase-benchmark +perlbase-config +perlbase-essential +perlbase-file +perlbase-getopt +perlbase-io +perlbase-posix +perlbase-text
 endef
 
 define Build/Configure
diff --git a/lang/perl-test-warn/Makefile b/lang/perl-test-warn/Makefile
new file mode 100644 (file)
index 0000000..995e1ba
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-test-warn
+PKG_VERSION:=0.30
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/C/CH/CHORNY
+PKG_SOURCE:=Test-Warn-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=8306b998a96d2cc69266b5248d550472
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Test-Warn-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-test-warn
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Perl extension to test methods for warnings
+  URL:=http://search.cpan.org/dist/Test-Warn/
+  DEPENDS:=perl +perl-sub-uplevel +perlbase-essential +perlbase-test
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-test-warn/install
+        $(call perlmod/Install,$(1),Test auto/Test)
+endef
+
+
+$(eval $(call BuildPackage,perl-test-warn))
index df46d5292a7fa63781faa25b7f22236e75eb2604..3508d903c0b93c5c11d7ebc7d6ca10049645c5fd 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-uri
-PKG_VERSION:=1.67
-PKG_RELEASE:=2
+PKG_VERSION:=1.68
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
 PKG_SOURCE:=URI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=d0ef53b6c63bcc02ba55f405c30741e3
+PKG_MD5SUM:=4a954ab8d79f831616ca817ba4b26cb9
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
@@ -29,7 +29,7 @@ define Package/perl-uri
   CATEGORY:=Languages
   TITLE:=Manipulates and accesses URI strings
   URL:=http://search.cpan.org/dist/URI/
-  DEPENDS:=perl
+  DEPENDS:=perl +perlbase-essential +perlbase-integer +perlbase-mime +perlbase-scalar +perlbase-utf8
 endef
 
 define Build/Configure
index 3eaa3d01ccd699858d438382f74bd268dfb674f5..1e424cbb07b05d11fec589eb39f7c3c7a3bc047d 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-www-curl
 PKG_VERSION:=4.17
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/S/SZ/SZBALINT/
 PKG_SOURCE:=WWW-Curl-$(PKG_VERSION).tar.gz
@@ -30,7 +30,7 @@ define Package/perl-www-curl
   CATEGORY:=Languages
   TITLE:=Perl bindings to libcurl
   URL:=http://search.cpan.org/dist/WWW-Curl/
-  DEPENDS:=perl +libcurl
+  DEPENDS:=perl +libcurl +perlbase-essential +perlbase-xsloader
 endef
 
 define Build/Configure
index 9fb1fcb22f52792351577d4a68796ac3aee5af75..93d6be21b5bcd3388efa28b2a13082f43b429fbd 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-www-mechanize
-PKG_VERSION:=1.74
-PKG_RELEASE:=2
+PKG_VERSION:=1.75
+PKG_RELEASE:=1
 
 PKG_SOURCE:=WWW-Mechanize-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
-PKG_MD5SUM:=8ec615225037ac66a2d37f4e9693ef86
+PKG_MD5SUM:=9a4b9c8827f519908ef0a0d2b8ae96fa
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
@@ -29,7 +29,7 @@ define Package/perl-www-mechanize
   CATEGORY:=Languages
   TITLE:=Perl WWW Mechanize
   URL:=http://search.cpan.org/dist/WWW-Mechanize/
-  DEPENDS:=perl +perl-www
+  DEPENDS:=perl +perl-cgi +perl-html-form +perl-html-parser +perl-html-tree +perl-http-daemon +perl-http-message +perl-http-server-simple +perl-test-warn +perl-uri +perl-www +perlbase-base +perlbase-essential +perlbase-file +perlbase-findbin +perlbase-getopt +perlbase-pod +perlbase-test
 endef
 
 define Build/Configure
diff --git a/lang/perl-www-robotrules/Makefile b/lang/perl-www-robotrules/Makefile
new file mode 100644 (file)
index 0000000..c28b8c2
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-www-robotrules
+PKG_VERSION:=6.02
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
+PKG_SOURCE:=WWW-RobotRules-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=b7186e8b8b3701e70c22abf430742403
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/WWW-RobotRules-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-www-robotrules
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=database of robots.txt-derived permissions
+  URL:=http://search.cpan.org/dist/WWW-RobotRules/
+  DEPENDS:=perl +perl-uri +perlbase-anydbm-file +perlbase-essential +perlbase-fcntl
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-www-robotrules/install
+        $(call perlmod/Install,$(1),WWW auto/WWW)
+endef
+
+
+$(eval $(call BuildPackage,perl-www-robotrules))
index acd9e9b9fdf7ea9928707691b7a1c583944de49f..6bb7c653934abcff231f8e33a28eb561e12693a9 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2013-2014 OpenWrt.org
+# Copyright (C) 2013-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-www
-PKG_VERSION:=5.837
-PKG_RELEASE:=3
+PKG_VERSION:=6.13
+PKG_RELEASE:=1
 
-PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS/
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
 PKG_SOURCE:=libwww-perl-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=9bbf1bce482b0bac98bb4f04253c03d0
+PKG_MD5SUM:=85b36bcd2fd2450718ee14f894f0d3d1
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
@@ -29,7 +29,7 @@ define Package/perl-www
   CATEGORY:=Languages
   TITLE:=WWW client/server library for Perl (aka LWP)
   URL:=http://search.cpan.org/dist/libwww-perl/
-  DEPENDS:=perl +perl-html-parser +perl-html-tagset +perl-uri
+  DEPENDS:=perl +perl-encode-locale +perl-file-listing +perl-html-parser +perl-http-cookies +perl-http-daemon +perl-http-date +perl-http-message +perl-http-negotiate +perl-lwp-mediatypes +perl-net-http +perl-uri +perl-www-robotrules +perlbase-base +perlbase-digest +perlbase-encode +perlbase-essential +perlbase-io +perlbase-mime +perlbase-net
 endef
 
 define Build/Configure
@@ -41,7 +41,7 @@ define Build/Compile
 endef
 
 define Package/perl-www/install
-       $(call perlmod/Install,$(1),File HTML HTTP LWP LWP.pm Net WWW)
+       $(call perlmod/Install,$(1),LWP.pm auto/LWP LWP)
 endef
 
 
diff --git a/lang/perl-www/patches/010-lwp-https-call-verify-hostname-when-avail.patch b/lang/perl-www/patches/010-lwp-https-call-verify-hostname-when-avail.patch
deleted file mode 100644 (file)
index 9166e89..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-commit 3b266f17ccd5613a9c42d1e04118e94ca6467489
-Author: Gisle Aas <gisle@aas.no>
-Date:   Sun Jan 16 12:56:30 2011 +0100
-
-    Call IO::Socket::SSL's verify_hostname when available
-
---- a/lib/LWP/Protocol/https.pm
-+++ b/lib/LWP/Protocol/https.pm
-@@ -14,6 +14,15 @@ sub socket_type
- sub _check_sock
- {
-     my($self, $req, $sock) = @_;
-+    if ($sock->can("verify_hostname")) {
-+      if (!$sock->verify_hostname($req->uri->host, "www")) {
-+          my $subject = $sock->peer_certificate("subject");
-+          die "SSL-peer fails verification [subject=$subject]\n";
-+      }
-+      else {
-+          $req->{ssl_sock_verified}++;
-+      }
-+    }
-     my $check = $req->header("If-SSL-Cert-Subject");
-     if (defined $check) {
-       my $cert = $sock->get_peer_certificate ||
-@@ -36,9 +45,14 @@ sub _get_sock_info
-       $res->header("Client-SSL-Cert-Subject" => $cert->subject_name);
-       $res->header("Client-SSL-Cert-Issuer" => $cert->issuer_name);
-     }
--    if(! eval { $sock->get_peer_verify }) {
--       $res->header("Client-SSL-Warning" => "Peer certificate not verified");
-+    if (!$res->request->{ssl_sock_verified}) {
-+      if(! eval { $sock->get_peer_verify }) {
-+          my $msg = "Peer certificate not verified";
-+          $msg .= " [$@]" if $@;
-+          $res->header("Client-SSL-Warning" => $msg);
-+      }
-     }
-+    $res->header("Client-SSL-Socket-Class" => $Net::HTTPS::SSL_SOCKET_CLASS);
- }
- #-----------------------------------------------------------
diff --git a/lang/perl-www/patches/020-lwp-https-verify-hostnames-by-default.patch b/lang/perl-www/patches/020-lwp-https-verify-hostnames-by-default.patch
deleted file mode 100644 (file)
index 465010e..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-commit 62dd58188d8f8987d24bd84951813a54a8bf5987
-Author: Gisle Aas <gisle@aas.no>
-Date:   Mon Jan 24 23:19:59 2011 +0100
-
-    Default to verifying hostnames when using SSL
-
---- a/lib/LWP/Protocol/https.pm
-+++ b/lib/LWP/Protocol/https.pm
-@@ -11,18 +11,30 @@ sub socket_type
-     return "https";
- }
--sub _check_sock
-+sub _extra_sock_opts
- {
--    my($self, $req, $sock) = @_;
--    if ($sock->can("verify_hostname")) {
--      if (!$sock->verify_hostname($req->uri->host, "www")) {
--          my $subject = $sock->peer_certificate("subject");
--          die "SSL-peer fails verification [subject=$subject]\n";
--      }
--      else {
--          $req->{ssl_sock_verified}++;
-+    my $self = shift;
-+    my %ssl_opts = %{$self->{ua}{ssl_opts} || {}};
-+    unless (exists $ssl_opts{SSL_verify_mode}) {
-+      $ssl_opts{SSL_verify_mode} = 1;
-+    }
-+    if (delete $ssl_opts{verify_hostname}) {
-+      $ssl_opts{SSL_verify_mode} ||= 1;
-+      $ssl_opts{SSL_verifycn_scheme} = 'www';
-+    }
-+    if ($ssl_opts{SSL_verify_mode}) {
-+      unless (exists $ssl_opts{SSL_ca_file} || exists $ssl_opts{SSL_ca_path}) {
-+          require Mozilla::CA;
-+          $ssl_opts{SSL_ca_file} = Mozilla::CA::SSL_ca_file();
-       }
-     }
-+    $self->{ssl_opts} = \%ssl_opts;
-+    return (%ssl_opts, $self->SUPER::_extra_sock_opts);
-+}
-+
-+sub _check_sock
-+{
-+    my($self, $req, $sock) = @_;
-     my $check = $req->header("If-SSL-Cert-Subject");
-     if (defined $check) {
-       my $cert = $sock->get_peer_certificate ||
-@@ -45,12 +57,11 @@ sub _get_sock_info
-       $res->header("Client-SSL-Cert-Subject" => $cert->subject_name);
-       $res->header("Client-SSL-Cert-Issuer" => $cert->issuer_name);
-     }
--    if (!$res->request->{ssl_sock_verified}) {
--      if(! eval { $sock->get_peer_verify }) {
--          my $msg = "Peer certificate not verified";
--          $msg .= " [$@]" if $@;
--          $res->header("Client-SSL-Warning" => $msg);
--      }
-+    if (!$self->{ssl_opts}{SSL_verify_mode}) {
-+      $res->push_header("Client-SSL-Warning" => "Peer certificate not verified");
-+    }
-+    elsif (!$self->{ssl_opts}{SSL_verifycn_scheme}) {
-+      $res->push_header("Client-SSL-Warning" => "Peer hostname match with certificate not verified");
-     }
-     $res->header("Client-SSL-Socket-Class" => $Net::HTTPS::SSL_SOCKET_CLASS);
- }
---- a/lib/LWP/UserAgent.pm
-+++ b/lib/LWP/UserAgent.pm
-@@ -41,6 +41,7 @@ sub new
-     my $timeout = delete $cnf{timeout};
-     $timeout = 3*60 unless defined $timeout;
-     my $local_address = delete $cnf{local_address};
-+    my $ssl_opts = delete $cnf{ssl_opts};
-     my $use_eval = delete $cnf{use_eval};
-     $use_eval = 1 unless defined $use_eval;
-     my $parse_head = delete $cnf{parse_head};
-@@ -83,6 +84,7 @@ sub new
-                     def_headers  => $def_headers,
-                     timeout      => $timeout,
-                     local_address => $local_address,
-+                    ssl_opts     => { $ssl_opts ? %$ssl_opts  : (verify_hostname => 1) },
-                     use_eval     => $use_eval,
-                       show_progress=> $show_progress,
-                     max_size     => $max_size,
-@@ -582,6 +584,20 @@ sub max_size     { shift->_elem('max_siz
- sub max_redirect { shift->_elem('max_redirect', @_); }
- sub show_progress{ shift->_elem('show_progress', @_); }
-+sub ssl_opts {
-+    my $self = shift;
-+    if (@_ == 1) {
-+      my $k = shift;
-+      return $self->{ssl_opts}{$k};
-+    }
-+    if (@_) {
-+      %{$self->{ssl_opts}} = (%{$self->{ssl_opts}}, @_);
-+    }
-+    else {
-+      return keys %{$self->{ssl_opts}};
-+    }
-+}
-+
- sub parse_head {
-     my $self = shift;
-     if (@_) {
-@@ -1040,6 +1056,7 @@ The following options correspond to attr
-    cookie_jar              undef
-    default_headers         HTTP::Headers->new
-    local_address           undef
-+   ssl_opts              { verify_hostname => 1 }
-    max_size                undef
-    max_redirect            7
-    parse_head              1
index b54ea1e84ccd3cf7f839fdd40c3f374ccdfd29ed..ef0f31f0238e83c9b4ee3ca10f46e0c543141094 100644 (file)
@@ -226,16 +226,9 @@ define Build/InstallDev
                $(1)/usr/include/boost/ \
                # copies _all_ header files - independent of <--with-library>-argument above
 
-       if [ -d $(PKG_INSTALL_DIR)/lib ]; then \
-               $(INSTALL_DIR) \
-                       $(1)/usr/lib; \
-               $(CP) \
-                       $(PKG_INSTALL_DIR)/lib/*.a \
-                       $(1)/usr/lib/; \
-               $(CP) \
-                       $(PKG_INSTALL_DIR)/lib/*.so* \
-                       $(1)/usr/lib/; \
-       fi
+       $(INSTALL_DIR) $(1)/usr/lib
+       -$(CP) $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/
+       -$(CP) $(PKG_INSTALL_DIR)/lib/*.so* $(1)/usr/lib/
 endef
 
 define Host/Install
index 2fe243331f6b068dbc7594595a5656dac5a845b5..c3d2ddc2f9d113b1f3ca57e4f781d9264bdceb8e 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libevdev
-PKG_VERSION:=1.4.2
+PKG_VERSION:=1.4.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.freedesktop.org/software/libevdev/
-PKG_MD5SUM:=debfcd5153558eba25a8e71eb2534ae8
+PKG_MD5SUM:=2fc170e2d6f543ba26e7c79f95dc1935
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
index f03e1dbecc6eb646e823b8ca1d127cb15c61e78b..26da26366440a7b62b3d2bb4c43039a144b5977e 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libinput
-PKG_VERSION:=0.17.0
+PKG_VERSION:=0.18.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.freedesktop.org/software/libinput/
-# PKG_MD5SUM:=debfcd5153558eba25a8e71eb2534ae8
+PKG_MD5SUM:=0ddbb0d53d58dec0a86de6791560011a
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
index a9d7e750824028d844ba636e0439c3f4c00c7fcb..a7911633733d00d6338390cf6a3c9bc9568cb8b2 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libnet
 PKG_VERSION:=1.2-rc3
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://sourceforge.net/projects/libnet-dev/files/
index fcb4188a01ba8a9d947f4df99909552e64459512..b95366a07cfc66e6ccb2e7dc171ddcbd6b935621 100644 (file)
@@ -1,11 +1,16 @@
 --- a/src/libnet_link_linux.c
 +++ b/src/libnet_link_linux.c
-@@ -30,7 +30,7 @@
+@@ -30,13 +30,8 @@
  #include <sys/time.h>
  
  #include <net/if.h>
 -#if (__GLIBC__)
-+#if (!__UCLIBC__)
  #include <netinet/if_ether.h>
  #include <net/if_arp.h>
- #else
+-#else
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ #if (HAVE_PACKET_SOCKET)
+ #ifndef SOL_PACKET
index 6e07e6854cc8c4b49454eb7da10a66b0db3de134..54d7737e1cce9b8d7884daf47e4bd69d8593f471 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pthsem
 PKG_VERSION:=2.0.8
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
 PKG_LICENSE:=LGPL-2.1+
@@ -21,6 +21,7 @@ PKG_MD5SUM:=9144b26dcc27e67498d63dd5456f934c
 
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
+PKG_FORTIFY_SOURCE:=0
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
@@ -37,6 +38,13 @@ define Package/pthsem/description
   pthsem is an extend version, with support for semaphores added. It can be installed parallel to a normal pth.
 endef
 
+# The musl libc provides a proper implementation of sigaltstack() so
+# prevent configure from wrongly assuming a broken Linux platform
+ifeq ($(CONFIG_USE_MUSL),y)
+  CONFIGURE_VARS += \
+       ac_cv_check_sjlj=ssjlj
+endif
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pthsem-config $(1)/usr/bin/
index 609206324ddb1cb470306565e6f38fe7216ccf56..0725f5934cf9705af24aceda10ed21b44f0974b2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2008 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=ctorrent-svn
 PKG_REV:=322
 PKG_VERSION:=r$(PKG_REV)
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://svn.code.sf.net/p/dtorrent/code/dtorrent/trunk
diff --git a/net/ctorrent-svn/patches/400-musl-compat.patch b/net/ctorrent-svn/patches/400-musl-compat.patch
new file mode 100644 (file)
index 0000000..e17c147
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/compat.c
++++ b/compat.c
+@@ -51,6 +51,7 @@ int snprintf(char *str, size_t size, con
+ #ifndef HAVE_STRNSTR
+ #include <string.h>
++#include <sys/types.h>
+ /* FUNCTION PROGRAMER: Siberiaic Sang */
+ char *strnstr(const char *haystack, const char *needle, size_t haystacklen)
+ {
index 96de63c22eda34f9271dfd4bb821abae624083ea..f11d26a234772e9fb50976a51b894b8d3daf58ec 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=davfs2
 PKG_VERSION:=1.5.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/davfs2/
diff --git a/net/davfs2/patches/100-musl-compat.patch b/net/davfs2/patches/100-musl-compat.patch
new file mode 100644 (file)
index 0000000..e819cbc
--- /dev/null
@@ -0,0 +1,194 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -42,7 +42,7 @@ DAV_CHECK_NEON
+ # Checks for header files.
+ AC_HEADER_DIRENT
+ AC_HEADER_STDC
+-AC_CHECK_HEADERS([fcntl.h libintl.h langinfo.h limits.h locale.h mntent.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/mount.h sys/time.h syslog.h termios.h unistd.h utime.h])
++AC_CHECK_HEADERS([error.h fcntl.h libintl.h langinfo.h limits.h locale.h mntent.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/mount.h sys/time.h sys/select.h sys/types.h syslog.h termios.h unistd.h utime.h])
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+@@ -78,7 +78,7 @@ AC_FUNC_SELECT_ARGTYPES
+ AC_FUNC_STRFTIME
+ AC_FUNC_STAT
+ AC_FUNC_UTIME_NULL
+-AC_CHECK_FUNCS([endpwent ftruncate getmntent memset mkdir nl_langinfo rpmatch select setlocale strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol strtoull utime])
++AC_CHECK_FUNCS([endpwent ftruncate getmntent memset mkdir nl_langinfo rpmatch select setlocale strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol strtoull utime canonicalize_file_name fopencookie])
+ # Misc.
+ DAV_DEFAULTS
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -19,12 +19,12 @@
+ #include "config.h"
++#include "compat.h"
+ #ifdef HAVE_DIRENT_H
+ #include <dirent.h>
+ #endif
+ #include <errno.h>
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+--- a/src/dav_fuse.c
++++ b/src/dav_fuse.c
+@@ -47,6 +47,9 @@
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
++#ifdef HAVE_SYS_SELECT_H
++#include <sys/select.h>
++#endif
+ #include "defaults.h"
+ #include "mount_davfs.h"
+--- a/src/kernel_interface.c
++++ b/src/kernel_interface.c
+@@ -19,8 +19,8 @@
+ #include "config.h"
++#include "compat.h"
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+@@ -51,6 +51,9 @@
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
+ #include <sys/wait.h>
+ #include "defaults.h"
+--- a/src/mount_davfs.c
++++ b/src/mount_davfs.c
+@@ -19,10 +19,10 @@
+ #include "config.h"
++#include "compat.h"
+ #include <ctype.h>
+ #include <errno.h>
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+--- a/src/umount_davfs.c
++++ b/src/umount_davfs.c
+@@ -19,8 +19,8 @@
+ #include "config.h"
++#include "compat.h"
+-#include <error.h>
+ #include <errno.h>
+ #include <getopt.h>
+ #ifdef HAVE_LIBINTL_H
+--- a/src/webdav.c
++++ b/src/webdav.c
+@@ -19,9 +19,9 @@
+ #include "config.h"
++#include "compat.h"
+ #include <errno.h>
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+@@ -368,6 +368,7 @@ dav_init_webdav(const dav_args *args)
+         error(EXIT_FAILURE, errno, _("socket library initialization failed"));
+     if (args->neon_debug & ~NE_DBG_HTTPPLAIN) {
++#ifdef HAVE_FOPENCOOKIE
+         char *buf = malloc(log_bufsize);
+         cookie_io_functions_t *log_func = malloc(sizeof(cookie_io_functions_t));
+         if (!log_func) abort();
+@@ -380,6 +381,9 @@ dav_init_webdav(const dav_args *args)
+             error(EXIT_FAILURE, errno,
+                   _("can't open stream to log neon-messages"));
+         ne_debug_init(log_stream, args->neon_debug);
++#else
++      error(EXIT_FAILURE, 0, "neon debugging unsupported");
++#endif
+     }
+     session = ne_session_create(args->scheme, args->host, args->port);
+--- /dev/null
++++ b/src/compat.h
+@@ -0,0 +1,64 @@
++#ifndef _COMPAT_H
++#define _COMPAT_H
++
++#ifndef _PATH_MOUNTED
++# define _PATH_MOUNTED "/proc/mounts"
++#endif
++
++#ifndef _PATH_MNTTAB
++# define _PATH_MNTTAB "/etc/fstab"
++#endif
++
++#ifdef HAVE_ERROR_H
++# include <error.h>
++#else
++# include <stdio.h>
++# include <stdarg.h>
++# include <stdlib.h>
++# include <string.h>
++static void error_at_line(int status, int errnum, const char *filename,
++                          unsigned int linenum, const char *format, ...)
++{
++      va_list ap;
++
++      fflush(stdout);
++
++      if (filename != NULL)
++              fprintf(stderr, "%s:%u: ", filename, linenum);
++
++      va_start(ap, format);
++      vfprintf(stderr, format, ap);
++      va_end(ap);
++
++      if (errnum != 0)
++              fprintf(stderr, ": %s", strerror(errnum));
++
++      fprintf(stderr, "\n");
++
++      if (status != 0)
++              exit(status);
++}
++
++#define error(status, errnum, format...) \
++      error_at_line(status, errnum, NULL, 0, format)
++
++#endif /* HAVE_ERROR_H */
++
++#ifndef HAVE_CANONICALIZE_FILE_NAME
++#include <limits.h>
++#include <string.h>
++#include <stdlib.h>
++static char * canonicalize_file_name(const char *path)
++{
++      char buf[PATH_MAX] = { };
++
++      snprintf(buf, sizeof(buf) - 1, "%s", path);
++
++      if (!realpath(path, buf))
++              return NULL;
++
++      return strdup(buf);
++}
++#endif
++
++#endif /* _COMPAT_H */
index 8c8dadc74a6ca03f38ff8d6676c724e147e36f4d..08b7f4000aad88d44b623cdc21689c515a43e63d 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnunet
-PKG_SOURCE_VERSION:=35991
+PKG_SOURCE_VERSION:=36019
 PKG_VERSION:=0.10.1-svn$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
index e1415de219a07343b8d264654188b2321d3ea2d6..c63b1ffbb400b0e61287ee33cb50b8b79b5e2d40 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnurl
 PKG_VERSION:=7.40.0
-PKG_RELEASE:=3
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://gnunet.org/sites/default/files
@@ -53,6 +53,7 @@ CONFIGURE_ARGS += \
        --with-gnutls="$(STAGING_DIR)/usr" \
        --with-libidn="$(STAGING_DIR)/usr" \
        --with-zlib="$(STAGING_DIR)/usr" \
+       --with-ca-path="/etc/ssl/certs/" \
        --enable-shared \
        --enable-static \
        --without-axtls \
diff --git a/net/gnurl/patches/010-backport-gtls-add-support-for-CURLOPT_CAPATH.patch b/net/gnurl/patches/010-backport-gtls-add-support-for-CURLOPT_CAPATH.patch
new file mode 100644 (file)
index 0000000..37d862f
--- /dev/null
@@ -0,0 +1,100 @@
+From 5a1614cecdd57cab8b4ae3e9bc19dfff5ba77e80 Mon Sep 17 00:00:00 2001
+From: Alessandro Ghedini <alessandro@ghedini.me>
+Date: Sun, 8 Mar 2015 20:11:06 +0100
+Subject: [PATCH] gtls: add support for CURLOPT_CAPATH
+
+---
+ acinclude.m4                       |  4 ++--
+ docs/libcurl/opts/CURLOPT_CAPATH.3 |  5 ++---
+ lib/vtls/gtls.c                    | 22 ++++++++++++++++++++++
+ lib/vtls/gtls.h                    |  3 +++
+ 4 files changed, 29 insertions(+), 5 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 6ed7ffb..ca01869 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -2615,8 +2615,8 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
+     capath="no"
+   elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
+     dnl --with-ca-path given
+-    if test "x$OPENSSL_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then
+-      AC_MSG_ERROR([--with-ca-path only works with openSSL or PolarSSL])
++    if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then
++      AC_MSG_ERROR([--with-ca-path only works with OpenSSL, GnuTLS or PolarSSL])
+     fi
+     capath="$want_capath"
+     ca="no"
+diff --git a/docs/libcurl/opts/CURLOPT_CAPATH.3 b/docs/libcurl/opts/CURLOPT_CAPATH.3
+index 642953d..6695f9f 100644
+--- a/docs/libcurl/opts/CURLOPT_CAPATH.3
++++ b/docs/libcurl/opts/CURLOPT_CAPATH.3
+@@ -43,9 +43,8 @@ All TLS based protocols: HTTPS, FTPS, IMAPS, POP3, SMTPS etc.
+ .SH EXAMPLE
+ TODO
+ .SH AVAILABILITY
+-This option is OpenSSL-specific and does nothing if libcurl is built to use
+-GnuTLS. NSS-powered libcurl provides the option only for backward
+-compatibility.
++This option is supported by the OpenSSL, GnuTLS and PolarSSL backends. The NSS
++backend provides the option only for backward compatibility.
+ .SH RETURN VALUE
+ Returns CURLE_OK if TLS enabled, and CURLE_UNKNOWN_OPTION if not, or
+ CURLE_OUT_OF_MEMORY if there was insufficient heap space.
+diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c
+index 05aef19..c792540 100644
+--- a/lib/vtls/gtls.c
++++ b/lib/vtls/gtls.c
+@@ -97,6 +97,10 @@ static bool gtls_inited = FALSE;
+ #  if (GNUTLS_VERSION_NUMBER >= 0x03020d)
+ #    define HAS_OCSP
+ #  endif
++
++#  if (GNUTLS_VERSION_NUMBER >= 0x030306)
++#    define HAS_CAPATH
++#  endif
+ #endif
+ #ifdef HAS_OCSP
+@@ -462,6 +466,24 @@ gtls_connect_step1(struct connectdata *conn,
+             rc, data->set.ssl.CAfile);
+   }
++#ifdef HAS_CAPATH
++  if(data->set.ssl.CApath) {
++    /* set the trusted CA cert directory */
++    rc = gnutls_certificate_set_x509_trust_dir(conn->ssl[sockindex].cred,
++                                                data->set.ssl.CApath,
++                                                GNUTLS_X509_FMT_PEM);
++    if(rc < 0) {
++      infof(data, "error reading ca cert file %s (%s)\n",
++            data->set.ssl.CAfile, gnutls_strerror(rc));
++      if(data->set.ssl.verifypeer)
++        return CURLE_SSL_CACERT_BADFILE;
++    }
++    else
++      infof(data, "found %d certificates in %s\n",
++            rc, data->set.ssl.CApath);
++  }
++#endif
++
+   if(data->set.ssl.CRLfile) {
+     /* set the CRL list file */
+     rc = gnutls_certificate_set_x509_crl_file(conn->ssl[sockindex].cred,
+diff --git a/lib/vtls/gtls.h b/lib/vtls/gtls.h
+index c3867e5..af1cb5b 100644
+--- a/lib/vtls/gtls.h
++++ b/lib/vtls/gtls.h
+@@ -54,6 +54,9 @@ bool Curl_gtls_cert_status_request(void);
+ /* Set the API backend definition to GnuTLS */
+ #define CURL_SSL_BACKEND CURLSSLBACKEND_GNUTLS
++/* this backend supports the CAPATH option */
++#define have_curlssl_ca_path 1
++
+ /* API setup for GnuTLS */
+ #define curlssl_init Curl_gtls_init
+ #define curlssl_cleanup Curl_gtls_cleanup
+-- 
+2.4.4
+
index cc7f81d41faf33c9c27648f776d5826361ccdb38..238840629dd8225d2e9239c13cca15d33144beab 100644 (file)
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=knxd
-PKG_VERSION=2015-06-02-$(PKG_SOURCE_VERSION)
+PKG_VERSION=2015-06-27-$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/knxd/knxd.git
-PKG_SOURCE_VERSION:=3d3b1a5e8112397d297625d673a2a94507f9ebce
+PKG_SOURCE_VERSION:=50e7f6e6bfa13c2b6140b0f76aaa70234bf44b1d
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
 
diff --git a/net/knxd/patches/0100-musl-compat b/net/knxd/patches/0100-musl-compat
new file mode 100644 (file)
index 0000000..0c2a09b
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/examples/common.h    2015-06-27 15:20:15.266563893 +0200
++++ b/src/examples/common.h    2015-06-27 15:23:09.406457392 +0200
+@@ -20,6 +20,7 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <unistd.h>
++#include <sys/select.h>
+ #include "eibclient.h"
+ /** unsigned char*/
index 06083fc961bcd3704a70b61162c5d5ab52c77fc2..3af3842bef3ce99d3eb71333cdaf64d899240904 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=linknx
 PKG_VERSION:=0.0.1.32
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 PKG_MD5SUM:=7ecc1208f59bceb05068c752b2250b63
 
 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
@@ -18,6 +18,7 @@ PKG_LICENSE:=GPL-2.0+
 PKG_SOURCE_URL:=@SF/linknx
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_BUILD_DEPENDS:=argp-standalone
+PKG_FORTIFY_SOURCE:=1
 
 include $(INCLUDE_DIR)/package.mk
 
diff --git a/net/linknx/patches/010-musl-compat b/net/linknx/patches/010-musl-compat
new file mode 100644 (file)
index 0000000..15c757e
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/eibclient.c  2007-10-11 01:55:31.000000000 +0200
++++ b/src/eibclient.c  2015-06-27 22:18:01.433296921 +0200
+@@ -32,6 +32,7 @@
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #include <errno.h>
++#include <string.h>
+ #include "config.h"
diff --git a/net/linknx/patches/012-fix-linknx.cpp b/net/linknx/patches/012-fix-linknx.cpp
new file mode 100644 (file)
index 0000000..8394cf1
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/linknx.cpp   2012-06-04 22:12:13.000000000 +0200
++++ b/src/linknx.cpp   2015-06-27 22:35:23.705721355 +0200
+@@ -136,7 +136,7 @@
+     if (errno)
+         printf (": %s\n", strerror (errno));
+     else
+-        printf ("\n", strerror (errno));
++        printf ("\n");
+     exit (1);
+ }
index 1a46601117264730050e13e07658f453a0d969f9..f3ca9bacffc8711db7145102483afefdfb559c92 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=mtr
 PKG_REV:=dd2b750
 PKG_VERSION:=0.85+newdns-$(PKG_REV)
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/traviscross/mtr.git
diff --git a/net/mtr/patches/100-disabled-ipv6-fix.patch b/net/mtr/patches/100-disabled-ipv6-fix.patch
new file mode 100644 (file)
index 0000000..5ef9984
--- /dev/null
@@ -0,0 +1,49 @@
+--- a/net.c
++++ b/net.c
+@@ -307,9 +307,11 @@ void net_send_tcp(int index)
+   struct sockaddr_storage local;
+   struct sockaddr_storage remote;
+   struct sockaddr_in *local4 = (struct sockaddr_in *) &local;
+-  struct sockaddr_in6 *local6 = (struct sockaddr_in6 *) &local;
+   struct sockaddr_in *remote4 = (struct sockaddr_in *) &remote;
++#ifdef ENABLE_IPV6
++  struct sockaddr_in6 *local6 = (struct sockaddr_in6 *) &local;
+   struct sockaddr_in6 *remote6 = (struct sockaddr_in6 *) &remote;
++#endif
+   socklen_t len;
+   ttl = index + 1;
+@@ -566,8 +568,10 @@ void net_send_query(int index)
+   /* sendto() assumes packet length includes the IPv4 header but not the 
+      IPv6 header. */
+-  spacketsize = abs(packetsize)       -
+-              ( ( af == AF_INET ) ? 0 : sizeof (struct ip6_hdr) );
++  spacketsize = abs(packetsize);
++#ifdef ENABLE_IPV6
++  spacketsize -= ( ( af == AF_INET ) ? 0 : sizeof (struct ip6_hdr) );
++#endif
+   rv = sendto(sendsock, packet, spacketsize, 0, remotesockaddr, salen);
+   if (first && (rv < 0) && ((errno == EINVAL) || (errno == EMSGSIZE))) {
+     /* Try the first packet again using host byte order. */
+--- a/dns.c
++++ b/dns.c
+@@ -49,7 +49,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ //#include <ctype.h>
+-//#include <string.h>
++#include <string.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <signal.h>
+--- a/net.h
++++ b/net.h
+@@ -20,6 +20,7 @@
+ #include <netdb.h>
+ #include <arpa/inet.h>
+ #include <netinet/in.h>
++#include <sys/select.h>
+ #include <sys/socket.h>
+ #ifdef ENABLE_IPV6
+ #include <netinet/ip6.h>
index 38d038035fd58567c6ee3eae2c5cbe85e7856e13..2bf4ca1f06ba84f224e3dd3d84facd0bbf26aef7 100644 (file)
@@ -122,6 +122,7 @@ SNMP_MIB_MODULES_INCLUDED = \
        ucd-snmp/loadave \
        ucd-snmp/memory \
        ucd-snmp/pass \
+       ucd-snmp/pass_persist \
        ucd-snmp/proc \
        ucd-snmp/vmstat \
        util_funcs \
index b9c9706cb0cd256e0a411dc36e0f3402a697983b..787e77955b5330572654dd89e0aed697e6f24cc3 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ntp
 PKG_VERSION:=4.2.8p2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
@@ -93,7 +93,9 @@ endef
 CONFIGURE_VARS += \
        ac_cv_header_md5_h=no \
        ac_cv_lib_rt_sched_setscheduler=no \
-       ac_cv_header_dns_sd_h=no
+       ac_cv_header_dns_sd_h=no \
+       hw_cv_func_snprintf_c99=yes \
+       hw_cv_func_vsnprintf_c99=yes \
 
 CONFIGURE_ARGS += \
        --disable-all-clocks \
index 249f75ba21a1a182f5ddd5d5e387db1d38d905e1..2276b31ad27b8cbde23981e93412daf41729c511 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Copyright (C) 2011 segal.ubi.pt
-# Copyright (C) 2010-2014 OpenWrt.org
+# Copyright (C) 2010-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ntripclient
 PKG_VERSION:=1.5.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_LICENSE:=GPL-2.0+
 
 PKG_SOURCE:=$(PKG_NAME).zip
@@ -36,6 +36,7 @@ endef
 define Build/Prepare
        mkdir -p $(PKG_BUILD_DIR)
        unzip $(DL_DIR)/$(PKG_SOURCE) -d $(PKG_BUILD_DIR)
+       $(call Build/Prepare/Default)
 endef
 
 MAKE_FLAGS += \
diff --git a/net/ntripclient/patches/100-musl-compat.patch b/net/ntripclient/patches/100-musl-compat.patch
new file mode 100644 (file)
index 0000000..10f690f
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/ntripclient.c
++++ b/ntripclient.c
+@@ -44,6 +44,7 @@
+   #include <fcntl.h>
+   #include <unistd.h>
+   #include <arpa/inet.h>
++  #include <sys/select.h>
+   #include <sys/socket.h>
+   #include <netinet/in.h>
+   #include <netdb.h>
index f24a79b8b1cdb232e3bdace33b22244c0c89414b..e68b3eb21d5e5a5da486a08f98a45eda046274f7 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vsftpd
 PKG_VERSION:=3.0.2
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://security.appspot.com/downloads/
diff --git a/net/vsftpd/patches/007-CVE-2015-1419.patch b/net/vsftpd/patches/007-CVE-2015-1419.patch
new file mode 100644 (file)
index 0000000..173027a
--- /dev/null
@@ -0,0 +1,98 @@
+Description: CVE-2015-1419: config option deny_file is not handled correctly
+Author: Marcus Meissner <meissner@suse.com>
+Origin: https://bugzilla.novell.com/show_bug.cgi?id=CVE-2015-1419
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776922
+Last-Update: 2015-02-24
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/ls.c
++++ b/ls.c
+@@ -7,6 +7,7 @@
+  * Would you believe, code to handle directory listing.
+  */
++#include <stdlib.h>
+ #include "ls.h"
+ #include "access.h"
+ #include "defs.h"
+@@ -243,11 +244,42 @@ vsf_filename_passes_filter(const struct
+   struct mystr temp_str = INIT_MYSTR;
+   struct mystr brace_list_str = INIT_MYSTR;
+   struct mystr new_filter_str = INIT_MYSTR;
++  struct mystr normalize_filename_str = INIT_MYSTR;
++  const char *normname;
++  const char *path;
+   int ret = 0;
+   char last_token = 0;
+   int must_match_at_current_pos = 1;
++
+   str_copy(&filter_remain_str, p_filter_str);
+-  str_copy(&name_remain_str, p_filename_str);
++
++  /* normalize filepath */
++  path = str_strdup(p_filename_str);
++  normname = realpath(path, NULL);
++  if (normname == NULL)
++     goto out;
++  str_alloc_text(&normalize_filename_str, normname);
++
++  if (!str_isempty (&filter_remain_str) && !str_isempty(&normalize_filename_str)) {
++    if (str_get_char_at(p_filter_str, 0) == '/') {
++      if (str_get_char_at(&normalize_filename_str, 0) != '/') {
++        str_getcwd (&name_remain_str);
++
++        if (str_getlen(&name_remain_str) > 1) /* cwd != root dir */
++          str_append_char (&name_remain_str, '/');
++
++        str_append_str (&name_remain_str, &normalize_filename_str);
++      }
++      else
++       str_copy (&name_remain_str, &normalize_filename_str);
++    } else {
++      if (str_get_char_at(p_filter_str, 0) != '{')
++        str_basename (&name_remain_str, &normalize_filename_str);
++      else
++        str_copy (&name_remain_str, &normalize_filename_str);
++    }
++  } else
++    str_copy(&name_remain_str, &normalize_filename_str);
+   while (!str_isempty(&filter_remain_str) && *iters < VSFTP_MATCHITERS_MAX)
+   {
+@@ -360,6 +392,9 @@ vsf_filename_passes_filter(const struct
+     ret = 0;
+   }
+ out:
++  free(normname);
++  free(path);
++  str_free(&normalize_filename_str);
+   str_free(&filter_remain_str);
+   str_free(&name_remain_str);
+   str_free(&temp_str);
+--- a/str.c
++++ b/str.c
+@@ -711,3 +711,14 @@ str_replace_unprintable(struct mystr* p_
+   }
+ }
++void
++str_basename (struct mystr* d_str, const struct mystr* path)
++{
++  static struct mystr tmp;
++
++  str_copy (&tmp, path);
++  str_split_char_reverse(&tmp, d_str, '/');
++
++  if (str_isempty(d_str))
++   str_copy (d_str, path);
++}
+--- a/str.h
++++ b/str.h
+@@ -100,6 +100,7 @@ void str_replace_unprintable(struct myst
+ int str_atoi(const struct mystr* p_str);
+ filesize_t str_a_to_filesize_t(const struct mystr* p_str);
+ unsigned int str_octal_to_uint(const struct mystr* p_str);
++void str_basename (struct mystr* d_str, const struct mystr* path);
+ /* PURPOSE: Extract a line of text (delimited by \n or EOF) from a string
+  * buffer, starting at character position 'p_pos'. The extracted line will
index 2518ddae1805412710722ffe3de9ae053169ea44..6236acecb0f617a34cee396357dc04bb478b7066 100644 (file)
@@ -13,15 +13,15 @@ index 0000000..3de527b
 \ No newline at end of file
 diff --git a/src/pregen/DAAP2SQL.c b/src/pregen/DAAP2SQL.c
 new file mode 100644
-index 0000000..3f94589
+index 0000000..f13209c
 --- /dev/null
 +++ b/src/pregen/DAAP2SQL.c
-@@ -0,0 +1,929 @@
+@@ -0,0 +1,975 @@
 +/** \file
 + *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : DAAP2SQL.g
-+ *     -                            On : 2014-09-30 21:42:43
++ *     -                            On : 2015-06-27 19:05:20
 + *     -           for the tree parser : DAAP2SQLTreeParser *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -582,11 +582,7 @@ index 0000000..3f94589
 +
 +                      {
 +
-+                                              if (!a.valid || !b.valid)
-+                                              {
-+                                                      retval.valid= 0;
-+                                              }
-+                                              else
++                                              if (a.valid && b.valid)
 +                                              {
 +                                                      retval.result= a.result->factory->newRaw(a.result->factory);
 +                                                      retval.result->append8(retval.result, "(");
@@ -595,13 +591,27 @@ index 0000000..3f94589
 +                                                      retval.result->appendS(retval.result, b.result);
 +                                                      retval.result->append8(retval.result, ")");
 +                                              }
++                                              else if (a.valid)
++                                              {
++                                                      retval.result= a.result->factory->newRaw(a.result->factory);
++                                                      retval.result->appendS(retval.result, a.result);
++                                              }
++                                              else if (b.valid)
++                                              {
++                                                      retval.result= b.result->factory->newRaw(b.result->factory);
++                                                      retval.result->appendS(retval.result, b.result);
++                                              }
++                                              else
++                                              {
++                                                      retval.valid= 0;
++                                              }
 +                                      
 +                      }
 +
 +                  }
 +                  break;
 +              case 2:
-+                  // DAAP2SQL.g:86:4: ^( OPOR a= expr b= expr )
++                  // DAAP2SQL.g:96:4: ^( OPOR a= expr b= expr )
 +                  {
 +                       MATCHT(OPOR, &FOLLOW_OPOR_in_expr118); 
 +                      if  (HASEXCEPTION())
@@ -643,11 +653,7 @@ index 0000000..3f94589
 +
 +                      {
 +
-+                                              if (!a.valid || !b.valid)
-+                                              {
-+                                                      retval.valid= 0;
-+                                              }
-+                                              else
++                                              if (a.valid && b.valid)
 +                                              {
 +                                                      retval.result= a.result->factory->newRaw(a.result->factory);
 +                                                      retval.result->append8(retval.result, "(");
@@ -656,13 +662,27 @@ index 0000000..3f94589
 +                                                      retval.result->appendS(retval.result, b.result);
 +                                                      retval.result->append8(retval.result, ")");
 +                                              }
++                                              else if (a.valid)
++                                              {
++                                                      retval.result= a.result->factory->newRaw(a.result->factory);
++                                                      retval.result->appendS(retval.result, a.result);
++                                              }
++                                              else if (b.valid)
++                                              {
++                                                      retval.result= b.result->factory->newRaw(b.result->factory);
++                                                      retval.result->appendS(retval.result, b.result);
++                                              }
++                                              else
++                                              {
++                                                      retval.valid= 0;
++                                              }
 +                                      
 +                      }
 +
 +                  }
 +                  break;
 +              case 3:
-+                  // DAAP2SQL.g:102:4: STR
++                  // DAAP2SQL.g:122:4: STR
 +                  {
 +                      STR1 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_expr140); 
 +                      if  (HASEXCEPTION())
@@ -765,13 +785,22 @@ index 0000000..3f94589
 +                                                              goto STR_result_valid_0; /* ABORT */
 +                                                      }
 +
++                                                      /* No need to exclude empty artist and album, as forked-daapd makes sure there always exists an artist/album. */
++                                                      if (neg_op && op == ':'
++                                                              && (strcmp((char *)field, "daap.songalbumartist") == 0 
++                                                                      || strcmp((char *)field, "daap.songartist") == 0 
++                                                                      || strcmp((char *)field, "daap.songalbum") == 0))
++                                                      {
++                                                              DPRINTF(E_DBG, L_DAAP, "Ignoring clause '%s%s%c'\n", field, (neg_op) ? "!" : "", op);
++                                                              retval.valid= 0;
++                                                              goto STR_result_valid_0;
++                                                      }
++                                                      
 +                                                      /* Need to check against NULL too */
 +                                                      if (op == ':')
 +                                                              retval.result->append8(retval.result, "(");
 +                                              }
 +
-+                                              retval.result->append8(retval.result, dqfm->db_col);
-+
 +                                              /* Int field: check integer conversion */
 +                                              if (dqfm->as_int)
 +                                              {
@@ -796,6 +825,21 @@ index 0000000..3f94589
 +                                                      }
 +
 +                                                      *end = '\0'; /* Cut out potential garbage - we're being kind */
++
++                                                      /* forked-daapd only has media_kind = 1 for music - so remove media_kind = 32 to imporve select query performance. */
++                                                      if (llval == 32
++                                                              && (strcmp((char *)field, "com.apple.itunes.mediakind") == 0 
++                                                                      || strcmp((char *)field, "com.apple.itunes.extended-media-kind") == 0))
++                                                      {
++                                                              DPRINTF(E_DBG, L_DAAP, "Ignoring clause '%s%s%c%s'\n", field, (neg_op) ? "!" : "", op, val);
++                                                              
++                                                              if (neg_op)
++                                                                      retval.result->append8(retval.result, "1 = 1");
++                                                              else
++                                                                      retval.result->append8(retval.result, "1 = 0");
++                                                              
++                                                              goto STR_out;
++                                                      }
 +                                              }
 +                                              /* String field: escape string, check for '*' */
 +                                              else
@@ -823,12 +867,14 @@ index 0000000..3f94589
 +                                                              val[0] = '%';
 +                                                      }
 +
-+                                                      if (val[strlen((char *)val) - 1] == '*')
++                                                      if (val[0] && val[1] && val[strlen((char *)val) - 1] == '*')
 +                                                      {
 +                                                              op = '%';
 +                                                              val[strlen((char *)val) - 1] = '%';
 +                                                      }
 +                                              }
++                                              
++                                              retval.result->append8(retval.result, dqfm->db_col);
 +
 +                                              switch(op)
 +                                              {
@@ -948,7 +994,7 @@ index 0000000..3f94589
 + */
 diff --git a/src/pregen/DAAP2SQL.h b/src/pregen/DAAP2SQL.h
 new file mode 100644
-index 0000000..e170f6c
+index 0000000..2b1e806
 --- /dev/null
 +++ b/src/pregen/DAAP2SQL.h
 @@ -0,0 +1,195 @@
@@ -956,7 +1002,7 @@ index 0000000..e170f6c
 + *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : DAAP2SQL.g
-+ *     -                            On : 2014-09-30 21:42:43
++ *     -                            On : 2015-06-27 19:05:20
 + *     -           for the tree parser : DAAP2SQLTreeParser *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -1161,7 +1207,7 @@ index 0000000..385d80b
 \ No newline at end of file
 diff --git a/src/pregen/DAAPLexer.c b/src/pregen/DAAPLexer.c
 new file mode 100644
-index 0000000..12e7ef3
+index 0000000..b72f28a
 --- /dev/null
 +++ b/src/pregen/DAAPLexer.c
 @@ -0,0 +1,1101 @@
@@ -1169,7 +1215,7 @@ index 0000000..12e7ef3
 + *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : DAAP.g
-+ *     -                            On : 2014-09-30 21:42:40
++ *     -                            On : 2015-06-27 19:05:17
 + *     -                 for the lexer : DAAPLexerLexer *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -2268,7 +2314,7 @@ index 0000000..12e7ef3
 + */
 diff --git a/src/pregen/DAAPLexer.h b/src/pregen/DAAPLexer.h
 new file mode 100644
-index 0000000..ba8f58b
+index 0000000..401b214
 --- /dev/null
 +++ b/src/pregen/DAAPLexer.h
 @@ -0,0 +1,188 @@
@@ -2276,7 +2322,7 @@ index 0000000..ba8f58b
 + *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : DAAP.g
-+ *     -                            On : 2014-09-30 21:42:40
++ *     -                            On : 2015-06-27 19:05:17
 + *     -                 for the lexer : DAAPLexerLexer *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -2462,7 +2508,7 @@ index 0000000..ba8f58b
 +/* END - Note:Keep extra line feed to satisfy UNIX systems */
 diff --git a/src/pregen/DAAPParser.c b/src/pregen/DAAPParser.c
 new file mode 100644
-index 0000000..6d0239d
+index 0000000..7a9aae9
 --- /dev/null
 +++ b/src/pregen/DAAPParser.c
 @@ -0,0 +1,1014 @@
@@ -2470,7 +2516,7 @@ index 0000000..6d0239d
 + *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : DAAP.g
-+ *     -                            On : 2014-09-30 21:42:39
++ *     -                            On : 2015-06-27 19:05:16
 + *     -                for the parser : DAAPParserParser *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -3482,7 +3528,7 @@ index 0000000..6d0239d
 + */
 diff --git a/src/pregen/DAAPParser.h b/src/pregen/DAAPParser.h
 new file mode 100644
-index 0000000..dcc664f
+index 0000000..82ce85e
 --- /dev/null
 +++ b/src/pregen/DAAPParser.h
 @@ -0,0 +1,226 @@
@@ -3490,7 +3536,7 @@ index 0000000..dcc664f
 + *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : DAAP.g
-+ *     -                            On : 2014-09-30 21:42:39
++ *     -                            On : 2015-06-27 19:05:16
 + *     -                for the parser : DAAPParserParser *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -3727,7 +3773,7 @@ index 0000000..89256ff
 \ No newline at end of file
 diff --git a/src/pregen/RSP2SQL.c b/src/pregen/RSP2SQL.c
 new file mode 100644
-index 0000000..b5c9550
+index 0000000..05b54d3
 --- /dev/null
 +++ b/src/pregen/RSP2SQL.c
 @@ -0,0 +1,2546 @@
@@ -3735,7 +3781,7 @@ index 0000000..b5c9550
 + *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : RSP2SQL.g
-+ *     -                            On : 2014-09-30 21:42:42
++ *     -                            On : 2015-06-27 19:05:19
 + *     -           for the tree parser : RSP2SQLTreeParser *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -6279,7 +6325,7 @@ index 0000000..b5c9550
 + */
 diff --git a/src/pregen/RSP2SQL.h b/src/pregen/RSP2SQL.h
 new file mode 100644
-index 0000000..2789fc7
+index 0000000..a94e317
 --- /dev/null
 +++ b/src/pregen/RSP2SQL.h
 @@ -0,0 +1,291 @@
@@ -6287,7 +6333,7 @@ index 0000000..2789fc7
 + *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : RSP2SQL.g
-+ *     -                            On : 2014-09-30 21:42:42
++ *     -                            On : 2015-06-27 19:05:19
 + *     -           for the tree parser : RSP2SQLTreeParser *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -6588,7 +6634,7 @@ index 0000000..53d8cda
 \ No newline at end of file
 diff --git a/src/pregen/RSPLexer.c b/src/pregen/RSPLexer.c
 new file mode 100644
-index 0000000..ee23c08
+index 0000000..bc4245a
 --- /dev/null
 +++ b/src/pregen/RSPLexer.c
 @@ -0,0 +1,4867 @@
@@ -6596,7 +6642,7 @@ index 0000000..ee23c08
 + *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : RSP.g
-+ *     -                            On : 2014-09-30 21:42:41
++ *     -                            On : 2015-06-27 19:05:18
 + *     -                 for the lexer : RSPLexerLexer *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -11461,7 +11507,7 @@ index 0000000..ee23c08
 + */
 diff --git a/src/pregen/RSPLexer.h b/src/pregen/RSPLexer.h
 new file mode 100644
-index 0000000..4f4d06b
+index 0000000..d93f93e
 --- /dev/null
 +++ b/src/pregen/RSPLexer.h
 @@ -0,0 +1,254 @@
@@ -11469,7 +11515,7 @@ index 0000000..4f4d06b
 + *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : RSP.g
-+ *     -                            On : 2014-09-30 21:42:41
++ *     -                            On : 2015-06-27 19:05:18
 + *     -                 for the lexer : RSPLexerLexer *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -11721,7 +11767,7 @@ index 0000000..4f4d06b
 +/* END - Note:Keep extra line feed to satisfy UNIX systems */
 diff --git a/src/pregen/RSPParser.c b/src/pregen/RSPParser.c
 new file mode 100644
-index 0000000..c538e49
+index 0000000..c0f3e2a
 --- /dev/null
 +++ b/src/pregen/RSPParser.c
 @@ -0,0 +1,2684 @@
@@ -11729,7 +11775,7 @@ index 0000000..c538e49
 + *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : RSP.g
-+ *     -                            On : 2014-09-30 21:42:40
++ *     -                            On : 2015-06-27 19:05:18
 + *     -                for the parser : RSPParserParser *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -13250,7 +13296,7 @@ index 0000000..c538e49
 +
 +                       
 +                      /* AST REWRITE
-+                       * elements          : NOT, FIELD, strop, STR
++                       * elements          : NOT, strop, STR, FIELD
 +                       * token labels      : 
 +                       * rule labels       : retval
 +                       * token list labels : 
@@ -13557,7 +13603,7 @@ index 0000000..c538e49
 +
 +                       
 +                      /* AST REWRITE
-+                       * elements          : FIELD, intop, INT
++                       * elements          : intop, INT, FIELD
 +                       * token labels      : 
 +                       * rule labels       : retval
 +                       * token list labels : 
@@ -13632,7 +13678,7 @@ index 0000000..c538e49
 +
 +                       
 +                      /* AST REWRITE
-+                       * elements          : NOT, INT, FIELD, intop
++                       * elements          : INT, FIELD, intop, NOT
 +                       * token labels      : 
 +                       * rule labels       : retval
 +                       * token list labels : 
@@ -13867,7 +13913,7 @@ index 0000000..c538e49
 +
 +             
 +            /* AST REWRITE
-+             * elements          : FIELD, datespec, dateop
++             * elements          : datespec, FIELD, dateop
 +             * token labels      : 
 +             * rule labels       : retval
 +             * token list labels : 
@@ -14167,7 +14213,7 @@ index 0000000..c538e49
 +
 +                       
 +                      /* AST REWRITE
-+                       * elements          : dateintval, INT, dateref, dateop
++                       * elements          : INT, dateintval, dateop, dateref
 +                       * token labels      : 
 +                       * rule labels       : retval
 +                       * token list labels : 
@@ -14411,7 +14457,7 @@ index 0000000..c538e49
 + */
 diff --git a/src/pregen/RSPParser.h b/src/pregen/RSPParser.h
 new file mode 100644
-index 0000000..d0744a2
+index 0000000..4b3bbfe
 --- /dev/null
 +++ b/src/pregen/RSPParser.h
 @@ -0,0 +1,365 @@
@@ -14419,7 +14465,7 @@ index 0000000..d0744a2
 + *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
 + *
 + *     -  From the grammar source file : RSP.g
-+ *     -                            On : 2014-09-30 21:42:40
++ *     -                            On : 2015-06-27 19:05:18
 + *     -                for the parser : RSPParserParser *
 + * Editing it, at least manually, is not wise. 
 + *
@@ -14780,3 +14826,8446 @@ index 0000000..d0744a2
 +#endif
 +
 +/* END - Note:Keep extra line feed to satisfy UNIX systems */
+diff --git a/src/pregen/SMARTPL.u b/src/pregen/SMARTPL.u
+new file mode 100644
+index 0000000..2a66bf3
+--- /dev/null
++++ b/src/pregen/SMARTPL.u
+@@ -0,0 +1,6 @@
++SMARTPLParser.c : SMARTPL.g
++./SMARTPL.tokens : SMARTPL.g
++SMARTPLParser.h : SMARTPL.g
++SMARTPLLexer.c : SMARTPL.g
++SMARTPLLexer.h : SMARTPL.g
++ANTLR_PRODUCTS += SMARTPLParser.c ./SMARTPL.tokens SMARTPLParser.h SMARTPLLexer.c SMARTPLLexer.h 
+\ No newline at end of file
+diff --git a/src/pregen/SMARTPL2SQL.c b/src/pregen/SMARTPL2SQL.c
+new file mode 100644
+index 0000000..c435f37
+--- /dev/null
++++ b/src/pregen/SMARTPL2SQL.c
+@@ -0,0 +1,1649 @@
++/** \file
++ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : SMARTPL2SQL.g
++ *     -                            On : 2015-06-27 19:05:21
++ *     -           for the tree parser : SMARTPL2SQLTreeParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++*/
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++
++/* =============================================================================
++ * This is what the grammar programmer asked us to put at the top of every file.
++ */
++
++      #include <stdio.h>
++      #include <stdlib.h>
++      #include <string.h>
++      #include <limits.h>
++      #include <errno.h>
++      #include <time.h>
++      #include <sqlite3.h>
++
++      #include "logger.h"
++      #include "db.h"
++
++/* End of Header action.
++ * =============================================================================
++ */
++/* -----------------------------------------
++ * Include the ANTLR3 generated header file.
++ */
++#include    "SMARTPL2SQL.h"
++/* ----------------------------------------- */
++
++
++
++
++
++/* MACROS that hide the C interface implementations from the
++ * generated code, which makes it a little more understandable to the human eye.
++ * I am very much against using C pre-processor macros for function calls and bits
++ * of code as you cannot see what is happening when single stepping in debuggers
++ * and so on. The exception (in my book at least) is for generated code, where you are
++ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
++ * hides some indirect calls, but is always referring to the input stream. This is
++ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
++ * the runtime interfaces without changing the generated code too often, without
++ * confusing the reader of the generated output, who may not wish to know the gory
++ * details of the interface inheritance.
++ */
++ 
++#define               CTX     ctx
++
++/* Aids in accessing scopes for grammar programmers
++ */
++#undef        SCOPE_TYPE
++#undef        SCOPE_STACK
++#undef        SCOPE_TOP
++#define       SCOPE_TYPE(scope)   pSMARTPL2SQL_##scope##_SCOPE
++#define SCOPE_STACK(scope)  pSMARTPL2SQL_##scope##Stack
++#define       SCOPE_TOP(scope)    ctx->pSMARTPL2SQL_##scope##Top
++#define       SCOPE_SIZE(scope)               ctx->pSMARTPL2SQL_##scope##Stack_limit
++#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
++
++/* Macros for accessing things in the parser
++ */
++ 
++#undef            PARSER
++#undef            RECOGNIZER              
++#undef            HAVEPARSEDRULE
++#undef            INPUT
++#undef            STRSTREAM
++#undef            HASEXCEPTION
++#undef            EXCEPTION
++#undef            MATCHT
++#undef            MATCHANYT
++#undef            FOLLOWSTACK
++#undef            FOLLOWPUSH
++#undef            FOLLOWPOP
++#undef            PRECOVER
++#undef            PREPORTERROR
++#undef            LA
++#undef            LT
++#undef            CONSTRUCTEX
++#undef            CONSUME
++#undef            MARK
++#undef            REWIND
++#undef            REWINDLAST
++#undef            PERRORRECOVERY
++#undef            HASFAILED
++#undef            FAILEDFLAG
++#undef            RECOVERFROMMISMATCHEDSET
++#undef            RECOVERFROMMISMATCHEDELEMENT
++#undef            BACKTRACKING
++#undef      ADAPTOR
++#undef            RULEMEMO            
++#undef                SEEK    
++#undef                INDEX
++#undef                DBG
++
++#define           PARSER                                                      ctx->pTreeParser  
++#define           RECOGNIZER                                          PARSER->rec
++#define               PSRSTATE                                                RECOGNIZER->state
++#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
++#define           INPUT                                                       PARSER->ctnstream
++#define               ISTREAM                                                 INPUT->tnstream->istream
++#define           STRSTREAM                                           INPUT->tnstream
++#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
++#define           EXCEPTION                                           PSRSTATE->exception
++#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
++#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
++#define           FOLLOWSTACK                                     PSRSTATE->following
++#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
++#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
++#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
++#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
++#define           LA(n)                                                       ISTREAM->_LA(ISTREAM, n)
++#define           LT(n)                                                       INPUT->tnstream->_LT(INPUT->tnstream, n)
++#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
++#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
++#define           MARK()                                                      ISTREAM->mark(ISTREAM)
++#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
++#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
++#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
++#define           FAILEDFLAG                                          PSRSTATE->failed
++#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
++#define           BACKTRACKING                                        PSRSTATE->backtracking
++#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
++#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
++#define     ADAPTOR                         INPUT->adaptor
++#define               RULEMEMO                                                PSRSTATE->ruleMemo
++#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
++#define               INDEX()                                                 ISTREAM->index(ISTREAM)
++#define               DBG                                                             RECOGNIZER->debugger
++
++
++#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
++
++/* The 4 tokens defined below may well clash with your own #defines or token types. If so
++ * then for the present you must use different names for your defines as these are hard coded
++ * in the code generator. It would be better not to use such names internally, and maybe
++ * we can change this in a forthcoming release. I deliberately do not #undef these
++ * here as this will at least give you a redefined error somewhere if they clash.
++ */
++#define           UP      ANTLR3_TOKEN_UP
++#define           DOWN    ANTLR3_TOKEN_DOWN
++#define           EOR     ANTLR3_TOKEN_EOR
++#define           INVALID ANTLR3_TOKEN_INVALID
++
++
++/* =============================================================================
++ * Functions to create and destroy scopes. First come the rule scopes, followed
++ * by the global declared scopes.
++ */
++
++
++
++/* ============================================================================= */
++
++/* =============================================================================
++ * Start of recognizer
++ */
++
++
++
++/** \brief Table of all token names in symbolic order, mainly used for
++ *         error reporting.
++ */
++pANTLR3_UINT8   SMARTPL2SQLTokenNames[28+4]
++     = {
++        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
++        (pANTLR3_UINT8) "<EOR>",
++        (pANTLR3_UINT8) "<DOWN>", 
++        (pANTLR3_UINT8) "<UP>", 
++        (pANTLR3_UINT8) "STR",
++        (pANTLR3_UINT8) "OR",
++        (pANTLR3_UINT8) "AND",
++        (pANTLR3_UINT8) "NOT",
++        (pANTLR3_UINT8) "LPAR",
++        (pANTLR3_UINT8) "RPAR",
++        (pANTLR3_UINT8) "STRTAG",
++        (pANTLR3_UINT8) "INCLUDES",
++        (pANTLR3_UINT8) "IS",
++        (pANTLR3_UINT8) "INTTAG",
++        (pANTLR3_UINT8) "INTBOOL",
++        (pANTLR3_UINT8) "INT",
++        (pANTLR3_UINT8) "DATETAG",
++        (pANTLR3_UINT8) "AFTER",
++        (pANTLR3_UINT8) "BEFORE",
++        (pANTLR3_UINT8) "ENUMTAG",
++        (pANTLR3_UINT8) "ENUMVAL",
++        (pANTLR3_UINT8) "DATE",
++        (pANTLR3_UINT8) "AGO",
++        (pANTLR3_UINT8) "DATINTERVAL",
++        (pANTLR3_UINT8) "GREATER",
++        (pANTLR3_UINT8) "GREATEREQUAL",
++        (pANTLR3_UINT8) "LESS",
++        (pANTLR3_UINT8) "LESSEQUAL",
++        (pANTLR3_UINT8) "EQUAL",
++        (pANTLR3_UINT8) "WHITESPACE",
++        (pANTLR3_UINT8) "'{'",
++        (pANTLR3_UINT8) "'}'"
++       };
++
++        
++
++// Forward declare the locally static matching functions we have generated.
++//
++static SMARTPL2SQL_playlist_return    playlist    (pSMARTPL2SQL ctx);
++static pANTLR3_STRING expression    (pSMARTPL2SQL ctx);
++static int    dateval    (pSMARTPL2SQL ctx);
++static int    interval    (pSMARTPL2SQL ctx);
++static void   SMARTPL2SQLFree(pSMARTPL2SQL ctx);
++/* For use in tree output where we are accumulating rule labels via label += ruleRef
++ * we need a function that knows how to free a return scope when the list is destroyed. 
++ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
++ */
++static        void ANTLR3_CDECL freeScope(void * scope)
++{
++    ANTLR3_FREE(scope);
++}
++
++/** \brief Name of the grammar file that generated this code
++ */
++static const char fileName[] = "SMARTPL2SQL.g";
++
++/** \brief Return the name of the grammar file that generated this code.
++ */
++static const char * getGrammarFileName()
++{
++      return fileName;
++}
++/** \brief Create a new SMARTPL2SQL parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pSMARTPL2SQL
++SMARTPL2SQLNew   (pANTLR3_COMMON_TREE_NODE_STREAM instream)
++{
++      // See if we can create a new parser with the standard constructor
++      //
++      return SMARTPL2SQLNewSSD(instream, NULL);
++}
++
++/** \brief Create a new SMARTPL2SQL parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pSMARTPL2SQL
++SMARTPL2SQLNewSSD   (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
++{
++    pSMARTPL2SQL ctx;     /* Context structure we will build and return   */
++    
++    ctx       = (pSMARTPL2SQL) ANTLR3_CALLOC(1, sizeof(SMARTPL2SQL));
++    
++    if        (ctx == NULL)
++    {
++              // Failed to allocate memory for parser context
++              //
++        return  NULL;
++    }
++    
++    /* -------------------------------------------------------------------
++     * Memory for basic structure is allocated, now to fill in
++     * the base ANTLR3 structures. We initialize the function pointers
++     * for the standard ANTLR3 parser function set, but upon return
++     * from here, the programmer may set the pointers to provide custom
++     * implementations of each function. 
++     *
++     * We don't use the macros defined in SMARTPL2SQL.h here, in order that you can get a sense
++     * of what goes where.
++     */
++
++    /* Create a base Tree parser/recognizer, using the supplied tree node stream
++     */
++    ctx->pTreeParser          = antlr3TreeParserNewStream(ANTLR3_SIZE_HINT, instream, state);
++    /* Install the implementation of our SMARTPL2SQL interface
++     */
++    ctx->playlist     = playlist;
++    ctx->expression   = expression;
++    ctx->dateval      = dateval;
++    ctx->interval     = interval;
++    ctx->free                 = SMARTPL2SQLFree;
++    ctx->getGrammarFileName   = getGrammarFileName;
++    
++    /* Install the scope pushing methods.
++     */
++
++        
++    
++
++      
++    /* Install the token table
++     */
++    PSRSTATE->tokenNames   = SMARTPL2SQLTokenNames;
++    
++    
++    /* Return the newly built parser to the caller
++     */
++    return  ctx;
++}
++
++/** Free the parser resources
++ */
++ static void
++ SMARTPL2SQLFree(pSMARTPL2SQL ctx)
++ {
++    /* Free any scope memory
++     */
++    
++        
++      // Free this parser
++      //
++    ctx->pTreeParser->free(ctx->pTreeParser);
++    ANTLR3_FREE(ctx);
++
++    /* Everything is released, so we can return
++     */
++    return;
++ }
++ 
++/** Return token names used by this tree parser
++ *
++ * The returned pointer is used as an index into the token names table (using the token 
++ * number as the index).
++ * 
++ * \return Pointer to first char * in the table.
++ */
++static pANTLR3_UINT8    *getTokenNames() 
++{
++        return SMARTPL2SQLTokenNames; 
++}
++
++
++
++    
++/* Declare the bitsets
++ */
++
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_playlist66  */
++static        ANTLR3_BITWORD FOLLOW_STR_in_playlist66_bits[]  = { ANTLR3_UINT64_LIT(0x0000000040000000) };
++static  ANTLR3_BITSET_LIST FOLLOW_STR_in_playlist66   = { FOLLOW_STR_in_playlist66_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_30_in_playlist68  */
++static        ANTLR3_BITWORD FOLLOW_30_in_playlist68_bits[]   = { ANTLR3_UINT64_LIT(0x00000000000924E0) };
++static  ANTLR3_BITSET_LIST FOLLOW_30_in_playlist68    = { FOLLOW_30_in_playlist68_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_playlist74  */
++static        ANTLR3_BITWORD FOLLOW_expression_in_playlist74_bits[]   = { ANTLR3_UINT64_LIT(0x0000000080000000) };
++static  ANTLR3_BITSET_LIST FOLLOW_expression_in_playlist74    = { FOLLOW_expression_in_playlist74_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_31_in_playlist76  */
++static        ANTLR3_BITWORD FOLLOW_31_in_playlist76_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_31_in_playlist76    = { FOLLOW_31_in_playlist76_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_expression101  */
++static        ANTLR3_BITWORD FOLLOW_NOT_in_expression101_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_expression101        = { FOLLOW_NOT_in_expression101_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression107  */
++static        ANTLR3_BITWORD FOLLOW_expression_in_expression107_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_expression_in_expression107 = { FOLLOW_expression_in_expression107_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_expression118  */
++static        ANTLR3_BITWORD FOLLOW_AND_in_expression118_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_AND_in_expression118        = { FOLLOW_AND_in_expression118_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression124  */
++static        ANTLR3_BITWORD FOLLOW_expression_in_expression124_bits[]        = { ANTLR3_UINT64_LIT(0x00000000000924E0) };
++static  ANTLR3_BITSET_LIST FOLLOW_expression_in_expression124 = { FOLLOW_expression_in_expression124_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression130  */
++static        ANTLR3_BITWORD FOLLOW_expression_in_expression130_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_expression_in_expression130 = { FOLLOW_expression_in_expression130_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expression141  */
++static        ANTLR3_BITWORD FOLLOW_OR_in_expression141_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_OR_in_expression141 = { FOLLOW_OR_in_expression141_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression147  */
++static        ANTLR3_BITWORD FOLLOW_expression_in_expression147_bits[]        = { ANTLR3_UINT64_LIT(0x00000000000924E0) };
++static  ANTLR3_BITSET_LIST FOLLOW_expression_in_expression147 = { FOLLOW_expression_in_expression147_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression153  */
++static        ANTLR3_BITWORD FOLLOW_expression_in_expression153_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_expression_in_expression153 = { FOLLOW_expression_in_expression153_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRTAG_in_expression163  */
++static        ANTLR3_BITWORD FOLLOW_STRTAG_in_expression163_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000800) };
++static  ANTLR3_BITSET_LIST FOLLOW_STRTAG_in_expression163     = { FOLLOW_STRTAG_in_expression163_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCLUDES_in_expression165  */
++static        ANTLR3_BITWORD FOLLOW_INCLUDES_in_expression165_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000010) };
++static  ANTLR3_BITSET_LIST FOLLOW_INCLUDES_in_expression165   = { FOLLOW_INCLUDES_in_expression165_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_expression167  */
++static        ANTLR3_BITWORD FOLLOW_STR_in_expression167_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_STR_in_expression167        = { FOLLOW_STR_in_expression167_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRTAG_in_expression176  */
++static        ANTLR3_BITWORD FOLLOW_STRTAG_in_expression176_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000001000) };
++static  ANTLR3_BITSET_LIST FOLLOW_STRTAG_in_expression176     = { FOLLOW_STRTAG_in_expression176_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_IS_in_expression178  */
++static        ANTLR3_BITWORD FOLLOW_IS_in_expression178_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000010) };
++static  ANTLR3_BITSET_LIST FOLLOW_IS_in_expression178 = { FOLLOW_IS_in_expression178_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_expression180  */
++static        ANTLR3_BITWORD FOLLOW_STR_in_expression180_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_STR_in_expression180        = { FOLLOW_STR_in_expression180_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTTAG_in_expression189  */
++static        ANTLR3_BITWORD FOLLOW_INTTAG_in_expression189_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000004000) };
++static  ANTLR3_BITSET_LIST FOLLOW_INTTAG_in_expression189     = { FOLLOW_INTTAG_in_expression189_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTBOOL_in_expression191  */
++static        ANTLR3_BITWORD FOLLOW_INTBOOL_in_expression191_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000008000) };
++static  ANTLR3_BITSET_LIST FOLLOW_INTBOOL_in_expression191    = { FOLLOW_INTBOOL_in_expression191_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_expression193  */
++static        ANTLR3_BITWORD FOLLOW_INT_in_expression193_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_INT_in_expression193        = { FOLLOW_INT_in_expression193_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATETAG_in_expression202  */
++static        ANTLR3_BITWORD FOLLOW_DATETAG_in_expression202_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000020000) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATETAG_in_expression202    = { FOLLOW_DATETAG_in_expression202_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_expression204  */
++static        ANTLR3_BITWORD FOLLOW_AFTER_in_expression204_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000208000) };
++static  ANTLR3_BITSET_LIST FOLLOW_AFTER_in_expression204      = { FOLLOW_AFTER_in_expression204_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateval_in_expression206  */
++static        ANTLR3_BITWORD FOLLOW_dateval_in_expression206_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateval_in_expression206    = { FOLLOW_dateval_in_expression206_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATETAG_in_expression215  */
++static        ANTLR3_BITWORD FOLLOW_DATETAG_in_expression215_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000040000) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATETAG_in_expression215    = { FOLLOW_DATETAG_in_expression215_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_expression217  */
++static        ANTLR3_BITWORD FOLLOW_BEFORE_in_expression217_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000208000) };
++static  ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_expression217     = { FOLLOW_BEFORE_in_expression217_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateval_in_expression219  */
++static        ANTLR3_BITWORD FOLLOW_dateval_in_expression219_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateval_in_expression219    = { FOLLOW_dateval_in_expression219_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMTAG_in_expression228  */
++static        ANTLR3_BITWORD FOLLOW_ENUMTAG_in_expression228_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000001000) };
++static  ANTLR3_BITSET_LIST FOLLOW_ENUMTAG_in_expression228    = { FOLLOW_ENUMTAG_in_expression228_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_IS_in_expression230  */
++static        ANTLR3_BITWORD FOLLOW_IS_in_expression230_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000100000) };
++static  ANTLR3_BITSET_LIST FOLLOW_IS_in_expression230 = { FOLLOW_IS_in_expression230_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMVAL_in_expression232  */
++static        ANTLR3_BITWORD FOLLOW_ENUMVAL_in_expression232_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_ENUMVAL_in_expression232    = { FOLLOW_ENUMVAL_in_expression232_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval257  */
++static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval257_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval257  = { FOLLOW_DATE_in_dateval257_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval266  */
++static        ANTLR3_BITWORD FOLLOW_interval_in_dateval266_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000040000) };
++static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval266      = { FOLLOW_interval_in_dateval266_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_dateval268  */
++static        ANTLR3_BITWORD FOLLOW_BEFORE_in_dateval268_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000200000) };
++static  ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_dateval268        = { FOLLOW_BEFORE_in_dateval268_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval270  */
++static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval270_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval270  = { FOLLOW_DATE_in_dateval270_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval279  */
++static        ANTLR3_BITWORD FOLLOW_interval_in_dateval279_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000020000) };
++static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval279      = { FOLLOW_interval_in_dateval279_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_dateval281  */
++static        ANTLR3_BITWORD FOLLOW_AFTER_in_dateval281_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000200000) };
++static  ANTLR3_BITSET_LIST FOLLOW_AFTER_in_dateval281 = { FOLLOW_AFTER_in_dateval281_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval283  */
++static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval283_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval283  = { FOLLOW_DATE_in_dateval283_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval292  */
++static        ANTLR3_BITWORD FOLLOW_interval_in_dateval292_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000400000) };
++static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval292      = { FOLLOW_interval_in_dateval292_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_AGO_in_dateval294  */
++static        ANTLR3_BITWORD FOLLOW_AGO_in_dateval294_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_AGO_in_dateval294   = { FOLLOW_AGO_in_dateval294_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_interval318  */
++static        ANTLR3_BITWORD FOLLOW_INT_in_interval318_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000) };
++static  ANTLR3_BITSET_LIST FOLLOW_INT_in_interval318  = { FOLLOW_INT_in_interval318_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATINTERVAL_in_interval320  */
++static        ANTLR3_BITWORD FOLLOW_DATINTERVAL_in_interval320_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATINTERVAL_in_interval320  = { FOLLOW_DATINTERVAL_in_interval320_bits, 1   };
++     
++
++ 
++ 
++/* ==============================================
++ * Parsing rules
++ */
++/** 
++ * $ANTLR start playlist
++ * SMARTPL2SQL.g:43:1: playlist returns [ pANTLR3_STRING title, pANTLR3_STRING query ] : STR '{' e= expression '}' ;
++ */
++static SMARTPL2SQL_playlist_return
++playlist(pSMARTPL2SQL ctx)
++{   
++    SMARTPL2SQL_playlist_return retval;
++
++    pANTLR3_BASE_TREE    STR1;
++    pANTLR3_STRING e;
++    #undef    RETURN_TYPE_e
++    #define   RETURN_TYPE_e pANTLR3_STRING
++
++    /* Initialize rule variables
++     */
++
++
++     retval.title= NULL; retval.query= NULL; 
++    STR1       = NULL;
++    e = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    {
++        // SMARTPL2SQL.g:45:2: ( STR '{' e= expression '}' )
++        // SMARTPL2SQL.g:45:4: STR '{' e= expression '}'
++        {
++            STR1 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_playlist66); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleplaylistEx;
++            }
++
++             MATCHT(30, &FOLLOW_30_in_playlist68); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleplaylistEx;
++            }
++
++            FOLLOWPUSH(FOLLOW_expression_in_playlist74);
++            e=expression(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruleplaylistEx;
++            }
++
++             MATCHT(31, &FOLLOW_31_in_playlist76); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleplaylistEx;
++            }
++
++            {
++
++                                      pANTLR3_UINT8 val;
++                                      val = (STR1->getText(STR1))->toUTF8((STR1->getText(STR1)))->chars;
++                                      val++;
++                                      val[strlen((const char *)val) - 1] = '\0';
++                                      
++                                      retval.title= (STR1->getText(STR1))->factory->newRaw((STR1->getText(STR1))->factory);
++                                      retval.title->append8(retval.title, (const char *)val);
++                                      
++                                      retval.query= e->factory->newRaw(e->factory);
++                                      retval.query->append8(retval.query, "(");
++                                      retval.query->appendS(retval.query, e);
++                                      retval.query->append8(retval.query, ")");
++                              
++            }
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleplaylistEx; /* Prevent compiler warnings */
++    ruleplaylistEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return retval;
++}
++/* $ANTLR end playlist */
++
++/** 
++ * $ANTLR start expression
++ * SMARTPL2SQL.g:62:1: expression returns [ pANTLR3_STRING result ] : ( ^( NOT a= expression ) | ^( AND a= expression b= expression ) | ^( OR a= expression b= expression ) | STRTAG INCLUDES STR | STRTAG IS STR | INTTAG INTBOOL INT | DATETAG AFTER dateval | DATETAG BEFORE dateval | ENUMTAG IS ENUMVAL );
++ */
++static pANTLR3_STRING
++expression(pSMARTPL2SQL ctx)
++{   
++    pANTLR3_STRING result = NULL;
++
++    pANTLR3_BASE_TREE    STR2;
++    pANTLR3_BASE_TREE    STRTAG3;
++    pANTLR3_BASE_TREE    STR4;
++    pANTLR3_BASE_TREE    STRTAG5;
++    pANTLR3_BASE_TREE    INTTAG6;
++    pANTLR3_BASE_TREE    INTBOOL7;
++    pANTLR3_BASE_TREE    INT8;
++    pANTLR3_BASE_TREE    DATETAG10;
++    pANTLR3_BASE_TREE    DATETAG12;
++    pANTLR3_BASE_TREE    ENUMTAG13;
++    pANTLR3_BASE_TREE    ENUMVAL14;
++    pANTLR3_STRING a;
++    #undef    RETURN_TYPE_a
++    #define   RETURN_TYPE_a pANTLR3_STRING
++
++    pANTLR3_STRING b;
++    #undef    RETURN_TYPE_b
++    #define   RETURN_TYPE_b pANTLR3_STRING
++
++    int dateval9;
++    #undef    RETURN_TYPE_dateval9
++    #define   RETURN_TYPE_dateval9 int
++
++    int dateval11;
++    #undef    RETURN_TYPE_dateval11
++    #define   RETURN_TYPE_dateval11 int
++
++    /* Initialize rule variables
++     */
++
++
++     result= NULL; 
++    STR2       = NULL;
++    STRTAG3       = NULL;
++    STR4       = NULL;
++    STRTAG5       = NULL;
++    INTTAG6       = NULL;
++    INTBOOL7       = NULL;
++    INT8       = NULL;
++    DATETAG10       = NULL;
++    DATETAG12       = NULL;
++    ENUMTAG13       = NULL;
++    ENUMVAL14       = NULL;
++    a = NULL;
++    b = NULL;
++    dateval9 = 0;
++    dateval11 = 0;
++
++    {
++        {
++            //  SMARTPL2SQL.g:64:2: ( ^( NOT a= expression ) | ^( AND a= expression b= expression ) | ^( OR a= expression b= expression ) | STRTAG INCLUDES STR | STRTAG IS STR | INTTAG INTBOOL INT | DATETAG AFTER dateval | DATETAG BEFORE dateval | ENUMTAG IS ENUMVAL )
++            
++            ANTLR3_UINT32 alt1;
++
++            alt1=9;
++
++            switch ( LA(1) ) 
++            {
++            case NOT:
++              {
++                      alt1=1;
++              }
++                break;
++            case AND:
++              {
++                      alt1=2;
++              }
++                break;
++            case OR:
++              {
++                      alt1=3;
++              }
++                break;
++            case STRTAG:
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case INCLUDES:
++                              {
++                                      alt1=4;
++                              }
++                          break;
++                      case IS:
++                              {
++                                      alt1=5;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 1;
++                          EXCEPTION->state        = 4;
++
++
++                          goto ruleexpressionEx;
++                      }
++
++              }
++                break;
++            case INTTAG:
++              {
++                      alt1=6;
++              }
++                break;
++            case DATETAG:
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case AFTER:
++                              {
++                                      alt1=7;
++                              }
++                          break;
++                      case BEFORE:
++                              {
++                                      alt1=8;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 1;
++                          EXCEPTION->state        = 6;
++
++
++                          goto ruleexpressionEx;
++                      }
++
++              }
++                break;
++            case ENUMTAG:
++              {
++                      alt1=9;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 1;
++                EXCEPTION->state        = 0;
++
++
++                goto ruleexpressionEx;
++            }
++
++            switch (alt1) 
++            {
++              case 1:
++                  // SMARTPL2SQL.g:64:4: ^( NOT a= expression )
++                  {
++                       MATCHT(NOT, &FOLLOW_NOT_in_expression101); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expression_in_expression107);
++                      a=expression(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      {
++
++                                              result= a->factory->newRaw(a->factory);
++                                              result->append8(result, "NOT(");
++                                              result->appendS(result, a);
++                                              result->append8(result, ")");
++                                      
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // SMARTPL2SQL.g:71:4: ^( AND a= expression b= expression )
++                  {
++                       MATCHT(AND, &FOLLOW_AND_in_expression118); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expression_in_expression124);
++                      a=expression(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expression_in_expression130);
++                      b=expression(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      {
++
++                                              result= a->factory->newRaw(a->factory);
++                                              result->append8(result, "(");
++                                              result->appendS(result, a);
++                                              result->append8(result, " AND ");
++                                              result->appendS(result, b);
++                                              result->append8(result, ")");
++                                      
++                      }
++
++                  }
++                  break;
++              case 3:
++                  // SMARTPL2SQL.g:80:4: ^( OR a= expression b= expression )
++                  {
++                       MATCHT(OR, &FOLLOW_OR_in_expression141); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expression_in_expression147);
++                      a=expression(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expression_in_expression153);
++                      b=expression(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      {
++
++                                              result= a->factory->newRaw(a->factory);
++                                              result->append8(result, "(");
++                                              result->appendS(result, a);
++                                              result->append8(result, " OR ");
++                                              result->appendS(result, b);
++                                              result->append8(result, ")");
++                                      
++                      }
++
++                  }
++                  break;
++              case 4:
++                  // SMARTPL2SQL.g:89:4: STRTAG INCLUDES STR
++                  {
++                      STRTAG3 = (pANTLR3_BASE_TREE) MATCHT(STRTAG, &FOLLOW_STRTAG_in_expression163); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                       MATCHT(INCLUDES, &FOLLOW_INCLUDES_in_expression165); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      STR2 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_expression167); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      {
++
++                                              pANTLR3_UINT8 val;
++                                              val = (STR2->getText(STR2))->toUTF8((STR2->getText(STR2)))->chars;
++                                              val++;
++                                              val[strlen((const char *)val) - 1] = '\0';
++                                              
++                                              result= (STR2->getText(STR2))->factory->newRaw((STR2->getText(STR2))->factory);
++                                              result->append8(result, "f.");
++                                              result->appendS(result, (STRTAG3->getText(STRTAG3))->toUTF8((STRTAG3->getText(STRTAG3))));
++                                              result->append8(result, " LIKE '%");
++                                              result->append8(result, sqlite3_mprintf("%q", (const char *)val));
++                                              result->append8(result, "%'");
++                                      
++                      }
++
++                  }
++                  break;
++              case 5:
++                  // SMARTPL2SQL.g:103:4: STRTAG IS STR
++                  {
++                      STRTAG5 = (pANTLR3_BASE_TREE) MATCHT(STRTAG, &FOLLOW_STRTAG_in_expression176); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                       MATCHT(IS, &FOLLOW_IS_in_expression178); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      STR4 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_expression180); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      {
++
++                                              pANTLR3_UINT8 val;
++                                              val = (STR4->getText(STR4))->toUTF8((STR4->getText(STR4)))->chars;
++                                              val++;
++                                              val[strlen((const char *)val) - 1] = '\0';
++                                              
++                                              result= (STR4->getText(STR4))->factory->newRaw((STR4->getText(STR4))->factory);
++                                              result->append8(result, "f.");
++                                              result->appendS(result, (STRTAG5->getText(STRTAG5))->toUTF8((STRTAG5->getText(STRTAG5))));
++                                              result->append8(result, " LIKE '");
++                                              result->append8(result, sqlite3_mprintf("%q", (const char *)val));
++                                              result->append8(result, "'");
++                                      
++                      }
++
++                  }
++                  break;
++              case 6:
++                  // SMARTPL2SQL.g:117:4: INTTAG INTBOOL INT
++                  {
++                      INTTAG6 = (pANTLR3_BASE_TREE) MATCHT(INTTAG, &FOLLOW_INTTAG_in_expression189); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      INTBOOL7 = (pANTLR3_BASE_TREE) MATCHT(INTBOOL, &FOLLOW_INTBOOL_in_expression191); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      INT8 = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_expression193); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      {
++
++                                              result= (INTTAG6->getText(INTTAG6))->factory->newRaw((INTTAG6->getText(INTTAG6))->factory);
++                                              result->append8(result, "f.");
++                                              result->appendS(result, (INTTAG6->getText(INTTAG6))->toUTF8((INTTAG6->getText(INTTAG6))));
++                                              result->append8(result, " ");
++                                              result->appendS(result, (INTBOOL7->getText(INTBOOL7))->toUTF8((INTBOOL7->getText(INTBOOL7))));
++                                              result->append8(result, " ");
++                                              result->appendS(result, (INT8->getText(INT8))->toUTF8((INT8->getText(INT8))));
++                                      
++                      }
++
++                  }
++                  break;
++              case 7:
++                  // SMARTPL2SQL.g:127:4: DATETAG AFTER dateval
++                  {
++                      DATETAG10 = (pANTLR3_BASE_TREE) MATCHT(DATETAG, &FOLLOW_DATETAG_in_expression202); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                       MATCHT(AFTER, &FOLLOW_AFTER_in_expression204); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_dateval_in_expression206);
++                      dateval9=dateval(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      {
++
++                                              char str[15];
++                                              sprintf(str, "%d", dateval9);
++                                              
++                                              result= (DATETAG10->getText(DATETAG10))->factory->newRaw((DATETAG10->getText(DATETAG10))->factory);
++                                              result->append8(result, "f.");
++                                              result->appendS(result, (DATETAG10->getText(DATETAG10))->toUTF8((DATETAG10->getText(DATETAG10))));
++                                              result->append8(result, " > ");
++                                              result->append8(result, str);
++                                      
++                      }
++
++                  }
++                  break;
++              case 8:
++                  // SMARTPL2SQL.g:138:4: DATETAG BEFORE dateval
++                  {
++                      DATETAG12 = (pANTLR3_BASE_TREE) MATCHT(DATETAG, &FOLLOW_DATETAG_in_expression215); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                       MATCHT(BEFORE, &FOLLOW_BEFORE_in_expression217); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_dateval_in_expression219);
++                      dateval11=dateval(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      {
++
++                                              char str[15];
++                                              sprintf(str, "%d", dateval11);
++                                              
++                                              result= (DATETAG12->getText(DATETAG12))->factory->newRaw((DATETAG12->getText(DATETAG12))->factory);
++                                              result->append8(result, "f.");
++                                              result->appendS(result, (DATETAG12->getText(DATETAG12))->toUTF8((DATETAG12->getText(DATETAG12))));
++                                              result->append8(result, " > ");
++                                              result->append8(result, str);
++                                      
++                      }
++
++                  }
++                  break;
++              case 9:
++                  // SMARTPL2SQL.g:149:4: ENUMTAG IS ENUMVAL
++                  {
++                      ENUMTAG13 = (pANTLR3_BASE_TREE) MATCHT(ENUMTAG, &FOLLOW_ENUMTAG_in_expression228); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                       MATCHT(IS, &FOLLOW_IS_in_expression230); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      ENUMVAL14 = (pANTLR3_BASE_TREE) MATCHT(ENUMVAL, &FOLLOW_ENUMVAL_in_expression232); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      {
++
++                                              pANTLR3_UINT8 tag;
++                                              pANTLR3_UINT8 val;
++                                              char str[20];
++                                              
++                                              sprintf(str, "1=1");
++                                              
++                                              tag = (ENUMTAG13->getText(ENUMTAG13))->chars;
++                                              val = (ENUMVAL14->getText(ENUMVAL14))->chars;
++                                              if (strcmp((char *)tag, "media_kind") == 0)
++                                              {
++                                                      if (strcmp((char *)val, "music") == 0)
++                                                      {
++                                                              sprintf(str, "f.media_kind = %d", MEDIA_KIND_MUSIC);
++                                                      }
++                                                      else if (strcmp((char *)val, "movie") == 0)
++                                                      {
++                                                              sprintf(str, "f.media_kind = %d", MEDIA_KIND_MOVIE);
++                                                      }
++                                                      else if (strcmp((char *)val, "podcast") == 0)
++                                                      {
++                                                              sprintf(str, "f.media_kind = %d", MEDIA_KIND_PODCAST);
++                                                      }
++                                                      else if (strcmp((char *)val, "audiobook") == 0)
++                                                      {
++                                                              sprintf(str, "f.media_kind = %d", MEDIA_KIND_AUDIOBOOK);
++                                                      }
++                                                      else if (strcmp((char *)val, "tvshow") == 0)
++                                                      {
++                                                              sprintf(str, "f.media_kind = %d", MEDIA_KIND_TVSHOW);
++                                                      }
++                                              }
++                                              else if (strcmp((char *)tag, "data_kind") == 0)
++                                              {
++                                                      if (strcmp((char *)val, "file") == 0)
++                                                      {
++                                                              sprintf(str, "f.data_kind = %d", DATA_KIND_FILE);
++                                                      }
++                                                      else if (strcmp((char *)val, "url") == 0)
++                                                      {
++                                                              sprintf(str, "f.data_kind = %d", DATA_KIND_URL);
++                                                      }
++                                                      else if (strcmp((char *)val, "spotify") == 0)
++                                                      {
++                                                              sprintf(str, "f.data_kind = %d", DATA_KIND_SPOTIFY);
++                                                      }
++                                                      else if (strcmp((char *)val, "pipe") == 0)
++                                                      {
++                                                              sprintf(str, "f.data_kind = %d", DATA_KIND_PIPE);
++                                                      }
++                                              }
++                                              
++                                              result= (ENUMTAG13->getText(ENUMTAG13))->factory->newRaw((ENUMTAG13->getText(ENUMTAG13))->factory);
++                                              result->append8(result, str);
++                                      
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleexpressionEx; /* Prevent compiler warnings */
++    ruleexpressionEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return result;
++}
++/* $ANTLR end expression */
++
++/** 
++ * $ANTLR start dateval
++ * SMARTPL2SQL.g:207:1: dateval returns [ int result ] : ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO );
++ */
++static int
++dateval(pSMARTPL2SQL ctx)
++{   
++    int result = 0;
++
++    pANTLR3_BASE_TREE    DATE15;
++    pANTLR3_BASE_TREE    DATE16;
++    pANTLR3_BASE_TREE    DATE18;
++    int interval17;
++    #undef    RETURN_TYPE_interval17
++    #define   RETURN_TYPE_interval17 int
++
++    int interval19;
++    #undef    RETURN_TYPE_interval19
++    #define   RETURN_TYPE_interval19 int
++
++    int interval20;
++    #undef    RETURN_TYPE_interval20
++    #define   RETURN_TYPE_interval20 int
++
++    /* Initialize rule variables
++     */
++
++
++     result= 0; 
++    DATE15       = NULL;
++    DATE16       = NULL;
++    DATE18       = NULL;
++    interval17 = 0;
++    interval19 = 0;
++    interval20 = 0;
++
++    {
++        {
++            //  SMARTPL2SQL.g:209:2: ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO )
++            
++            ANTLR3_UINT32 alt2;
++
++            alt2=4;
++
++            switch ( LA(1) ) 
++            {
++            case DATE:
++              {
++                      alt2=1;
++              }
++                break;
++            case INT:
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case DATINTERVAL:
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case AGO:
++                                              {
++                                                      alt2=4;
++                                              }
++                                          break;
++                                      case BEFORE:
++                                              {
++                                                      alt2=2;
++                                              }
++                                          break;
++                                      case AFTER:
++                                              {
++                                                      alt2=3;
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 2;
++                                          EXCEPTION->state        = 3;
++
++
++                                          goto ruledatevalEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 2;
++                          EXCEPTION->state        = 2;
++
++
++                          goto ruledatevalEx;
++                      }
++
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 2;
++                EXCEPTION->state        = 0;
++
++
++                goto ruledatevalEx;
++            }
++
++            switch (alt2) 
++            {
++              case 1:
++                  // SMARTPL2SQL.g:209:4: DATE
++                  {
++                      DATE15 = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateval257); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      {
++
++                                              pANTLR3_UINT8 datval;
++                                              
++                                              datval = (DATE15->getText(DATE15))->chars;
++                                              
++                                              if (strcmp((char *)datval, "today") == 0)
++                                              {
++                                                      result= time(NULL);
++                                              }
++                                              else if (strcmp((char *)datval, "yesterday") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600;
++                                              }
++                                              else if (strcmp((char *)datval, "last week") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600 * 7;
++                                              }
++                                              else if (strcmp((char *)datval, "last month") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600 * 30;
++                                              }
++                                              else if (strcmp((char *)datval, "last year") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600 * 365;
++                                              }
++                                              else
++                                              {
++                                                      struct tm tm;
++                                                      char year[5];
++                                                      char month[3];
++                                                      char day[3];
++                                                      
++                                                      memset((void*)&tm,0,sizeof(tm));
++                                                      memset(year, 0, sizeof(year));
++                                                      memset(month, 0, sizeof(month));
++                                                      memset(day, 0, sizeof(day));
++
++                                                      strncpy(year, (const char *)datval, 4);
++                                                      strncpy(month, (const char *)datval + 5, 2);
++                                                      strncpy(day, (const char *)datval + 8, 2);
++                                                      
++                                                      tm.tm_year = atoi(year) - 1900;
++                                                      tm.tm_mon = atoi(month) - 1;
++                                                      tm.tm_mday = atoi(day);
++                                                      
++                                                      result= mktime(&tm);
++                                              }
++                                      
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // SMARTPL2SQL.g:258:4: interval BEFORE DATE
++                  {
++                      FOLLOWPUSH(FOLLOW_interval_in_dateval266);
++                      interval17=interval(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                       MATCHT(BEFORE, &FOLLOW_BEFORE_in_dateval268); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      DATE16 = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateval270); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      {
++
++                                              pANTLR3_UINT8 datval;
++                                              
++                                              datval = (DATE16->getText(DATE16))->chars;
++                                              
++                                              if (strcmp((char *)datval, "yesterday") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600;
++                                              }
++                                              else if (strcmp((char *)datval, "last week") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600 * 7;
++                                              }
++                                              else if (strcmp((char *)datval, "last month") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600 * 30;
++                                              }
++                                              else if (strcmp((char *)datval, "last year") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600 * 365;
++                                              }
++                                              else
++                                              {
++                                                      result= time(NULL);
++                                              }
++                                              
++                                              result= result - interval17;
++                                      
++                      }
++
++                  }
++                  break;
++              case 3:
++                  // SMARTPL2SQL.g:287:4: interval AFTER DATE
++                  {
++                      FOLLOWPUSH(FOLLOW_interval_in_dateval279);
++                      interval19=interval(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                       MATCHT(AFTER, &FOLLOW_AFTER_in_dateval281); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      DATE18 = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateval283); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      {
++
++                                              pANTLR3_UINT8 datval;
++                                              
++                                              datval = (DATE18->getText(DATE18))->chars;
++                                              
++                                              if (strcmp((char *)datval, "yesterday") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600;
++                                              }
++                                              else if (strcmp((char *)datval, "last week") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600 * 7;
++                                              }
++                                              else if (strcmp((char *)datval, "last month") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600 * 30;
++                                              }
++                                              else if (strcmp((char *)datval, "last year") == 0)
++                                              {
++                                                      result= time(NULL) - 24 * 3600 * 365;
++                                              }
++                                              else
++                                              {
++                                                      result= time(NULL);
++                                              }
++                                              
++                                              result= result + interval19;
++                                      
++                      }
++
++                  }
++                  break;
++              case 4:
++                  // SMARTPL2SQL.g:316:4: interval AGO
++                  {
++                      FOLLOWPUSH(FOLLOW_interval_in_dateval292);
++                      interval20=interval(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                       MATCHT(AGO, &FOLLOW_AGO_in_dateval294); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      {
++
++                                              result= time(NULL) - interval20;
++                                      
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledatevalEx; /* Prevent compiler warnings */
++    ruledatevalEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return result;
++}
++/* $ANTLR end dateval */
++
++/** 
++ * $ANTLR start interval
++ * SMARTPL2SQL.g:322:1: interval returns [ int result ] : INT DATINTERVAL ;
++ */
++static int
++interval(pSMARTPL2SQL ctx)
++{   
++    int result = 0;
++
++    pANTLR3_BASE_TREE    INT21;
++    pANTLR3_BASE_TREE    DATINTERVAL22;
++
++    /* Initialize rule variables
++     */
++
++
++     result= 0; 
++    INT21       = NULL;
++    DATINTERVAL22       = NULL;
++
++    {
++        // SMARTPL2SQL.g:324:2: ( INT DATINTERVAL )
++        // SMARTPL2SQL.g:324:4: INT DATINTERVAL
++        {
++            INT21 = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_interval318); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleintervalEx;
++            }
++
++            DATINTERVAL22 = (pANTLR3_BASE_TREE) MATCHT(DATINTERVAL, &FOLLOW_DATINTERVAL_in_interval320); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleintervalEx;
++            }
++
++            {
++
++                                      pANTLR3_UINT8 interval;
++                                      
++                                      result= atoi((const char *)(INT21->getText(INT21))->chars);
++                                      interval = (DATINTERVAL22->getText(DATINTERVAL22))->chars;
++                                      
++                                      if (strcmp((char *)interval, "days") == 0)
++                                      {
++                                              result= result * 24 * 3600;
++                                      }
++                                      else if (strcmp((char *)interval, "weeks") == 0)
++                                      {
++                                              result= result * 24 * 3600 * 7;
++                                      }
++                                      else if (strcmp((char *)interval, "months") == 0)
++                                      {
++                                              result= result * 24 * 3600 * 30;
++                                      }
++                                      else if (strcmp((char *)interval, "weeks") == 0)
++                                      {
++                                              result= result * 24 * 3600 * 365;
++                                      }
++                                      else
++                                      {
++                                              result= 0;
++                                      }
++                              
++            }
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleintervalEx; /* Prevent compiler warnings */
++    ruleintervalEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return result;
++}
++/* $ANTLR end interval */
++/* End of parsing rules
++ * ==============================================
++ */
++
++/* ==============================================
++ * Syntactic predicates
++ */
++/* End of syntactic predicates
++ * ==============================================
++ */
++
++ 
++ 
++
++
++
++/* End of code
++ * =============================================================================
++ */
+diff --git a/src/pregen/SMARTPL2SQL.h b/src/pregen/SMARTPL2SQL.h
+new file mode 100644
+index 0000000..322e8fd
+--- /dev/null
++++ b/src/pregen/SMARTPL2SQL.h
+@@ -0,0 +1,220 @@
++/** \file
++ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : SMARTPL2SQL.g
++ *     -                            On : 2015-06-27 19:05:21
++ *     -           for the tree parser : SMARTPL2SQLTreeParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++ * The tree parser SMARTPL2SQL has the callable functions (rules) shown below,
++ * which will invoke the code for the associated rule in the source grammar
++ * assuming that the input stream is pointing to a token/text stream that could begin
++ * this rule.
++ * 
++ * For instance if you call the first (topmost) rule in a parser grammar, you will
++ * get the results of a full parse, but calling a rule half way through the grammar will
++ * allow you to pass part of a full token stream to the parser, such as for syntax checking
++ * in editors and so on.
++ *
++ * The parser entry points are called indirectly (by function pointer to function) via
++ * a parser context typedef pSMARTPL2SQL, which is returned from a call to SMARTPL2SQLNew().
++ *
++ * The methods in pSMARTPL2SQL are  as follows:
++ *
++ *  - SMARTPL2SQL_playlist_return      pSMARTPL2SQL->playlist(pSMARTPL2SQL)
++ *  - pANTLR3_STRING      pSMARTPL2SQL->expression(pSMARTPL2SQL)
++ *  - int      pSMARTPL2SQL->dateval(pSMARTPL2SQL)
++ *  - int      pSMARTPL2SQL->interval(pSMARTPL2SQL)
++ *
++ * The return type for any particular rule is of course determined by the source
++ * grammar file.
++ */
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++#ifndef       _SMARTPL2SQL_H
++#define _SMARTPL2SQL_H
++/* =============================================================================
++ * Standard antlr3 C runtime definitions
++ */
++#include    <antlr3.h>
++
++/* End of standard antlr 3 runtime definitions
++ * =============================================================================
++ */
++ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++// Forward declare the context typedef so that we can use it before it is
++// properly defined. Delegators and delegates (from import statements) are
++// interdependent and their context structures contain pointers to each other
++// C only allows such things to be declared if you pre-declare the typedef.
++//
++typedef struct SMARTPL2SQL_Ctx_struct SMARTPL2SQL, * pSMARTPL2SQL;
++
++
++
++      #include <stdio.h>
++      #include <stdlib.h>
++      #include <string.h>
++      #include <limits.h>
++      #include <errno.h>
++      #include <time.h>
++      #include <sqlite3.h>
++
++      #include "logger.h"
++      #include "db.h"
++
++
++#ifdef        ANTLR3_WINDOWS
++// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
++//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
++//          initialized but unused variable                                   - tree rewrite variables declared but not needed
++//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
++//          potentially unitialized variable used                     - retval always returned from a rule 
++//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
++//
++// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
++// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
++// usually generated when a parser rule is given a parameter that it does not use. Mostly though
++// this is a matter of orthogonality hence I disable that one.
++//
++#pragma warning( disable : 4100 )
++#pragma warning( disable : 4101 )
++#pragma warning( disable : 4127 )
++#pragma warning( disable : 4189 )
++#pragma warning( disable : 4505 )
++#pragma warning( disable : 4701 )
++#endif
++typedef struct SMARTPL2SQL_playlist_return_struct
++{
++    pANTLR3_BASE_TREE       start;
++    pANTLR3_BASE_TREE       stop;   
++    pANTLR3_STRING title;
++    pANTLR3_STRING query;
++}
++    SMARTPL2SQL_playlist_return;
++
++
++
++/** Context tracking structure for SMARTPL2SQL
++ */
++struct SMARTPL2SQL_Ctx_struct
++{
++    /** Built in ANTLR3 context tracker contains all the generic elements
++     *  required for context tracking.
++     */
++    pANTLR3_TREE_PARSER           pTreeParser;
++
++
++     SMARTPL2SQL_playlist_return (*playlist)  (struct SMARTPL2SQL_Ctx_struct * ctx);
++     pANTLR3_STRING (*expression)     (struct SMARTPL2SQL_Ctx_struct * ctx);
++     int (*dateval)   (struct SMARTPL2SQL_Ctx_struct * ctx);
++     int (*interval)  (struct SMARTPL2SQL_Ctx_struct * ctx);
++    // Delegated rules
++    const char * (*getGrammarFileName)();
++    void          (*free)   (struct SMARTPL2SQL_Ctx_struct * ctx);
++        
++};
++
++// Function protoypes for the constructor functions that external translation units
++// such as delegators and delegates may wish to call.
++//
++ANTLR3_API pSMARTPL2SQL SMARTPL2SQLNew         (pANTLR3_COMMON_TREE_NODE_STREAM instream);
++ANTLR3_API pSMARTPL2SQL SMARTPL2SQLNewSSD      (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
++
++/** Symbolic definitions of all the tokens that the tree parser will work with.
++ * \{
++ *
++ * Antlr will define EOF, but we can't use that as it it is too common in
++ * in C header files and that would be confusing. There is no way to filter this out at the moment
++ * so we just undef it here for now. That isn't the value we get back from C recognizers
++ * anyway. We are looking for ANTLR3_TOKEN_EOF.
++ */
++#ifdef        EOF
++#undef        EOF
++#endif
++#ifdef        Tokens
++#undef        Tokens
++#endif 
++#define INTBOOL      14
++#define STRTAG      10
++#define AGO      22
++#define WHITESPACE      29
++#define GREATEREQUAL      25
++#define BEFORE      18
++#define DATETAG      16
++#define INT      15
++#define NOT      7
++#define AFTER      17
++#define AND      6
++#define EOF      -1
++#define INCLUDES      11
++#define STR      4
++#define T__30      30
++#define T__31      31
++#define GREATER      24
++#define LPAR      8
++#define ENUMTAG      19
++#define IS      12
++#define ENUMVAL      20
++#define EQUAL      28
++#define OR      5
++#define LESS      26
++#define RPAR      9
++#define DATE      21
++#define LESSEQUAL      27
++#define INTTAG      13
++#define DATINTERVAL      23
++#ifdef        EOF
++#undef        EOF
++#define       EOF     ANTLR3_TOKEN_EOF
++#endif
++
++#ifndef TOKENSOURCE
++#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
++#endif
++
++/* End of token definitions for SMARTPL2SQL
++ * =============================================================================
++ */
++/** \} */
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++
++/* END - Note:Keep extra line feed to satisfy UNIX systems */
+diff --git a/src/pregen/SMARTPL2SQL.u b/src/pregen/SMARTPL2SQL.u
+new file mode 100644
+index 0000000..85567d1
+--- /dev/null
++++ b/src/pregen/SMARTPL2SQL.u
+@@ -0,0 +1,5 @@
++SMARTPL2SQL.g: SMARTPL.tokens
++SMARTPL2SQL.c : SMARTPL2SQL.g
++./SMARTPL2SQL.tokens : SMARTPL2SQL.g
++SMARTPL2SQL.h : SMARTPL2SQL.g
++ANTLR_PRODUCTS += SMARTPL2SQL.c ./SMARTPL2SQL.tokens SMARTPL2SQL.h 
+\ No newline at end of file
+diff --git a/src/pregen/SMARTPLLexer.c b/src/pregen/SMARTPLLexer.c
+new file mode 100644
+index 0000000..9ea1a83
+--- /dev/null
++++ b/src/pregen/SMARTPLLexer.c
+@@ -0,0 +1,4168 @@
++/** \file
++ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : SMARTPL.g
++ *     -                            On : 2015-06-27 19:05:15
++ *     -                 for the lexer : SMARTPLLexerLexer *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++*/
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++/* -----------------------------------------
++ * Include the ANTLR3 generated header file.
++ */
++#include    "SMARTPLLexer.h"
++/* ----------------------------------------- */
++
++
++/** String literals used by SMARTPLLexer that we must do things like MATCHS() with.
++ *  C will normally just lay down 8 bit characters, and you can use L"xxx" to
++ *  get wchar_t, but wchar_t is 16 bits on Windows, which is not UTF32 and so
++ *  we perform this little trick of defining the literals as arrays of UINT32
++ *  and passing in the address of these.
++ */
++static ANTLR3_UCHAR   lit_1[]  = { 0x61, 0x72, 0x74, 0x69, 0x73, 0x74,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_2[]  = { 0x61, 0x6C, 0x62, 0x75, 0x6D, 0x5F, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_3[]  = { 0x61, 0x6C, 0x62, 0x75, 0x6D,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_4[]  = { 0x74, 0x69, 0x74, 0x6C, 0x65,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_5[]  = { 0x67, 0x65, 0x6E, 0x72, 0x65,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_6[]  = { 0x63, 0x6F, 0x6D, 0x70, 0x6F, 0x73, 0x65, 0x72,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_7[]  = { 0x70, 0x61, 0x74, 0x68,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_8[]  = { 0x74, 0x79, 0x70, 0x65,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_9[]  = { 0x67, 0x72, 0x6F, 0x75, 0x70, 0x69, 0x6E, 0x67,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_10[]  = { 0x70, 0x6C, 0x61, 0x79, 0x5F, 0x63, 0x6F, 0x75, 0x6E, 0x74,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_11[]  = { 0x72, 0x61, 0x74, 0x69, 0x6E, 0x67,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_12[]  = { 0x79, 0x65, 0x61, 0x72,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_13[]  = { 0x63, 0x6F, 0x6D, 0x70, 0x69, 0x6C, 0x61, 0x74, 0x69, 0x6F, 0x6E,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_14[]  = { 0x74, 0x69, 0x6D, 0x65, 0x5F, 0x61, 0x64, 0x64, 0x65, 0x64,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_15[]  = { 0x74, 0x69, 0x6D, 0x65, 0x5F, 0x70, 0x6C, 0x61, 0x79, 0x65, 0x64,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_16[]  = { 0x64, 0x61, 0x74, 0x61, 0x5F, 0x6B, 0x69, 0x6E, 0x64,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_17[]  = { 0x6D, 0x65, 0x64, 0x69, 0x61, 0x5F, 0x6B, 0x69, 0x6E, 0x64,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_18[]  = { 0x69, 0x6E, 0x63, 0x6C, 0x75, 0x64, 0x65, 0x73,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_19[]  = { 0x69, 0x73,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_20[]  = { 0x3E, 0x3D,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_21[]  = { 0x3C, 0x3D,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_22[]  = { 0x61, 0x66, 0x74, 0x65, 0x72,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_23[]  = { 0x62, 0x65, 0x66, 0x6F, 0x72, 0x65,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_24[]  = { 0x61, 0x67, 0x6F,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_25[]  = { 0x41, 0x4E, 0x44,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_26[]  = { 0x61, 0x6E, 0x64,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_27[]  = { 0x4F, 0x52,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_28[]  = { 0x6F, 0x72,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_29[]  = { 0x4E, 0x4F, 0x54,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_30[]  = { 0x6E, 0x6F, 0x74,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_31[]  = { 0x74, 0x6F, 0x64, 0x61, 0x79,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_32[]  = { 0x79, 0x65, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, 0x79,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_33[]  = { 0x6C, 0x61, 0x73, 0x74, 0x20, 0x77, 0x65, 0x65, 0x6B,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_34[]  = { 0x6C, 0x61, 0x73, 0x74, 0x20, 0x6D, 0x6F, 0x6E, 0x74, 0x68,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_35[]  = { 0x6C, 0x61, 0x73, 0x74, 0x20, 0x79, 0x65, 0x61, 0x72,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_36[]  = { 0x64, 0x61, 0x79, 0x73,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_37[]  = { 0x77, 0x65, 0x65, 0x6B, 0x73,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_38[]  = { 0x6D, 0x6F, 0x6E, 0x74, 0x68, 0x73,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_39[]  = { 0x79, 0x65, 0x61, 0x72, 0x73,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_40[]  = { 0x6D, 0x75, 0x73, 0x69, 0x63,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_41[]  = { 0x6D, 0x6F, 0x76, 0x69, 0x65,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_42[]  = { 0x70, 0x6F, 0x64, 0x63, 0x61, 0x73, 0x74,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_43[]  = { 0x61, 0x75, 0x64, 0x69, 0x6F, 0x62, 0x6F, 0x6F, 0x6B,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_44[]  = { 0x74, 0x76, 0x73, 0x68, 0x6F, 0x77,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_45[]  = { 0x66, 0x69, 0x6C, 0x65,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_46[]  = { 0x75, 0x72, 0x6C,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_47[]  = { 0x73, 0x70, 0x6F, 0x74, 0x69, 0x66, 0x79,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_48[]  = { 0x70, 0x69, 0x70, 0x65,  ANTLR3_STRING_TERMINATOR};
++
++
++
++
++/* MACROS that hide the C interface implementations from the
++ * generated code, which makes it a little more understandable to the human eye.
++ * I am very much against using C pre-processor macros for function calls and bits
++ * of code as you cannot see what is happening when single stepping in debuggers
++ * and so on. The exception (in my book at least) is for generated code, where you are
++ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
++ * hides some indirect calls, but is always referring to the input stream. This is
++ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
++ * the runtime interfaces without changing the generated code too often, without
++ * confusing the reader of the generated output, who may not wish to know the gory
++ * details of the interface inheritance.
++ */
++ 
++#define               CTX     ctx
++
++/* Aids in accessing scopes for grammar programmers
++ */
++#undef        SCOPE_TYPE
++#undef        SCOPE_STACK
++#undef        SCOPE_TOP
++#define       SCOPE_TYPE(scope)   pSMARTPLLexer_##scope##_SCOPE
++#define SCOPE_STACK(scope)  pSMARTPLLexer_##scope##Stack
++#define       SCOPE_TOP(scope)    ctx->pSMARTPLLexer_##scope##Top
++#define       SCOPE_SIZE(scope)               ctx->pSMARTPLLexer_##scope##Stack_limit
++#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
++
++ 
++/* Macros for accessing things in a lexer
++ */
++#undef            LEXER
++#undef            RECOGNIZER              
++#undef            RULEMEMO                
++#undef            GETCHARINDEX
++#undef            GETLINE
++#undef            GETCHARPOSITIONINLINE
++#undef            EMIT
++#undef            EMITNEW
++#undef            MATCHC
++#undef            MATCHS
++#undef            MATCHRANGE
++#undef            LTOKEN
++#undef            HASFAILED
++#undef            FAILEDFLAG
++#undef            INPUT
++#undef            STRSTREAM
++#undef            LA
++#undef            HASEXCEPTION
++#undef            EXCEPTION
++#undef            CONSTRUCTEX
++#undef            CONSUME
++#undef            LRECOVER
++#undef            MARK
++#undef            REWIND
++#undef            REWINDLAST
++#undef            BACKTRACKING
++#undef                MATCHANY
++#undef                MEMOIZE
++#undef                HAVEPARSEDRULE
++#undef                GETTEXT
++#undef                INDEX
++#undef                SEEK
++#undef                PUSHSTREAM
++#undef                POPSTREAM
++#undef                SETTEXT
++#undef                SETTEXT8
++
++#define           LEXER                                       ctx->pLexer
++#define           RECOGNIZER                      LEXER->rec
++#define               LEXSTATE                                RECOGNIZER->state
++#define               TOKSOURCE                               LEXSTATE->tokSource
++#define           GETCHARINDEX()                      LEXER->getCharIndex(LEXER)
++#define           GETLINE()                           LEXER->getLine(LEXER)
++#define           GETTEXT()                           LEXER->getText(LEXER)
++#define           GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
++#define           EMIT()                                      LEXSTATE->type = _type; LEXER->emit(LEXER)
++#define           EMITNEW(t)                          LEXER->emitNew(LEXER, t)
++#define           MATCHC(c)                           LEXER->matchc(LEXER, c)
++#define           MATCHS(s)                           LEXER->matchs(LEXER, s)
++#define           MATCHRANGE(c1,c2)       LEXER->matchRange(LEXER, c1, c2)
++#define           MATCHANY()                          LEXER->matchAny(LEXER)
++#define           LTOKEN                              LEXSTATE->token
++#define           HASFAILED()                         (LEXSTATE->failed == ANTLR3_TRUE)
++#define           BACKTRACKING                        LEXSTATE->backtracking
++#define           FAILEDFLAG                          LEXSTATE->failed
++#define           INPUT                                       LEXER->input
++#define           STRSTREAM                           INPUT
++#define               ISTREAM                                 INPUT->istream
++#define               INDEX()                                 ISTREAM->index(ISTREAM)
++#define               SEEK(n)                                 ISTREAM->seek(ISTREAM, n)
++#define           EOF_TOKEN                           &(LEXSTATE->tokSource->eofToken)
++#define           HASEXCEPTION()                      (LEXSTATE->error == ANTLR3_TRUE)
++#define           EXCEPTION                           LEXSTATE->exception
++#define           CONSTRUCTEX()                       RECOGNIZER->exConstruct(RECOGNIZER)
++#define           LRECOVER()                          LEXER->recover(LEXER)
++#define           MARK()                                      ISTREAM->mark(ISTREAM)
++#define           REWIND(m)                           ISTREAM->rewind(ISTREAM, m)
++#define           REWINDLAST()                        ISTREAM->rewindLast(ISTREAM)
++#define               MEMOIZE(ri,si)                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
++#define               HAVEPARSEDRULE(r)               RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
++#define               PUSHSTREAM(str)                 LEXER->pushCharStream(LEXER, str)
++#define               POPSTREAM()                             LEXER->popCharStream(LEXER)
++#define               SETTEXT(str)                    LEXSTATE->text = str
++#define               SKIP()                                  LEXSTATE->token = &(TOKSOURCE->skipToken)
++#define               USER1                                   LEXSTATE->user1
++#define               USER2                                   LEXSTATE->user2
++#define               USER3                                   LEXSTATE->user3
++#define               CUSTOM                                  LEXSTATE->custom
++#define               RULEMEMO                                LEXSTATE->ruleMemo
++#define               DBG                                             RECOGNIZER->debugger
++
++/* If we have been told we can rely on the standard 8 bit or 16 bit input
++ * stream, then we can define our macros to use the direct pointers
++ * in the input object, which is much faster than indirect calls. This
++ * is really only significant to lexers with a lot of fragment rules (which
++ * do not place LA(1) in a temporary at the moment) and even then
++ * only if there is a lot of input (order of say 1M or so).
++ */
++#if   defined(ANTLR3_INLINE_INPUT_ASCII) || defined(ANTLR3_INLINE_INPUT_UTF16)
++
++# ifdef       ANTLR3_INLINE_INPUT_ASCII
++
++/* 8 bit "ASCII" (actually any 8 bit character set) */
++
++#  define         NEXTCHAR                    ((pANTLR3_UINT8)(INPUT->nextChar))
++#  define         DATAP                               ((pANTLR3_UINT8)(INPUT->data))
++
++# else
++
++#  define         NEXTCHAR                    ((pANTLR3_UINT16)(INPUT->nextChar)) 
++#  define         DATAP                               ((pANTLR3_UINT16)(INPUT->data))
++
++# endif
++
++# define          LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
++# define          CONSUME()                                                                                   \
++{                                                                                                                                     \
++    if        (NEXTCHAR < (DATAP + INPUT->sizeBuf))                                           \
++    {                                                                                                                         \
++              INPUT->charPositionInLine++;                                                            \
++              if  ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar)           \
++              {                                                                                                                       \
++                      INPUT->line++;                                                                                  \
++                      INPUT->charPositionInLine       = 0;                                            \
++                      INPUT->currentLine              = (void *)(NEXTCHAR + 1);               \
++              }                                                                                                                       \
++              INPUT->nextChar = (void *)(NEXTCHAR + 1);                                       \
++    }                                                                                                                         \
++}
++
++#else
++
++// Pick up the input character by calling the input stream implementation.
++//
++#define           CONSUME()                           INPUT->istream->consume(INPUT->istream)
++#define           LA(n)                                       INPUT->istream->_LA(INPUT->istream, n)
++
++#endif
++#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
++
++/* The 4 tokens defined below may well clash with your own #defines or token types. If so
++ * then for the present you must use different names for your defines as these are hard coded
++ * in the code generator. It would be better not to use such names internally, and maybe
++ * we can change this in a forthcoming release. I deliberately do not #undef these
++ * here as this will at least give you a redefined error somewhere if they clash.
++ */
++#define           UP      ANTLR3_TOKEN_UP
++#define           DOWN    ANTLR3_TOKEN_DOWN
++#define           EOR     ANTLR3_TOKEN_EOR
++#define           INVALID ANTLR3_TOKEN_INVALID
++
++
++/* =============================================================================
++ * Functions to create and destroy scopes. First come the rule scopes, followed
++ * by the global declared scopes.
++ */
++
++
++
++/* ============================================================================= */
++
++/* =============================================================================
++ * Start of recognizer
++ */
++
++
++/* Forward declare the locally static matching functions we have generated and any predicate functions.
++ */
++static ANTLR3_INLINE  void    mT__30    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mT__31    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mSTRTAG    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mINTTAG    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mDATETAG    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mENUMTAG    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mINCLUDES    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mIS    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mINTBOOL    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mGREATER    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mGREATEREQUAL    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mLESS    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mLESSEQUAL    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mEQUAL    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mAFTER    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mBEFORE    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mAGO    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mAND    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mOR    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mNOT    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mLPAR    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mRPAR    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mDATE    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mDATINTERVAL    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mENUMVAL    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mSTR    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mINT    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mWHITESPACE    (pSMARTPLLexer ctx);
++static ANTLR3_INLINE  void    mTokens    (pSMARTPLLexer ctx);
++static void   SMARTPLLexerFree(pSMARTPLLexer ctx);
++
++/* =========================================================================
++ * Lexer matching rules end.
++ * =========================================================================
++ */
++
++
++
++static void
++SMARTPLLexerFree  (pSMARTPLLexer ctx)
++{
++    LEXER->free(LEXER);
++    
++    ANTLR3_FREE(ctx);
++}
++
++/** \brief Name of the grammar file that generated this code
++ */
++static const char fileName[] = "SMARTPL.g";
++
++/** \brief Return the name of the grammar file that generated this code.
++ */
++static const char * getGrammarFileName()
++{
++      return fileName;
++}
++
++/** \brief Create a new lexer called SMARTPLLexer
++ *
++ * \param[in]    instream Pointer to an initialized input stream
++ * \return 
++ *     - Success pSMARTPLLexer initialized for the lex start
++ *     - Fail NULL
++ */
++ANTLR3_API pSMARTPLLexer SMARTPLLexerNew         
++(pANTLR3_INPUT_STREAM instream)
++{
++      // See if we can create a new lexer with the standard constructor
++      //
++      return SMARTPLLexerNewSSD(instream, NULL);
++}
++
++/** \brief Create a new lexer called SMARTPLLexer
++ *
++ * \param[in]    instream Pointer to an initialized input stream
++ * \param[state] state Previously created shared recognizer stat
++ * \return 
++ *     - Success pSMARTPLLexer initialized for the lex start
++ *     - Fail NULL
++ */
++ANTLR3_API pSMARTPLLexer SMARTPLLexerNewSSD         
++(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
++{
++    pSMARTPLLexer ctx; // Context structure we will build and return
++
++    ctx = (pSMARTPLLexer) ANTLR3_CALLOC(1, sizeof(SMARTPLLexer));
++
++    if  (ctx == NULL)
++    {
++        // Failed to allocate memory for lexer context
++        return  NULL;
++    }
++
++    /* -------------------------------------------------------------------
++     * Memory for basic structure is allocated, now to fill in
++     * in base ANTLR3 structures. We initialize the function pointers
++     * for the standard ANTLR3 lexer function set, but upon return
++     * from here, the programmer may set the pointers to provide custom
++     * implementations of each function. 
++     *
++     * We don't use the macros defined in SMARTPLLexer.h here so you can get a sense
++     * of what goes where.
++     */
++    
++    /* Create a base lexer, using the supplied input stream
++     */
++    ctx->pLexer       = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
++    
++    /* Check that we allocated the memory correctly
++     */
++    if        (ctx->pLexer == NULL)
++    {
++              ANTLR3_FREE(ctx);
++              return  NULL;
++    }
++    /* Install the implementation of our SMARTPLLexer interface
++     */
++    ctx->mT__30       = mT__30;
++    ctx->mT__31       = mT__31;
++    ctx->mSTRTAG      = mSTRTAG;
++    ctx->mINTTAG      = mINTTAG;
++    ctx->mDATETAG     = mDATETAG;
++    ctx->mENUMTAG     = mENUMTAG;
++    ctx->mINCLUDES    = mINCLUDES;
++    ctx->mIS  = mIS;
++    ctx->mINTBOOL     = mINTBOOL;
++    ctx->mGREATER     = mGREATER;
++    ctx->mGREATEREQUAL        = mGREATEREQUAL;
++    ctx->mLESS        = mLESS;
++    ctx->mLESSEQUAL   = mLESSEQUAL;
++    ctx->mEQUAL       = mEQUAL;
++    ctx->mAFTER       = mAFTER;
++    ctx->mBEFORE      = mBEFORE;
++    ctx->mAGO = mAGO;
++    ctx->mAND = mAND;
++    ctx->mOR  = mOR;
++    ctx->mNOT = mNOT;
++    ctx->mLPAR        = mLPAR;
++    ctx->mRPAR        = mRPAR;
++    ctx->mDATE        = mDATE;
++    ctx->mDATINTERVAL = mDATINTERVAL;
++    ctx->mENUMVAL     = mENUMVAL;
++    ctx->mSTR = mSTR;
++    ctx->mINT = mINT;
++    ctx->mWHITESPACE  = mWHITESPACE;
++    ctx->mTokens      = mTokens;
++    
++    /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
++     *  it will call mTokens() in this generated code, and will pass it the ctx
++     * pointer of this lexer, not the context of the base lexer, so store that now.
++     */
++    ctx->pLexer->ctx      = ctx;
++    
++    /**Install the token matching function
++     */
++    ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
++    
++    ctx->getGrammarFileName   = getGrammarFileName;
++    ctx->free         = SMARTPLLexerFree;
++
++    
++    
++
++
++    /* Return the newly built lexer to the caller
++     */
++    return  ctx;
++}
++ 
++
++/* =========================================================================
++ * Functions to match the lexer grammar defined tokens from the input stream
++ */
++
++//   Comes from: 7:7: ( '{' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start T__30
++ *
++ * Looks to match the characters the constitute the token T__30
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mT__30(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = T__30;
++       
++    
++    // SMARTPL.g:7:7: ( '{' )
++    // SMARTPL.g:7:9: '{'
++    {
++        MATCHC('{'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleT__30Ex;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleT__30Ex; /* Prevent compiler warnings */
++    ruleT__30Ex: ;
++
++}
++// $ANTLR end T__30
++
++//   Comes from: 8:7: ( '}' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start T__31
++ *
++ * Looks to match the characters the constitute the token T__31
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mT__31(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = T__31;
++       
++    
++    // SMARTPL.g:8:7: ( '}' )
++    // SMARTPL.g:8:9: '}'
++    {
++        MATCHC('}'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleT__31Ex;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleT__31Ex; /* Prevent compiler warnings */
++    ruleT__31Ex: ;
++
++}
++// $ANTLR end T__31
++
++//   Comes from: 56:9: ( 'artist' | 'album_artist' | 'album' | 'title' | 'genre' | 'composer' | 'path' | 'type' | 'grouping' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start STRTAG
++ *
++ * Looks to match the characters the constitute the token STRTAG
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mSTRTAG(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = STRTAG;
++       
++    
++    {
++        //  SMARTPL.g:56:9: ( 'artist' | 'album_artist' | 'album' | 'title' | 'genre' | 'composer' | 'path' | 'type' | 'grouping' )
++        
++        ANTLR3_UINT32 alt1;
++
++        alt1=9;
++
++        switch ( LA(1) ) 
++        {
++        case 'a':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'r':
++                              {
++                                      alt1=1;
++                              }
++                          break;
++                      case 'l':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'b':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'u':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 'm':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case '_':
++                                                                                              {
++                                                                                                      alt1=2;
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          alt1=3;}
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          CONSTRUCTEX();
++                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                                          EXCEPTION->message      = (void *)"";
++                                                                          EXCEPTION->decisionNum  = 1;
++                                                                          EXCEPTION->state        = 13;
++
++
++                                                                          goto ruleSTRTAGEx;
++                                                                      }
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          CONSTRUCTEX();
++                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                          EXCEPTION->message      = (void *)"";
++                                                          EXCEPTION->decisionNum  = 1;
++                                                          EXCEPTION->state        = 12;
++
++
++                                                          goto ruleSTRTAGEx;
++                                                      }
++
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 1;
++                                          EXCEPTION->state        = 7;
++
++
++                                          goto ruleSTRTAGEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 1;
++                          EXCEPTION->state        = 1;
++
++
++                          goto ruleSTRTAGEx;
++                      }
++
++              }
++            break;
++        case 't':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'i':
++                              {
++                                      alt1=4;
++                              }
++                          break;
++                      case 'y':
++                              {
++                                      alt1=8;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 1;
++                          EXCEPTION->state        = 2;
++
++
++                          goto ruleSTRTAGEx;
++                      }
++
++              }
++            break;
++        case 'g':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'e':
++                              {
++                                      alt1=5;
++                              }
++                          break;
++                      case 'r':
++                              {
++                                      alt1=9;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 1;
++                          EXCEPTION->state        = 3;
++
++
++                          goto ruleSTRTAGEx;
++                      }
++
++              }
++            break;
++        case 'c':
++              {
++                      alt1=6;
++              }
++            break;
++        case 'p':
++              {
++                      alt1=7;
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 1;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleSTRTAGEx;
++        }
++
++        switch (alt1) 
++        {
++      case 1:
++          // SMARTPL.g:56:11: 'artist'
++          {
++              MATCHS(lit_1); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleSTRTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // SMARTPL.g:57:6: 'album_artist'
++          {
++              MATCHS(lit_2); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleSTRTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 3:
++          // SMARTPL.g:58:6: 'album'
++          {
++              MATCHS(lit_3); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleSTRTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 4:
++          // SMARTPL.g:59:6: 'title'
++          {
++              MATCHS(lit_4); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleSTRTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 5:
++          // SMARTPL.g:60:6: 'genre'
++          {
++              MATCHS(lit_5); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleSTRTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 6:
++          // SMARTPL.g:61:6: 'composer'
++          {
++              MATCHS(lit_6); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleSTRTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 7:
++          // SMARTPL.g:62:6: 'path'
++          {
++              MATCHS(lit_7); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleSTRTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 8:
++          // SMARTPL.g:63:6: 'type'
++          {
++              MATCHS(lit_8); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleSTRTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 9:
++          // SMARTPL.g:64:6: 'grouping'
++          {
++              MATCHS(lit_9); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleSTRTAGEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleSTRTAGEx; /* Prevent compiler warnings */
++    ruleSTRTAGEx: ;
++
++}
++// $ANTLR end STRTAG
++
++//   Comes from: 67:9: ( 'play_count' | 'rating' | 'year' | 'compilation' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start INTTAG
++ *
++ * Looks to match the characters the constitute the token INTTAG
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mINTTAG(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = INTTAG;
++       
++    
++    {
++        //  SMARTPL.g:67:9: ( 'play_count' | 'rating' | 'year' | 'compilation' )
++        
++        ANTLR3_UINT32 alt2;
++
++        alt2=4;
++
++        switch ( LA(1) ) 
++        {
++        case 'p':
++              {
++                      alt2=1;
++              }
++            break;
++        case 'r':
++              {
++                      alt2=2;
++              }
++            break;
++        case 'y':
++              {
++                      alt2=3;
++              }
++            break;
++        case 'c':
++              {
++                      alt2=4;
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 2;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleINTTAGEx;
++        }
++
++        switch (alt2) 
++        {
++      case 1:
++          // SMARTPL.g:67:11: 'play_count'
++          {
++              MATCHS(lit_10); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleINTTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // SMARTPL.g:68:6: 'rating'
++          {
++              MATCHS(lit_11); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleINTTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 3:
++          // SMARTPL.g:69:6: 'year'
++          {
++              MATCHS(lit_12); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleINTTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 4:
++          // SMARTPL.g:70:6: 'compilation'
++          {
++              MATCHS(lit_13); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleINTTAGEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleINTTAGEx; /* Prevent compiler warnings */
++    ruleINTTAGEx: ;
++
++}
++// $ANTLR end INTTAG
++
++//   Comes from: 73:10: ( 'time_added' | 'time_played' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start DATETAG
++ *
++ * Looks to match the characters the constitute the token DATETAG
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mDATETAG(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = DATETAG;
++       
++    
++    {
++        //  SMARTPL.g:73:10: ( 'time_added' | 'time_played' )
++        
++        ANTLR3_UINT32 alt3;
++
++        alt3=2;
++
++        switch ( LA(1) ) 
++        {
++        case 't':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'i':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'm':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'e':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case '_':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case 'a':
++                                                                                              {
++                                                                                                      alt3=1;
++                                                                                              }
++                                                                                          break;
++                                                                                      case 'p':
++                                                                                              {
++                                                                                                      alt3=2;
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          CONSTRUCTEX();
++                                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                                                          EXCEPTION->message      = (void *)"";
++                                                                                          EXCEPTION->decisionNum  = 3;
++                                                                                          EXCEPTION->state        = 5;
++
++
++                                                                                          goto ruleDATETAGEx;
++                                                                                      }
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          CONSTRUCTEX();
++                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                                          EXCEPTION->message      = (void *)"";
++                                                                          EXCEPTION->decisionNum  = 3;
++                                                                          EXCEPTION->state        = 4;
++
++
++                                                                          goto ruleDATETAGEx;
++                                                                      }
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          CONSTRUCTEX();
++                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                          EXCEPTION->message      = (void *)"";
++                                                          EXCEPTION->decisionNum  = 3;
++                                                          EXCEPTION->state        = 3;
++
++
++                                                          goto ruleDATETAGEx;
++                                                      }
++
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 3;
++                                          EXCEPTION->state        = 2;
++
++
++                                          goto ruleDATETAGEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 3;
++                          EXCEPTION->state        = 1;
++
++
++                          goto ruleDATETAGEx;
++                      }
++
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 3;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleDATETAGEx;
++        }
++
++        switch (alt3) 
++        {
++      case 1:
++          // SMARTPL.g:73:12: 'time_added'
++          {
++              MATCHS(lit_14); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATETAGEx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // SMARTPL.g:74:6: 'time_played'
++          {
++              MATCHS(lit_15); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATETAGEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleDATETAGEx; /* Prevent compiler warnings */
++    ruleDATETAGEx: ;
++
++}
++// $ANTLR end DATETAG
++
++//   Comes from: 77:10: ( 'data_kind' | 'media_kind' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start ENUMTAG
++ *
++ * Looks to match the characters the constitute the token ENUMTAG
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mENUMTAG(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = ENUMTAG;
++       
++    
++    {
++        //  SMARTPL.g:77:10: ( 'data_kind' | 'media_kind' )
++        
++        ANTLR3_UINT32 alt4;
++
++        alt4=2;
++
++        switch ( LA(1) ) 
++        {
++        case 'd':
++              {
++                      alt4=1;
++              }
++            break;
++        case 'm':
++              {
++                      alt4=2;
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 4;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleENUMTAGEx;
++        }
++
++        switch (alt4) 
++        {
++      case 1:
++          // SMARTPL.g:77:12: 'data_kind'
++          {
++              MATCHS(lit_16); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleENUMTAGEx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // SMARTPL.g:78:6: 'media_kind'
++          {
++              MATCHS(lit_17); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleENUMTAGEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleENUMTAGEx; /* Prevent compiler warnings */
++    ruleENUMTAGEx: ;
++
++}
++// $ANTLR end ENUMTAG
++
++//   Comes from: 81:10: ( 'includes' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start INCLUDES
++ *
++ * Looks to match the characters the constitute the token INCLUDES
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mINCLUDES(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = INCLUDES;
++       
++    
++    // SMARTPL.g:81:10: ( 'includes' )
++    // SMARTPL.g:81:12: 'includes'
++    {
++        MATCHS(lit_18); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleINCLUDESEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleINCLUDESEx; /* Prevent compiler warnings */
++    ruleINCLUDESEx: ;
++
++}
++// $ANTLR end INCLUDES
++
++//   Comes from: 84:6: ( 'is' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start IS
++ *
++ * Looks to match the characters the constitute the token IS
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mIS(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = IS;
++       
++    
++    // SMARTPL.g:84:6: ( 'is' )
++    // SMARTPL.g:84:8: 'is'
++    {
++        MATCHS(lit_19); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleISEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleISEx; /* Prevent compiler warnings */
++    ruleISEx: ;
++
++}
++// $ANTLR end IS
++
++//   Comes from: 87:10: ( ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL ) )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start INTBOOL
++ *
++ * Looks to match the characters the constitute the token INTBOOL
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mINTBOOL(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = INTBOOL;
++       
++    
++    // SMARTPL.g:87:10: ( ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL ) )
++    // SMARTPL.g:87:12: ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL )
++    {
++
++        // SMARTPL.g:87:12: ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL )
++        {
++            int alt5=5;
++            switch ( LA(1) ) 
++            {
++            case '>':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case '=':
++                              {
++                                      alt5=2;
++                              }
++                          break;
++
++                      default:
++                          alt5=1;}
++
++              }
++                break;
++            case '<':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case '=':
++                              {
++                                      alt5=4;
++                              }
++                          break;
++
++                      default:
++                          alt5=3;}
++
++              }
++                break;
++            case '=':
++              {
++                      alt5=5;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 5;
++                EXCEPTION->state        = 0;
++
++
++                goto ruleINTBOOLEx;
++            }
++
++            switch (alt5) 
++            {
++              case 1:
++                  // SMARTPL.g:87:13: GREATER
++                  {
++                      /* 87:13: GREATER */
++                      mGREATER(ctx ); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleINTBOOLEx;
++                      }
++
++
++                  }
++                  break;
++              case 2:
++                  // SMARTPL.g:87:21: GREATEREQUAL
++                  {
++                      /* 87:21: GREATEREQUAL */
++                      mGREATEREQUAL(ctx ); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleINTBOOLEx;
++                      }
++
++
++                  }
++                  break;
++              case 3:
++                  // SMARTPL.g:87:34: LESS
++                  {
++                      /* 87:34: LESS */
++                      mLESS(ctx ); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleINTBOOLEx;
++                      }
++
++
++                  }
++                  break;
++              case 4:
++                  // SMARTPL.g:87:39: LESSEQUAL
++                  {
++                      /* 87:39: LESSEQUAL */
++                      mLESSEQUAL(ctx ); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleINTBOOLEx;
++                      }
++
++
++                  }
++                  break;
++              case 5:
++                  // SMARTPL.g:87:49: EQUAL
++                  {
++                      /* 87:49: EQUAL */
++                      mEQUAL(ctx ); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleINTBOOLEx;
++                      }
++
++
++                  }
++                  break;
++
++            }
++        }
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleINTBOOLEx; /* Prevent compiler warnings */
++    ruleINTBOOLEx: ;
++
++}
++// $ANTLR end INTBOOL
++
++//   Comes from: 91:10: ( '>' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start GREATER
++ *
++ * Looks to match the characters the constitute the token GREATER
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mGREATER(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++        
++    // SMARTPL.g:91:10: ( '>' )
++    // SMARTPL.g:91:12: '>'
++    {
++        MATCHC('>'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleGREATEREx;
++        }
++
++
++    }
++
++
++
++    // This is where rules clean up and exit
++    //
++    goto ruleGREATEREx; /* Prevent compiler warnings */
++    ruleGREATEREx: ;
++
++}
++// $ANTLR end GREATER
++
++//   Comes from: 95:13: ( '>=' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start GREATEREQUAL
++ *
++ * Looks to match the characters the constitute the token GREATEREQUAL
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mGREATEREQUAL(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++        
++    // SMARTPL.g:95:13: ( '>=' )
++    // SMARTPL.g:95:15: '>='
++    {
++        MATCHS(lit_20); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleGREATEREQUALEx;
++        }
++
++
++
++    }
++
++
++
++    // This is where rules clean up and exit
++    //
++    goto ruleGREATEREQUALEx; /* Prevent compiler warnings */
++    ruleGREATEREQUALEx: ;
++
++}
++// $ANTLR end GREATEREQUAL
++
++//   Comes from: 99:7: ( '<' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start LESS
++ *
++ * Looks to match the characters the constitute the token LESS
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mLESS(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++        
++    // SMARTPL.g:99:7: ( '<' )
++    // SMARTPL.g:99:9: '<'
++    {
++        MATCHC('<'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleLESSEx;
++        }
++
++
++    }
++
++
++
++    // This is where rules clean up and exit
++    //
++    goto ruleLESSEx; /* Prevent compiler warnings */
++    ruleLESSEx: ;
++
++}
++// $ANTLR end LESS
++
++//   Comes from: 103:11: ( '<=' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start LESSEQUAL
++ *
++ * Looks to match the characters the constitute the token LESSEQUAL
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mLESSEQUAL(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++        
++    // SMARTPL.g:103:11: ( '<=' )
++    // SMARTPL.g:103:13: '<='
++    {
++        MATCHS(lit_21); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleLESSEQUALEx;
++        }
++
++
++
++    }
++
++
++
++    // This is where rules clean up and exit
++    //
++    goto ruleLESSEQUALEx; /* Prevent compiler warnings */
++    ruleLESSEQUALEx: ;
++
++}
++// $ANTLR end LESSEQUAL
++
++//   Comes from: 107:8: ( '=' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start EQUAL
++ *
++ * Looks to match the characters the constitute the token EQUAL
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mEQUAL(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++        
++    // SMARTPL.g:107:8: ( '=' )
++    // SMARTPL.g:107:10: '='
++    {
++        MATCHC('='); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleEQUALEx;
++        }
++
++
++    }
++
++
++
++    // This is where rules clean up and exit
++    //
++    goto ruleEQUALEx; /* Prevent compiler warnings */
++    ruleEQUALEx: ;
++
++}
++// $ANTLR end EQUAL
++
++//   Comes from: 110:8: ( 'after' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start AFTER
++ *
++ * Looks to match the characters the constitute the token AFTER
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mAFTER(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = AFTER;
++       
++    
++    // SMARTPL.g:110:8: ( 'after' )
++    // SMARTPL.g:110:10: 'after'
++    {
++        MATCHS(lit_22); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleAFTEREx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleAFTEREx; /* Prevent compiler warnings */
++    ruleAFTEREx: ;
++
++}
++// $ANTLR end AFTER
++
++//   Comes from: 113:9: ( 'before' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start BEFORE
++ *
++ * Looks to match the characters the constitute the token BEFORE
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mBEFORE(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = BEFORE;
++       
++    
++    // SMARTPL.g:113:9: ( 'before' )
++    // SMARTPL.g:113:11: 'before'
++    {
++        MATCHS(lit_23); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleBEFOREEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleBEFOREEx; /* Prevent compiler warnings */
++    ruleBEFOREEx: ;
++
++}
++// $ANTLR end BEFORE
++
++//   Comes from: 116:7: ( 'ago' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start AGO
++ *
++ * Looks to match the characters the constitute the token AGO
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mAGO(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = AGO;
++       
++    
++    // SMARTPL.g:116:7: ( 'ago' )
++    // SMARTPL.g:116:9: 'ago'
++    {
++        MATCHS(lit_24); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleAGOEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleAGOEx; /* Prevent compiler warnings */
++    ruleAGOEx: ;
++
++}
++// $ANTLR end AGO
++
++//   Comes from: 119:7: ( 'AND' | 'and' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start AND
++ *
++ * Looks to match the characters the constitute the token AND
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mAND(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = AND;
++       
++    
++    {
++        //  SMARTPL.g:119:7: ( 'AND' | 'and' )
++        
++        ANTLR3_UINT32 alt6;
++
++        alt6=2;
++
++        switch ( LA(1) ) 
++        {
++        case 'A':
++              {
++                      alt6=1;
++              }
++            break;
++        case 'a':
++              {
++                      alt6=2;
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 6;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleANDEx;
++        }
++
++        switch (alt6) 
++        {
++      case 1:
++          // SMARTPL.g:119:9: 'AND'
++          {
++              MATCHS(lit_25); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleANDEx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // SMARTPL.g:120:6: 'and'
++          {
++              MATCHS(lit_26); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleANDEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleANDEx; /* Prevent compiler warnings */
++    ruleANDEx: ;
++
++}
++// $ANTLR end AND
++
++//   Comes from: 123:6: ( 'OR' | 'or' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start OR
++ *
++ * Looks to match the characters the constitute the token OR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mOR(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = OR;
++       
++    
++    {
++        //  SMARTPL.g:123:6: ( 'OR' | 'or' )
++        
++        ANTLR3_UINT32 alt7;
++
++        alt7=2;
++
++        switch ( LA(1) ) 
++        {
++        case 'O':
++              {
++                      alt7=1;
++              }
++            break;
++        case 'o':
++              {
++                      alt7=2;
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 7;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleOREx;
++        }
++
++        switch (alt7) 
++        {
++      case 1:
++          // SMARTPL.g:123:8: 'OR'
++          {
++              MATCHS(lit_27); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleOREx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // SMARTPL.g:124:6: 'or'
++          {
++              MATCHS(lit_28); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleOREx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleOREx; /* Prevent compiler warnings */
++    ruleOREx: ;
++
++}
++// $ANTLR end OR
++
++//   Comes from: 127:7: ( 'NOT' | 'not' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start NOT
++ *
++ * Looks to match the characters the constitute the token NOT
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mNOT(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = NOT;
++       
++    
++    {
++        //  SMARTPL.g:127:7: ( 'NOT' | 'not' )
++        
++        ANTLR3_UINT32 alt8;
++
++        alt8=2;
++
++        switch ( LA(1) ) 
++        {
++        case 'N':
++              {
++                      alt8=1;
++              }
++            break;
++        case 'n':
++              {
++                      alt8=2;
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 8;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleNOTEx;
++        }
++
++        switch (alt8) 
++        {
++      case 1:
++          // SMARTPL.g:127:9: 'NOT'
++          {
++              MATCHS(lit_29); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleNOTEx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // SMARTPL.g:128:6: 'not'
++          {
++              MATCHS(lit_30); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleNOTEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleNOTEx; /* Prevent compiler warnings */
++    ruleNOTEx: ;
++
++}
++// $ANTLR end NOT
++
++//   Comes from: 131:7: ( '(' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start LPAR
++ *
++ * Looks to match the characters the constitute the token LPAR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mLPAR(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = LPAR;
++       
++    
++    // SMARTPL.g:131:7: ( '(' )
++    // SMARTPL.g:131:9: '('
++    {
++        MATCHC('('); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleLPAREx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleLPAREx; /* Prevent compiler warnings */
++    ruleLPAREx: ;
++
++}
++// $ANTLR end LPAR
++
++//   Comes from: 134:7: ( ')' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start RPAR
++ *
++ * Looks to match the characters the constitute the token RPAR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mRPAR(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = RPAR;
++       
++    
++    // SMARTPL.g:134:7: ( ')' )
++    // SMARTPL.g:134:9: ')'
++    {
++        MATCHC(')'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleRPAREx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleRPAREx; /* Prevent compiler warnings */
++    ruleRPAREx: ;
++
++}
++// $ANTLR end RPAR
++
++//   Comes from: 137:7: ( ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) '-' ( '0' .. '1' ) ( '0' .. '9' ) '-' ( '0' .. '3' ) ( '0' .. '9' ) | 'today' | 'yesterday' | 'last week' | 'last month' | 'last year' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start DATE
++ *
++ * Looks to match the characters the constitute the token DATE
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mDATE(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = DATE;
++       
++    
++    {
++        //  SMARTPL.g:137:7: ( ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) '-' ( '0' .. '1' ) ( '0' .. '9' ) '-' ( '0' .. '3' ) ( '0' .. '9' ) | 'today' | 'yesterday' | 'last week' | 'last month' | 'last year' )
++        
++        ANTLR3_UINT32 alt9;
++
++        alt9=6;
++
++        switch ( LA(1) ) 
++        {
++        case '0':
++        case '1':
++        case '2':
++        case '3':
++        case '4':
++        case '5':
++        case '6':
++        case '7':
++        case '8':
++        case '9':
++              {
++                      alt9=1;
++              }
++            break;
++        case 't':
++              {
++                      alt9=2;
++              }
++            break;
++        case 'y':
++              {
++                      alt9=3;
++              }
++            break;
++        case 'l':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'a':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 's':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 't':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case ' ':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case 'w':
++                                                                                              {
++                                                                                                      alt9=4;
++                                                                                              }
++                                                                                          break;
++                                                                                      case 'm':
++                                                                                              {
++                                                                                                      alt9=5;
++                                                                                              }
++                                                                                          break;
++                                                                                      case 'y':
++                                                                                              {
++                                                                                                      alt9=6;
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          CONSTRUCTEX();
++                                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                                                          EXCEPTION->message      = (void *)"";
++                                                                                          EXCEPTION->decisionNum  = 9;
++                                                                                          EXCEPTION->state        = 8;
++
++
++                                                                                          goto ruleDATEEx;
++                                                                                      }
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          CONSTRUCTEX();
++                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                                          EXCEPTION->message      = (void *)"";
++                                                                          EXCEPTION->decisionNum  = 9;
++                                                                          EXCEPTION->state        = 7;
++
++
++                                                                          goto ruleDATEEx;
++                                                                      }
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          CONSTRUCTEX();
++                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                          EXCEPTION->message      = (void *)"";
++                                                          EXCEPTION->decisionNum  = 9;
++                                                          EXCEPTION->state        = 6;
++
++
++                                                          goto ruleDATEEx;
++                                                      }
++
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 9;
++                                          EXCEPTION->state        = 5;
++
++
++                                          goto ruleDATEEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 9;
++                          EXCEPTION->state        = 4;
++
++
++                          goto ruleDATEEx;
++                      }
++
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 9;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleDATEEx;
++        }
++
++        switch (alt9) 
++        {
++      case 1:
++          // SMARTPL.g:137:9: ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) '-' ( '0' .. '1' ) ( '0' .. '9' ) '-' ( '0' .. '3' ) ( '0' .. '9' )
++          {
++              // SMARTPL.g:137:9: ( '0' .. '9' )
++              // SMARTPL.g:137:10: '0' .. '9'
++              {
++                  MATCHRANGE('0', '9'); 
++                  if  (HASEXCEPTION())
++                  {
++                      goto ruleDATEEx;
++                  }
++
++
++              }
++
++              // SMARTPL.g:137:19: ( '0' .. '9' )
++              // SMARTPL.g:137:20: '0' .. '9'
++              {
++                  MATCHRANGE('0', '9'); 
++                  if  (HASEXCEPTION())
++                  {
++                      goto ruleDATEEx;
++                  }
++
++
++              }
++
++              // SMARTPL.g:137:29: ( '0' .. '9' )
++              // SMARTPL.g:137:30: '0' .. '9'
++              {
++                  MATCHRANGE('0', '9'); 
++                  if  (HASEXCEPTION())
++                  {
++                      goto ruleDATEEx;
++                  }
++
++
++              }
++
++              // SMARTPL.g:137:39: ( '0' .. '9' )
++              // SMARTPL.g:137:40: '0' .. '9'
++              {
++                  MATCHRANGE('0', '9'); 
++                  if  (HASEXCEPTION())
++                  {
++                      goto ruleDATEEx;
++                  }
++
++
++              }
++
++              MATCHC('-'); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATEEx;
++              }
++
++              // SMARTPL.g:137:52: ( '0' .. '1' )
++              // SMARTPL.g:137:53: '0' .. '1'
++              {
++                  MATCHRANGE('0', '1'); 
++                  if  (HASEXCEPTION())
++                  {
++                      goto ruleDATEEx;
++                  }
++
++
++              }
++
++              // SMARTPL.g:137:62: ( '0' .. '9' )
++              // SMARTPL.g:137:63: '0' .. '9'
++              {
++                  MATCHRANGE('0', '9'); 
++                  if  (HASEXCEPTION())
++                  {
++                      goto ruleDATEEx;
++                  }
++
++
++              }
++
++              MATCHC('-'); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATEEx;
++              }
++
++              // SMARTPL.g:137:75: ( '0' .. '3' )
++              // SMARTPL.g:137:76: '0' .. '3'
++              {
++                  MATCHRANGE('0', '3'); 
++                  if  (HASEXCEPTION())
++                  {
++                      goto ruleDATEEx;
++                  }
++
++
++              }
++
++              // SMARTPL.g:137:85: ( '0' .. '9' )
++              // SMARTPL.g:137:86: '0' .. '9'
++              {
++                  MATCHRANGE('0', '9'); 
++                  if  (HASEXCEPTION())
++                  {
++                      goto ruleDATEEx;
++                  }
++
++
++              }
++
++
++          }
++          break;
++      case 2:
++          // SMARTPL.g:138:6: 'today'
++          {
++              MATCHS(lit_31); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATEEx;
++              }
++
++
++
++          }
++          break;
++      case 3:
++          // SMARTPL.g:139:6: 'yesterday'
++          {
++              MATCHS(lit_32); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATEEx;
++              }
++
++
++
++          }
++          break;
++      case 4:
++          // SMARTPL.g:140:6: 'last week'
++          {
++              MATCHS(lit_33); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATEEx;
++              }
++
++
++
++          }
++          break;
++      case 5:
++          // SMARTPL.g:141:6: 'last month'
++          {
++              MATCHS(lit_34); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATEEx;
++              }
++
++
++
++          }
++          break;
++      case 6:
++          // SMARTPL.g:142:6: 'last year'
++          {
++              MATCHS(lit_35); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATEEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleDATEEx; /* Prevent compiler warnings */
++    ruleDATEEx: ;
++
++}
++// $ANTLR end DATE
++
++//   Comes from: 145:13: ( 'days' | 'weeks' | 'months' | 'years' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start DATINTERVAL
++ *
++ * Looks to match the characters the constitute the token DATINTERVAL
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mDATINTERVAL(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = DATINTERVAL;
++       
++    
++    {
++        //  SMARTPL.g:145:13: ( 'days' | 'weeks' | 'months' | 'years' )
++        
++        ANTLR3_UINT32 alt10;
++
++        alt10=4;
++
++        switch ( LA(1) ) 
++        {
++        case 'd':
++              {
++                      alt10=1;
++              }
++            break;
++        case 'w':
++              {
++                      alt10=2;
++              }
++            break;
++        case 'm':
++              {
++                      alt10=3;
++              }
++            break;
++        case 'y':
++              {
++                      alt10=4;
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 10;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleDATINTERVALEx;
++        }
++
++        switch (alt10) 
++        {
++      case 1:
++          // SMARTPL.g:145:15: 'days'
++          {
++              MATCHS(lit_36); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATINTERVALEx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // SMARTPL.g:146:6: 'weeks'
++          {
++              MATCHS(lit_37); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATINTERVALEx;
++              }
++
++
++
++          }
++          break;
++      case 3:
++          // SMARTPL.g:147:6: 'months'
++          {
++              MATCHS(lit_38); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATINTERVALEx;
++              }
++
++
++
++          }
++          break;
++      case 4:
++          // SMARTPL.g:148:6: 'years'
++          {
++              MATCHS(lit_39); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDATINTERVALEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleDATINTERVALEx; /* Prevent compiler warnings */
++    ruleDATINTERVALEx: ;
++
++}
++// $ANTLR end DATINTERVAL
++
++//   Comes from: 151:10: ( 'music' | 'movie' | 'podcast' | 'audiobook' | 'tvshow' | 'file' | 'url' | 'spotify' | 'pipe' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start ENUMVAL
++ *
++ * Looks to match the characters the constitute the token ENUMVAL
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mENUMVAL(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = ENUMVAL;
++       
++    
++    {
++        //  SMARTPL.g:151:10: ( 'music' | 'movie' | 'podcast' | 'audiobook' | 'tvshow' | 'file' | 'url' | 'spotify' | 'pipe' )
++        
++        ANTLR3_UINT32 alt11;
++
++        alt11=9;
++
++        switch ( LA(1) ) 
++        {
++        case 'm':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'u':
++                              {
++                                      alt11=1;
++                              }
++                          break;
++                      case 'o':
++                              {
++                                      alt11=2;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 11;
++                          EXCEPTION->state        = 1;
++
++
++                          goto ruleENUMVALEx;
++                      }
++
++              }
++            break;
++        case 'p':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'o':
++                              {
++                                      alt11=3;
++                              }
++                          break;
++                      case 'i':
++                              {
++                                      alt11=9;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 11;
++                          EXCEPTION->state        = 2;
++
++
++                          goto ruleENUMVALEx;
++                      }
++
++              }
++            break;
++        case 'a':
++              {
++                      alt11=4;
++              }
++            break;
++        case 't':
++              {
++                      alt11=5;
++              }
++            break;
++        case 'f':
++              {
++                      alt11=6;
++              }
++            break;
++        case 'u':
++              {
++                      alt11=7;
++              }
++            break;
++        case 's':
++              {
++                      alt11=8;
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 11;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleENUMVALEx;
++        }
++
++        switch (alt11) 
++        {
++      case 1:
++          // SMARTPL.g:151:12: 'music'
++          {
++              MATCHS(lit_40); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleENUMVALEx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // SMARTPL.g:152:6: 'movie'
++          {
++              MATCHS(lit_41); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleENUMVALEx;
++              }
++
++
++
++          }
++          break;
++      case 3:
++          // SMARTPL.g:153:6: 'podcast'
++          {
++              MATCHS(lit_42); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleENUMVALEx;
++              }
++
++
++
++          }
++          break;
++      case 4:
++          // SMARTPL.g:154:6: 'audiobook'
++          {
++              MATCHS(lit_43); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleENUMVALEx;
++              }
++
++
++
++          }
++          break;
++      case 5:
++          // SMARTPL.g:155:6: 'tvshow'
++          {
++              MATCHS(lit_44); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleENUMVALEx;
++              }
++
++
++
++          }
++          break;
++      case 6:
++          // SMARTPL.g:156:6: 'file'
++          {
++              MATCHS(lit_45); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleENUMVALEx;
++              }
++
++
++
++          }
++          break;
++      case 7:
++          // SMARTPL.g:157:6: 'url'
++          {
++              MATCHS(lit_46); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleENUMVALEx;
++              }
++
++
++
++          }
++          break;
++      case 8:
++          // SMARTPL.g:158:6: 'spotify'
++          {
++              MATCHS(lit_47); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleENUMVALEx;
++              }
++
++
++
++          }
++          break;
++      case 9:
++          // SMARTPL.g:159:6: 'pipe'
++          {
++              MATCHS(lit_48); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleENUMVALEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleENUMVALEx; /* Prevent compiler warnings */
++    ruleENUMVALEx: ;
++
++}
++// $ANTLR end ENUMVAL
++
++//   Comes from: 162:7: ( '\"' (~ ( '\"' ) )+ '\"' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start STR
++ *
++ * Looks to match the characters the constitute the token STR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mSTR(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = STR;
++       
++    
++    // SMARTPL.g:162:7: ( '\"' (~ ( '\"' ) )+ '\"' )
++    // SMARTPL.g:162:9: '\"' (~ ( '\"' ) )+ '\"'
++    {
++        MATCHC('"'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleSTREx;
++        }
++
++        // SMARTPL.g:162:13: (~ ( '\"' ) )+
++        {
++            int cnt12=0;
++
++            for (;;)
++            {
++                int alt12=2;
++              {
++                 /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
++                  */
++                  int LA12_0 = LA(1);
++                  if ( (((LA12_0 >= 0x0000) && (LA12_0 <= '!')) || ((LA12_0 >= '#') && (LA12_0 <= 0xFFFF))) ) 
++                  {
++                      alt12=1;
++                  }
++
++              }
++              switch (alt12) 
++              {
++                  case 1:
++                      // SMARTPL.g:162:13: ~ ( '\"' )
++                      {
++                          if ( ((LA(1) >= 0x0000) && (LA(1) <= '!')) || ((LA(1) >= '#') && (LA(1) <= 0xFFFF)) )
++                          {
++                              CONSUME();
++
++                          }
++                          else 
++                          {
++                              CONSTRUCTEX();
++                              EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++                              EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++
++                              LRECOVER();    goto ruleSTREx;
++                          }
++
++
++                      }
++                      break;
++
++                  default:
++                  
++                      if ( cnt12 >= 1 )
++                      {
++                          goto loop12;
++                      }
++                      /* mismatchedSetEx()
++                       */
++                      CONSTRUCTEX();
++                      EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
++                      EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
++
++
++                      goto ruleSTREx;
++              }
++              cnt12++;
++            }
++            loop12: ; /* Jump to here if this rule does not match */
++        }
++        MATCHC('"'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleSTREx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleSTREx; /* Prevent compiler warnings */
++    ruleSTREx: ;
++
++}
++// $ANTLR end STR
++
++//   Comes from: 165:7: ( ( '0' .. '9' )+ )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start INT
++ *
++ * Looks to match the characters the constitute the token INT
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mINT(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = INT;
++       
++    
++    // SMARTPL.g:165:7: ( ( '0' .. '9' )+ )
++    // SMARTPL.g:165:9: ( '0' .. '9' )+
++    {
++        // SMARTPL.g:165:9: ( '0' .. '9' )+
++        {
++            int cnt13=0;
++
++            for (;;)
++            {
++                int alt13=2;
++              switch ( LA(1) ) 
++              {
++              case '0':
++              case '1':
++              case '2':
++              case '3':
++              case '4':
++              case '5':
++              case '6':
++              case '7':
++              case '8':
++              case '9':
++                      {
++                              alt13=1;
++                      }
++                  break;
++
++              }
++
++              switch (alt13) 
++              {
++                  case 1:
++                      // SMARTPL.g:165:10: '0' .. '9'
++                      {
++                          MATCHRANGE('0', '9'); 
++                          if  (HASEXCEPTION())
++                          {
++                              goto ruleINTEx;
++                          }
++
++
++                      }
++                      break;
++
++                  default:
++                  
++                      if ( cnt13 >= 1 )
++                      {
++                          goto loop13;
++                      }
++                      /* mismatchedSetEx()
++                       */
++                      CONSTRUCTEX();
++                      EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
++                      EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
++
++
++                      goto ruleINTEx;
++              }
++              cnt13++;
++            }
++            loop13: ; /* Jump to here if this rule does not match */
++        }
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleINTEx; /* Prevent compiler warnings */
++    ruleINTEx: ;
++
++}
++// $ANTLR end INT
++
++//   Comes from: 168:12: ( ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' ) )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start WHITESPACE
++ *
++ * Looks to match the characters the constitute the token WHITESPACE
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mWHITESPACE(pSMARTPLLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = WHITESPACE;
++       
++    
++    // SMARTPL.g:168:12: ( ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' ) )
++    // SMARTPL.g:168:14: ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )
++    {
++        if ( ((LA(1) >= '\t') && (LA(1) <= '\n')) || ((LA(1) >= '\f') && (LA(1) <= '\r')) || LA(1) == ' ' )
++        {
++            CONSUME();
++
++        }
++        else 
++        {
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++            EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++
++            LRECOVER();    goto ruleWHITESPACEEx;
++        }
++
++        {
++             LEXSTATE->channel = HIDDEN; 
++        }
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleWHITESPACEEx; /* Prevent compiler warnings */
++    ruleWHITESPACEEx: ;
++
++}
++// $ANTLR end WHITESPACE
++
++/** This is the entry point in to the lexer from an object that
++ *  wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
++ */
++static void 
++mTokens(pSMARTPLLexer ctx)
++{
++    {
++        //  SMARTPL.g:1:8: ( T__30 | T__31 | STRTAG | INTTAG | DATETAG | ENUMTAG | INCLUDES | IS | INTBOOL | AFTER | BEFORE | AGO | AND | OR | NOT | LPAR | RPAR | DATE | DATINTERVAL | ENUMVAL | STR | INT | WHITESPACE )
++        
++        ANTLR3_UINT32 alt14;
++
++        alt14=23;
++
++        switch ( LA(1) ) 
++        {
++        case '{':
++              {
++                      alt14=1;
++              }
++            break;
++        case '}':
++              {
++                      alt14=2;
++              }
++            break;
++        case 'a':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'l':
++                      case 'r':
++                              {
++                                      alt14=3;
++                              }
++                          break;
++                      case 'f':
++                              {
++                                      alt14=10;
++                              }
++                          break;
++                      case 'g':
++                              {
++                                      alt14=12;
++                              }
++                          break;
++                      case 'n':
++                              {
++                                      alt14=13;
++                              }
++                          break;
++                      case 'u':
++                              {
++                                      alt14=20;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 14;
++                          EXCEPTION->state        = 3;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 't':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'i':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 't':
++                                              {
++                                                      alt14=3;
++                                              }
++                                          break;
++                                      case 'm':
++                                              {
++                                                      alt14=5;
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 14;
++                                          EXCEPTION->state        = 28;
++
++
++                                          goto ruleTokensEx;
++                                      }
++
++                              }
++                          break;
++                      case 'y':
++                              {
++                                      alt14=3;
++                              }
++                          break;
++                      case 'o':
++                              {
++                                      alt14=18;
++                              }
++                          break;
++                      case 'v':
++                              {
++                                      alt14=20;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 14;
++                          EXCEPTION->state        = 4;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'g':
++              {
++                      alt14=3;
++              }
++            break;
++        case 'c':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'o':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'm':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'p':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 'o':
++                                                                              {
++                                                                                      alt14=3;
++                                                                              }
++                                                                          break;
++                                                                      case 'i':
++                                                                              {
++                                                                                      alt14=4;
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          CONSTRUCTEX();
++                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                                          EXCEPTION->message      = (void *)"";
++                                                                          EXCEPTION->decisionNum  = 14;
++                                                                          EXCEPTION->state        = 42;
++
++
++                                                                          goto ruleTokensEx;
++                                                                      }
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          CONSTRUCTEX();
++                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                          EXCEPTION->message      = (void *)"";
++                                                          EXCEPTION->decisionNum  = 14;
++                                                          EXCEPTION->state        = 39;
++
++
++                                                          goto ruleTokensEx;
++                                                      }
++
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 14;
++                                          EXCEPTION->state        = 29;
++
++
++                                          goto ruleTokensEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 14;
++                          EXCEPTION->state        = 6;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'p':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'a':
++                              {
++                                      alt14=3;
++                              }
++                          break;
++                      case 'l':
++                              {
++                                      alt14=4;
++                              }
++                          break;
++                      case 'i':
++                      case 'o':
++                              {
++                                      alt14=20;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 14;
++                          EXCEPTION->state        = 7;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'r':
++              {
++                      alt14=4;
++              }
++            break;
++        case 'y':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'e':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'a':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'r':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 's':
++                                                                              {
++                                                                                      alt14=19;
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt14=4;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          CONSTRUCTEX();
++                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                          EXCEPTION->message      = (void *)"";
++                                                          EXCEPTION->decisionNum  = 14;
++                                                          EXCEPTION->state        = 40;
++
++
++                                                          goto ruleTokensEx;
++                                                      }
++
++                                              }
++                                          break;
++                                      case 's':
++                                              {
++                                                      alt14=18;
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 14;
++                                          EXCEPTION->state        = 30;
++
++
++                                          goto ruleTokensEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 14;
++                          EXCEPTION->state        = 9;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'd':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'a':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 't':
++                                              {
++                                                      alt14=6;
++                                              }
++                                          break;
++                                      case 'y':
++                                              {
++                                                      alt14=19;
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 14;
++                                          EXCEPTION->state        = 31;
++
++
++                                          goto ruleTokensEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 14;
++                          EXCEPTION->state        = 10;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'm':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'e':
++                              {
++                                      alt14=6;
++                              }
++                          break;
++                      case 'o':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'n':
++                                              {
++                                                      alt14=19;
++                                              }
++                                          break;
++                                      case 'v':
++                                              {
++                                                      alt14=20;
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 14;
++                                          EXCEPTION->state        = 33;
++
++
++                                          goto ruleTokensEx;
++                                      }
++
++                              }
++                          break;
++                      case 'u':
++                              {
++                                      alt14=20;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 14;
++                          EXCEPTION->state        = 11;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'i':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'n':
++                              {
++                                      alt14=7;
++                              }
++                          break;
++                      case 's':
++                              {
++                                      alt14=8;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 14;
++                          EXCEPTION->state        = 12;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case '<':
++        case '=':
++        case '>':
++              {
++                      alt14=9;
++              }
++            break;
++        case 'b':
++              {
++                      alt14=11;
++              }
++            break;
++        case 'A':
++              {
++                      alt14=13;
++              }
++            break;
++        case 'O':
++        case 'o':
++              {
++                      alt14=14;
++              }
++            break;
++        case 'N':
++        case 'n':
++              {
++                      alt14=15;
++              }
++            break;
++        case '(':
++              {
++                      alt14=16;
++              }
++            break;
++        case ')':
++              {
++                      alt14=17;
++              }
++            break;
++        case '0':
++        case '1':
++        case '2':
++        case '3':
++        case '4':
++        case '5':
++        case '6':
++        case '7':
++        case '8':
++        case '9':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case '0':
++                      case '1':
++                      case '2':
++                      case '3':
++                      case '4':
++                      case '5':
++                      case '6':
++                      case '7':
++                      case '8':
++                      case '9':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case '0':
++                                      case '1':
++                                      case '2':
++                                      case '3':
++                                      case '4':
++                                      case '5':
++                                      case '6':
++                                      case '7':
++                                      case '8':
++                                      case '9':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case '0':
++                                                      case '1':
++                                                      case '2':
++                                                      case '3':
++                                                      case '4':
++                                                      case '5':
++                                                      case '6':
++                                                      case '7':
++                                                      case '8':
++                                                      case '9':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case '-':
++                                                                              {
++                                                                                      alt14=18;
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt14=22;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt14=22;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt14=22;}
++
++                              }
++                          break;
++
++                      default:
++                          alt14=22;}
++
++              }
++            break;
++        case 'l':
++              {
++                      alt14=18;
++              }
++            break;
++        case 'w':
++              {
++                      alt14=19;
++              }
++            break;
++        case 'f':
++        case 's':
++        case 'u':
++              {
++                      alt14=20;
++              }
++            break;
++        case '"':
++              {
++                      alt14=21;
++              }
++            break;
++        case '\t':
++        case '\n':
++        case '\f':
++        case '\r':
++        case ' ':
++              {
++                      alt14=23;
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 14;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleTokensEx;
++        }
++
++        switch (alt14) 
++        {
++      case 1:
++          // SMARTPL.g:1:10: T__30
++          {
++              /* 1:10: T__30 */
++              mT__30(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 2:
++          // SMARTPL.g:1:16: T__31
++          {
++              /* 1:16: T__31 */
++              mT__31(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 3:
++          // SMARTPL.g:1:22: STRTAG
++          {
++              /* 1:22: STRTAG */
++              mSTRTAG(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 4:
++          // SMARTPL.g:1:29: INTTAG
++          {
++              /* 1:29: INTTAG */
++              mINTTAG(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 5:
++          // SMARTPL.g:1:36: DATETAG
++          {
++              /* 1:36: DATETAG */
++              mDATETAG(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 6:
++          // SMARTPL.g:1:44: ENUMTAG
++          {
++              /* 1:44: ENUMTAG */
++              mENUMTAG(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 7:
++          // SMARTPL.g:1:52: INCLUDES
++          {
++              /* 1:52: INCLUDES */
++              mINCLUDES(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 8:
++          // SMARTPL.g:1:61: IS
++          {
++              /* 1:61: IS */
++              mIS(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 9:
++          // SMARTPL.g:1:64: INTBOOL
++          {
++              /* 1:64: INTBOOL */
++              mINTBOOL(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 10:
++          // SMARTPL.g:1:72: AFTER
++          {
++              /* 1:72: AFTER */
++              mAFTER(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 11:
++          // SMARTPL.g:1:78: BEFORE
++          {
++              /* 1:78: BEFORE */
++              mBEFORE(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 12:
++          // SMARTPL.g:1:85: AGO
++          {
++              /* 1:85: AGO */
++              mAGO(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 13:
++          // SMARTPL.g:1:89: AND
++          {
++              /* 1:89: AND */
++              mAND(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 14:
++          // SMARTPL.g:1:93: OR
++          {
++              /* 1:93: OR */
++              mOR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 15:
++          // SMARTPL.g:1:96: NOT
++          {
++              /* 1:96: NOT */
++              mNOT(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 16:
++          // SMARTPL.g:1:100: LPAR
++          {
++              /* 1:100: LPAR */
++              mLPAR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 17:
++          // SMARTPL.g:1:105: RPAR
++          {
++              /* 1:105: RPAR */
++              mRPAR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 18:
++          // SMARTPL.g:1:110: DATE
++          {
++              /* 1:110: DATE */
++              mDATE(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 19:
++          // SMARTPL.g:1:115: DATINTERVAL
++          {
++              /* 1:115: DATINTERVAL */
++              mDATINTERVAL(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 20:
++          // SMARTPL.g:1:127: ENUMVAL
++          {
++              /* 1:127: ENUMVAL */
++              mENUMVAL(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 21:
++          // SMARTPL.g:1:135: STR
++          {
++              /* 1:135: STR */
++              mSTR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 22:
++          // SMARTPL.g:1:139: INT
++          {
++              /* 1:139: INT */
++              mINT(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 23:
++          // SMARTPL.g:1:143: WHITESPACE
++          {
++              /* 1:143: WHITESPACE */
++              mWHITESPACE(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++
++        }
++    }
++
++    
++    goto ruleTokensEx; /* Prevent compiler warnings */
++ruleTokensEx: ;
++}
++
++/* =========================================================================
++ * Lexer matching rules end.
++ * =========================================================================
++ */
++/* End of Lexer code
++ * ================================================
++ * ================================================
++ */ 
++
++
++/* End of code
++ * =============================================================================
++ */
+diff --git a/src/pregen/SMARTPLLexer.h b/src/pregen/SMARTPLLexer.h
+new file mode 100644
+index 0000000..9d73721
+--- /dev/null
++++ b/src/pregen/SMARTPLLexer.h
+@@ -0,0 +1,248 @@
++/** \file
++ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : SMARTPL.g
++ *     -                            On : 2015-06-27 19:05:15
++ *     -                 for the lexer : SMARTPLLexerLexer *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++ * The lexer SMARTPLLexer has the callable functions (rules) shown below,
++ * which will invoke the code for the associated rule in the source grammar
++ * assuming that the input stream is pointing to a token/text stream that could begin
++ * this rule.
++ * 
++ * For instance if you call the first (topmost) rule in a parser grammar, you will
++ * get the results of a full parse, but calling a rule half way through the grammar will
++ * allow you to pass part of a full token stream to the parser, such as for syntax checking
++ * in editors and so on.
++ *
++ * The parser entry points are called indirectly (by function pointer to function) via
++ * a parser context typedef pSMARTPLLexer, which is returned from a call to SMARTPLLexerNew().
++ *
++ * As this is a generated lexer, it is unlikely you will call it 'manually'. However
++ * the methods are provided anyway.
++ * * The methods in pSMARTPLLexer are  as follows:
++ *
++ *  -  void      pSMARTPLLexer->T__30(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->T__31(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->STRTAG(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->INTTAG(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->DATETAG(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->ENUMTAG(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->INCLUDES(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->IS(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->INTBOOL(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->GREATER(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->GREATEREQUAL(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->LESS(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->LESSEQUAL(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->EQUAL(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->AFTER(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->BEFORE(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->AGO(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->AND(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->OR(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->NOT(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->LPAR(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->RPAR(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->DATE(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->DATINTERVAL(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->ENUMVAL(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->STR(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->INT(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->WHITESPACE(pSMARTPLLexer)
++ *  -  void      pSMARTPLLexer->Tokens(pSMARTPLLexer)
++ *
++ * The return type for any particular rule is of course determined by the source
++ * grammar file.
++ */
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++#ifndef       _SMARTPLLexer_H
++#define _SMARTPLLexer_H
++/* =============================================================================
++ * Standard antlr3 C runtime definitions
++ */
++#include    <antlr3.h>
++
++/* End of standard antlr 3 runtime definitions
++ * =============================================================================
++ */
++ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++// Forward declare the context typedef so that we can use it before it is
++// properly defined. Delegators and delegates (from import statements) are
++// interdependent and their context structures contain pointers to each other
++// C only allows such things to be declared if you pre-declare the typedef.
++//
++typedef struct SMARTPLLexer_Ctx_struct SMARTPLLexer, * pSMARTPLLexer;
++
++
++
++#ifdef        ANTLR3_WINDOWS
++// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
++//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
++//          initialized but unused variable                                   - tree rewrite variables declared but not needed
++//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
++//          potentially unitialized variable used                     - retval always returned from a rule 
++//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
++//
++// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
++// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
++// usually generated when a parser rule is given a parameter that it does not use. Mostly though
++// this is a matter of orthogonality hence I disable that one.
++//
++#pragma warning( disable : 4100 )
++#pragma warning( disable : 4101 )
++#pragma warning( disable : 4127 )
++#pragma warning( disable : 4189 )
++#pragma warning( disable : 4505 )
++#pragma warning( disable : 4701 )
++#endif
++
++/** Context tracking structure for SMARTPLLexer
++ */
++struct SMARTPLLexer_Ctx_struct
++{
++    /** Built in ANTLR3 context tracker contains all the generic elements
++     *  required for context tracking.
++     */
++    pANTLR3_LEXER    pLexer;
++
++
++     void (*mT__30)   (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mT__31)   (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mSTRTAG)  (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mINTTAG)  (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mDATETAG) (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mENUMTAG) (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mINCLUDES)        (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mIS)      (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mINTBOOL) (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mGREATER) (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mGREATEREQUAL)    (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mLESS)    (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mLESSEQUAL)       (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mEQUAL)   (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mAFTER)   (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mBEFORE)  (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mAGO)     (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mAND)     (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mOR)      (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mNOT)     (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mLPAR)    (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mRPAR)    (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mDATE)    (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mDATINTERVAL)     (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mENUMVAL) (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mSTR)     (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mINT)     (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mWHITESPACE)      (struct SMARTPLLexer_Ctx_struct * ctx);
++     void (*mTokens)  (struct SMARTPLLexer_Ctx_struct * ctx);    const char * (*getGrammarFileName)();
++    void          (*free)   (struct SMARTPLLexer_Ctx_struct * ctx);
++        
++};
++
++// Function protoypes for the constructor functions that external translation units
++// such as delegators and delegates may wish to call.
++//
++ANTLR3_API pSMARTPLLexer SMARTPLLexerNew         (pANTLR3_INPUT_STREAM instream);
++ANTLR3_API pSMARTPLLexer SMARTPLLexerNewSSD      (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
++
++/** Symbolic definitions of all the tokens that the lexer will work with.
++ * \{
++ *
++ * Antlr will define EOF, but we can't use that as it it is too common in
++ * in C header files and that would be confusing. There is no way to filter this out at the moment
++ * so we just undef it here for now. That isn't the value we get back from C recognizers
++ * anyway. We are looking for ANTLR3_TOKEN_EOF.
++ */
++#ifdef        EOF
++#undef        EOF
++#endif
++#ifdef        Tokens
++#undef        Tokens
++#endif 
++#define INTBOOL      14
++#define STRTAG      10
++#define AGO      22
++#define WHITESPACE      29
++#define GREATEREQUAL      25
++#define BEFORE      18
++#define DATETAG      16
++#define INT      15
++#define NOT      7
++#define AFTER      17
++#define AND      6
++#define EOF      -1
++#define INCLUDES      11
++#define STR      4
++#define T__30      30
++#define T__31      31
++#define GREATER      24
++#define LPAR      8
++#define ENUMTAG      19
++#define IS      12
++#define ENUMVAL      20
++#define EQUAL      28
++#define OR      5
++#define LESS      26
++#define RPAR      9
++#define DATE      21
++#define LESSEQUAL      27
++#define INTTAG      13
++#define DATINTERVAL      23
++#ifdef        EOF
++#undef        EOF
++#define       EOF     ANTLR3_TOKEN_EOF
++#endif
++
++#ifndef TOKENSOURCE
++#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
++#endif
++
++/* End of token definitions for SMARTPLLexer
++ * =============================================================================
++ */
++/** \} */
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++
++/* END - Note:Keep extra line feed to satisfy UNIX systems */
+diff --git a/src/pregen/SMARTPLParser.c b/src/pregen/SMARTPLParser.c
+new file mode 100644
+index 0000000..afe9f99
+--- /dev/null
++++ b/src/pregen/SMARTPLParser.c
+@@ -0,0 +1,1812 @@
++/** \file
++ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : SMARTPL.g
++ *     -                            On : 2015-06-27 19:05:15
++ *     -                for the parser : SMARTPLParserParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++*/
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++/* -----------------------------------------
++ * Include the ANTLR3 generated header file.
++ */
++#include    "SMARTPLParser.h"
++/* ----------------------------------------- */
++
++
++
++
++
++/* MACROS that hide the C interface implementations from the
++ * generated code, which makes it a little more understandable to the human eye.
++ * I am very much against using C pre-processor macros for function calls and bits
++ * of code as you cannot see what is happening when single stepping in debuggers
++ * and so on. The exception (in my book at least) is for generated code, where you are
++ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
++ * hides some indirect calls, but is always referring to the input stream. This is
++ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
++ * the runtime interfaces without changing the generated code too often, without
++ * confusing the reader of the generated output, who may not wish to know the gory
++ * details of the interface inheritance.
++ */
++ 
++#define               CTX     ctx
++
++/* Aids in accessing scopes for grammar programmers
++ */
++#undef        SCOPE_TYPE
++#undef        SCOPE_STACK
++#undef        SCOPE_TOP
++#define       SCOPE_TYPE(scope)   pSMARTPLParser_##scope##_SCOPE
++#define SCOPE_STACK(scope)  pSMARTPLParser_##scope##Stack
++#define       SCOPE_TOP(scope)    ctx->pSMARTPLParser_##scope##Top
++#define       SCOPE_SIZE(scope)               ctx->pSMARTPLParser_##scope##Stack_limit
++#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
++
++/* Macros for accessing things in the parser
++ */
++ 
++#undef            PARSER                  
++#undef            RECOGNIZER              
++#undef            HAVEPARSEDRULE
++#undef                MEMOIZE
++#undef            INPUT
++#undef            STRSTREAM
++#undef            HASEXCEPTION
++#undef            EXCEPTION
++#undef            MATCHT
++#undef            MATCHANYT
++#undef            FOLLOWSTACK
++#undef            FOLLOWPUSH
++#undef            FOLLOWPOP
++#undef            PRECOVER
++#undef            PREPORTERROR
++#undef            LA
++#undef            LT
++#undef            CONSTRUCTEX
++#undef            CONSUME
++#undef            MARK
++#undef            REWIND
++#undef            REWINDLAST
++#undef            PERRORRECOVERY
++#undef            HASFAILED
++#undef            FAILEDFLAG
++#undef            RECOVERFROMMISMATCHEDSET
++#undef            RECOVERFROMMISMATCHEDELEMENT
++#undef                INDEX
++#undef      ADAPTOR
++#undef                SEEK
++#undef            RULEMEMO                
++#undef                DBG
++
++#define           PARSER                                                      ctx->pParser  
++#define           RECOGNIZER                                          PARSER->rec
++#define               PSRSTATE                                                RECOGNIZER->state
++#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
++#define               MEMOIZE(ri,si)                                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
++#define           INPUT                                                       PARSER->tstream
++#define           STRSTREAM                                           INPUT
++#define               ISTREAM                                                 INPUT->istream
++#define               INDEX()                                                 ISTREAM->index(INPUT->istream)
++#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
++#define           EXCEPTION                                           PSRSTATE->exception
++#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
++#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
++#define           FOLLOWSTACK                                     PSRSTATE->following
++#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
++#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
++#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
++#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
++#define           LA(n)                                                       INPUT->istream->_LA(ISTREAM, n)
++#define           LT(n)                                                       INPUT->_LT(INPUT, n)
++#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
++#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
++#define           MARK()                                                      ISTREAM->mark(ISTREAM)
++#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
++#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
++#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
++#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
++#define           FAILEDFLAG                                          PSRSTATE->failed
++#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
++#define           BACKTRACKING                                        PSRSTATE->backtracking
++#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
++#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
++#define     ADAPTOR                         ctx->adaptor
++#define               RULEMEMO                                                PSRSTATE->ruleMemo
++#define               DBG                                                             RECOGNIZER->debugger
++
++#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
++
++/* The 4 tokens defined below may well clash with your own #defines or token types. If so
++ * then for the present you must use different names for your defines as these are hard coded
++ * in the code generator. It would be better not to use such names internally, and maybe
++ * we can change this in a forthcoming release. I deliberately do not #undef these
++ * here as this will at least give you a redefined error somewhere if they clash.
++ */
++#define           UP      ANTLR3_TOKEN_UP
++#define           DOWN    ANTLR3_TOKEN_DOWN
++#define           EOR     ANTLR3_TOKEN_EOR
++#define           INVALID ANTLR3_TOKEN_INVALID
++
++
++/* =============================================================================
++ * Functions to create and destroy scopes. First come the rule scopes, followed
++ * by the global declared scopes.
++ */
++
++
++
++/* ============================================================================= */
++
++/* =============================================================================
++ * Start of recognizer
++ */
++
++
++
++/** \brief Table of all token names in symbolic order, mainly used for
++ *         error reporting.
++ */
++pANTLR3_UINT8   SMARTPLParserTokenNames[28+4]
++     = {
++        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
++        (pANTLR3_UINT8) "<EOR>",
++        (pANTLR3_UINT8) "<DOWN>", 
++        (pANTLR3_UINT8) "<UP>", 
++        (pANTLR3_UINT8) "STR",
++        (pANTLR3_UINT8) "OR",
++        (pANTLR3_UINT8) "AND",
++        (pANTLR3_UINT8) "NOT",
++        (pANTLR3_UINT8) "LPAR",
++        (pANTLR3_UINT8) "RPAR",
++        (pANTLR3_UINT8) "STRTAG",
++        (pANTLR3_UINT8) "INCLUDES",
++        (pANTLR3_UINT8) "IS",
++        (pANTLR3_UINT8) "INTTAG",
++        (pANTLR3_UINT8) "INTBOOL",
++        (pANTLR3_UINT8) "INT",
++        (pANTLR3_UINT8) "DATETAG",
++        (pANTLR3_UINT8) "AFTER",
++        (pANTLR3_UINT8) "BEFORE",
++        (pANTLR3_UINT8) "ENUMTAG",
++        (pANTLR3_UINT8) "ENUMVAL",
++        (pANTLR3_UINT8) "DATE",
++        (pANTLR3_UINT8) "AGO",
++        (pANTLR3_UINT8) "DATINTERVAL",
++        (pANTLR3_UINT8) "GREATER",
++        (pANTLR3_UINT8) "GREATEREQUAL",
++        (pANTLR3_UINT8) "LESS",
++        (pANTLR3_UINT8) "LESSEQUAL",
++        (pANTLR3_UINT8) "EQUAL",
++        (pANTLR3_UINT8) "WHITESPACE",
++        (pANTLR3_UINT8) "'{'",
++        (pANTLR3_UINT8) "'}'"
++       };
++
++        
++
++// Forward declare the locally static matching functions we have generated.
++//
++static SMARTPLParser_playlist_return  playlist    (pSMARTPLParser ctx);
++static SMARTPLParser_expression_return        expression    (pSMARTPLParser ctx);
++static SMARTPLParser_aexpr_return     aexpr    (pSMARTPLParser ctx);
++static SMARTPLParser_nexpr_return     nexpr    (pSMARTPLParser ctx);
++static SMARTPLParser_crit_return      crit    (pSMARTPLParser ctx);
++static SMARTPLParser_dateval_return   dateval    (pSMARTPLParser ctx);
++static SMARTPLParser_interval_return  interval    (pSMARTPLParser ctx);
++static void   SMARTPLParserFree(pSMARTPLParser ctx);
++/* For use in tree output where we are accumulating rule labels via label += ruleRef
++ * we need a function that knows how to free a return scope when the list is destroyed. 
++ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
++ */
++static        void ANTLR3_CDECL freeScope(void * scope)
++{
++    ANTLR3_FREE(scope);
++}
++
++/** \brief Name of the grammar file that generated this code
++ */
++static const char fileName[] = "SMARTPL.g";
++
++/** \brief Return the name of the grammar file that generated this code.
++ */
++static const char * getGrammarFileName()
++{
++      return fileName;
++}
++/** \brief Create a new SMARTPLParser parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pSMARTPLParser
++SMARTPLParserNew   (pANTLR3_COMMON_TOKEN_STREAM instream)
++{
++      // See if we can create a new parser with the standard constructor
++      //
++      return SMARTPLParserNewSSD(instream, NULL);
++}
++
++/** \brief Create a new SMARTPLParser parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pSMARTPLParser
++SMARTPLParserNewSSD   (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
++{
++    pSMARTPLParser ctx;           /* Context structure we will build and return   */
++    
++    ctx       = (pSMARTPLParser) ANTLR3_CALLOC(1, sizeof(SMARTPLParser));
++    
++    if        (ctx == NULL)
++    {
++              // Failed to allocate memory for parser context
++              //
++        return  NULL;
++    }
++    
++    /* -------------------------------------------------------------------
++     * Memory for basic structure is allocated, now to fill in
++     * the base ANTLR3 structures. We initialize the function pointers
++     * for the standard ANTLR3 parser function set, but upon return
++     * from here, the programmer may set the pointers to provide custom
++     * implementations of each function. 
++     *
++     * We don't use the macros defined in SMARTPLParser.h here, in order that you can get a sense
++     * of what goes where.
++     */
++
++    /* Create a base parser/recognizer, using the supplied token stream
++     */
++    ctx->pParser          = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
++    /* Install the implementation of our SMARTPLParser interface
++     */
++    ctx->playlist     = playlist;
++    ctx->expression   = expression;
++    ctx->aexpr        = aexpr;
++    ctx->nexpr        = nexpr;
++    ctx->crit = crit;
++    ctx->dateval      = dateval;
++    ctx->interval     = interval;
++    ctx->free                 = SMARTPLParserFree;
++    ctx->getGrammarFileName   = getGrammarFileName;
++    
++    /* Install the scope pushing methods.
++     */
++    ADAPTOR   = ANTLR3_TREE_ADAPTORNew(instream->tstream->tokenSource->strFactory);
++    ctx->vectors      = antlr3VectorFactoryNew(0);
++    
++
++      
++    /* Install the token table
++     */
++    PSRSTATE->tokenNames   = SMARTPLParserTokenNames;
++    
++    
++    /* Return the newly built parser to the caller
++     */
++    return  ctx;
++}
++
++/** Free the parser resources
++ */
++ static void
++ SMARTPLParserFree(pSMARTPLParser ctx)
++ {
++    /* Free any scope memory
++     */
++    
++    ctx->vectors->close(ctx->vectors);
++    /* We created the adaptor so we must free it
++     */
++    ADAPTOR->free(ADAPTOR);
++      // Free this parser
++      //
++    ctx->pParser->free(ctx->pParser);
++    ANTLR3_FREE(ctx);
++
++    /* Everything is released, so we can return
++     */
++    return;
++ }
++ 
++/** Return token names used by this parser
++ *
++ * The returned pointer is used as an index into the token names table (using the token 
++ * number as the index).
++ * 
++ * \return Pointer to first char * in the table.
++ */
++static pANTLR3_UINT8    *getTokenNames() 
++{
++        return SMARTPLParserTokenNames; 
++}
++
++    
++/* Declare the bitsets
++ */
++
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_playlist42  */
++static        ANTLR3_BITWORD FOLLOW_STR_in_playlist42_bits[]  = { ANTLR3_UINT64_LIT(0x0000000040000000) };
++static  ANTLR3_BITSET_LIST FOLLOW_STR_in_playlist42   = { FOLLOW_STR_in_playlist42_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_30_in_playlist44  */
++static        ANTLR3_BITWORD FOLLOW_30_in_playlist44_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000092580) };
++static  ANTLR3_BITSET_LIST FOLLOW_30_in_playlist44    = { FOLLOW_30_in_playlist44_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_playlist46  */
++static        ANTLR3_BITWORD FOLLOW_expression_in_playlist46_bits[]   = { ANTLR3_UINT64_LIT(0x0000000080000000) };
++static  ANTLR3_BITSET_LIST FOLLOW_expression_in_playlist46    = { FOLLOW_expression_in_playlist46_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_31_in_playlist48  */
++static        ANTLR3_BITWORD FOLLOW_31_in_playlist48_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000000) };
++static  ANTLR3_BITSET_LIST FOLLOW_31_in_playlist48    = { FOLLOW_31_in_playlist48_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_playlist50  */
++static        ANTLR3_BITWORD FOLLOW_EOF_in_playlist50_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_playlist50   = { FOLLOW_EOF_in_playlist50_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expression62  */
++static        ANTLR3_BITWORD FOLLOW_aexpr_in_expression62_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000022) };
++static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expression62       = { FOLLOW_aexpr_in_expression62_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expression65  */
++static        ANTLR3_BITWORD FOLLOW_OR_in_expression65_bits[] = { ANTLR3_UINT64_LIT(0x0000000000092580) };
++static  ANTLR3_BITSET_LIST FOLLOW_OR_in_expression65  = { FOLLOW_OR_in_expression65_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expression68  */
++static        ANTLR3_BITWORD FOLLOW_aexpr_in_expression68_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000022) };
++static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expression68       = { FOLLOW_aexpr_in_expression68_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_nexpr_in_aexpr83  */
++static        ANTLR3_BITWORD FOLLOW_nexpr_in_aexpr83_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000042) };
++static  ANTLR3_BITSET_LIST FOLLOW_nexpr_in_aexpr83    = { FOLLOW_nexpr_in_aexpr83_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_aexpr86  */
++static        ANTLR3_BITWORD FOLLOW_AND_in_aexpr86_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000092580) };
++static  ANTLR3_BITSET_LIST FOLLOW_AND_in_aexpr86      = { FOLLOW_AND_in_aexpr86_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_nexpr_in_aexpr89  */
++static        ANTLR3_BITWORD FOLLOW_nexpr_in_aexpr89_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000042) };
++static  ANTLR3_BITSET_LIST FOLLOW_nexpr_in_aexpr89    = { FOLLOW_nexpr_in_aexpr89_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_nexpr104  */
++static        ANTLR3_BITWORD FOLLOW_NOT_in_nexpr104_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000092580) };
++static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_nexpr104     = { FOLLOW_NOT_in_nexpr104_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_nexpr107  */
++static        ANTLR3_BITWORD FOLLOW_crit_in_nexpr107_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_crit_in_nexpr107    = { FOLLOW_crit_in_nexpr107_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_nexpr114  */
++static        ANTLR3_BITWORD FOLLOW_crit_in_nexpr114_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_crit_in_nexpr114    = { FOLLOW_crit_in_nexpr114_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAR_in_crit127  */
++static        ANTLR3_BITWORD FOLLOW_LPAR_in_crit127_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000092580) };
++static  ANTLR3_BITSET_LIST FOLLOW_LPAR_in_crit127     = { FOLLOW_LPAR_in_crit127_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_crit129  */
++static        ANTLR3_BITWORD FOLLOW_expression_in_crit129_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000200) };
++static  ANTLR3_BITSET_LIST FOLLOW_expression_in_crit129       = { FOLLOW_expression_in_crit129_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAR_in_crit131  */
++static        ANTLR3_BITWORD FOLLOW_RPAR_in_crit131_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_RPAR_in_crit131     = { FOLLOW_RPAR_in_crit131_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRTAG_in_crit142  */
++static        ANTLR3_BITWORD FOLLOW_STRTAG_in_crit142_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000001800) };
++static  ANTLR3_BITSET_LIST FOLLOW_STRTAG_in_crit142   = { FOLLOW_STRTAG_in_crit142_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_crit144  */
++static        ANTLR3_BITWORD FOLLOW_set_in_crit144_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000010) };
++static  ANTLR3_BITSET_LIST FOLLOW_set_in_crit144      = { FOLLOW_set_in_crit144_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_crit150  */
++static        ANTLR3_BITWORD FOLLOW_STR_in_crit150_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_STR_in_crit150      = { FOLLOW_STR_in_crit150_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTTAG_in_crit157  */
++static        ANTLR3_BITWORD FOLLOW_INTTAG_in_crit157_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000004000) };
++static  ANTLR3_BITSET_LIST FOLLOW_INTTAG_in_crit157   = { FOLLOW_INTTAG_in_crit157_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTBOOL_in_crit159  */
++static        ANTLR3_BITWORD FOLLOW_INTBOOL_in_crit159_bits[] = { ANTLR3_UINT64_LIT(0x0000000000008000) };
++static  ANTLR3_BITSET_LIST FOLLOW_INTBOOL_in_crit159  = { FOLLOW_INTBOOL_in_crit159_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_crit161  */
++static        ANTLR3_BITWORD FOLLOW_INT_in_crit161_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_INT_in_crit161      = { FOLLOW_INT_in_crit161_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATETAG_in_crit168  */
++static        ANTLR3_BITWORD FOLLOW_DATETAG_in_crit168_bits[] = { ANTLR3_UINT64_LIT(0x0000000000060000) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATETAG_in_crit168  = { FOLLOW_DATETAG_in_crit168_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_crit170  */
++static        ANTLR3_BITWORD FOLLOW_set_in_crit170_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000208000) };
++static  ANTLR3_BITSET_LIST FOLLOW_set_in_crit170      = { FOLLOW_set_in_crit170_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateval_in_crit176  */
++static        ANTLR3_BITWORD FOLLOW_dateval_in_crit176_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateval_in_crit176  = { FOLLOW_dateval_in_crit176_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMTAG_in_crit183  */
++static        ANTLR3_BITWORD FOLLOW_ENUMTAG_in_crit183_bits[] = { ANTLR3_UINT64_LIT(0x0000000000001000) };
++static  ANTLR3_BITSET_LIST FOLLOW_ENUMTAG_in_crit183  = { FOLLOW_ENUMTAG_in_crit183_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_IS_in_crit185  */
++static        ANTLR3_BITWORD FOLLOW_IS_in_crit185_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000100000) };
++static  ANTLR3_BITSET_LIST FOLLOW_IS_in_crit185       = { FOLLOW_IS_in_crit185_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMVAL_in_crit187  */
++static        ANTLR3_BITWORD FOLLOW_ENUMVAL_in_crit187_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_ENUMVAL_in_crit187  = { FOLLOW_ENUMVAL_in_crit187_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval200  */
++static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval200_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval200  = { FOLLOW_DATE_in_dateval200_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval207  */
++static        ANTLR3_BITWORD FOLLOW_interval_in_dateval207_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000040000) };
++static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval207      = { FOLLOW_interval_in_dateval207_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_dateval209  */
++static        ANTLR3_BITWORD FOLLOW_BEFORE_in_dateval209_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000200000) };
++static  ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_dateval209        = { FOLLOW_BEFORE_in_dateval209_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval211  */
++static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval211_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval211  = { FOLLOW_DATE_in_dateval211_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval218  */
++static        ANTLR3_BITWORD FOLLOW_interval_in_dateval218_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000020000) };
++static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval218      = { FOLLOW_interval_in_dateval218_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_dateval220  */
++static        ANTLR3_BITWORD FOLLOW_AFTER_in_dateval220_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000200000) };
++static  ANTLR3_BITSET_LIST FOLLOW_AFTER_in_dateval220 = { FOLLOW_AFTER_in_dateval220_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval222  */
++static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval222_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval222  = { FOLLOW_DATE_in_dateval222_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval229  */
++static        ANTLR3_BITWORD FOLLOW_interval_in_dateval229_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000400000) };
++static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval229      = { FOLLOW_interval_in_dateval229_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_AGO_in_dateval231  */
++static        ANTLR3_BITWORD FOLLOW_AGO_in_dateval231_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_AGO_in_dateval231   = { FOLLOW_AGO_in_dateval231_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_interval243  */
++static        ANTLR3_BITWORD FOLLOW_INT_in_interval243_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000) };
++static  ANTLR3_BITSET_LIST FOLLOW_INT_in_interval243  = { FOLLOW_INT_in_interval243_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATINTERVAL_in_interval245  */
++static        ANTLR3_BITWORD FOLLOW_DATINTERVAL_in_interval245_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATINTERVAL_in_interval245  = { FOLLOW_DATINTERVAL_in_interval245_bits, 1   };
++     
++
++ 
++ 
++/* ==============================================
++ * Parsing rules
++ */
++/** 
++ * $ANTLR start playlist
++ * SMARTPL.g:27:1: playlist : STR '{' expression '}' EOF ;
++ */
++static SMARTPLParser_playlist_return
++playlist(pSMARTPLParser ctx)
++{   
++    SMARTPLParser_playlist_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    STR1;
++    pANTLR3_COMMON_TOKEN    char_literal2;
++    pANTLR3_COMMON_TOKEN    char_literal4;
++    pANTLR3_COMMON_TOKEN    EOF5;
++    SMARTPLParser_expression_return expression3;
++    #undef    RETURN_TYPE_expression3
++    #define   RETURN_TYPE_expression3 SMARTPLParser_expression_return
++
++    pANTLR3_BASE_TREE STR1_tree;
++    pANTLR3_BASE_TREE char_literal2_tree;
++    pANTLR3_BASE_TREE char_literal4_tree;
++    pANTLR3_BASE_TREE EOF5_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    STR1       = NULL;
++    char_literal2       = NULL;
++    char_literal4       = NULL;
++    EOF5       = NULL;
++    expression3.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    STR1_tree   = NULL;
++    char_literal2_tree   = NULL;
++    char_literal4_tree   = NULL;
++    EOF5_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // SMARTPL.g:27:10: ( STR '{' expression '}' EOF )
++        // SMARTPL.g:27:12: STR '{' expression '}' EOF
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            STR1 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_playlist42); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleplaylistEx;
++            }
++
++            STR1_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STR1));
++            ADAPTOR->addChild(ADAPTOR, root_0, STR1_tree);
++
++            char_literal2 = (pANTLR3_COMMON_TOKEN) MATCHT(30, &FOLLOW_30_in_playlist44); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleplaylistEx;
++            }
++
++            char_literal2_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, char_literal2));
++            ADAPTOR->addChild(ADAPTOR, root_0, char_literal2_tree);
++
++            FOLLOWPUSH(FOLLOW_expression_in_playlist46);
++            expression3=expression(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruleplaylistEx;
++            }
++
++            ADAPTOR->addChild(ADAPTOR, root_0, expression3.tree);
++            char_literal4 = (pANTLR3_COMMON_TOKEN) MATCHT(31, &FOLLOW_31_in_playlist48); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleplaylistEx;
++            }
++
++            char_literal4_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, char_literal4));
++            ADAPTOR->addChild(ADAPTOR, root_0, char_literal4_tree);
++
++            EOF5 = (pANTLR3_COMMON_TOKEN) MATCHT(EOF, &FOLLOW_EOF_in_playlist50); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleplaylistEx;
++            }
++
++            EOF5_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, EOF5));
++            ADAPTOR->addChild(ADAPTOR, root_0, EOF5_tree);
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleplaylistEx; /* Prevent compiler warnings */
++    ruleplaylistEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end playlist */
++
++/** 
++ * $ANTLR start expression
++ * SMARTPL.g:30:1: expression : aexpr ( OR aexpr )* ;
++ */
++static SMARTPLParser_expression_return
++expression(pSMARTPLParser ctx)
++{   
++    SMARTPLParser_expression_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    OR7;
++    SMARTPLParser_aexpr_return aexpr6;
++    #undef    RETURN_TYPE_aexpr6
++    #define   RETURN_TYPE_aexpr6 SMARTPLParser_aexpr_return
++
++    SMARTPLParser_aexpr_return aexpr8;
++    #undef    RETURN_TYPE_aexpr8
++    #define   RETURN_TYPE_aexpr8 SMARTPLParser_aexpr_return
++
++    pANTLR3_BASE_TREE OR7_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    OR7       = NULL;
++    aexpr6.tree = NULL;
++
++    aexpr8.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    OR7_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // SMARTPL.g:30:12: ( aexpr ( OR aexpr )* )
++        // SMARTPL.g:30:14: aexpr ( OR aexpr )*
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            FOLLOWPUSH(FOLLOW_aexpr_in_expression62);
++            aexpr6=aexpr(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruleexpressionEx;
++            }
++
++            ADAPTOR->addChild(ADAPTOR, root_0, aexpr6.tree);
++
++            // SMARTPL.g:30:20: ( OR aexpr )*
++
++            for (;;)
++            {
++                int alt1=2;
++                switch ( LA(1) ) 
++                {
++                case OR:
++                      {
++                              alt1=1;
++                      }
++                    break;
++
++                }
++
++                switch (alt1) 
++                {
++              case 1:
++                  // SMARTPL.g:30:21: OR aexpr
++                  {
++                      OR7 = (pANTLR3_COMMON_TOKEN) MATCHT(OR, &FOLLOW_OR_in_expression65); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      OR7_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OR7));
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OR7_tree, root_0));
++
++                      FOLLOWPUSH(FOLLOW_aexpr_in_expression68);
++                      aexpr8=aexpr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexpressionEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, aexpr8.tree);
++
++                  }
++                  break;
++
++              default:
++                  goto loop1; /* break out of the loop */
++                  break;
++                }
++            }
++            loop1: ; /* Jump out to here if this rule does not match */
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleexpressionEx; /* Prevent compiler warnings */
++    ruleexpressionEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end expression */
++
++/** 
++ * $ANTLR start aexpr
++ * SMARTPL.g:33:1: aexpr : nexpr ( AND nexpr )* ;
++ */
++static SMARTPLParser_aexpr_return
++aexpr(pSMARTPLParser ctx)
++{   
++    SMARTPLParser_aexpr_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    AND10;
++    SMARTPLParser_nexpr_return nexpr9;
++    #undef    RETURN_TYPE_nexpr9
++    #define   RETURN_TYPE_nexpr9 SMARTPLParser_nexpr_return
++
++    SMARTPLParser_nexpr_return nexpr11;
++    #undef    RETURN_TYPE_nexpr11
++    #define   RETURN_TYPE_nexpr11 SMARTPLParser_nexpr_return
++
++    pANTLR3_BASE_TREE AND10_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    AND10       = NULL;
++    nexpr9.tree = NULL;
++
++    nexpr11.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    AND10_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // SMARTPL.g:33:8: ( nexpr ( AND nexpr )* )
++        // SMARTPL.g:33:10: nexpr ( AND nexpr )*
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            FOLLOWPUSH(FOLLOW_nexpr_in_aexpr83);
++            nexpr9=nexpr(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruleaexprEx;
++            }
++
++            ADAPTOR->addChild(ADAPTOR, root_0, nexpr9.tree);
++
++            // SMARTPL.g:33:16: ( AND nexpr )*
++
++            for (;;)
++            {
++                int alt2=2;
++                switch ( LA(1) ) 
++                {
++                case AND:
++                      {
++                              alt2=1;
++                      }
++                    break;
++
++                }
++
++                switch (alt2) 
++                {
++              case 1:
++                  // SMARTPL.g:33:17: AND nexpr
++                  {
++                      AND10 = (pANTLR3_COMMON_TOKEN) MATCHT(AND, &FOLLOW_AND_in_aexpr86); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleaexprEx;
++                      }
++
++                      AND10_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AND10));
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, AND10_tree, root_0));
++
++                      FOLLOWPUSH(FOLLOW_nexpr_in_aexpr89);
++                      nexpr11=nexpr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleaexprEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, nexpr11.tree);
++
++                  }
++                  break;
++
++              default:
++                  goto loop2; /* break out of the loop */
++                  break;
++                }
++            }
++            loop2: ; /* Jump out to here if this rule does not match */
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleaexprEx; /* Prevent compiler warnings */
++    ruleaexprEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end aexpr */
++
++/** 
++ * $ANTLR start nexpr
++ * SMARTPL.g:36:1: nexpr : ( NOT crit | crit );
++ */
++static SMARTPLParser_nexpr_return
++nexpr(pSMARTPLParser ctx)
++{   
++    SMARTPLParser_nexpr_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    NOT12;
++    SMARTPLParser_crit_return crit13;
++    #undef    RETURN_TYPE_crit13
++    #define   RETURN_TYPE_crit13 SMARTPLParser_crit_return
++
++    SMARTPLParser_crit_return crit14;
++    #undef    RETURN_TYPE_crit14
++    #define   RETURN_TYPE_crit14 SMARTPLParser_crit_return
++
++    pANTLR3_BASE_TREE NOT12_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    NOT12       = NULL;
++    crit13.tree = NULL;
++
++    crit14.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    NOT12_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        {
++            //  SMARTPL.g:36:8: ( NOT crit | crit )
++            
++            ANTLR3_UINT32 alt3;
++
++            alt3=2;
++
++            switch ( LA(1) ) 
++            {
++            case NOT:
++              {
++                      alt3=1;
++              }
++                break;
++            case LPAR:
++            case STRTAG:
++            case INTTAG:
++            case DATETAG:
++            case ENUMTAG:
++              {
++                      alt3=2;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 3;
++                EXCEPTION->state        = 0;
++
++
++                goto rulenexprEx;
++            }
++
++            switch (alt3) 
++            {
++              case 1:
++                  // SMARTPL.g:36:10: NOT crit
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      NOT12 = (pANTLR3_COMMON_TOKEN) MATCHT(NOT, &FOLLOW_NOT_in_nexpr104); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulenexprEx;
++                      }
++
++                      NOT12_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, NOT12));
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, NOT12_tree, root_0));
++
++                      FOLLOWPUSH(FOLLOW_crit_in_nexpr107);
++                      crit13=crit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulenexprEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, crit13.tree);
++
++                  }
++                  break;
++              case 2:
++                  // SMARTPL.g:37:6: crit
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      FOLLOWPUSH(FOLLOW_crit_in_nexpr114);
++                      crit14=crit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulenexprEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, crit14.tree);
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulenexprEx; /* Prevent compiler warnings */
++    rulenexprEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end nexpr */
++
++/** 
++ * $ANTLR start crit
++ * SMARTPL.g:40:1: crit : ( LPAR expression RPAR -> expression | STRTAG ( INCLUDES | IS ) STR | INTTAG INTBOOL INT | DATETAG ( AFTER | BEFORE ) dateval | ENUMTAG IS ENUMVAL );
++ */
++static SMARTPLParser_crit_return
++crit(pSMARTPLParser ctx)
++{   
++    SMARTPLParser_crit_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    LPAR15;
++    pANTLR3_COMMON_TOKEN    RPAR17;
++    pANTLR3_COMMON_TOKEN    STRTAG18;
++    pANTLR3_COMMON_TOKEN    set19;
++    pANTLR3_COMMON_TOKEN    STR20;
++    pANTLR3_COMMON_TOKEN    INTTAG21;
++    pANTLR3_COMMON_TOKEN    INTBOOL22;
++    pANTLR3_COMMON_TOKEN    INT23;
++    pANTLR3_COMMON_TOKEN    DATETAG24;
++    pANTLR3_COMMON_TOKEN    set25;
++    pANTLR3_COMMON_TOKEN    ENUMTAG27;
++    pANTLR3_COMMON_TOKEN    IS28;
++    pANTLR3_COMMON_TOKEN    ENUMVAL29;
++    SMARTPLParser_expression_return expression16;
++    #undef    RETURN_TYPE_expression16
++    #define   RETURN_TYPE_expression16 SMARTPLParser_expression_return
++
++    SMARTPLParser_dateval_return dateval26;
++    #undef    RETURN_TYPE_dateval26
++    #define   RETURN_TYPE_dateval26 SMARTPLParser_dateval_return
++
++    pANTLR3_BASE_TREE LPAR15_tree;
++    pANTLR3_BASE_TREE RPAR17_tree;
++    pANTLR3_BASE_TREE STRTAG18_tree;
++    pANTLR3_BASE_TREE set19_tree;
++    pANTLR3_BASE_TREE STR20_tree;
++    pANTLR3_BASE_TREE INTTAG21_tree;
++    pANTLR3_BASE_TREE INTBOOL22_tree;
++    pANTLR3_BASE_TREE INT23_tree;
++    pANTLR3_BASE_TREE DATETAG24_tree;
++    pANTLR3_BASE_TREE set25_tree;
++    pANTLR3_BASE_TREE ENUMTAG27_tree;
++    pANTLR3_BASE_TREE IS28_tree;
++    pANTLR3_BASE_TREE ENUMVAL29_tree;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RPAR;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LPAR;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expression;
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    LPAR15       = NULL;
++    RPAR17       = NULL;
++    STRTAG18       = NULL;
++    set19       = NULL;
++    STR20       = NULL;
++    INTTAG21       = NULL;
++    INTBOOL22       = NULL;
++    INT23       = NULL;
++    DATETAG24       = NULL;
++    set25       = NULL;
++    ENUMTAG27       = NULL;
++    IS28       = NULL;
++    ENUMVAL29       = NULL;
++    expression16.tree = NULL;
++
++    dateval26.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    LPAR15_tree   = NULL;
++    RPAR17_tree   = NULL;
++    STRTAG18_tree   = NULL;
++    set19_tree   = NULL;
++    STR20_tree   = NULL;
++    INTTAG21_tree   = NULL;
++    INTBOOL22_tree   = NULL;
++    INT23_tree   = NULL;
++    DATETAG24_tree   = NULL;
++    set25_tree   = NULL;
++    ENUMTAG27_tree   = NULL;
++    IS28_tree   = NULL;
++    ENUMVAL29_tree   = NULL;
++
++    stream_RPAR   = NULL;
++    #define CREATE_stream_RPAR  if (stream_RPAR == NULL) {stream_RPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RPAR"); } 
++    stream_LPAR   = NULL;
++    #define CREATE_stream_LPAR  if (stream_LPAR == NULL) {stream_LPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LPAR"); } 
++    stream_expression   = NULL;
++    #define CREATE_stream_expression  if (stream_expression == NULL) {stream_expression = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expression"); }
++
++    retval.tree  = NULL;
++    {
++        {
++            //  SMARTPL.g:40:7: ( LPAR expression RPAR -> expression | STRTAG ( INCLUDES | IS ) STR | INTTAG INTBOOL INT | DATETAG ( AFTER | BEFORE ) dateval | ENUMTAG IS ENUMVAL )
++            
++            ANTLR3_UINT32 alt4;
++
++            alt4=5;
++
++            switch ( LA(1) ) 
++            {
++            case LPAR:
++              {
++                      alt4=1;
++              }
++                break;
++            case STRTAG:
++              {
++                      alt4=2;
++              }
++                break;
++            case INTTAG:
++              {
++                      alt4=3;
++              }
++                break;
++            case DATETAG:
++              {
++                      alt4=4;
++              }
++                break;
++            case ENUMTAG:
++              {
++                      alt4=5;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 4;
++                EXCEPTION->state        = 0;
++
++
++                goto rulecritEx;
++            }
++
++            switch (alt4) 
++            {
++              case 1:
++                  // SMARTPL.g:40:9: LPAR expression RPAR
++                  {
++                      LPAR15 = (pANTLR3_COMMON_TOKEN) MATCHT(LPAR, &FOLLOW_LPAR_in_crit127); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++                       
++                      CREATE_stream_LPAR; stream_LPAR->add(stream_LPAR, LPAR15, NULL);
++
++                      FOLLOWPUSH(FOLLOW_expression_in_crit129);
++                      expression16=expression(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      CREATE_stream_expression; stream_expression->add(stream_expression, expression16.tree, NULL);
++                      RPAR17 = (pANTLR3_COMMON_TOKEN) MATCHT(RPAR, &FOLLOW_RPAR_in_crit131); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++                       
++                      CREATE_stream_RPAR; stream_RPAR->add(stream_RPAR, RPAR17, NULL);
++
++
++                       
++                      /* AST REWRITE
++                       * elements          : expression
++                       * token labels      : 
++                       * rule labels       : retval
++                       * token list labels : 
++                       * rule list labels  : 
++                       */
++                      {
++                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
++
++                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
++
++                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                              retval.tree    = root_0;
++                              // 40:30: -> expression
++                              {
++                                  ADAPTOR->addChild(ADAPTOR, root_0, stream_expression == NULL ? NULL : stream_expression->nextTree(stream_expression));
++
++                              }
++
++                              retval.tree = root_0; // set result root
++                              if (stream_retval != NULL) stream_retval->free(stream_retval);
++
++
++                      }
++                  }
++                  break;
++              case 2:
++                  // SMARTPL.g:41:6: STRTAG ( INCLUDES | IS ) STR
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      STRTAG18 = (pANTLR3_COMMON_TOKEN) MATCHT(STRTAG, &FOLLOW_STRTAG_in_crit142); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      STRTAG18_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STRTAG18));
++                      ADAPTOR->addChild(ADAPTOR, root_0, STRTAG18_tree);
++
++                      set19=(pANTLR3_COMMON_TOKEN)LT(1);
++                      if ( ((LA(1) >= INCLUDES) && (LA(1) <= IS)) )
++                      {
++                          CONSUME();
++                          ADAPTOR->addChild(ADAPTOR, root_0, (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set19)));
++                          PERRORRECOVERY=ANTLR3_FALSE;
++                      }
++                      else 
++                      {
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++                          EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++                          EXCEPTION->expectingSet = &FOLLOW_set_in_crit144;
++                          RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_crit144);    goto rulecritEx;
++                      }
++
++                      STR20 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_crit150); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      STR20_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STR20));
++                      ADAPTOR->addChild(ADAPTOR, root_0, STR20_tree);
++
++
++                  }
++                  break;
++              case 3:
++                  // SMARTPL.g:42:6: INTTAG INTBOOL INT
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      INTTAG21 = (pANTLR3_COMMON_TOKEN) MATCHT(INTTAG, &FOLLOW_INTTAG_in_crit157); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      INTTAG21_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INTTAG21));
++                      ADAPTOR->addChild(ADAPTOR, root_0, INTTAG21_tree);
++
++                      INTBOOL22 = (pANTLR3_COMMON_TOKEN) MATCHT(INTBOOL, &FOLLOW_INTBOOL_in_crit159); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      INTBOOL22_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INTBOOL22));
++                      ADAPTOR->addChild(ADAPTOR, root_0, INTBOOL22_tree);
++
++                      INT23 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_crit161); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      INT23_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INT23));
++                      ADAPTOR->addChild(ADAPTOR, root_0, INT23_tree);
++
++
++                  }
++                  break;
++              case 4:
++                  // SMARTPL.g:43:6: DATETAG ( AFTER | BEFORE ) dateval
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      DATETAG24 = (pANTLR3_COMMON_TOKEN) MATCHT(DATETAG, &FOLLOW_DATETAG_in_crit168); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      DATETAG24_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATETAG24));
++                      ADAPTOR->addChild(ADAPTOR, root_0, DATETAG24_tree);
++
++                      set25=(pANTLR3_COMMON_TOKEN)LT(1);
++                      if ( ((LA(1) >= AFTER) && (LA(1) <= BEFORE)) )
++                      {
++                          CONSUME();
++                          ADAPTOR->addChild(ADAPTOR, root_0, (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set25)));
++                          PERRORRECOVERY=ANTLR3_FALSE;
++                      }
++                      else 
++                      {
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++                          EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++                          EXCEPTION->expectingSet = &FOLLOW_set_in_crit170;
++                          RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_crit170);    goto rulecritEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_dateval_in_crit176);
++                      dateval26=dateval(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, dateval26.tree);
++
++                  }
++                  break;
++              case 5:
++                  // SMARTPL.g:44:6: ENUMTAG IS ENUMVAL
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      ENUMTAG27 = (pANTLR3_COMMON_TOKEN) MATCHT(ENUMTAG, &FOLLOW_ENUMTAG_in_crit183); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      ENUMTAG27_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, ENUMTAG27));
++                      ADAPTOR->addChild(ADAPTOR, root_0, ENUMTAG27_tree);
++
++                      IS28 = (pANTLR3_COMMON_TOKEN) MATCHT(IS, &FOLLOW_IS_in_crit185); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      IS28_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, IS28));
++                      ADAPTOR->addChild(ADAPTOR, root_0, IS28_tree);
++
++                      ENUMVAL29 = (pANTLR3_COMMON_TOKEN) MATCHT(ENUMVAL, &FOLLOW_ENUMVAL_in_crit187); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      ENUMVAL29_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, ENUMVAL29));
++                      ADAPTOR->addChild(ADAPTOR, root_0, ENUMVAL29_tree);
++
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulecritEx; /* Prevent compiler warnings */
++    rulecritEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++        if (stream_RPAR != NULL) stream_RPAR->free(stream_RPAR);
++        if (stream_LPAR != NULL) stream_LPAR->free(stream_LPAR);
++        if (stream_expression != NULL) stream_expression->free(stream_expression);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end crit */
++
++/** 
++ * $ANTLR start dateval
++ * SMARTPL.g:47:1: dateval : ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO );
++ */
++static SMARTPLParser_dateval_return
++dateval(pSMARTPLParser ctx)
++{   
++    SMARTPLParser_dateval_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    DATE30;
++    pANTLR3_COMMON_TOKEN    BEFORE32;
++    pANTLR3_COMMON_TOKEN    DATE33;
++    pANTLR3_COMMON_TOKEN    AFTER35;
++    pANTLR3_COMMON_TOKEN    DATE36;
++    pANTLR3_COMMON_TOKEN    AGO38;
++    SMARTPLParser_interval_return interval31;
++    #undef    RETURN_TYPE_interval31
++    #define   RETURN_TYPE_interval31 SMARTPLParser_interval_return
++
++    SMARTPLParser_interval_return interval34;
++    #undef    RETURN_TYPE_interval34
++    #define   RETURN_TYPE_interval34 SMARTPLParser_interval_return
++
++    SMARTPLParser_interval_return interval37;
++    #undef    RETURN_TYPE_interval37
++    #define   RETURN_TYPE_interval37 SMARTPLParser_interval_return
++
++    pANTLR3_BASE_TREE DATE30_tree;
++    pANTLR3_BASE_TREE BEFORE32_tree;
++    pANTLR3_BASE_TREE DATE33_tree;
++    pANTLR3_BASE_TREE AFTER35_tree;
++    pANTLR3_BASE_TREE DATE36_tree;
++    pANTLR3_BASE_TREE AGO38_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    DATE30       = NULL;
++    BEFORE32       = NULL;
++    DATE33       = NULL;
++    AFTER35       = NULL;
++    DATE36       = NULL;
++    AGO38       = NULL;
++    interval31.tree = NULL;
++
++    interval34.tree = NULL;
++
++    interval37.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    DATE30_tree   = NULL;
++    BEFORE32_tree   = NULL;
++    DATE33_tree   = NULL;
++    AFTER35_tree   = NULL;
++    DATE36_tree   = NULL;
++    AGO38_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        {
++            //  SMARTPL.g:47:10: ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO )
++            
++            ANTLR3_UINT32 alt5;
++
++            alt5=4;
++
++            switch ( LA(1) ) 
++            {
++            case DATE:
++              {
++                      alt5=1;
++              }
++                break;
++            case INT:
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case DATINTERVAL:
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case AGO:
++                                              {
++                                                      alt5=4;
++                                              }
++                                          break;
++                                      case AFTER:
++                                              {
++                                                      alt5=3;
++                                              }
++                                          break;
++                                      case BEFORE:
++                                              {
++                                                      alt5=2;
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 5;
++                                          EXCEPTION->state        = 3;
++
++
++                                          goto ruledatevalEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 5;
++                          EXCEPTION->state        = 2;
++
++
++                          goto ruledatevalEx;
++                      }
++
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 5;
++                EXCEPTION->state        = 0;
++
++
++                goto ruledatevalEx;
++            }
++
++            switch (alt5) 
++            {
++              case 1:
++                  // SMARTPL.g:47:12: DATE
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      DATE30 = (pANTLR3_COMMON_TOKEN) MATCHT(DATE, &FOLLOW_DATE_in_dateval200); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      DATE30_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATE30));
++                      ADAPTOR->addChild(ADAPTOR, root_0, DATE30_tree);
++
++
++                  }
++                  break;
++              case 2:
++                  // SMARTPL.g:48:6: interval BEFORE DATE
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      FOLLOWPUSH(FOLLOW_interval_in_dateval207);
++                      interval31=interval(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, interval31.tree);
++                      BEFORE32 = (pANTLR3_COMMON_TOKEN) MATCHT(BEFORE, &FOLLOW_BEFORE_in_dateval209); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      BEFORE32_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, BEFORE32));
++                      ADAPTOR->addChild(ADAPTOR, root_0, BEFORE32_tree);
++
++                      DATE33 = (pANTLR3_COMMON_TOKEN) MATCHT(DATE, &FOLLOW_DATE_in_dateval211); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      DATE33_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATE33));
++                      ADAPTOR->addChild(ADAPTOR, root_0, DATE33_tree);
++
++
++                  }
++                  break;
++              case 3:
++                  // SMARTPL.g:49:6: interval AFTER DATE
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      FOLLOWPUSH(FOLLOW_interval_in_dateval218);
++                      interval34=interval(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, interval34.tree);
++                      AFTER35 = (pANTLR3_COMMON_TOKEN) MATCHT(AFTER, &FOLLOW_AFTER_in_dateval220); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      AFTER35_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AFTER35));
++                      ADAPTOR->addChild(ADAPTOR, root_0, AFTER35_tree);
++
++                      DATE36 = (pANTLR3_COMMON_TOKEN) MATCHT(DATE, &FOLLOW_DATE_in_dateval222); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      DATE36_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATE36));
++                      ADAPTOR->addChild(ADAPTOR, root_0, DATE36_tree);
++
++
++                  }
++                  break;
++              case 4:
++                  // SMARTPL.g:50:6: interval AGO
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      FOLLOWPUSH(FOLLOW_interval_in_dateval229);
++                      interval37=interval(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, interval37.tree);
++                      AGO38 = (pANTLR3_COMMON_TOKEN) MATCHT(AGO, &FOLLOW_AGO_in_dateval231); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatevalEx;
++                      }
++
++                      AGO38_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AGO38));
++                      ADAPTOR->addChild(ADAPTOR, root_0, AGO38_tree);
++
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledatevalEx; /* Prevent compiler warnings */
++    ruledatevalEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end dateval */
++
++/** 
++ * $ANTLR start interval
++ * SMARTPL.g:53:1: interval : INT DATINTERVAL ;
++ */
++static SMARTPLParser_interval_return
++interval(pSMARTPLParser ctx)
++{   
++    SMARTPLParser_interval_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    INT39;
++    pANTLR3_COMMON_TOKEN    DATINTERVAL40;
++
++    pANTLR3_BASE_TREE INT39_tree;
++    pANTLR3_BASE_TREE DATINTERVAL40_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    INT39       = NULL;
++    DATINTERVAL40       = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    INT39_tree   = NULL;
++    DATINTERVAL40_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // SMARTPL.g:53:10: ( INT DATINTERVAL )
++        // SMARTPL.g:53:12: INT DATINTERVAL
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            INT39 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_interval243); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleintervalEx;
++            }
++
++            INT39_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INT39));
++            ADAPTOR->addChild(ADAPTOR, root_0, INT39_tree);
++
++            DATINTERVAL40 = (pANTLR3_COMMON_TOKEN) MATCHT(DATINTERVAL, &FOLLOW_DATINTERVAL_in_interval245); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleintervalEx;
++            }
++
++            DATINTERVAL40_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATINTERVAL40));
++            ADAPTOR->addChild(ADAPTOR, root_0, DATINTERVAL40_tree);
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleintervalEx; /* Prevent compiler warnings */
++    ruleintervalEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end interval */
++/* End of parsing rules
++ * ==============================================
++ */
++
++/* ==============================================
++ * Syntactic predicates
++ */
++/* End of syntactic predicates
++ * ==============================================
++ */
++
++ 
++ 
++
++
++
++/* End of code
++ * =============================================================================
++ */
+diff --git a/src/pregen/SMARTPLParser.h b/src/pregen/SMARTPLParser.h
+new file mode 100644
+index 0000000..5360136
+--- /dev/null
++++ b/src/pregen/SMARTPLParser.h
+@@ -0,0 +1,285 @@
++/** \file
++ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : SMARTPL.g
++ *     -                            On : 2015-06-27 19:05:15
++ *     -                for the parser : SMARTPLParserParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++ * The parser SMARTPLParser has the callable functions (rules) shown below,
++ * which will invoke the code for the associated rule in the source grammar
++ * assuming that the input stream is pointing to a token/text stream that could begin
++ * this rule.
++ * 
++ * For instance if you call the first (topmost) rule in a parser grammar, you will
++ * get the results of a full parse, but calling a rule half way through the grammar will
++ * allow you to pass part of a full token stream to the parser, such as for syntax checking
++ * in editors and so on.
++ *
++ * The parser entry points are called indirectly (by function pointer to function) via
++ * a parser context typedef pSMARTPLParser, which is returned from a call to SMARTPLParserNew().
++ *
++ * The methods in pSMARTPLParser are  as follows:
++ *
++ *  - SMARTPLParser_playlist_return      pSMARTPLParser->playlist(pSMARTPLParser)
++ *  - SMARTPLParser_expression_return      pSMARTPLParser->expression(pSMARTPLParser)
++ *  - SMARTPLParser_aexpr_return      pSMARTPLParser->aexpr(pSMARTPLParser)
++ *  - SMARTPLParser_nexpr_return      pSMARTPLParser->nexpr(pSMARTPLParser)
++ *  - SMARTPLParser_crit_return      pSMARTPLParser->crit(pSMARTPLParser)
++ *  - SMARTPLParser_dateval_return      pSMARTPLParser->dateval(pSMARTPLParser)
++ *  - SMARTPLParser_interval_return      pSMARTPLParser->interval(pSMARTPLParser)
++ *
++ * The return type for any particular rule is of course determined by the source
++ * grammar file.
++ */
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++#ifndef       _SMARTPLParser_H
++#define _SMARTPLParser_H
++/* =============================================================================
++ * Standard antlr3 C runtime definitions
++ */
++#include    <antlr3.h>
++
++/* End of standard antlr 3 runtime definitions
++ * =============================================================================
++ */
++ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++// Forward declare the context typedef so that we can use it before it is
++// properly defined. Delegators and delegates (from import statements) are
++// interdependent and their context structures contain pointers to each other
++// C only allows such things to be declared if you pre-declare the typedef.
++//
++typedef struct SMARTPLParser_Ctx_struct SMARTPLParser, * pSMARTPLParser;
++
++
++
++#ifdef        ANTLR3_WINDOWS
++// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
++//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
++//          initialized but unused variable                                   - tree rewrite variables declared but not needed
++//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
++//          potentially unitialized variable used                     - retval always returned from a rule 
++//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
++//
++// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
++// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
++// usually generated when a parser rule is given a parameter that it does not use. Mostly though
++// this is a matter of orthogonality hence I disable that one.
++//
++#pragma warning( disable : 4100 )
++#pragma warning( disable : 4101 )
++#pragma warning( disable : 4127 )
++#pragma warning( disable : 4189 )
++#pragma warning( disable : 4505 )
++#pragma warning( disable : 4701 )
++#endif
++typedef struct SMARTPLParser_playlist_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    SMARTPLParser_playlist_return;
++
++typedef struct SMARTPLParser_expression_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    SMARTPLParser_expression_return;
++
++typedef struct SMARTPLParser_aexpr_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    SMARTPLParser_aexpr_return;
++
++typedef struct SMARTPLParser_nexpr_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    SMARTPLParser_nexpr_return;
++
++typedef struct SMARTPLParser_crit_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    SMARTPLParser_crit_return;
++
++typedef struct SMARTPLParser_dateval_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    SMARTPLParser_dateval_return;
++
++typedef struct SMARTPLParser_interval_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    SMARTPLParser_interval_return;
++
++
++
++/** Context tracking structure for SMARTPLParser
++ */
++struct SMARTPLParser_Ctx_struct
++{
++    /** Built in ANTLR3 context tracker contains all the generic elements
++     *  required for context tracking.
++     */
++    pANTLR3_PARSER   pParser;
++
++
++     SMARTPLParser_playlist_return (*playlist)        (struct SMARTPLParser_Ctx_struct * ctx);
++     SMARTPLParser_expression_return (*expression)    (struct SMARTPLParser_Ctx_struct * ctx);
++     SMARTPLParser_aexpr_return (*aexpr)      (struct SMARTPLParser_Ctx_struct * ctx);
++     SMARTPLParser_nexpr_return (*nexpr)      (struct SMARTPLParser_Ctx_struct * ctx);
++     SMARTPLParser_crit_return (*crit)        (struct SMARTPLParser_Ctx_struct * ctx);
++     SMARTPLParser_dateval_return (*dateval)  (struct SMARTPLParser_Ctx_struct * ctx);
++     SMARTPLParser_interval_return (*interval)        (struct SMARTPLParser_Ctx_struct * ctx);
++    // Delegated rules
++    const char * (*getGrammarFileName)();
++    void          (*free)   (struct SMARTPLParser_Ctx_struct * ctx);
++    /* @headerFile.members() */
++    pANTLR3_BASE_TREE_ADAPTOR adaptor;
++    pANTLR3_VECTOR_FACTORY            vectors;
++    /* End @headerFile.members() */
++};
++
++// Function protoypes for the constructor functions that external translation units
++// such as delegators and delegates may wish to call.
++//
++ANTLR3_API pSMARTPLParser SMARTPLParserNew         (pANTLR3_COMMON_TOKEN_STREAM instream);
++ANTLR3_API pSMARTPLParser SMARTPLParserNewSSD      (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
++
++/** Symbolic definitions of all the tokens that the parser will work with.
++ * \{
++ *
++ * Antlr will define EOF, but we can't use that as it it is too common in
++ * in C header files and that would be confusing. There is no way to filter this out at the moment
++ * so we just undef it here for now. That isn't the value we get back from C recognizers
++ * anyway. We are looking for ANTLR3_TOKEN_EOF.
++ */
++#ifdef        EOF
++#undef        EOF
++#endif
++#ifdef        Tokens
++#undef        Tokens
++#endif 
++#define INTBOOL      14
++#define STRTAG      10
++#define AGO      22
++#define WHITESPACE      29
++#define GREATEREQUAL      25
++#define BEFORE      18
++#define DATETAG      16
++#define INT      15
++#define NOT      7
++#define AFTER      17
++#define AND      6
++#define EOF      -1
++#define INCLUDES      11
++#define STR      4
++#define T__30      30
++#define T__31      31
++#define GREATER      24
++#define LPAR      8
++#define ENUMTAG      19
++#define IS      12
++#define ENUMVAL      20
++#define EQUAL      28
++#define OR      5
++#define LESS      26
++#define RPAR      9
++#define DATE      21
++#define LESSEQUAL      27
++#define DATINTERVAL      23
++#define INTTAG      13
++#ifdef        EOF
++#undef        EOF
++#define       EOF     ANTLR3_TOKEN_EOF
++#endif
++
++#ifndef TOKENSOURCE
++#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
++#endif
++
++/* End of token definitions for SMARTPLParser
++ * =============================================================================
++ */
++/** \} */
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++
++/* END - Note:Keep extra line feed to satisfy UNIX systems */
index 5879e37a60d671a7ffd6c37830cb7085e3dc342d..c7449bcd8cf9f4f35831475edeb8ba1bad7bfb5f 100644 (file)
@@ -40,10 +40,6 @@ define Build/Configure
        )
        # XXX: memmove() works well with overlapped memory areas
        echo "#define USEMEMMOVE 1" >>$(PKG_BUILD_DIR)/config.h
-  ifeq ($(CONFIG_USE_MUSL),y)
-       # XXX: assume a working getlogin() for musl
-       echo "#undef BUGGYGETLOGIN" >>$(PKG_BUILD_DIR)/config.h
-  endif
 endef
 
 define Package/screen/install