diff options
author | Roger Leigh <rleigh@debian.org> | 2008-10-26 16:17:32 +0000 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2008-10-26 16:17:32 +0000 |
commit | cda0fb3b8a7cb56045b24fd0af0ed36591b5d7eb (patch) | |
tree | 31ef197ec5c98ac9ac08714a2440a787c065d8c7 /src/testpattern | |
parent | 92b02ddce00dec2787514568fa9d644d4f0350e9 (diff) |
Imported Upstream version 5.0.1
Diffstat (limited to 'src/testpattern')
-rw-r--r-- | src/testpattern/Makefile.in | 74 | ||||
-rw-r--r-- | src/testpattern/printer_options.c | 20 | ||||
-rw-r--r-- | src/testpattern/printers.c | 4 | ||||
-rw-r--r-- | src/testpattern/run-testpattern-2.in | 122 | ||||
-rw-r--r-- | src/testpattern/testpatterny.c | 1673 | ||||
-rw-r--r-- | src/testpattern/testpatterny.h | 33 | ||||
-rw-r--r-- | src/testpattern/testpatterny.y | 14 |
7 files changed, 1207 insertions, 733 deletions
diff --git a/src/testpattern/Makefile.in b/src/testpattern/Makefile.in index c5833f9..a58e6a2 100644 --- a/src/testpattern/Makefile.in +++ b/src/testpattern/Makefile.in @@ -52,11 +52,12 @@ subdir = src/testpattern ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(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/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/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.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 @@ -78,8 +79,8 @@ testpattern_OBJECTS = $(am_testpattern_OBJECTS) testpattern_DEPENDENCIES = $(am__DEPENDENCIES_1) SCRIPTS = $(noinst_SCRIPTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -109,13 +110,18 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkgdatadir = $(datadir)/$(PACKAGE)/samples ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -141,6 +147,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -148,6 +156,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -160,12 +169,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -200,6 +211,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -295,14 +307,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -319,6 +334,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -336,17 +354,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -376,9 +398,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/testpattern/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/testpattern/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/testpattern/Makefile + $(AUTOMAKE) --gnu src/testpattern/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -454,14 +476,32 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printer_options.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printers.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpattern.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpatternl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpatterny.Po@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .l.c: $(LEXCOMPILE) $< @@ -707,6 +747,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -732,6 +773,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/testpattern/printer_options.c b/src/testpattern/printer_options.c index 388e920..444e4b5 100644 --- a/src/testpattern/printer_options.c +++ b/src/testpattern/printer_options.c @@ -1,7 +1,7 @@ /* - * "$Id: printer_options.c,v 1.2 2006/05/28 16:59:05 rlk Exp $" + * "$Id: printer_options.c,v 1.2.8.2 2007/03/04 23:57:48 tillkamppeter Exp $" * - * Dump the per-printer options for Grant Taylor's *-omatic database + * Dump the per-printer options for the OpenPrinting database * * Copyright 2000 Robert Krawitz (rlk@alum.mit.edu) * @@ -32,11 +32,23 @@ int main(int argc, char **argv) { int i, j, k; + int first_arg = 1; + stp_string_list_t *printer_list = NULL; stp_parameter_level_t max_level = STP_PARAMETER_LEVEL_ADVANCED4; if (argc > 1 && !strcmp(argv[1], "-s")) - max_level = STP_PARAMETER_LEVEL_BASIC; + { + max_level = STP_PARAMETER_LEVEL_BASIC; + first_arg++; + } stp_init(); + + if (argc > first_arg) + { + printer_list = stp_string_list_create(); + for (i = 1; i < argc; i++) + stp_string_list_add_string(printer_list, argv[i], argv[i]); + } for (i = 0; i < stp_printer_model_count(); i++) { stp_parameter_list_t params; @@ -51,6 +63,8 @@ main(int argc, char **argv) int printer_is_color = 0; if (strcmp(family, "ps") == 0 || strcmp(family, "raw") == 0) continue; + if (printer_list && !stp_string_list_is_present(printer_list, driver)) + continue; /* Set Job Mode to "Job" as this enables the Duplex option */ stp_set_string_parameter(pv, "JobMode", "Job"); diff --git a/src/testpattern/printers.c b/src/testpattern/printers.c index d9c5286..21ffd1e 100644 --- a/src/testpattern/printers.c +++ b/src/testpattern/printers.c @@ -1,7 +1,7 @@ /* - * "$Id: printers.c,v 1.6 2004/09/17 18:38:27 rleigh Exp $" + * "$Id: printers.c,v 1.6.18.1 2007/03/04 23:57:49 tillkamppeter Exp $" * - * Dump the per-printer options for Grant Taylor's *-omatic database + * Dump the per-printer options for the OpenPrinting database * * Copyright 2000 Robert Krawitz (rlk@alum.mit.edu) * diff --git a/src/testpattern/run-testpattern-2.in b/src/testpattern/run-testpattern-2.in index daba8db..9f0fd5c 100644 --- a/src/testpattern/run-testpattern-2.in +++ b/src/testpattern/run-testpattern-2.in @@ -8,9 +8,14 @@ use strict; my $valgrind = 0; my $cachegrind = 0; my $gdb_attach = 0; +my $calc_md5 = 0; my $dontrun = 0; my $retval = 0; +my $testpattern_command; my @printer_list = (); +my @special_options = (); +my @standard_options = qw(InkType); +my $global_status = 1; my @extras = (); my @messages = (); @@ -24,7 +29,13 @@ GetOptions("v+" => \$valgrind, "c" => \$cachegrind, "g" => \$gdb_attach, "n" => \$dontrun, - "s!" => \$skip_duplicate_printers); + "s!" => \$skip_duplicate_printers, + "o=s" => \@special_options, + "m" => \$calc_md5); + +if (! @special_options) { + @special_options = @standard_options; +} my $pwd = `pwd`; chomp $pwd; @@ -110,15 +121,10 @@ EOF return $stuff; } -open PIPE, "./printer_options|" or die "Cannot run printer_options: $!\n"; -while(<PIPE>) { - next if m!^#!; - eval $_; -} -close PIPE or die "Cannot run printer_options: $!\n"; - +my $extra_arg = ""; if ($#ARGV >= 0) { @printer_list = @ARGV; + $extra_arg = join " ", @printer_list; } else { open PIPE, "./printers|" or die "Cannot run printers: $!\n"; while(<PIPE>) { @@ -129,24 +135,55 @@ if ($#ARGV >= 0) { close PIPE; } -sub do_printer($$) { +open PIPE, "./printer_options $extra_arg|" or die "Cannot run printer_options: $!\n"; +while(<PIPE>) { + next if m!^#!; + eval $_; +} +close PIPE or die "Cannot run printer_options: $!\n"; + +sub do_print { + my ($output, $fh) = @_; + if ($dontrun) { + print $output; + } elsif ($calc_md5) { + open TESTPATTERN, "|$testpattern_command" or + die "Can't run $testpattern_command: $!\n"; + print TESTPATTERN $output; + my $status = close TESTPATTERN; + if (! $status) { + $global_status = 0; + } + } else { + print $fh $output; + } +} + + +sub do_printer { my ($printer, $fh) = @_; - my $tmp = $stpdata{$printer}{'Resolution'}; + my $tmp; my $min_res_name; my $min_res_value = 0; my $first_time = 1; my $model_id = $models{$printer}; my $family_id = $families{$printer}; + my $key; + my %opt_vals = {}; if ($skip_duplicate_printers && $models_found{$family_id}{$model_id}) { return; } else { $models_found{$family_id}{$model_id} = 1; } + $tmp = $stpdata{$printer}{'Resolution'}; my (@resolutions) = grep {$_ ne 'None' } keys %$tmp; $tmp = $stpdata{$printer}{'PrintingMode'}; my (@printing_modes) = grep {$_ ne 'None' } keys %$tmp; - $tmp = $stpdata{$printer}{'InkType'}; - my (@ink_types) = grep {$_ ne 'None' } keys %$tmp; + foreach $key (@special_options) { + $tmp = $stpdata{$printer}{$key}; + my (@tmp) = grep {$_ ne 'None' } keys %$tmp; + $opt_vals{$key} = \@tmp; + } foreach $tmp (sort @resolutions) { my $res_value = ($stpdata{$printer}{'x_resolution'}{$tmp} * $stpdata{$printer}{'y_resolution'}{$tmp}); @@ -159,7 +196,7 @@ sub do_printer($$) { # We don't need to do both resolutions and ink types. my $pmode; foreach $pmode (@printing_modes) { - my ($resolution, $ink_type); + my ($resolution); foreach $resolution (@resolutions) { @extras = (); @messages = (); @@ -173,24 +210,29 @@ sub do_printer($$) { set_opt("ColorCorrection", "Raw"); set_message(" ${pmode}+${resolution}"); my $output = print_one_testpattern($printer); - print $fh $output; + do_print( $output, $fh ); } - if ($#ink_types >= 1) { - foreach $ink_type (@ink_types) { - @extras = (); - @messages = (); - if ($first_time) { - set_message("$printer\n"); - $first_time = 0; + foreach $key (@special_options) { + $tmp = $opt_vals{$key}; + my (@opts) = @$tmp; + if ($#opts >= 1) { + my $opt; + foreach $opt (@opts) { + @extras = (); + @messages = (); + if ($first_time) { + set_message("$printer\n"); + $first_time = 0; + } + set_opt("PrintingMode", $pmode); + set_opt("Resolution", $min_res_name); + set_opt($key, $opt); + set_opt("DitherAlgorithm", "Fast"); + set_opt("ColorCorrection", "Raw"); + set_message(" ${key}=${opt}+${pmode}+${min_res_name}"); + my $output = print_one_testpattern($printer); + do_print( $output, $fh ); } - set_opt("PrintingMode", $pmode); - set_opt("Resolution", $min_res_name); - set_opt("InkType", $ink_type); - set_opt("DitherAlgorithm", "Fast"); - set_opt("ColorCorrection", "Raw"); - set_message(" ${ink_type}+${pmode}+${min_res_name}"); - my $output = print_one_testpattern($printer); - print $fh $output; } } } @@ -200,7 +242,6 @@ if ($dontrun) { map { do_printer($_, \*STDOUT) } @printer_list; exit 0; } else { - my $testpattern_command; my $valgrind_command; my $valopts; if ($cachegrind) { @@ -215,19 +256,26 @@ if ($dontrun) { if ($valgrind == 1) { $valgrind_command = "valgrind $valopts -q --num-callers=100 --error-limit=no --leak-check=yes"; } elsif ($valgrind == 2) { - $valgrind_command = "valgrind $valopts --num-callers=100 --error-limit=no --show-reachable=yes --leak-resolution=high --leak-check=yes"; + $valgrind_command = "valgrind $valopts --num-callers=100 --error-limit=no --leak-resolution=high --leak-check=yes"; } elsif ($valgrind == 3) { $valgrind_command = "valgrind $valopts --error-limit=no --num-callers=100 --show-reachable=yes --leak-resolution=high --leak-check=yes"; } elsif ($valgrind == 4) { $valgrind_command = "valgrind $valopts"; } - $testpattern_command = "$valgrind_command ./testpattern -n"; - - open TESTPATTERN, "|$testpattern_command" or - die "Can't run $testpattern_command: $!\n"; - map { do_printer($_, \*TESTPATTERN) } @printer_list; - my $status = close TESTPATTERN; + my $status = 1; + if ($calc_md5) { + $testpattern_command = "./testpattern > out.prn; a=\$? ; md5sum out.prn; exit \$a"; + map { do_printer($_) } @printer_list; + $status = $global_status; + } else { + $testpattern_command = "$valgrind_command ./testpattern -n"; + open TESTPATTERN, "|$testpattern_command" or + die "Can't run $testpattern_command: $!\n"; + $testpattern_command = "$valgrind_command ./testpattern -n"; + map { do_printer($_, \*TESTPATTERN) } @printer_list; + $status = close TESTPATTERN; + } if ($status) { exit 0; } else { diff --git a/src/testpattern/testpatterny.c b/src/testpattern/testpatterny.c index ede6285..25a082c 100644 --- a/src/testpattern/testpatterny.c +++ b/src/testpattern/testpatterny.c @@ -1,7 +1,9 @@ -/* A Bison parser, made by GNU Bison 1.875. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 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 @@ -15,16 +17,24 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -36,6 +46,9 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.3" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -99,6 +112,7 @@ END = 301 }; #endif +/* Tokens. */ #define tINT 258 #define tDOUBLE 259 #define tSTRING 260 @@ -228,7 +242,12 @@ find_color(const char *name) # define YYERROR_VERBOSE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -240,49 +259,171 @@ typedef int YYSTYPE; /* Copy the second part of user declarations. */ -/* Line 214 of yacc.c. */ -#line 244 "testpatterny.c" +/* Line 216 of yacc.c. */ +#line 264 "testpatterny.c" -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifdef short +# undef short +#endif -/* The parser invokes alloca or malloc; define the necessary symbols. */ +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t # else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca # else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (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 +# endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif # else -# if defined (__STDC__) || defined (__cplusplus) +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (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__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif # endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free # endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; + yytype_int16 yyss; YYSTYPE yyvs; }; @@ -292,24 +433,24 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((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 1 < __GNUC__ +# if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif @@ -327,39 +468,33 @@ union yyalloc yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (0) + while (YYID (0)) #endif -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 52 +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 54 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 131 +#define YYLAST 134 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 47 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 65 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 115 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 170 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 66 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 117 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 174 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 301 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = +static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -397,26 +532,26 @@ static const unsigned char yytranslate[] = #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned short yyprhs[] = +static const yytype_uint16 yyprhs[] = { 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, 19, 22, 25, 28, 31, 34, 37, 41, 43, 45, 47, 49, 51, 53, 55, 58, 62, 66, 70, 74, 77, 80, 83, 86, 89, 93, 95, 97, 101, 105, - 109, 111, 113, 115, 118, 121, 124, 127, 130, 133, - 137, 139, 142, 143, 145, 148, 153, 159, 161, 163, - 165, 168, 169, 171, 173, 175, 181, 185, 188, 191, - 195, 198, 202, 207, 213, 220, 222, 224, 226, 228, - 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, - 250, 252, 254, 256, 258, 260, 262, 264, 266, 268, - 271, 273, 275, 277, 279, 282, 283, 286, 288, 289, - 292, 294, 296, 297, 300, 301 + 109, 113, 115, 117, 119, 121, 124, 127, 130, 133, + 136, 139, 143, 145, 148, 149, 151, 154, 159, 165, + 167, 169, 171, 174, 175, 177, 179, 181, 187, 191, + 194, 197, 201, 204, 208, 213, 219, 226, 228, 230, + 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, + 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, + 272, 274, 277, 279, 281, 283, 285, 288, 289, 292, + 294, 295, 298, 300, 302, 303, 306, 307 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = { - 110, 0, -1, 6, -1, 7, -1, 8, -1, 9, + 111, 0, -1, 6, -1, 7, -1, 8, -1, 9, -1, 10, -1, 11, -1, 12, -1, 13, -1, 36, 3, -1, 37, 3, -1, 38, 3, -1, 39, 3, -1, 40, 3, -1, 41, 3, -1, 31, 3, 3, @@ -426,71 +561,72 @@ static const yysigned_char yyrhs[] = 14, 3, 4, -1, 14, 4, -1, 16, 3, -1, 17, 4, -1, 18, 5, -1, 44, 5, -1, 44, 3, 3, -1, 66, -1, 67, -1, 19, 5, 5, - -1, 20, 5, 3, -1, 21, 5, 4, -1, 69, - -1, 70, -1, 71, -1, 23, 4, -1, 24, 4, - -1, 25, 4, -1, 26, 4, -1, 27, 4, -1, - 28, 3, -1, 4, 4, 4, -1, 79, -1, 80, - 79, -1, -1, 80, -1, 79, 81, -1, 48, 4, - 4, 4, -1, 35, 3, 4, 4, 4, -1, 83, - -1, 84, -1, 85, -1, 86, 85, -1, -1, 86, - -1, 82, -1, 87, -1, 4, 4, 4, 4, 4, - -1, 29, 89, 88, -1, 30, 88, -1, 33, 3, - -1, 32, 3, 3, -1, 45, 5, -1, 45, 5, - 5, -1, 45, 5, 5, 5, -1, 45, 5, 5, - 5, 5, -1, 45, 5, 5, 5, 5, 5, -1, - 94, -1, 95, -1, 96, -1, 97, -1, 98, -1, - 99, -1, 60, -1, 61, -1, 58, -1, 59, -1, - 62, -1, 63, -1, 64, -1, 65, -1, 72, -1, - 73, -1, 74, -1, 75, -1, 76, -1, 77, -1, - 78, -1, 57, -1, 68, -1, 100, -1, 101, 34, - -1, 90, -1, 91, -1, 92, -1, 100, -1, 103, - 34, -1, -1, 105, 104, -1, 93, -1, -1, 107, - 102, -1, 105, -1, 106, -1, -1, 46, 34, -1, - -1, 107, 111, 108, 109, -1 + -1, 20, 5, 3, -1, 21, 5, 4, -1, 22, + 5, 5, -1, 69, -1, 70, -1, 71, -1, 72, + -1, 23, 4, -1, 24, 4, -1, 25, 4, -1, + 26, 4, -1, 27, 4, -1, 28, 3, -1, 4, + 4, 4, -1, 80, -1, 81, 80, -1, -1, 81, + -1, 80, 82, -1, 48, 4, 4, 4, -1, 35, + 3, 4, 4, 4, -1, 84, -1, 85, -1, 86, + -1, 87, 86, -1, -1, 87, -1, 83, -1, 88, + -1, 4, 4, 4, 4, 4, -1, 29, 90, 89, + -1, 30, 89, -1, 33, 3, -1, 32, 3, 3, + -1, 45, 5, -1, 45, 5, 5, -1, 45, 5, + 5, 5, -1, 45, 5, 5, 5, 5, -1, 45, + 5, 5, 5, 5, 5, -1, 95, -1, 96, -1, + 97, -1, 98, -1, 99, -1, 100, -1, 60, -1, + 61, -1, 58, -1, 59, -1, 62, -1, 63, -1, + 64, -1, 65, -1, 73, -1, 74, -1, 75, -1, + 76, -1, 77, -1, 78, -1, 79, -1, 57, -1, + 68, -1, 101, -1, 102, 34, -1, 91, -1, 92, + -1, 93, -1, 101, -1, 104, 34, -1, -1, 106, + 105, -1, 94, -1, -1, 108, 103, -1, 106, -1, + 107, -1, -1, 46, 34, -1, -1, 108, 112, 109, + 110, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = +static const yytype_uint16 yyrline[] = { 0, 139, 139, 139, 139, 139, 140, 140, 140, 140, 143, 155, 167, 179, 191, 203, 215, 227, 227, 227, 227, 227, 227, 227, 230, 233, 243, 252, 262, 271, 278, 285, 292, 301, 310, 319, 319, 322, 332, 341, - 364, 364, 364, 366, 373, 380, 387, 394, 401, 409, - 424, 424, 427, 427, 430, 433, 447, 460, 460, 463, - 463, 466, 466, 469, 469, 472, 487, 490, 505, 516, - 533, 539, 546, 554, 563, 574, 574, 574, 574, 574, - 577, 580, 580, 580, 580, 580, 580, 581, 581, 581, - 581, 581, 581, 581, 582, 582, 582, 582, 582, 585, - 589, 589, 589, 589, 592, 596, 596, 599, 603, 603, - 606, 606, 609, 609, 614, 613 + 350, 364, 364, 364, 364, 366, 373, 380, 387, 394, + 401, 409, 424, 424, 427, 427, 430, 433, 447, 460, + 460, 463, 463, 466, 466, 469, 469, 472, 487, 490, + 505, 516, 533, 539, 546, 554, 563, 574, 574, 574, + 574, 574, 577, 580, 580, 580, 580, 580, 580, 581, + 581, 581, 581, 581, 581, 581, 582, 582, 582, 582, + 582, 585, 589, 589, 589, 589, 592, 596, 596, 599, + 603, 603, 606, 606, 609, 609, 614, 613 }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "tINT", "tDOUBLE", "tSTRING", "CYAN", - "L_CYAN", "MAGENTA", "L_MAGENTA", "YELLOW", "D_YELLOW", "BLACK", - "L_BLACK", "GAMMA", "LEVEL", "STEPS", "INK_LIMIT", "PRINTER", - "PARAMETER", "PARAMETER_INT", "PARAMETER_FLOAT", "PARAMETER_CURVE", - "DENSITY", "TOP", "LEFT", "HSIZE", "VSIZE", "BLACKLINE", "PATTERN", - "XPATTERN", "EXTENDED", "IMAGE", "GRID", "SEMI", "CHANNEL", "CMYK", - "KCMY", "RGB", "CMY", "GRAY", "WHITE", "RAW", "MODE", "PAGESIZE", - "MESSAGE", "END", "$accept", "COLOR", "cmykspec", "kcmyspec", "rgbspec", - "cmyspec", "grayspec", "whitespec", "extendedspec", "modespec", - "inputspec", "level", "channel_level", "gamma", "channel_gamma", - "global_gamma", "steps", "ink_limit", "printer", "page_size_name", - "page_size_custom", "page_size", "parameter_string", "parameter_int", - "parameter_float", "parameter", "density", "top", "left", "hsize", - "vsize", "blackline", "color_block1", "color_blocks1a", - "color_blocks1b", "color_blocks1", "color_block2a", "color_block2b", - "color_block2", "color_blocks2a", "color_blocks2", "color_blocks", - "patvars", "pattern", "xpattern", "grid", "image", "Message0", - "Message1", "Message2", "Message3", "Message4", "A_Message", "message", - "A_Rule", "Rule", "A_Pattern", "Pattern", "Patterns", "Image", "Rules", + "$end", "error", "$undefined", "tINT", "tDOUBLE", "tSTRING", "CYAN", + "L_CYAN", "MAGENTA", "L_MAGENTA", "YELLOW", "D_YELLOW", "BLACK", + "L_BLACK", "GAMMA", "LEVEL", "STEPS", "INK_LIMIT", "PRINTER", + "PARAMETER", "PARAMETER_INT", "PARAMETER_FLOAT", "PARAMETER_CURVE", + "DENSITY", "TOP", "LEFT", "HSIZE", "VSIZE", "BLACKLINE", "PATTERN", + "XPATTERN", "EXTENDED", "IMAGE", "GRID", "SEMI", "CHANNEL", "CMYK", + "KCMY", "RGB", "CMY", "GRAY", "WHITE", "RAW", "MODE", "PAGESIZE", + "MESSAGE", "END", "$accept", "COLOR", "cmykspec", "kcmyspec", "rgbspec", + "cmyspec", "grayspec", "whitespec", "extendedspec", "modespec", + "inputspec", "level", "channel_level", "gamma", "channel_gamma", + "global_gamma", "steps", "ink_limit", "printer", "page_size_name", + "page_size_custom", "page_size", "parameter_string", "parameter_int", + "parameter_float", "parameter_curve", "parameter", "density", "top", + "left", "hsize", "vsize", "blackline", "color_block1", "color_blocks1a", + "color_blocks1b", "color_blocks1", "color_block2a", "color_block2b", + "color_block2", "color_blocks2a", "color_blocks2", "color_blocks", + "patvars", "pattern", "xpattern", "grid", "image", "Message0", + "Message1", "Message2", "Message3", "Message4", "A_Message", "message", + "A_Rule", "Rule", "A_Pattern", "Pattern", "Patterns", "Image", "Rules", "Output", "EOF", "Thing", "@1", 0 }; #endif @@ -498,7 +634,7 @@ static const char *const yytname[] = # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = +static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -509,109 +645,111 @@ static const unsigned short yytoknum[] = # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = +static const yytype_uint8 yyr1[] = { 0, 47, 48, 48, 48, 48, 48, 48, 48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 56, 56, 56, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 68, 69, 70, 71, - 72, 72, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 80, 81, 81, 82, 83, 84, 85, 85, 86, - 86, 87, 87, 88, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 99, 99, 99, 99, - 100, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 102, - 103, 103, 103, 103, 104, 105, 105, 106, 107, 107, - 108, 108, 109, 109, 111, 110 + 72, 73, 73, 73, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 81, 82, 82, 83, 84, 85, 86, + 86, 87, 87, 88, 88, 89, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 100, 100, + 100, 100, 101, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 103, 104, 104, 104, 104, 105, 106, 106, 107, + 108, 108, 109, 109, 110, 110, 112, 111 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = +static const yytype_uint8 yyr2[] = { 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 3, 1, 1, 3, 3, 3, - 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, - 1, 2, 0, 1, 2, 4, 5, 1, 1, 1, - 2, 0, 1, 1, 1, 5, 3, 2, 2, 3, - 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, + 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, + 2, 3, 1, 2, 0, 1, 2, 4, 5, 1, + 1, 1, 2, 0, 1, 1, 1, 5, 3, 2, + 2, 3, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 2, 0, 2, 1, 0, 2, - 1, 1, 0, 2, 0, 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 1, 2, 0, 2, 1, + 0, 2, 1, 1, 0, 2, 0, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned char yydefact[] = +static const yytype_uint8 yydefact[] = { - 108, 114, 0, 0, 0, 0, 0, 0, 0, 0, + 110, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 96, 83, 84, 81, 82, 85, 86, 87, 88, 35, - 36, 97, 40, 41, 42, 89, 90, 91, 92, 93, - 94, 95, 75, 76, 77, 78, 79, 80, 98, 0, - 109, 105, 1, 0, 29, 2, 3, 4, 5, 6, - 7, 8, 9, 0, 0, 0, 30, 31, 32, 0, - 0, 0, 43, 44, 45, 46, 47, 48, 0, 0, - 0, 0, 0, 0, 0, 17, 18, 19, 20, 21, - 22, 23, 24, 0, 33, 70, 99, 0, 107, 110, - 111, 112, 28, 27, 26, 25, 37, 38, 39, 0, - 10, 11, 12, 13, 14, 15, 34, 71, 0, 0, - 61, 0, 100, 101, 102, 103, 0, 106, 0, 115, - 16, 72, 69, 0, 61, 0, 0, 0, 52, 63, - 57, 58, 59, 62, 64, 67, 68, 104, 113, 73, - 0, 66, 0, 0, 0, 50, 53, 54, 60, 74, - 0, 49, 0, 0, 51, 0, 0, 55, 65, 56 + 0, 98, 85, 86, 83, 84, 87, 88, 89, 90, + 35, 36, 99, 41, 42, 43, 44, 91, 92, 93, + 94, 95, 96, 97, 77, 78, 79, 80, 81, 82, + 100, 0, 111, 107, 1, 0, 29, 2, 3, 4, + 5, 6, 7, 8, 9, 0, 0, 0, 30, 31, + 32, 0, 0, 0, 0, 45, 46, 47, 48, 49, + 50, 0, 0, 0, 0, 0, 0, 0, 17, 18, + 19, 20, 21, 22, 23, 24, 0, 33, 72, 101, + 0, 109, 112, 113, 114, 28, 27, 26, 25, 37, + 38, 39, 40, 0, 10, 11, 12, 13, 14, 15, + 34, 73, 0, 0, 63, 0, 102, 103, 104, 105, + 0, 108, 0, 117, 16, 74, 71, 0, 63, 0, + 0, 0, 54, 65, 59, 60, 61, 64, 66, 69, + 70, 106, 115, 75, 0, 68, 0, 0, 0, 52, + 55, 56, 62, 76, 0, 51, 0, 0, 53, 0, + 0, 57, 67, 58 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { - -1, 137, 85, 86, 87, 88, 89, 90, 91, 92, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 138, 156, 157, 139, 140, 141, 142, 143, - 144, 145, 134, 122, 123, 124, 98, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 126, 127, 99, 100, - 1, 101, 129, 2, 51 + -1, 141, 88, 89, 90, 91, 92, 93, 94, 95, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 142, 160, 161, 143, 144, 145, 146, + 147, 148, 149, 138, 126, 127, 128, 101, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 130, 131, 102, + 103, 1, 104, 133, 2, 53 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -131 -static const short yypact[] = +#define YYPACT_NINF -118 +static const yytype_int16 yypact[] = { - -131, -14, 16, 56, 41, 25, 36, 38, 53, 66, - 67, 69, 70, 77, 78, 79, 81, 39, 22, 80, - -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, -131, -131, -131, -131, -131, -131, 54, - -131, 55, -131, 82, -131, -131, -131, -131, -131, -131, - -131, -131, -131, 85, 86, 87, -131, -131, -131, 88, - 89, 90, -131, -131, -131, -131, -131, -131, 92, 93, - 94, 95, 96, 97, 98, -131, -131, -131, -131, -131, - -131, -131, -131, 99, -131, 100, -131, 101, -131, 12, - -131, 57, -131, -131, -131, -131, -131, -131, -131, 103, - -131, -131, -131, -131, -131, -131, -131, 102, 105, 106, - 11, 108, -131, -131, -131, -131, 75, -131, 83, -131, - -131, 107, -131, 109, 11, 110, 112, 114, 115, -131, - -131, -131, -131, 26, -131, -131, -131, -131, -131, 111, - 116, -131, 117, 118, 119, -131, 115, -131, -131, -131, - 120, -131, 121, 122, -131, 123, 124, -131, -131, -131 + -118, -14, 16, 56, 41, 24, 36, 53, 66, 67, + 68, 69, 77, 78, 79, 80, 81, 83, 39, 23, + 82, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, 54, -118, 57, -118, 86, -118, -118, -118, -118, + -118, -118, -118, -118, -118, 87, 88, 89, -118, -118, + -118, 90, 91, 92, 93, -118, -118, -118, -118, -118, + -118, 94, 96, 97, 98, 99, 100, 101, -118, -118, + -118, -118, -118, -118, -118, -118, 102, -118, 103, -118, + 104, -118, 12, -118, 60, -118, -118, -118, -118, -118, + -118, -118, -118, 106, -118, -118, -118, -118, -118, -118, + -118, 105, 108, 109, 11, 111, -118, -118, -118, -118, + 84, -118, 85, -118, -118, 107, -118, 112, 11, 113, + 117, 118, 119, -118, -118, -118, -118, 26, -118, -118, + -118, -118, -118, 110, 120, -118, 121, 122, 123, -118, + 119, -118, -118, -118, 124, -118, 125, 126, -118, 127, + 128, -118, -118, -118 }; /* YYPGOTO[NTERM-NUM]. */ -static const short yypgoto[] = +static const yytype_int8 yypgoto[] = { - -131, 52, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -130, -131, -131, -131, -131, -131, -13, -131, - -131, -5, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, 32, -131, -131, -131, -131, -131, -131, - -131, -131, -131, -131, -131 + -118, 52, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -117, -118, -118, -118, -118, -118, -26, + -118, -118, -5, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, 32, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -619,81 +757,66 @@ static const short yypgoto[] = number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 -static const unsigned char yytable[] = +static const yytype_uint8 yytable[] = { - 3, 4, 5, 6, 7, 8, 9, 10, 155, 11, - 12, 13, 14, 15, 16, 135, 52, 55, 56, 57, - 58, 59, 60, 61, 62, 93, 164, 94, 66, 17, - 18, 19, 55, 56, 57, 58, 59, 60, 61, 62, - 67, 119, 120, 68, 64, 121, 136, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 65, 19, 69, 53, - 54, 136, 55, 56, 57, 58, 59, 60, 61, 62, - 78, 70, 71, 72, 73, 79, 80, 81, 82, 83, - 84, 74, 75, 76, 77, 95, 102, 97, 96, 103, - 104, 105, 107, 106, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 128, 118, 117, 130, 131, 132, 147, - 133, 146, 149, 150, 152, 153, 159, 148, 154, 135, - 160, 161, 162, 163, 165, 166, 167, 168, 169, 151, - 158, 125 + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 139, 54, 57, 58, 59, + 60, 61, 62, 63, 64, 159, 96, 68, 97, 18, + 19, 20, 57, 58, 59, 60, 61, 62, 63, 64, + 69, 123, 124, 168, 66, 125, 140, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 67, 20, 70, 55, + 56, 140, 57, 58, 59, 60, 61, 62, 63, 64, + 81, 71, 72, 73, 74, 82, 83, 84, 85, 86, + 87, 75, 76, 77, 78, 79, 80, 98, 99, 100, + 105, 106, 107, 108, 110, 109, 111, 113, 112, 114, + 115, 116, 117, 118, 119, 120, 132, 122, 121, 134, + 135, 136, 153, 137, 150, 163, 154, 156, 151, 152, + 157, 162, 158, 139, 164, 165, 166, 167, 169, 170, + 171, 172, 173, 155, 129 }; -static const unsigned char yycheck[] = +static const yytype_uint8 yycheck[] = { - 14, 15, 16, 17, 18, 19, 20, 21, 138, 23, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 4, 0, 6, 7, 8, - 9, 10, 11, 12, 13, 3, 156, 5, 3, 43, + 9, 10, 11, 12, 13, 142, 3, 3, 5, 43, 44, 45, 6, 7, 8, 9, 10, 11, 12, 13, - 4, 29, 30, 5, 3, 33, 35, 6, 7, 8, + 4, 29, 30, 160, 3, 33, 35, 6, 7, 8, 9, 10, 11, 12, 13, 3, 4, 45, 5, 3, 4, 35, 6, 7, 8, 9, 10, 11, 12, 13, - 31, 5, 5, 4, 4, 36, 37, 38, 39, 40, - 41, 4, 4, 4, 3, 5, 4, 32, 34, 4, - 4, 4, 3, 5, 4, 3, 3, 3, 3, 3, - 3, 3, 3, 46, 3, 5, 3, 5, 3, 34, - 4, 3, 5, 4, 4, 3, 5, 34, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 134, - 143, 99 + 31, 5, 5, 5, 5, 36, 37, 38, 39, 40, + 41, 4, 4, 4, 4, 4, 3, 5, 34, 32, + 4, 4, 4, 4, 3, 5, 4, 3, 5, 3, + 3, 3, 3, 3, 3, 3, 46, 3, 5, 3, + 5, 3, 5, 4, 3, 5, 4, 4, 34, 34, + 3, 147, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 138, 102 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned char yystos[] = +static const yytype_uint8 yystos[] = { - 0, 107, 110, 14, 15, 16, 17, 18, 19, 20, - 21, 23, 24, 25, 26, 27, 28, 43, 44, 45, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 111, 0, 3, 4, 6, 7, 8, 9, 10, - 11, 12, 13, 48, 3, 48, 3, 4, 5, 5, - 5, 5, 4, 4, 4, 4, 4, 3, 31, 36, - 37, 38, 39, 40, 41, 49, 50, 51, 52, 53, - 54, 55, 56, 3, 5, 5, 34, 32, 93, 105, - 106, 108, 4, 4, 4, 4, 5, 3, 4, 3, - 3, 3, 3, 3, 3, 3, 3, 5, 3, 29, - 30, 33, 90, 91, 92, 100, 103, 104, 46, 109, - 3, 5, 3, 4, 89, 4, 35, 48, 79, 82, - 83, 84, 85, 86, 87, 88, 3, 34, 34, 5, - 4, 88, 4, 3, 4, 79, 80, 81, 85, 5, - 4, 4, 4, 4, 79, 4, 4, 4, 4, 4 + 0, 108, 111, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 43, 44, + 45, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 112, 0, 3, 4, 6, 7, 8, + 9, 10, 11, 12, 13, 48, 3, 48, 3, 4, + 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, + 3, 31, 36, 37, 38, 39, 40, 41, 49, 50, + 51, 52, 53, 54, 55, 56, 3, 5, 5, 34, + 32, 94, 106, 107, 109, 4, 4, 4, 4, 5, + 3, 4, 5, 3, 3, 3, 3, 3, 3, 3, + 3, 5, 3, 29, 30, 33, 91, 92, 93, 101, + 104, 105, 46, 110, 3, 5, 3, 4, 90, 4, + 35, 48, 80, 83, 84, 85, 86, 87, 88, 89, + 3, 34, 34, 5, 4, 89, 4, 3, 4, 80, + 81, 82, 86, 5, 4, 4, 4, 4, 80, 4, + 4, 4, 4, 4 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -701,7 +824,8 @@ static const unsigned char yystos[] = #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 +#define YYERROR goto yyerrorlab + /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. @@ -718,30 +842,63 @@ do \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ + { \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (0) +while (YYID (0)) + #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ +/* 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) \ - Current.first_line = Rhs[1].first_line; \ - Current.first_column = Rhs[1].first_column; \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; +# 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. */ + +#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 +#endif + + /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM @@ -762,42 +919,96 @@ while (0) do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (0) +} while (YYID (0)) -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) -# define YYDSYMPRINTF(Title, Token, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (cinluded). | +| TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (short *bottom, short *top) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) - short *bottom; - short *top; + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) + for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -806,45 +1017,52 @@ yy_stack_print (bottom, top) do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (0) +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyrule) +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; int yyrule; #endif { + int yynrhs = yyr2[yyrule]; int yyi; - unsigned int yylineno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylineno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -859,13 +1077,9 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif @@ -875,45 +1089,47 @@ int yydebug; #if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -# else +#else +static YYSIZE_T yystrlen (yystr) - const char *yystr; -# endif + const char *yystr; +#endif { - register const char *yys = yystr; - - while (*yys++ != '\0') + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) continue; - - return yys - yystr - 1; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * -# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -# else +#else +static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif + char *yydest; + const char *yysrc; +#endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -923,70 +1139,192 @@ yystpcpy (yydest, yysrc) # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } - + if (! yyres) + return yystrlen (yystr); -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + return yystpcpy (yyres, yystr) - yyres; +} +# endif -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#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) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + int yyn = yypact[yystate]; - if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - } + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - switch (yytype) { - default: - break; + 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; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + 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; } - YYFPRINTF (yyoutput, ")"); } +#endif /* YYERROR_VERBOSE */ + -#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yydestruct (int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: - break; + break; } } @@ -994,13 +1332,13 @@ yydestruct (yytype, yyvaluep) /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); -# else +#else int yyparse (); -# endif +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); @@ -1009,10 +1347,10 @@ int yyparse (); -/* The lookahead symbol. */ +/* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -1025,14 +1363,18 @@ int yynerrs; `----------*/ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else @@ -1043,13 +1385,19 @@ yyparse () #endif { - register int yystate; - register int yyn; + int yystate; + int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ + /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif /* Three stacks and their tools: `yyss': related to states, @@ -1060,18 +1408,18 @@ yyparse () to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + YYSTYPE *yyvsp; -#define YYPOPSTACK (yyvsp--, yyssp--) +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; @@ -1080,9 +1428,9 @@ yyparse () YYSTYPE yyval; - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1106,8 +1454,7 @@ yyparse () `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: @@ -1120,18 +1467,18 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -1142,21 +1489,21 @@ yyparse () } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -1187,19 +1534,17 @@ yyparse () `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1214,7 +1559,7 @@ yybackup: else { yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to @@ -1234,22 +1579,21 @@ yybackup: if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + yystate = yyn; + *++yyvsp = yylval; + goto yynewstate; @@ -1288,12 +1632,12 @@ yyreduce: #line 144 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>cmykspec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>cmykspec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "CMYK"; global_channel_depth = 4; global_invert_data = 0; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1301,12 +1645,12 @@ yyreduce: #line 156 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>kcmyspec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>kcmyspec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "KCMY"; global_channel_depth = 4; global_invert_data = 0; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1314,12 +1658,12 @@ yyreduce: #line 168 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>rgbspec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>rgbspec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "RGB"; global_channel_depth = 3; global_invert_data = 1; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1327,12 +1671,12 @@ yyreduce: #line 180 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>cmyspec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>cmyspec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "CMY"; global_channel_depth = 3; global_invert_data = 0; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1340,12 +1684,12 @@ yyreduce: #line 192 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>grayspec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>grayspec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "Grayscale"; global_channel_depth = 1; global_invert_data = 0; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1353,12 +1697,12 @@ yyreduce: #line 204 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>whitespec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>whitespec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "Whitescale"; global_channel_depth = 1; global_invert_data = 1; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1366,23 +1710,23 @@ yyreduce: #line 216 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>extendedspec %d\n", yyvsp[-1].ival); + fprintf(stderr, ">>>extendedspec %d\n", (yyvsp[(2) - (3)].ival)); global_image_type = "Raw"; global_invert_data = 0; - global_channel_depth = yyvsp[-1].ival; - if (yyvsp[-1].ival == 8 || yyvsp[-1].ival == 16) - global_bit_depth = yyvsp[0].ival; + global_channel_depth = (yyvsp[(2) - (3)].ival); + if ((yyvsp[(2) - (3)].ival) == 8 || (yyvsp[(2) - (3)].ival) == 16) + global_bit_depth = (yyvsp[(3) - (3)].ival); } break; case 25: #line 234 "testpatterny.y" { - int channel = find_color(yyvsp[-1].sval); + int channel = find_color((yyvsp[(2) - (3)]).sval); if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>level %s %f\n", yyvsp[-1].sval, yyvsp[0].dval); + fprintf(stderr, ">>>level %s %f\n", (yyvsp[(2) - (3)]).sval, (yyvsp[(3) - (3)].dval)); if (channel >= 0) - global_levels[channel] = yyvsp[0].dval; + global_levels[channel] = (yyvsp[(3) - (3)].dval); } break; @@ -1390,20 +1734,20 @@ yyreduce: #line 244 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>channel_level %d %f\n", yyvsp[-1].ival, yyvsp[0].dval); - if (yyvsp[-1].ival >= 0 && yyvsp[-1].ival <= STP_CHANNEL_LIMIT) - global_levels[yyvsp[-1].ival] = yyvsp[0].dval; + fprintf(stderr, ">>>channel_level %d %f\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval)); + if ((yyvsp[(2) - (3)].ival) >= 0 && (yyvsp[(2) - (3)].ival) <= STP_CHANNEL_LIMIT) + global_levels[(yyvsp[(2) - (3)].ival)] = (yyvsp[(3) - (3)].dval); } break; case 27: #line 253 "testpatterny.y" { - int channel = find_color(yyvsp[-1].sval); + int channel = find_color((yyvsp[(2) - (3)]).sval); if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>gamma %s %f\n", yyvsp[-1].sval, yyvsp[0].dval); + fprintf(stderr, ">>>gamma %s %f\n", (yyvsp[(2) - (3)]).sval, (yyvsp[(3) - (3)].dval)); if (channel >= 0) - global_gammas[channel] = yyvsp[0].dval; + global_gammas[channel] = (yyvsp[(3) - (3)].dval); } break; @@ -1411,9 +1755,9 @@ yyreduce: #line 263 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>channel_gamma %d %f\n", yyvsp[-1].ival, yyvsp[0].dval); - if (yyvsp[-1].ival >= 0 && yyvsp[-1].ival <= STP_CHANNEL_LIMIT) - global_gammas[yyvsp[-1].ival] = yyvsp[0].dval; + fprintf(stderr, ">>>channel_gamma %d %f\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval)); + if ((yyvsp[(2) - (3)].ival) >= 0 && (yyvsp[(2) - (3)].ival) <= STP_CHANNEL_LIMIT) + global_gammas[(yyvsp[(2) - (3)].ival)] = (yyvsp[(3) - (3)].dval); } break; @@ -1421,8 +1765,8 @@ yyreduce: #line 272 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>global_gamma %f\n", yyvsp[0].dval); - global_gamma = yyvsp[0].dval; + fprintf(stderr, ">>>global_gamma %f\n", (yyvsp[(2) - (2)].dval)); + global_gamma = (yyvsp[(2) - (2)].dval); } break; @@ -1430,8 +1774,8 @@ yyreduce: #line 279 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>steps %d\n", yyvsp[0].ival); - global_steps = yyvsp[0].ival; + fprintf(stderr, ">>>steps %d\n", (yyvsp[(2) - (2)].ival)); + global_steps = (yyvsp[(2) - (2)].ival); } break; @@ -1439,8 +1783,8 @@ yyreduce: #line 286 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>ink_limit %f\n", yyvsp[0].dval); - global_ink_limit = yyvsp[0].dval; + fprintf(stderr, ">>>ink_limit %f\n", (yyvsp[(2) - (2)].dval)); + global_ink_limit = (yyvsp[(2) - (2)].dval); } break; @@ -1448,9 +1792,9 @@ yyreduce: #line 293 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>printer %s\n", yyvsp[0].sval); - global_printer = strdup(yyvsp[0].sval); - free(yyvsp[0].sval); + fprintf(stderr, ">>>printer %s\n", (yyvsp[(2) - (2)].sval)); + global_printer = strdup((yyvsp[(2) - (2)].sval)); + free((yyvsp[(2) - (2)].sval)); } break; @@ -1458,9 +1802,9 @@ yyreduce: #line 302 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>page_size_name %s\n", yyvsp[0].sval); - stp_set_string_parameter(global_vars, "PageSize", yyvsp[0].sval); - free(yyvsp[0].sval); + fprintf(stderr, ">>>page_size_name %s\n", (yyvsp[(2) - (2)].sval)); + stp_set_string_parameter(global_vars, "PageSize", (yyvsp[(2) - (2)].sval)); + free((yyvsp[(2) - (2)].sval)); } break; @@ -1468,9 +1812,9 @@ yyreduce: #line 311 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>page_size_custom %d %d\n", yyvsp[-1].ival, yyvsp[0].ival); - stp_set_page_width(global_vars, yyvsp[-1].ival); - stp_set_page_height(global_vars, yyvsp[0].ival); + fprintf(stderr, ">>>page_size_custom %d %d\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival)); + stp_set_page_width(global_vars, (yyvsp[(2) - (3)].ival)); + stp_set_page_height(global_vars, (yyvsp[(3) - (3)].ival)); } break; @@ -1478,10 +1822,10 @@ yyreduce: #line 323 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>parameter_string %s %s\n", yyvsp[-1].sval, yyvsp[0].sval); - stp_set_string_parameter(global_vars, yyvsp[-1].sval, yyvsp[0].sval); - free(yyvsp[-1].sval); - free(yyvsp[0].sval); + fprintf(stderr, ">>>parameter_string %s %s\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval)); + stp_set_string_parameter(global_vars, (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval)); + free((yyvsp[(2) - (3)].sval)); + free((yyvsp[(3) - (3)].sval)); } break; @@ -1489,9 +1833,9 @@ yyreduce: #line 333 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>parameter_int %s %d\n", yyvsp[-1].sval, yyvsp[0].ival); - stp_set_int_parameter(global_vars, yyvsp[-1].sval, yyvsp[0].ival); - free(yyvsp[-1].sval); + fprintf(stderr, ">>>parameter_int %s %d\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].ival)); + stp_set_int_parameter(global_vars, (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].ival)); + free((yyvsp[(2) - (3)].sval)); } break; @@ -1499,128 +1843,143 @@ yyreduce: #line 342 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>parameter_float %s %f\n", yyvsp[-1].sval, yyvsp[0].dval); - stp_set_float_parameter(global_vars, yyvsp[-1].sval, yyvsp[0].dval); - free(yyvsp[-1].sval); + fprintf(stderr, ">>>parameter_float %s %f\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].dval)); + stp_set_float_parameter(global_vars, (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].dval)); + free((yyvsp[(2) - (3)].sval)); + } + break; + + case 40: +#line 351 "testpatterny.y" + { + stp_curve_t *curve = stp_curve_create_from_string((yyvsp[(3) - (3)].sval)); + if (getenv("STP_TESTPATTERN_DEBUG")) + fprintf(stderr, ">>>parameter_curve %s %s\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval)); + if (curve) + { + stp_set_curve_parameter(global_vars, (yyvsp[(2) - (3)].sval), curve); + stp_curve_destroy(curve); + } + free((yyvsp[(2) - (3)].sval)); } break; - case 43: + case 45: #line 367 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>density %f\n", yyvsp[0].dval); - global_density = yyvsp[0].dval; + fprintf(stderr, ">>>density %f\n", (yyvsp[(2) - (2)].dval)); + global_density = (yyvsp[(2) - (2)].dval); } break; - case 44: + case 46: #line 374 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>top %f\n", yyvsp[0].dval); - global_xtop = yyvsp[0].dval; + fprintf(stderr, ">>>top %f\n", (yyvsp[(2) - (2)].dval)); + global_xtop = (yyvsp[(2) - (2)].dval); } break; - case 45: + case 47: #line 381 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>left %f\n", yyvsp[0].dval); - global_xleft = yyvsp[0].dval; + fprintf(stderr, ">>>left %f\n", (yyvsp[(2) - (2)].dval)); + global_xleft = (yyvsp[(2) - (2)].dval); } break; - case 46: + case 48: #line 388 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>hsize %f\n", yyvsp[0].dval); - global_hsize = yyvsp[0].dval; + fprintf(stderr, ">>>hsize %f\n", (yyvsp[(2) - (2)].dval)); + global_hsize = (yyvsp[(2) - (2)].dval); } break; - case 47: + case 49: #line 395 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>vsize %f\n", yyvsp[0].dval); - global_vsize = yyvsp[0].dval; + fprintf(stderr, ">>>vsize %f\n", (yyvsp[(2) - (2)].dval)); + global_vsize = (yyvsp[(2) - (2)].dval); } break; - case 48: + case 50: #line 402 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>blackline %d\n", yyvsp[0].ival); - global_noblackline = !(yyvsp[0].ival); + fprintf(stderr, ">>>blackline %d\n", (yyvsp[(2) - (2)].ival)); + global_noblackline = !((yyvsp[(2) - (2)].ival)); } break; - case 49: + case 51: #line 410 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>color_block1 %f %f %f (%d)\n", yyvsp[-2].dval, yyvsp[-1].dval, yyvsp[0].dval, + fprintf(stderr, ">>>color_block1 %f %f %f (%d)\n", (yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].dval), (yyvsp[(3) - (3)].dval), current_index); if (current_index < STP_CHANNEL_LIMIT) { - current_testpattern->d.p.mins[current_index] = yyvsp[-2].dval; - current_testpattern->d.p.vals[current_index] = yyvsp[-1].dval; - current_testpattern->d.p.gammas[current_index] = yyvsp[0].dval; + current_testpattern->d.p.mins[current_index] = (yyvsp[(1) - (3)].dval); + current_testpattern->d.p.vals[current_index] = (yyvsp[(2) - (3)].dval); + current_testpattern->d.p.gammas[current_index] = (yyvsp[(3) - (3)].dval); current_index++; } } break; - case 55: + case 57: #line 434 "testpatterny.y" { - int channel = find_color(yyvsp[-3].sval); + int channel = find_color((yyvsp[(1) - (4)]).sval); if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>color_block2a %s %f %f %f\n", yyvsp[-3].sval, yyvsp[-2].dval, yyvsp[-1].dval, yyvsp[0].dval); + fprintf(stderr, ">>>color_block2a %s %f %f %f\n", (yyvsp[(1) - (4)]).sval, (yyvsp[(2) - (4)].dval), (yyvsp[(3) - (4)].dval), (yyvsp[(4) - (4)].dval)); if (channel >= 0 && channel < STP_CHANNEL_LIMIT) { - current_testpattern->d.p.mins[channel] = yyvsp[-2].dval; - current_testpattern->d.p.vals[channel] = yyvsp[-1].dval; - current_testpattern->d.p.gammas[channel] = yyvsp[0].dval; + current_testpattern->d.p.mins[channel] = (yyvsp[(2) - (4)].dval); + current_testpattern->d.p.vals[channel] = (yyvsp[(3) - (4)].dval); + current_testpattern->d.p.gammas[channel] = (yyvsp[(4) - (4)].dval); } } break; - case 56: + case 58: #line 448 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>color_block2b %d %f %f %f\n", yyvsp[-3].ival, yyvsp[-2].dval, yyvsp[-1].dval, yyvsp[0].dval); - if (yyvsp[-3].ival >= 0 && yyvsp[-3].ival < STP_CHANNEL_LIMIT) + 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)); + if ((yyvsp[(2) - (5)].ival) >= 0 && (yyvsp[(2) - (5)].ival) < STP_CHANNEL_LIMIT) { - current_testpattern->d.p.mins[yyvsp[-3].ival] = yyvsp[-2].dval; - current_testpattern->d.p.vals[yyvsp[-3].ival] = yyvsp[-1].dval; - current_testpattern->d.p.gammas[yyvsp[-3].ival] = yyvsp[0].dval; + current_testpattern->d.p.mins[(yyvsp[(2) - (5)].ival)] = (yyvsp[(3) - (5)].dval); + current_testpattern->d.p.vals[(yyvsp[(2) - (5)].ival)] = (yyvsp[(4) - (5)].dval); + current_testpattern->d.p.gammas[(yyvsp[(2) - (5)].ival)] = (yyvsp[(5) - (5)].dval); } } break; - case 65: + case 67: #line 473 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>patvars %f %f %f %f %f\n", yyvsp[-4].dval, yyvsp[-3].dval, yyvsp[-2].dval, yyvsp[-1].dval, yyvsp[0].dval); + 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)); current_testpattern->t = E_PATTERN; - current_testpattern->d.p.lower = yyvsp[-4].dval; - current_testpattern->d.p.upper = yyvsp[-3].dval; - current_testpattern->d.p.levels[1] = yyvsp[-2].dval; - current_testpattern->d.p.levels[2] = yyvsp[-1].dval; - current_testpattern->d.p.levels[3] = yyvsp[0].dval; + current_testpattern->d.p.lower = (yyvsp[(1) - (5)].dval); + current_testpattern->d.p.upper = (yyvsp[(2) - (5)].dval); + current_testpattern->d.p.levels[1] = (yyvsp[(3) - (5)].dval); + current_testpattern->d.p.levels[2] = (yyvsp[(4) - (5)].dval); + current_testpattern->d.p.levels[3] = (yyvsp[(5) - (5)].dval); current_testpattern = get_next_testpattern(); current_index = 0; } break; - case 67: + case 69: #line 491 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) @@ -1636,26 +1995,26 @@ yyreduce: } break; - case 68: + case 70: #line 506 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>grid %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>grid %d\n", (yyvsp[(2) - (2)].ival)); current_testpattern->t = E_GRID; - current_testpattern->d.g.ticks = yyvsp[0].ival; + current_testpattern->d.g.ticks = (yyvsp[(2) - (2)].ival); current_testpattern = get_next_testpattern(); current_index = 0; } break; - case 69: + case 71: #line 517 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>image %d %d\n", yyvsp[-1].ival, yyvsp[0].ival); + fprintf(stderr, ">>>image %d %d\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival)); current_testpattern->t = E_IMAGE; - current_testpattern->d.i.x = yyvsp[-1].ival; - current_testpattern->d.i.y = yyvsp[0].ival; + current_testpattern->d.i.x = (yyvsp[(2) - (3)].ival); + current_testpattern->d.i.y = (yyvsp[(3) - (3)].ival); if (current_testpattern->d.i.x <= 0 || current_testpattern->d.i.y <= 0) { @@ -1666,77 +2025,77 @@ yyreduce: } break; - case 70: + case 72: #line 534 "testpatterny.y" { - fprintf(stderr, yyvsp[0].sval); - free(yyvsp[0].sval); + fprintf(stderr,"%s",(yyvsp[(2) - (2)].sval)); + free((yyvsp[(2) - (2)].sval)); } break; - case 71: + case 73: #line 540 "testpatterny.y" { - fprintf(stderr, yyvsp[-1].sval, yyvsp[0].sval); - free(yyvsp[-1].sval); - free(yyvsp[0].sval); + fprintf(stderr,"%s%s", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval)); + free((yyvsp[(2) - (3)].sval)); + free((yyvsp[(3) - (3)].sval)); } break; - case 72: + case 74: #line 547 "testpatterny.y" { - fprintf(stderr, yyvsp[-2].sval, yyvsp[-1].sval, yyvsp[0].sval); - free(yyvsp[-2].sval); - free(yyvsp[-1].sval); - free(yyvsp[0].sval); + fprintf(stderr,"%s%s%s", (yyvsp[(2) - (4)].sval), (yyvsp[(3) - (4)].sval), (yyvsp[(4) - (4)].sval)); + free((yyvsp[(2) - (4)].sval)); + free((yyvsp[(3) - (4)].sval)); + free((yyvsp[(4) - (4)].sval)); } break; - case 73: + case 75: #line 555 "testpatterny.y" { - fprintf(stderr, yyvsp[-3].sval, yyvsp[-2].sval, yyvsp[-1].sval, yyvsp[0].sval); - free(yyvsp[-3].sval); - free(yyvsp[-2].sval); - free(yyvsp[-1].sval); - free(yyvsp[0].sval); + fprintf(stderr, "%s%s%s%s", (yyvsp[(2) - (5)].sval), (yyvsp[(3) - (5)].sval), (yyvsp[(4) - (5)].sval), (yyvsp[(5) - (5)].sval)); + free((yyvsp[(2) - (5)].sval)); + free((yyvsp[(3) - (5)].sval)); + free((yyvsp[(4) - (5)].sval)); + free((yyvsp[(5) - (5)].sval)); } break; - case 74: + case 76: #line 564 "testpatterny.y" { - fprintf(stderr, yyvsp[-4].sval, yyvsp[-3].sval, yyvsp[-2].sval, yyvsp[-1].sval, yyvsp[0].sval); - free(yyvsp[-4].sval); - free(yyvsp[-3].sval); - free(yyvsp[-2].sval); - free(yyvsp[-1].sval); - free(yyvsp[0].sval); + fprintf(stderr, "%s%s%s%s%s", (yyvsp[(2) - (6)].sval), (yyvsp[(3) - (6)].sval), (yyvsp[(4) - (6)].sval), (yyvsp[(5) - (6)].sval), (yyvsp[(6) - (6)].sval)); + free((yyvsp[(2) - (6)].sval)); + free((yyvsp[(3) - (6)].sval)); + free((yyvsp[(4) - (6)].sval)); + free((yyvsp[(5) - (6)].sval)); + free((yyvsp[(6) - (6)].sval)); } break; - case 99: + case 101: #line 586 "testpatterny.y" { global_did_something = 1; } break; - case 104: + case 106: #line 593 "testpatterny.y" { global_did_something = 1; } break; - case 107: + case 109: #line 600 "testpatterny.y" { global_did_something = 1; } break; - case 113: + case 115: #line 610 "testpatterny.y" { return 0; } break; - case 114: + case 116: #line 614 "testpatterny.y" { current_testpattern = get_next_testpattern(); @@ -1744,15 +2103,14 @@ yyreduce: break; +/* Line 1267 of yacc.c. */ +#line 2108 "testpatterny.c" + default: break; } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); -/* Line 991 of yacc.c. */ -#line 1750 "testpatterny.c" - - yyvsp -= yylen; - yyssp -= yylen; - - + YYPOPSTACK (yylen); + yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -1781,109 +2139,93 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - char *yymsg; - int yyx, yycount; - - yycount = 0; - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("syntax error, unexpected ") + 1; - yysize += yystrlen (yytname[yytype]); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - - if (yycount < 5) - { - yycount = 0; - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); - yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - const char *yyq = ! yycount ? ", expecting " : " or "; - yyp = yystpcpy (yyp, yyq); - yyp = yystpcpy (yyp, yytname[yyx]); - yycount++; - } - } - yyerror (yymsg); +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + 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); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + 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; + } + } +#endif } if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ - /* Return failure if at end of input. */ - if (yychar == YYEOF) - { - /* Pop the error token. */ - YYPOPSTACK; - /* Pop the rest of the stack. */ - while (yyss < yyssp) - { - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - YYPOPSTACK; - } - YYABORT; - } - - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); - yychar = YYEMPTY; - + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ - goto yyerrlab2; + goto yyerrlab1; -/*----------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action. | -`----------------------------------------------------*/ -yyerrlab1: - - /* Suppress GCC warning that yyerrlab1 is unused when no action - invokes YYERROR. */ -#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ - && !defined __cplusplus - __attribute__ ((__unused__)) -#endif +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; - goto yyerrlab2; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; -/*---------------------------------------------------------------. -| yyerrlab2 -- pop states until the error token can be shifted. | -`---------------------------------------------------------------*/ -yyerrlab2: +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) @@ -1904,22 +2246,23 @@ yyerrlab2: if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); - yyvsp--; - yystate = *--yyssp; + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; - YYDPRINTF ((stderr, "Shifting error token, ")); - *++yyvsp = yylval; + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + yystate = yyn; goto yynewstate; @@ -1939,21 +2282,39 @@ yyabortlab: goto yyreturn; #ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } diff --git a/src/testpattern/testpatterny.h b/src/testpattern/testpatterny.h index 2567b82..69e3127 100644 --- a/src/testpattern/testpatterny.h +++ b/src/testpattern/testpatterny.h @@ -1,7 +1,9 @@ -/* A Bison parser, made by GNU Bison 1.875. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 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 @@ -15,13 +17,21 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE @@ -75,6 +85,7 @@ END = 301 }; #endif +/* Tokens. */ #define tINT 258 #define tDOUBLE 259 #define tSTRING 260 @@ -123,7 +134,7 @@ -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -132,5 +143,3 @@ typedef int YYSTYPE; extern YYSTYPE yylval; - - diff --git a/src/testpattern/testpatterny.y b/src/testpattern/testpatterny.y index 6d92bad..bb2073f 100644 --- a/src/testpattern/testpatterny.y +++ b/src/testpattern/testpatterny.y @@ -1,5 +1,5 @@ /* - * "$Id: testpatterny.y,v 1.26 2004/08/21 22:35:18 rlk Exp $" + * "$Id: testpatterny.y,v 1.26.18.2 2007/05/29 01:47:30 rlk Exp $" * * Test pattern generator for Gimp-Print * @@ -361,7 +361,7 @@ parameter_curve: PARAMETER_CURVE tSTRING tSTRING } ; -parameter: parameter_string | parameter_int | parameter_float +parameter: parameter_string | parameter_int | parameter_float | parameter_curve ; density: DENSITY tDOUBLE { @@ -532,20 +532,20 @@ image: IMAGE tINT tINT Message0: MESSAGE tSTRING { - fprintf(stderr, $2); + fprintf(stderr,"%s",$2); free($2); } ; Message1: MESSAGE tSTRING tSTRING { - fprintf(stderr, $2, $3); + fprintf(stderr,"%s%s", $2, $3); free($2); free($3); } ; Message2: MESSAGE tSTRING tSTRING tSTRING { - fprintf(stderr, $2, $3, $4); + fprintf(stderr,"%s%s%s", $2, $3, $4); free($2); free($3); free($4); @@ -553,7 +553,7 @@ Message2: MESSAGE tSTRING tSTRING tSTRING ; Message3: MESSAGE tSTRING tSTRING tSTRING tSTRING { - fprintf(stderr, $2, $3, $4, $5); + fprintf(stderr, "%s%s%s%s", $2, $3, $4, $5); free($2); free($3); free($4); @@ -562,7 +562,7 @@ Message3: MESSAGE tSTRING tSTRING tSTRING tSTRING ; Message4: MESSAGE tSTRING tSTRING tSTRING tSTRING tSTRING { - fprintf(stderr, $2, $3, $4, $5, $6); + fprintf(stderr, "%s%s%s%s%s", $2, $3, $4, $5, $6); free($2); free($3); free($4); |