summaryrefslogtreecommitdiff
path: root/src/testpattern
diff options
context:
space:
mode:
Diffstat (limited to 'src/testpattern')
-rw-r--r--src/testpattern/Makefile.am1
-rw-r--r--src/testpattern/Makefile.in37
-rwxr-xr-xsrc/testpattern/compare-checksums.in28
-rw-r--r--src/testpattern/extended.sample3
-rw-r--r--src/testpattern/printer_options.c1
-rw-r--r--src/testpattern/printers.c1
-rw-r--r--src/testpattern/run-testpattern-2.in21
-rw-r--r--src/testpattern/testpattern.c1
-rw-r--r--src/testpattern/testpattern.h1
-rw-r--r--src/testpattern/testpattern.sample3
-rw-r--r--src/testpattern/testpatternl.c117
-rw-r--r--src/testpattern/testpatternl.l1
-rw-r--r--src/testpattern/testpatterny.c917
-rw-r--r--src/testpattern/testpatterny.h32
-rw-r--r--src/testpattern/testpatterny.y1
15 files changed, 587 insertions, 578 deletions
diff --git a/src/testpattern/Makefile.am b/src/testpattern/Makefile.am
index 7fe813f..b02ac4a 100644
--- a/src/testpattern/Makefile.am
+++ b/src/testpattern/Makefile.am
@@ -1,4 +1,3 @@
-## $Id: Makefile.am,v 1.29 2015/09/13 15:30:40 rlk Exp $
## Copyright (C) 2000 Roger Leigh
##
## This program is free software; you can redistribute it and/or modify
diff --git a/src/testpattern/Makefile.in b/src/testpattern/Makefile.in
index 152eea8..9003446 100644
--- a/src/testpattern/Makefile.in
+++ b/src/testpattern/Makefile.in
@@ -85,30 +85,28 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \
- $(srcdir)/Makefile.am $(top_srcdir)/scripts/mkinstalldirs \
- $(srcdir)/run-testpattern-2.in $(srcdir)/compare-checksums.in \
- testpatterny.h testpatterny.c testpatternl.c \
- $(top_srcdir)/scripts/depcomp $(top_srcdir)/scripts/ylwrap \
- $(top_srcdir)/scripts/test-driver
+ $(srcdir)/Makefile.am $(srcdir)/run-testpattern-2.in \
+ $(srcdir)/compare-checksums.in testpatterny.h testpatterny.c \
+ testpatternl.c $(top_srcdir)/scripts/depcomp \
+ $(top_srcdir)/scripts/ylwrap $(top_srcdir)/scripts/test-driver
@BUILD_TESTPATTERN_TRUE@bin_PROGRAMS = testpattern$(EXEEXT)
@BUILD_TESTPATTERN_TRUE@noinst_PROGRAMS = printers$(EXEEXT) \
@BUILD_TESTPATTERN_TRUE@ printer_options$(EXEEXT)
subdir = src/testpattern
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/isc-posix.m4 \
- $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
- $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
- $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \
- $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \
- $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+ $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \
+ $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \
+ $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = run-testpattern-2 compare-checksums
CONFIG_CLEAN_VPATH_FILES =
@@ -458,9 +456,6 @@ ENABLE_STATIC = @ENABLE_STATIC@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FIND = @FIND@
-FOOMATIC_CONFIGURE = @FOOMATIC_CONFIGURE@
-FOOMATIC_KITLOAD = @FOOMATIC_KITLOAD@
-FOOMATIC_PPDFILE = @FOOMATIC_PPDFILE@
GENPPD_LIBS = @GENPPD_LIBS@
GIMP2_CFLAGS = @GIMP2_CFLAGS@
GIMP2_LIBS = @GIMP2_LIBS@
@@ -493,9 +488,6 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@
GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@
GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@
GUTENPRINT_VERSION = @GUTENPRINT_VERSION@
-IJS_CFLAGS = @IJS_CFLAGS@
-IJS_CONFIG = @IJS_CONFIG@
-IJS_LIBS = @IJS_LIBS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -516,6 +508,7 @@ LIBREADLINE_DEPS = @LIBREADLINE_DEPS@
LIBS = $(INTLLIBS) @LIBS@
LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIBUSB_BACKEND_LIBDEPS = @LIBUSB_BACKEND_LIBDEPS@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
diff --git a/src/testpattern/compare-checksums.in b/src/testpattern/compare-checksums.in
index 0846424..c27ffdf 100755
--- a/src/testpattern/compare-checksums.in
+++ b/src/testpattern/compare-checksums.in
@@ -3,6 +3,12 @@
use strict;
my (%old_modes, %old_printers, %new_modes, %new_printers);
+my ($detail1) = 0;
+
+while ($#ARGV >= 0 && $ARGV[0] eq '-d') {
+ $detail1++;
+ shift @ARGV;
+}
if ($#ARGV != 1) {
die "Usage: $0 old_checksum_file new_checksum_file\n";
@@ -84,11 +90,15 @@ sub print_changes($$@) {
my ($tag, $detail, @changes) = @_;
my ($prev_printer);
return if ($#changes < 0);
- print "$tag:\n";
+ if (! $detail1) {
+ print "$tag:\n";
+ }
foreach my $m (@changes) {
my ($printer) = get_printer($m);
my ($mode) = get_mode($m);
- if ($detail) {
+ if ($detail > 1) {
+ print "${printer}_${mode}\n";
+ } elsif ($detail) {
if ($printer ne $prev_printer) {
print " $printer:\n";
$prev_printer = $printer;
@@ -101,9 +111,11 @@ sub print_changes($$@) {
print "\n";
}
-print "*** Changes from $ARGV[0] to $ARGV[1] ***\n\n";
-print_changes("Printers removed from $ARGV[1]", 0, @only_old_printers);
-print_changes("Printers added to $ARGV[1]", 0, @only_new_printers);
-print_changes("Modes removed from $ARGV[1]", 1, @only_old_modes);
-print_changes("Modes added to $ARGV[1]", 1, @only_new_modes);
-print_changes("Changed printing modes", 1, @changed_modes);
+if (! $detail1) {
+ print "*** Changes from $ARGV[0] to $ARGV[1] ***\n\n";
+ print_changes("Printers removed from $ARGV[1]", 0, @only_old_printers);
+ print_changes("Printers added to $ARGV[1]", 0, @only_new_printers);
+ print_changes("Modes removed from $ARGV[1]", 1, @only_old_modes);
+ print_changes("Modes added to $ARGV[1]", 1, @only_new_modes);
+}
+print_changes("Changed printing modes", 1 + $detail1, @changed_modes);
diff --git a/src/testpattern/extended.sample b/src/testpattern/extended.sample
index 025f841..53ec901 100644
--- a/src/testpattern/extended.sample
+++ b/src/testpattern/extended.sample
@@ -1,7 +1,6 @@
# Sample test pattern file, for use with Gimp-Print test pattern generator
-# Printer/driver settings. Please see src/ghost/README for appropriate
-# values for each of these settings
+# Printer/driver settings.
# Printer model
printer escp2-2200;
mode extended 7 16;
diff --git a/src/testpattern/printer_options.c b/src/testpattern/printer_options.c
index a13479e..5f736e2 100644
--- a/src/testpattern/printer_options.c
+++ b/src/testpattern/printer_options.c
@@ -1,5 +1,4 @@
/*
- * "$Id: printer_options.c,v 1.7 2015/10/04 15:09:54 rlk Exp $"
*
* Dump the per-printer options for the OpenPrinting database
*
diff --git a/src/testpattern/printers.c b/src/testpattern/printers.c
index 3879de9..5f36568 100644
--- a/src/testpattern/printers.c
+++ b/src/testpattern/printers.c
@@ -1,5 +1,4 @@
/*
- * "$Id: printers.c,v 1.7 2007/03/05 00:04:00 tillkamppeter Exp $"
*
* Dump the per-printer options for the OpenPrinting database
*
diff --git a/src/testpattern/run-testpattern-2.in b/src/testpattern/run-testpattern-2.in
index 62c7cbf..48d84d2 100644
--- a/src/testpattern/run-testpattern-2.in
+++ b/src/testpattern/run-testpattern-2.in
@@ -571,6 +571,7 @@ sub do_printer($$) {
my $min_res_value = 0;
my $first_time = 1;
my $key;
+ my $skip_resolutions_local = $skip_resolutions;
my %opt_vals = {};
$tmp = $stpdata{$printer}{'Resolution'};
my (@resolutions) = grep {$_ ne 'None' } keys %$tmp;
@@ -589,6 +590,10 @@ sub do_printer($$) {
}
foreach $key (@special_options) {
+ my (@subkeys) = split(/,/, $key);
+ if (grep { /^Resolution$/ } @subkeys) {
+ $skip_resolutions_local = 1;
+ }
my $nkey = build_key($key, $printer);
if ($nkey ne "") {
my (@vals) = build_list($nkey, $printer);
@@ -612,7 +617,7 @@ sub do_printer($$) {
foreach $pmode (sort @printing_modes) {
my ($resolution);
$pages = $std_pages;
- if (! $skip_resolutions) {
+ if (! $skip_resolutions_local) {
foreach $resolution (sort @resolutions) {
@extras = ();
@job_extras = ();
@@ -643,6 +648,8 @@ sub do_printer($$) {
foreach $key (sort keys %opt_vals) {
next if ($key eq "RawChannels" && $pmode ne "Color");
my (@subkeys) = split (/,/, $key);
+ my (%subkeys);
+ map {$subkeys{$_} = 1} @subkeys;
$tmp = $opt_vals{$key};
if (defined $tmp && $tmp >= 1) {
my (@opts) = sort @$tmp;
@@ -656,7 +663,7 @@ sub do_printer($$) {
@messages = ();
@global_messages = ();
set_opt("PrintingMode", $pmode, $printer);
- if ($use_min_res) {
+ if ($use_min_res && ! grep { /^Resolution$/ } @subkeys) {
set_opt("Resolution", $min_res_name, $printer);
}
my (@mvals);
@@ -696,7 +703,9 @@ sub do_printer($$) {
$pages = $duplex_pages;
}
}
- } grep { $use_unused_options || defined $stpdata{$printer}{$_}} (keys %base_settings);
+ } grep { ! defined $subkeys{$_} &&
+ ($use_unused_options ||
+ defined $stpdata{$printer}{$_})} (keys %base_settings);
my ($mstring) = join "_", @mvals;
my ($ostring) = join "+", @ovals;
my $case;
@@ -748,9 +757,11 @@ foreach my $printer (@printer_list) {
sub restart_testpattern {
my ($silent) = @_;
if (! $silent) {
- $error = 1;
close($global_fh);
my ($err) = $? & 255;
+ if ($err > 0) {
+ $error++;
+ }
if ($single > 1) {
warn("\n***TESTPATTERN CRASHED*** ($global_case) ($err)!\n");
} else {
@@ -891,7 +902,7 @@ if ($list_options) {
if ($single > 1) {
print STDERR "$error cases failed\n";
} else {
- print STDERR "Failures noted.\n";
+ print STDERR "*** $error CRASHES NOTED***\n";
}
}
exit 1;
diff --git a/src/testpattern/testpattern.c b/src/testpattern/testpattern.c
index 2e14faa..ca3d25d 100644
--- a/src/testpattern/testpattern.c
+++ b/src/testpattern/testpattern.c
@@ -1,5 +1,4 @@
/*
- * "$Id: testpattern.c,v 1.65 2015/04/11 20:35:42 rlk Exp $"
*
* Test pattern generator for Gutenprint
*
diff --git a/src/testpattern/testpattern.h b/src/testpattern/testpattern.h
index 29bd3c3..d43618c 100644
--- a/src/testpattern/testpattern.h
+++ b/src/testpattern/testpattern.h
@@ -1,5 +1,4 @@
/*
- * "$Id: testpattern.h,v 1.21 2014/01/23 13:22:41 rlk Exp $"
*
* Test pattern generator for Gimp-Print
*
diff --git a/src/testpattern/testpattern.sample b/src/testpattern/testpattern.sample
index dd5a596..5359c4b 100644
--- a/src/testpattern/testpattern.sample
+++ b/src/testpattern/testpattern.sample
@@ -1,7 +1,6 @@
# Sample test pattern file, for use with Gimp-Print test pattern generator
-# Printer/driver settings. Please see src/ghost/README for appropriate
-# values for each of these settings
+# Printer/driver settings.
# Printer model
printer escp2-870;
# Resolution, or print quality
diff --git a/src/testpattern/testpatternl.c b/src/testpattern/testpatternl.c
index cee5dea..3a6e90e 100644
--- a/src/testpattern/testpatternl.c
+++ b/src/testpattern/testpatternl.c
@@ -752,7 +752,6 @@ int yy_flex_debug = 0;
char *yytext;
#line 1 "testpatternl.l"
/*
- * "$Id: testpatternl.l,v 1.28 2014/01/04 00:30:27 rlk Exp $"
*
* Test pattern generator for Gimp-Print
*
@@ -772,7 +771,7 @@ char *yytext;
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#line 24 "testpatternl.l"
+#line 23 "testpatternl.l"
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -817,7 +816,7 @@ do \
while (0)
-#line 821 "testpatternl.c"
+#line 820 "testpatternl.c"
#define INITIAL 0
@@ -999,10 +998,10 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 82 "testpatternl.l"
+#line 81 "testpatternl.l"
-#line 1006 "testpatternl.c"
+#line 1005 "testpatternl.c"
if ( !(yy_init) )
{
@@ -1087,267 +1086,267 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 84 "testpatternl.l"
+#line 83 "testpatternl.l"
DBG(GAMMA); return GAMMA;
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 85 "testpatternl.l"
+#line 84 "testpatternl.l"
DBG(LEVEL); return LEVEL;
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 86 "testpatternl.l"
+#line 85 "testpatternl.l"
DBG(STEPS); return STEPS;
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 87 "testpatternl.l"
+#line 86 "testpatternl.l"
DBG(INK_LIMIT); return INK_LIMIT;
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 88 "testpatternl.l"
+#line 87 "testpatternl.l"
DBG(PRINTER); return PRINTER;
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 89 "testpatternl.l"
+#line 88 "testpatternl.l"
DBG(PARAMETER); return PARAMETER;
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 90 "testpatternl.l"
+#line 89 "testpatternl.l"
DBG(PARAMETER_INT); return PARAMETER_INT;
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 91 "testpatternl.l"
+#line 90 "testpatternl.l"
DBG(PARAMETER_BOOL); return PARAMETER_BOOL;
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 92 "testpatternl.l"
+#line 91 "testpatternl.l"
DBG(PARAMETER); return PARAMETER;
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 93 "testpatternl.l"
+#line 92 "testpatternl.l"
DBG(PARAMETER_FLOAT); return PARAMETER_FLOAT;
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 94 "testpatternl.l"
+#line 93 "testpatternl.l"
DBG(PARAMETER_CURVE); return PARAMETER_CURVE;
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 95 "testpatternl.l"
+#line 94 "testpatternl.l"
DBG(DENSITY); return DENSITY;
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 96 "testpatternl.l"
+#line 95 "testpatternl.l"
DBG(TOP); return TOP;
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 97 "testpatternl.l"
+#line 96 "testpatternl.l"
DBG(LEFT); return LEFT;
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 98 "testpatternl.l"
+#line 97 "testpatternl.l"
DBG(SIZE_MODE); return SIZE_MODE;
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 99 "testpatternl.l"
+#line 98 "testpatternl.l"
DBG(RELATIVE); return RELATIVE;
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 100 "testpatternl.l"
+#line 99 "testpatternl.l"
DBG(PT); return PT;
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 101 "testpatternl.l"
+#line 100 "testpatternl.l"
DBG(IN); return IN;
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 102 "testpatternl.l"
+#line 101 "testpatternl.l"
DBG(MM); return MM;
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 103 "testpatternl.l"
+#line 102 "testpatternl.l"
DBG(HSIZE); return HSIZE;
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 104 "testpatternl.l"
+#line 103 "testpatternl.l"
DBG(VSIZE); return VSIZE;
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 105 "testpatternl.l"
+#line 104 "testpatternl.l"
DBG(BLACKLINE); return BLACKLINE;
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 106 "testpatternl.l"
+#line 105 "testpatternl.l"
DBG(PATTERN); return PATTERN;
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 107 "testpatternl.l"
+#line 106 "testpatternl.l"
DBG(XPATTERN); return XPATTERN;
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 108 "testpatternl.l"
+#line 107 "testpatternl.l"
DBG(IMAGE); return IMAGE;
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 109 "testpatternl.l"
+#line 108 "testpatternl.l"
DBG(EXTENDED); return EXTENDED;
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 110 "testpatternl.l"
+#line 109 "testpatternl.l"
DBG(GRID); return GRID;
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 111 "testpatternl.l"
+#line 110 "testpatternl.l"
DBG(CHANNEL); return CHANNEL;
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 112 "testpatternl.l"
+#line 111 "testpatternl.l"
DBG(PAGESIZE); return PAGESIZE;
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 113 "testpatternl.l"
+#line 112 "testpatternl.l"
DBG(SEMI); return SEMI;
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 114 "testpatternl.l"
+#line 113 "testpatternl.l"
DBG(MODE); return MODE;
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 115 "testpatternl.l"
+#line 114 "testpatternl.l"
yylval.ival = CMYK;DBG(CMYK); return CMYK;
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 116 "testpatternl.l"
+#line 115 "testpatternl.l"
yylval.ival = CMYK;DBG(KCMY); return KCMY;
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 117 "testpatternl.l"
+#line 116 "testpatternl.l"
yylval.ival = RGB;DBG(RGB); return RGB;
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 118 "testpatternl.l"
+#line 117 "testpatternl.l"
yylval.ival = RGB;DBG(CMY); return CMY;
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 119 "testpatternl.l"
+#line 118 "testpatternl.l"
yylval.ival = GRAY;DBG(GRAY); return GRAY;
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 120 "testpatternl.l"
+#line 119 "testpatternl.l"
yylval.ival = GRAY;DBG(GRAY); return GRAY;
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 121 "testpatternl.l"
+#line 120 "testpatternl.l"
yylval.ival = WHITE;DBG(WHITE); return WHITE;
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 122 "testpatternl.l"
+#line 121 "testpatternl.l"
DBG(OUTPUT); return OUTPUT;
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 123 "testpatternl.l"
+#line 122 "testpatternl.l"
DBG(MESSAGE); return MESSAGE;
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 124 "testpatternl.l"
+#line 123 "testpatternl.l"
DBG(NOSCALE); return NOSCALE;
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 125 "testpatternl.l"
+#line 124 "testpatternl.l"
DBG(START_JOB); return START_JOB;
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 126 "testpatternl.l"
+#line 125 "testpatternl.l"
DBG(END_JOB); return END_JOB;
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 127 "testpatternl.l"
+#line 126 "testpatternl.l"
DBG(END); return END;
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 129 "testpatternl.l"
+#line 128 "testpatternl.l"
yylval.sval = yytext;DBG(COLOR); return COLOR;
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 130 "testpatternl.l"
+#line 129 "testpatternl.l"
yylval.ival = strtol(yytext, NULL, 0); yylval.dval = (double) yylval.ival; DBG(tINT); return tINT;
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 131 "testpatternl.l"
+#line 130 "testpatternl.l"
yylval.dval = strtod(yytext, NULL); DBG(tDOUBLE); return tDOUBLE;
YY_BREAK
case 48:
/* rule 48 can match eol */
YY_RULE_SETUP
-#line 132 "testpatternl.l"
+#line 131 "testpatternl.l"
yylval.sval = c_strstrip(yytext); DBG(tSTRING); return tSTRING;
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 133 "testpatternl.l"
+#line 132 "testpatternl.l"
DBG(whitespace); /* Skip blanks/tabs */
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 134 "testpatternl.l"
+#line 133 "testpatternl.l"
DBG(comment); /* Skip comments */
YY_BREAK
case 51:
/* rule 51 can match eol */
YY_RULE_SETUP
-#line 135 "testpatternl.l"
+#line 134 "testpatternl.l"
DBG(newline); mylineno++;
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 136 "testpatternl.l"
+#line 135 "testpatternl.l"
ECHO;
YY_BREAK
-#line 1351 "testpatternl.c"
+#line 1350 "testpatternl.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -2341,4 +2340,4 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 136 "testpatternl.l"
+#line 135 "testpatternl.l"
diff --git a/src/testpattern/testpatternl.l b/src/testpattern/testpatternl.l
index f4f6708..21f1530 100644
--- a/src/testpattern/testpatternl.l
+++ b/src/testpattern/testpatternl.l
@@ -1,5 +1,4 @@
/*
- * "$Id: testpatternl.l,v 1.28 2014/01/04 00:30:27 rlk Exp $"
*
* Test pattern generator for Gimp-Print
*
diff --git a/src/testpattern/testpatterny.c b/src/testpattern/testpatterny.c
index 818087e..47bd3bf 100644
--- a/src/testpattern/testpatterny.c
+++ b/src/testpattern/testpatterny.c
@@ -1,10 +1,8 @@
+/* A Bison parser, made by GNU Bison 2.7. */
-/* A Bison parser, made by GNU Bison 2.4.1. */
-
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.7"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -60,15 +58,12 @@
/* Pull parsers. */
#define YYPULL 1
-/* Using locations. */
-#define YYLSP_NEEDED 0
/* Copy the first part of user declarations. */
-
-/* Line 189 of yacc.c */
-#line 23 "testpatterny.y"
+/* Line 371 of yacc.c */
+#line 22 "testpatterny.y"
#ifdef HAVE_CONFIG_H
@@ -135,14 +130,16 @@ find_color(const char *name)
}
+/* Line 371 of yacc.c */
+#line 135 "testpatterny.c"
-/* Line 189 of yacc.c */
-#line 141 "testpatterny.c"
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
+# ifndef YY_NULL
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULL nullptr
+# else
+# define YY_NULL 0
+# endif
+# endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
@@ -152,11 +149,17 @@ find_color(const char *name)
# define YYERROR_VERBOSE 0
#endif
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
+/* In a future release of Bison, this section will be replaced
+ by #include "y.tab.h". */
+#ifndef YY_YY_TESTPATTERNY_H_INCLUDED
+# define YY_YY_TESTPATTERNY_H_INCLUDED
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int yydebug;
#endif
-
/* Tokens. */
#ifndef YYTOKENTYPE
@@ -262,19 +265,34 @@ find_color(const char *name)
-
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
+extern YYSTYPE yylval;
-/* Copy the second part of user declarations. */
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+#endif /* !YY_YY_TESTPATTERNY_H_INCLUDED */
+
+/* Copy the second part of user declarations. */
-/* Line 264 of yacc.c */
-#line 278 "testpatterny.c"
+/* Line 390 of yacc.c */
+#line 296 "testpatterny.c"
#ifdef short
# undef short
@@ -324,27 +342,27 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif
# endif
# ifndef YY_
-# define YY_(msgid) msgid
+# define YY_(Msgid) Msgid
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
+# define YYUSE(E) ((void) (E))
#else
-# define YYUSE(e) /* empty */
+# define YYUSE(E) /* empty */
#endif
/* Identity function, used to suppress warnings about constant conditions. */
#ifndef lint
-# define YYID(n) (n)
+# define YYID(N) (N)
#else
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
@@ -377,11 +395,12 @@ YYID (yyi)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# endif
@@ -404,24 +423,24 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined _STDLIB_H \
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
@@ -450,23 +469,7 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
+# define YYCOPY_NEEDED 1
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
@@ -486,6 +489,26 @@ union yyalloc
#endif
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(Dst, Src, Count) \
+ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+# else
+# define YYCOPY(Dst, Src, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (Dst)[yyi] = (Src)[yyi]; \
+ } \
+ while (YYID (0))
+# endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 62
/* YYLAST -- Last index in YYTABLE. */
@@ -605,24 +628,24 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 144, 144, 144, 149, 159, 169, 179, 189, 199,
- 209, 219, 219, 219, 219, 219, 219, 219, 222, 230,
- 230, 233, 236, 246, 255, 265, 274, 281, 288, 295,
- 304, 313, 322, 322, 325, 335, 344, 353, 362, 376,
- 376, 376, 376, 376, 378, 385, 392, 399, 406, 413,
- 420, 427, 427, 427, 427, 429, 431, 438, 445, 453,
- 461, 476, 476, 479, 479, 482, 485, 499, 512, 512,
- 515, 515, 518, 518, 521, 521, 524, 539, 542, 557,
- 568, 585, 592, 592, 595, 598, 608, 614, 614, 617,
- 621, 625, 625, 625, 625, 625, 625, 626, 626, 626,
- 626, 626, 626, 626, 627, 627, 627, 627, 627, 627,
- 628, 628, 628, 628, 631, 635, 635, 635, 635, 638,
- 642, 642, 645, 649, 649, 652, 652, 655, 655, 660,
- 659
+ 0, 143, 143, 143, 148, 158, 168, 178, 188, 198,
+ 208, 218, 218, 218, 218, 218, 218, 218, 221, 229,
+ 229, 232, 235, 245, 254, 264, 273, 280, 287, 294,
+ 303, 312, 321, 321, 324, 334, 343, 352, 361, 375,
+ 375, 375, 375, 375, 377, 384, 391, 398, 405, 412,
+ 419, 426, 426, 426, 426, 428, 430, 437, 444, 452,
+ 460, 475, 475, 478, 478, 481, 484, 498, 511, 511,
+ 514, 514, 517, 517, 520, 520, 523, 538, 541, 556,
+ 567, 584, 591, 591, 594, 597, 607, 613, 613, 616,
+ 620, 624, 624, 624, 624, 624, 624, 625, 625, 625,
+ 625, 625, 625, 625, 626, 626, 626, 626, 626, 626,
+ 627, 627, 627, 627, 630, 634, 634, 634, 634, 637,
+ 641, 641, 644, 648, 648, 651, 651, 654, 654, 659,
+ 658
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+#if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
@@ -648,7 +671,7 @@ static const char *const yytname[] =
"color_blocks", "patvars", "pattern", "xpattern", "grid", "image",
"Message", "Messages", "message", "Output0", "Output1", "output",
"start_job", "end_job", "A_Rule", "Rule", "A_Pattern", "Pattern",
- "Patterns", "Image", "Rules", "Print", "EOF", "Thing", "$@1", 0
+ "Patterns", "Image", "Rules", "Print", "EOF", "Thing", "$@1", YY_NULL
};
#endif
@@ -703,8 +726,8 @@ static const yytype_uint8 yyr2[] =
4
};
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
@@ -783,8 +806,7 @@ static const yytype_int16 yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
+ number is the opposite. If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
static const yytype_uint8 yytable[] =
{
@@ -808,6 +830,12 @@ static const yytype_uint8 yytable[] =
178, 179, 180, 0, 0, 181, 0, 182
};
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-141)))
+
+#define yytable_value_is_error(Yytable_value) \
+ YYID (0)
+
static const yytype_int16 yycheck[] =
{
3, 3, 4, 6, 6, 21, 22, 23, 24, 6,
@@ -867,78 +895,50 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
+ Once GCC version 2 has supplanted version 1, this can go. However,
+ YYFAIL appears to be in use. Nevertheless, it is formally deprecated
+ in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+ discussed. */
#define YYFAIL goto yyerrlab
+#if defined YYFAIL
+ /* This is here to suppress warnings from the GCC cpp's
+ -Wunused-macros. Normally we don't worry about that warning, but
+ some users do, and we want to make it easy for users to remove
+ YYFAIL uses, which will produce warnings from Bison 2.5. */
+#endif
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK (1); \
- goto yybackup; \
- } \
- else \
- { \
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (YYID (0))
-
+/* Error token number */
#define YYTERROR 1
#define YYERRCODE 256
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
- while (YYID (0))
-#endif
-
-
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
-
+/* This macro is provided for backward compatibility. */
#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
#endif
/* YYLEX -- calling `yylex' with the right arguments. */
-
#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
@@ -988,6 +988,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
YYSTYPE const * const yyvaluep;
#endif
{
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
if (!yyvaluep)
return;
# ifdef YYPRINT
@@ -999,7 +1001,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
switch (yytype)
{
default:
- break;
+ break;
}
}
@@ -1125,7 +1127,6 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
-
#if YYERROR_VERBOSE
@@ -1228,115 +1229,145 @@ yytnamerr (char *yyres, const char *yystr)
}
# endif
-/* Copy into YYRESULT an error message about the unexpected token
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
- including the terminating null byte. If YYRESULT is null, do not
- copy anything; just return the number of bytes that would be
- copied. As a special case, return 0 if an ordinary "syntax error"
- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
- size calculation. */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
- int yyn = yypact[yystate];
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
- else
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+ yytype_int16 *yyssp, int yytoken)
+{
+ YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
+ YYSIZE_T yysize = yysize0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = YY_NULL;
+ /* Arguments of yyformat. */
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ /* Number of reported tokens (one for the "unexpected", one per
+ "expected"). */
+ int yycount = 0;
+
+ /* There are many possibilities here to consider:
+ - Assume YYFAIL is not used. It's too flawed to consider. See
+ <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+ for details. YYERROR is fine as it does not invoke this
+ function.
+ - If this state is a consistent state with a default action, then
+ the only way this function was invoked is if the default action
+ is an error action. In that case, don't check for expected
+ tokens because there are none.
+ - The only way there can be no lookahead present (in yychar) is if
+ this state is a consistent state with a default action. Thus,
+ detecting the absence of a lookahead is sufficient to determine
+ that there is no unexpected or expected token to report. In that
+ case, just report a simple "syntax error".
+ - Don't assume there isn't a lookahead just because this state is a
+ consistent state with a default action. There might have been a
+ previous inconsistent state, consistent state with a non-default
+ action, or user semantic action that manipulated yychar.
+ - Of course, the expected token list depends on states to have
+ correct lookahead information, and it depends on the parser not
+ to perform extra reductions after fetching a lookahead from the
+ scanner and before detecting a syntax error. Thus, state merging
+ (from LALR or IELR) and default reductions corrupt the expected
+ token list. However, the list is correct for canonical LR with
+ one exception: it will still contain any token that will not be
+ accepted due to an error action in a later state.
+ */
+ if (yytoken != YYEMPTY)
{
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-# if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- yyformat[sizeof yyunexpected - 1] = '\0';
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
- yyfmt = yystpcpy (yyfmt, yyprefix);
- yyprefix = yyor;
- }
+ int yyn = yypact[*yyssp];
+ yyarg[yycount++] = yytname[yytoken];
+ if (!yypact_value_is_default (yyn))
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ {
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
+ }
+ }
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
+ switch (yycount)
+ {
+# define YYCASE_(N, S) \
+ case N: \
+ yyformat = S; \
+ break
+ YYCASE_(0, YY_("syntax error"));
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+ }
- if (yysize_overflow)
- return YYSIZE_MAXIMUM;
+ {
+ YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
- if (yyresult)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yyresult;
- int yyi = 0;
- while ((*yyp = *yyf) != '\0')
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- }
- return yysize;
+ if (*yymsg_alloc < yysize)
+ {
+ *yymsg_alloc = 2 * yysize;
+ if (! (yysize <= *yymsg_alloc
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+ return 1;
}
+
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ {
+ char *yyp = *yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyformat) != '\0')
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyformat += 2;
+ }
+ else
+ {
+ yyp++;
+ yyformat++;
+ }
+ }
+ return 0;
}
#endif /* YYERROR_VERBOSE */
-
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
@@ -1365,40 +1396,35 @@ yydestruct (yymsg, yytype, yyvaluep)
{
default:
- break;
+ break;
}
}
-/* Prevent warnings from -Wmissing-prototypes. */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
+
/* The lookahead symbol. */
int yychar;
+
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval;
+YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
/* Number of syntax errors so far. */
int yynerrs;
-
-/*-------------------------.
-| yyparse or yypush_parse. |
-`-------------------------*/
+/*----------.
+| yyparse. |
+`----------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1422,8 +1448,6 @@ yyparse ()
#endif
#endif
{
-
-
int yystate;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
@@ -1432,7 +1456,7 @@ yyparse ()
`yyss': related to states.
`yyvs': related to semantic values.
- Refer to the stacks thru separate pointers, to allow yyoverflow
+ Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
@@ -1450,7 +1474,7 @@ yyparse ()
int yyn;
int yyresult;
/* Lookahead token as an internal (translated) token number. */
- int yytoken;
+ int yytoken = 0;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
@@ -1468,9 +1492,8 @@ yyparse ()
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yytoken = 0;
- yyss = yyssa;
- yyvs = yyvsa;
+ yyssp = yyss = yyssa;
+ yyvsp = yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1479,14 +1502,6 @@ yyparse ()
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
- yyssp = yyss;
- yyvsp = yyvs;
-
goto yysetstate;
/*------------------------------------------------------------.
@@ -1578,7 +1593,7 @@ yybackup:
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yypact_value_is_default (yyn))
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
@@ -1609,8 +1624,8 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
+ if (yytable_value_is_error (yyn))
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
@@ -1627,7 +1642,9 @@ yybackup:
yychar = YYEMPTY;
yystate = yyn;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
goto yynewstate;
@@ -1664,17 +1681,15 @@ yyreduce:
switch (yyn)
{
case 3:
-
-/* Line 1455 of yacc.c */
-#line 145 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 144 "testpatterny.y"
{
}
break;
case 4:
-
-/* Line 1455 of yacc.c */
-#line 150 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 149 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>cmykspec\n");
@@ -1685,9 +1700,8 @@ yyreduce:
break;
case 5:
-
-/* Line 1455 of yacc.c */
-#line 160 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 159 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>kcmyspec\n");
@@ -1698,9 +1712,8 @@ yyreduce:
break;
case 6:
-
-/* Line 1455 of yacc.c */
-#line 170 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 169 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>rgbspec\n");
@@ -1711,9 +1724,8 @@ yyreduce:
break;
case 7:
-
-/* Line 1455 of yacc.c */
-#line 180 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 179 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>cmyspec\n");
@@ -1724,9 +1736,8 @@ yyreduce:
break;
case 8:
-
-/* Line 1455 of yacc.c */
-#line 190 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 189 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>grayspec\n");
@@ -1737,9 +1748,8 @@ yyreduce:
break;
case 9:
-
-/* Line 1455 of yacc.c */
-#line 200 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 199 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>whitespec\n");
@@ -1750,9 +1760,8 @@ yyreduce:
break;
case 10:
-
-/* Line 1455 of yacc.c */
-#line 210 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 209 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>extendedspec %d\n", (yyvsp[(2) - (2)].ival));
@@ -1763,9 +1772,8 @@ yyreduce:
break;
case 18:
-
-/* Line 1455 of yacc.c */
-#line 223 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 222 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>modespec2 %d\n", (yyvsp[(2) - (2)].ival));
@@ -1775,9 +1783,8 @@ yyreduce:
break;
case 22:
-
-/* Line 1455 of yacc.c */
-#line 237 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 236 "testpatterny.y"
{
int channel = find_color((yyvsp[(2) - (3)].sval));
if (getenv("STP_TESTPATTERN_DEBUG"))
@@ -1788,9 +1795,8 @@ yyreduce:
break;
case 23:
-
-/* Line 1455 of yacc.c */
-#line 247 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 246 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>channel_level %d %f\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval));
@@ -1800,9 +1806,8 @@ yyreduce:
break;
case 24:
-
-/* Line 1455 of yacc.c */
-#line 256 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 255 "testpatterny.y"
{
int channel = find_color((yyvsp[(2) - (3)].sval));
if (getenv("STP_TESTPATTERN_DEBUG"))
@@ -1813,9 +1818,8 @@ yyreduce:
break;
case 25:
-
-/* Line 1455 of yacc.c */
-#line 266 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 265 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>channel_gamma %d %f\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval));
@@ -1825,9 +1829,8 @@ yyreduce:
break;
case 26:
-
-/* Line 1455 of yacc.c */
-#line 275 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 274 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>global_gamma %f\n", (yyvsp[(2) - (2)].dval));
@@ -1836,9 +1839,8 @@ yyreduce:
break;
case 27:
-
-/* Line 1455 of yacc.c */
-#line 282 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 281 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>steps %d\n", (yyvsp[(2) - (2)].ival));
@@ -1847,9 +1849,8 @@ yyreduce:
break;
case 28:
-
-/* Line 1455 of yacc.c */
-#line 289 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 288 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>ink_limit %f\n", (yyvsp[(2) - (2)].dval));
@@ -1858,9 +1859,8 @@ yyreduce:
break;
case 29:
-
-/* Line 1455 of yacc.c */
-#line 296 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 295 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>printer %s\n", (yyvsp[(2) - (2)].sval));
@@ -1870,9 +1870,8 @@ yyreduce:
break;
case 30:
-
-/* Line 1455 of yacc.c */
-#line 305 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 304 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>page_size_name %s\n", (yyvsp[(2) - (2)].sval));
@@ -1882,9 +1881,8 @@ yyreduce:
break;
case 31:
-
-/* Line 1455 of yacc.c */
-#line 314 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 313 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>page_size_custom %d %d\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival));
@@ -1894,9 +1892,8 @@ yyreduce:
break;
case 34:
-
-/* Line 1455 of yacc.c */
-#line 326 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 325 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>parameter_string %s %s\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval));
@@ -1907,9 +1904,8 @@ yyreduce:
break;
case 35:
-
-/* Line 1455 of yacc.c */
-#line 336 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 335 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>parameter_int %s %d\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].ival));
@@ -1919,9 +1915,8 @@ yyreduce:
break;
case 36:
-
-/* Line 1455 of yacc.c */
-#line 345 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 344 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>parameter_bool %s %d\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].ival));
@@ -1931,9 +1926,8 @@ yyreduce:
break;
case 37:
-
-/* Line 1455 of yacc.c */
-#line 354 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 353 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>parameter_float %s %f\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].dval));
@@ -1943,9 +1937,8 @@ yyreduce:
break;
case 38:
-
-/* Line 1455 of yacc.c */
-#line 363 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 362 "testpatterny.y"
{
stp_curve_t *curve = stp_curve_create_from_string((yyvsp[(3) - (3)].sval));
if (getenv("STP_TESTPATTERN_DEBUG"))
@@ -1960,9 +1953,8 @@ yyreduce:
break;
case 44:
-
-/* Line 1455 of yacc.c */
-#line 379 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 378 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>density %f\n", (yyvsp[(2) - (2)].dval));
@@ -1971,9 +1963,8 @@ yyreduce:
break;
case 45:
-
-/* Line 1455 of yacc.c */
-#line 386 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 385 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>top %f\n", (yyvsp[(2) - (2)].dval));
@@ -1982,9 +1973,8 @@ yyreduce:
break;
case 46:
-
-/* Line 1455 of yacc.c */
-#line 393 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 392 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>left %f\n", (yyvsp[(2) - (2)].dval));
@@ -1993,9 +1983,8 @@ yyreduce:
break;
case 47:
-
-/* Line 1455 of yacc.c */
-#line 400 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 399 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>relative size\n");
@@ -2004,9 +1993,8 @@ yyreduce:
break;
case 48:
-
-/* Line 1455 of yacc.c */
-#line 407 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 406 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>size inches\n");
@@ -2015,9 +2003,8 @@ yyreduce:
break;
case 49:
-
-/* Line 1455 of yacc.c */
-#line 414 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 413 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>size pt\n");
@@ -2026,9 +2013,8 @@ yyreduce:
break;
case 50:
-
-/* Line 1455 of yacc.c */
-#line 421 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 420 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>size mm\n");
@@ -2037,9 +2023,8 @@ yyreduce:
break;
case 56:
-
-/* Line 1455 of yacc.c */
-#line 432 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 431 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>hsize %f\n", (yyvsp[(2) - (2)].dval));
@@ -2048,9 +2033,8 @@ yyreduce:
break;
case 57:
-
-/* Line 1455 of yacc.c */
-#line 439 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 438 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>vsize %f\n", (yyvsp[(2) - (2)].dval));
@@ -2059,9 +2043,8 @@ yyreduce:
break;
case 58:
-
-/* Line 1455 of yacc.c */
-#line 446 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 445 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>blackline %d\n", (yyvsp[(2) - (2)].ival));
@@ -2070,9 +2053,8 @@ yyreduce:
break;
case 59:
-
-/* Line 1455 of yacc.c */
-#line 454 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 453 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>noscale %d\n", (yyvsp[(2) - (2)].ival));
@@ -2081,9 +2063,8 @@ yyreduce:
break;
case 60:
-
-/* Line 1455 of yacc.c */
-#line 462 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 461 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>color_block1 %f %f %f (%d)\n", (yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].dval), (yyvsp[(3) - (3)].dval),
@@ -2099,9 +2080,8 @@ yyreduce:
break;
case 66:
-
-/* Line 1455 of yacc.c */
-#line 486 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 485 "testpatterny.y"
{
int channel = find_color((yyvsp[(1) - (4)].sval));
if (getenv("STP_TESTPATTERN_DEBUG"))
@@ -2116,9 +2096,8 @@ yyreduce:
break;
case 67:
-
-/* Line 1455 of yacc.c */
-#line 500 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 499 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>color_block2b %d %f %f %f\n", (yyvsp[(2) - (5)].ival), (yyvsp[(3) - (5)].dval), (yyvsp[(4) - (5)].dval), (yyvsp[(5) - (5)].dval));
@@ -2132,9 +2111,8 @@ yyreduce:
break;
case 76:
-
-/* Line 1455 of yacc.c */
-#line 525 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 524 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>patvars %f %f %f %f %f\n", (yyvsp[(1) - (5)].dval), (yyvsp[(2) - (5)].dval), (yyvsp[(3) - (5)].dval), (yyvsp[(4) - (5)].dval), (yyvsp[(5) - (5)].dval));
@@ -2150,9 +2128,8 @@ yyreduce:
break;
case 78:
-
-/* Line 1455 of yacc.c */
-#line 543 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 542 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>xpattern\n");
@@ -2168,9 +2145,8 @@ yyreduce:
break;
case 79:
-
-/* Line 1455 of yacc.c */
-#line 558 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 557 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>grid %d\n", (yyvsp[(2) - (2)].ival));
@@ -2182,9 +2158,8 @@ yyreduce:
break;
case 80:
-
-/* Line 1455 of yacc.c */
-#line 569 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 568 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>image %d %d\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival));
@@ -2202,9 +2177,8 @@ yyreduce:
break;
case 81:
-
-/* Line 1455 of yacc.c */
-#line 586 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 585 "testpatterny.y"
{
fprintf(stderr,"%s",(yyvsp[(1) - (1)].sval));
free((yyvsp[(1) - (1)].sval));
@@ -2212,9 +2186,8 @@ yyreduce:
break;
case 85:
-
-/* Line 1455 of yacc.c */
-#line 599 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 598 "testpatterny.y"
{
close_output();
if (global_output)
@@ -2225,71 +2198,73 @@ yyreduce:
break;
case 86:
-
-/* Line 1455 of yacc.c */
-#line 609 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 608 "testpatterny.y"
{
global_output = (yyvsp[(2) - (2)].sval);
}
break;
case 89:
-
-/* Line 1455 of yacc.c */
-#line 618 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 617 "testpatterny.y"
{ start_job = 1; }
break;
case 90:
-
-/* Line 1455 of yacc.c */
-#line 622 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 621 "testpatterny.y"
{ end_job = 1; }
break;
case 114:
-
-/* Line 1455 of yacc.c */
-#line 632 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 631 "testpatterny.y"
{ global_did_something = 1; }
break;
case 119:
-
-/* Line 1455 of yacc.c */
-#line 639 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 638 "testpatterny.y"
{ global_did_something = 1; }
break;
case 122:
-
-/* Line 1455 of yacc.c */
-#line 646 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 645 "testpatterny.y"
{ global_did_something = 1; }
break;
case 128:
-
-/* Line 1455 of yacc.c */
-#line 656 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 655 "testpatterny.y"
{ return 0; }
break;
case 129:
-
-/* Line 1455 of yacc.c */
-#line 660 "testpatterny.y"
+/* Line 1792 of yacc.c */
+#line 659 "testpatterny.y"
{
current_testpattern = get_next_testpattern();
}
break;
-
-/* Line 1455 of yacc.c */
-#line 2291 "testpatterny.c"
+/* Line 1792 of yacc.c */
+#line 2255 "testpatterny.c"
default: break;
}
+ /* User semantic actions sometimes alter yychar, and that requires
+ that yytoken be updated with the new translation. We take the
+ approach of translating immediately before every use of yytoken.
+ One alternative is translating here after every semantic action,
+ but that translation would be missed if the semantic action invokes
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
+ incorrect destructor might then be invoked immediately. In the
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
+ to an incorrect destructor call or verbose syntax error message
+ before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
@@ -2317,6 +2292,10 @@ yyreduce:
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
@@ -2324,37 +2303,36 @@ yyerrlab:
#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+ yyssp, yytoken)
{
- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
- {
- YYSIZE_T yyalloc = 2 * yysize;
- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
- yyalloc = YYSTACK_ALLOC_MAXIMUM;
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
- if (yymsg)
- yymsg_alloc = yyalloc;
- else
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- }
- }
-
- if (0 < yysize && yysize <= yymsg_alloc)
- {
- (void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (yymsg);
- }
- else
- {
- yyerror (YY_("syntax error"));
- if (yysize != 0)
- goto yyexhaustedlab;
- }
+ char const *yymsgp = YY_("syntax error");
+ int yysyntax_error_status;
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ if (yysyntax_error_status == 0)
+ yymsgp = yymsg;
+ else if (yysyntax_error_status == 1)
+ {
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ if (!yymsg)
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ yysyntax_error_status = 2;
+ }
+ else
+ {
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ yymsgp = yymsg;
+ }
+ }
+ yyerror (yymsgp);
+ if (yysyntax_error_status == 2)
+ goto yyexhaustedlab;
}
+# undef YYSYNTAX_ERROR
#endif
}
@@ -2413,7 +2391,7 @@ yyerrlab1:
for (;;)
{
yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
+ if (!yypact_value_is_default (yyn))
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2436,7 +2414,9 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp);
}
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
/* Shift the error token. */
@@ -2460,7 +2440,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -2472,8 +2452,13 @@ yyexhaustedlab:
yyreturn:
if (yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
+ {
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = YYTRANSLATE (yychar);
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval);
+ }
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
@@ -2497,8 +2482,6 @@ yyreturn:
}
-
-/* Line 1675 of yacc.c */
-#line 666 "testpatterny.y"
-
+/* Line 2055 of yacc.c */
+#line 665 "testpatterny.y"
diff --git a/src/testpattern/testpatterny.h b/src/testpattern/testpatterny.h
index 010e17a..deb113c 100644
--- a/src/testpattern/testpatterny.h
+++ b/src/testpattern/testpatterny.h
@@ -1,10 +1,8 @@
+/* A Bison parser, made by GNU Bison 2.7. */
-/* A Bison parser, made by GNU Bison 2.4.1. */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,6 +30,15 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
+#ifndef YY_YY_TESTPATTERNY_H_INCLUDED
+# define YY_YY_TESTPATTERNY_H_INCLUDED
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int yydebug;
+#endif
/* Tokens. */
#ifndef YYTOKENTYPE
@@ -137,7 +144,6 @@
-
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -146,4 +152,18 @@
extern YYSTYPE yylval;
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+#endif /* !YY_YY_TESTPATTERNY_H_INCLUDED */
diff --git a/src/testpattern/testpatterny.y b/src/testpattern/testpatterny.y
index 229109a..4f921e6 100644
--- a/src/testpattern/testpatterny.y
+++ b/src/testpattern/testpatterny.y
@@ -1,5 +1,4 @@
/*
- * "$Id: testpatterny.y,v 1.40 2010/09/06 17:08:39 rlk Exp $"
*
* Test pattern generator for Gimp-Print
*