From d4f5ec23b71b76e401c7f596bb287e1473e5239e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 27 2021 16:35:51 +0000 Subject: import groff-1.22.3-18.el8 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..68e3cc7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/groff-1.22.3.tar.gz diff --git a/.groff.metadata b/.groff.metadata new file mode 100644 index 0000000..71fb351 --- /dev/null +++ b/.groff.metadata @@ -0,0 +1 @@ +61a6808ea1ef715df9fa8e9b424e1f6b9fa8c091 SOURCES/groff-1.22.3.tar.gz diff --git a/SOURCES/0001-missing-groff-x11-info-message-when-gxditview-not-fo.patch b/SOURCES/0001-missing-groff-x11-info-message-when-gxditview-not-fo.patch new file mode 100644 index 0000000..d6b0025 --- /dev/null +++ b/SOURCES/0001-missing-groff-x11-info-message-when-gxditview-not-fo.patch @@ -0,0 +1,30 @@ +From 103f1f6b4e4cfd007375cd127b8e69cd102d4097 Mon Sep 17 00:00:00 2001 +From: Jan Vcelak +Date: Tue, 1 Jan 2013 15:32:01 +0100 +Subject: [PATCH] missing groff-x11 info message when gxditview not found + +Adds info message that 'groff-x11' package might be missing when +executing 'groff -X' and 'gxditview' is not found. + +Resolves: #530788 +Signed-off-by: Jan Vcelak +--- + src/roff/groff/pipeline.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/roff/groff/pipeline.c b/src/roff/groff/pipeline.c +index cea7593..fce0abc 100644 +--- a/src/roff/groff/pipeline.c ++++ b/src/roff/groff/pipeline.c +@@ -486,6 +486,8 @@ int run_pipeline(int ncommands, char ***commands, int no_pipe) + execvp(commands[i][0], commands[i]); + error("couldn't exec %1: %2", + commands[i][0], strerror(errno), (char *)0); ++ if (strcmp(commands[i][0], "gxditview") == 0) ++ fprintf(stderr, "You might be missing 'groff-x11' package.\n"); + fflush(stderr); /* just in case error() doesn't */ + _exit(EXEC_FAILED_EXIT_STATUS); + } +-- +1.8.0.2 + diff --git a/SOURCES/0002-load-site-font-and-site-tmac-from-etc-groff.patch b/SOURCES/0002-load-site-font-and-site-tmac-from-etc-groff.patch new file mode 100644 index 0000000..163f784 --- /dev/null +++ b/SOURCES/0002-load-site-font-and-site-tmac-from-etc-groff.patch @@ -0,0 +1,43 @@ +From c6d8bb3e0ebc03274564d7b2c768e9932cc5f79d Mon Sep 17 00:00:00 2001 +From: Jan Vcelak +Date: Tue, 1 Jan 2013 15:33:45 +0100 +Subject: [PATCH] load site-font and site-tmac from /etc/groff + +Move site-font and site-tmac configuration from /usr/share/groff to +/etc/groff. That allows permanent custom changes. (Symlinking brought +a lot of problems with RPM. This is safer and cleaner.) + +Signed-off-by: Jan Vcelak +--- + Makefile.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 7534e56..d97d1b9 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -167,7 +167,7 @@ fontdir=$(datasubdir)/font + oldfontdir=$(datasubdir)/oldfont + + # `localfontdir' says where local fonts will be installed (as dev*/*). +-localfontdir=$(dataprogramdir)/site-font ++localfontdir=@sysconfdir@/groff/site-font + + # `legacyfontdir' is for compatibility with non-GNU troff. + legacyfontdir=/usr/lib/font +@@ -179,10 +179,10 @@ fontpath=$(localfontdir)$(RT_SEP)$(fontdir)$(RT_SEP)$(legacyfontdir) + tmacdir=$(datasubdir)/tmac + + # `systemtmacdir' says where to install platform-dependent macros. +-systemtmacdir=$(libprogramdir)/site-tmac ++systemtmacdir=@sysconfdir@/groff/site-tmac + + # `localtmacdir' says where local files will be installed. +-localtmacdir=$(dataprogramdir)/site-tmac ++localtmacdir=@sysconfdir@/groff/site-tmac + + # `appresdir' says where to install the application resource file for + # gxditview. +-- +1.8.0.2 + diff --git a/SOURCES/0003-various-security-fixes.patch b/SOURCES/0003-various-security-fixes.patch new file mode 100644 index 0000000..7dd1bea --- /dev/null +++ b/SOURCES/0003-various-security-fixes.patch @@ -0,0 +1,228 @@ +From 36115e102859badb08cb5b2398de6b0ba45421d3 Mon Sep 17 00:00:00 2001 +From: Jan Vcelak +Date: Tue, 4 Nov 2014 14:36:47 +0100 +Subject: [PATCH] various security fixes + +CVE-2009-5044 (#709413) +CVE-2009-5080 (#720058) +CVE-2009-5081 (#720057) + +Based on: http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/groff/groff-1.20.1-owl-tmp.diff?rev=1.2;content-type=text%2Fplain +Resolves: #709415, #720060 +Signed-off-by: Jan Vcelak +--- + contrib/eqn2graph/eqn2graph.sh | 2 ++ + contrib/gdiffmk/tests/runtests.in | 5 +++-- + contrib/grap2graph/grap2graph.sh | 2 ++ + contrib/groffer/main_subs.pl | 10 +++++----- + contrib/groffer/roff2.pl | 2 +- + contrib/pdfmark/pdfroff.man | 5 +++-- + contrib/pic2graph/pic2graph.sh | 2 ++ + doc/fixinfo.sh | 5 +++-- + doc/groff.info-2 | 6 +++--- + doc/groff.texinfo | 6 +++--- + gendef.sh | 10 +++------- + 11 files changed, 30 insertions(+), 25 deletions(-) + +diff --git a/contrib/eqn2graph/eqn2graph.sh b/contrib/eqn2graph/eqn2graph.sh +index ee7cc5f..13edf78 100644 +--- a/contrib/eqn2graph/eqn2graph.sh ++++ b/contrib/eqn2graph/eqn2graph.sh +@@ -67,6 +67,8 @@ for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do + + tmp=$d/eqn2graph$$-$RANDOM + (umask 077 && mkdir $tmp) 2> /dev/null && break ++ ++ tmp= + done; + if test -z "$tmp"; then + echo "$0: cannot create temporary directory" >&2 +diff --git a/contrib/gdiffmk/tests/runtests.in b/contrib/gdiffmk/tests/runtests.in +index 714ce48..40a35c4 100644 +--- a/contrib/gdiffmk/tests/runtests.in ++++ b/contrib/gdiffmk/tests/runtests.in +@@ -56,8 +56,9 @@ function TestResult { + fi + } + +-tmpfile=/tmp/$$ +-trap 'rm -f ${tmpfile}' 0 1 2 3 15 ++tmpfile="`mktemp -t gdiffmk-runtests.XXXXXXXXXX`" || exit ++trap 'rm -f -- "$tmpfile"' EXIT ++trap 'trap - EXIT; rm -f -- "$tmpfile"; exit 1' HUP INT QUIT TERM + + # Run tests. + +diff --git a/contrib/grap2graph/grap2graph.sh b/contrib/grap2graph/grap2graph.sh +index 58544e1..aeab832 100644 +--- a/contrib/grap2graph/grap2graph.sh ++++ b/contrib/grap2graph/grap2graph.sh +@@ -63,6 +63,8 @@ for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do + + tmp=$d/grap2graph$$-$RANDOM + (umask 077 && mkdir $tmp) 2> /dev/null && break ++ ++ tmp= + done; + if test -z "$tmp"; then + echo "$0: cannot create temporary directory" >&2 +diff --git a/contrib/groffer/main_subs.pl b/contrib/groffer/main_subs.pl +index 90627cc..76896cd 100644 +--- a/contrib/groffer/main_subs.pl ++++ b/contrib/groffer/main_subs.pl +@@ -1239,7 +1239,7 @@ sub main_temp { + our $fh_stdin; + our $tmp_cat; + our $tmp_stdin; +- my $template = 'groffer_' . "$$" . '_XXXX'; ++ my $template = 'groffer_' . "$$" . '_XXXXXXXXXX'; + foreach ($ENV{'GROFF_TMPDIR'}, $ENV{'TMPDIR'}, $ENV{'TMP'}, $ENV{'TEMP'}, + $ENV{'TEMPDIR'}, File::Spec->catfile($ENV{'HOME'}, 'tmp')) { + if ($_ && -d $_ && -w $_) { +@@ -1271,12 +1271,12 @@ sub main_temp { + + # further argument: SUFFIX => '.sh' + if ($Debug{'KEEP'}) { +- ($fh_cat, $tmp_cat) = tempfile(',cat_XXXX', DIR => $tmpdir); +- ($fh_stdin, $tmp_stdin) = tempfile(',stdin_XXXX', DIR => $tmpdir); ++ ($fh_cat, $tmp_cat) = tempfile(',cat_XXXXXXXXXX', DIR => $tmpdir); ++ ($fh_stdin, $tmp_stdin) = tempfile(',stdin_XXXXXXXXXX', DIR => $tmpdir); + } else { +- ($fh_cat, $tmp_cat) = tempfile(',cat_XXXX', UNLINK => 1, ++ ($fh_cat, $tmp_cat) = tempfile(',cat_XXXXXXXXXX', UNLINK => 1, + DIR => $tmpdir); +- ($fh_stdin, $tmp_stdin) = tempfile(',stdin_XXXX', UNLINK => 1, ++ ($fh_stdin, $tmp_stdin) = tempfile(',stdin_XXXXXXXXXX', UNLINK => 1, + DIR => $tmpdir); + } + } # main_temp() +diff --git a/contrib/groffer/roff2.pl b/contrib/groffer/roff2.pl +index d8dad3f..f0ca9f2 100755 +--- a/contrib/groffer/roff2.pl ++++ b/contrib/groffer/roff2.pl +@@ -123,7 +123,7 @@ if ($Has_Groffer) { + last; + } + } +- my $template = $Name . '_XXXX'; ++ my $template = $Name . '_XXXXXXXXXX'; + my ($fh, $stdin); + if ($tempdir) { + ($fh, $stdin) = tempfile($template, UNLINK => 1, DIR => $tempdir) || +diff --git a/contrib/pdfmark/pdfroff.man b/contrib/pdfmark/pdfroff.man +index ec412bb..faf2898 100644 +--- a/contrib/pdfmark/pdfroff.man ++++ b/contrib/pdfmark/pdfroff.man +@@ -555,7 +555,7 @@ defaults to + .B GROFF_TMPDIR + Identifies the directory in which + .B pdfroff +-should create temporary files. ++should create a subdirectory for its temporary files. + . + If + .B \%GROFF_TMPDIR +@@ -568,7 +568,8 @@ and + .B TEMP + are considered in turn, as possible temporary file repositories. + If none of these are set, then temporary files are created +-in the current directory. ++in a subdirectory of ++.BR /tmp . + . + .TP + .B GROFF_GHOSTSCRIPT_INTERPRETER +diff --git a/contrib/pic2graph/pic2graph.sh b/contrib/pic2graph/pic2graph.sh +index 72c5477..6b3360d 100644 +--- a/contrib/pic2graph/pic2graph.sh ++++ b/contrib/pic2graph/pic2graph.sh +@@ -78,6 +78,8 @@ for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do + tmp=$d/pic2graph$$-$RANDOM + (umask 077 && mkdir $tmp) 2> /dev/null \ + && break ++ ++ tmp= + done; + if test -z "$tmp"; then + echo "$0: cannot create temporary directory" >&2 +diff --git a/doc/fixinfo.sh b/doc/fixinfo.sh +index 2c853f8..6954e6a 100644 +--- a/doc/fixinfo.sh ++++ b/doc/fixinfo.sh +@@ -22,8 +22,9 @@ + # groff.texinfo macro code. Hopefully, a new texinfo version makes it + # unnecessary. + +-t=${TMPDIR-.}/gro$$.tmp +- ++t="`mktemp -t groff-fixinfo.XXXXXXXXXX`" || exit ++trap 'rm -f -- "$t"' EXIT ++trap 'trap - EXIT; rm -f -- "$t"; exit 1' HUP INT QUIT TERM + cat $1 | sed ' + 1 { + N +diff --git a/doc/groff.info-2 b/doc/groff.info-2 +index 7eaae86..e7dab72 100644 +--- a/doc/groff.info-2 ++++ b/doc/groff.info-2 +@@ -1697,9 +1697,9 @@ not there, 'groff' would not know when to stop. + time into a document: + + .sy perl -e 'printf ".nr H %d\\n.nr M %d\\n.nr S %d\\n",\ +- (localtime(time))[2,1,0]' > /tmp/x\n[$$] +- .so /tmp/x\n[$$] +- .sy rm /tmp/x\n[$$] ++ (localtime(time))[2,1,0]' > timefile\n[$$] ++ .so timefile\n[$$] ++ .sy rm timefile\n[$$] + \nH:\nM:\nS + + Note that this works by having the 'perl' script (run by 'sy') +diff --git a/doc/groff.texinfo b/doc/groff.texinfo +index 066b527..83684da 100644 +--- a/doc/groff.texinfo ++++ b/doc/groff.texinfo +@@ -13736,9 +13736,9 @@ into a document: + @pindex perl + @Example + .sy perl -e 'printf ".nr H %d\\n.nr M %d\\n.nr S %d\\n",\ +- (localtime(time))[2,1,0]' > /tmp/x\n[$$] +-.so /tmp/x\n[$$] +-.sy rm /tmp/x\n[$$] ++ (localtime(time))[2,1,0]' > timefile\n[$$] +++.so timefile\n[$$] +++.sy rm timefile\n[$$] + \nH:\nM:\nS + @endExample + +diff --git a/gendef.sh b/gendef.sh +index 41a511b..050bcbe 100644 +--- a/gendef.sh ++++ b/gendef.sh +@@ -33,11 +33,9 @@ do + #define $def" + done + +-# Use $TMPDIR if defined. Default to cwd, for non-Unix systems +-# which don't have /tmp on each drive (we are going to remove +-# the file before we exit anyway). Put the PID in the basename, +-# since the extension can only hold 3 characters on MS-DOS. +-t=${TMPDIR-.}/gro$$.tmp ++t="`mktemp -t groff-gendef.XXXXXXXXXX`" || exit ++trap 'rm -f -- "$t"' EXIT ++trap 'trap - EXIT; rm -f -- "$t"; exit 1' HUP INT QUIT TERM + + sed -e 's/=/ /' >$t < +Date: Tue, 4 Nov 2014 14:49:57 +0100 +Subject: [PATCH] don't use /usr/bin/env in shebang + +There might be an issue that the script is executed with unwanted version of + if that language is provided by enabled dynamic software collection. + +Resolves: #987069 +--- + contrib/chem/chem.pl | 2 +- + contrib/groffer/groffer.pl | 2 +- + contrib/groffer/roff2.pl | 2 +- + src/roff/grog/grog.pl | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/contrib/chem/chem.pl b/contrib/chem/chem.pl +index 1a8b3cc..15eda5f 100755 +--- a/contrib/chem/chem.pl ++++ b/contrib/chem/chem.pl +@@ -1,4 +1,4 @@ +-#! /usr/bin/env perl ++#! /usr/bin/perl + + # chem - a groff preprocessor for producing chemical structure diagrams + +diff --git a/contrib/groffer/groffer.pl b/contrib/groffer/groffer.pl +index 4e2e575..913e8eb 100755 +--- a/contrib/groffer/groffer.pl ++++ b/contrib/groffer/groffer.pl +@@ -1,4 +1,4 @@ +-#! /usr/bin/env perl ++#! /usr/bin/perl + + # groffer - display groff files + +diff --git a/contrib/groffer/roff2.pl b/contrib/groffer/roff2.pl +index f0ca9f2..1b8577f 100755 +--- a/contrib/groffer/roff2.pl ++++ b/contrib/groffer/roff2.pl +@@ -1,4 +1,4 @@ +-#! /usr/bin/env perl ++#! /usr/bin/perl + + # roff2* - transform roff files into other formats + +diff --git a/src/roff/grog/grog.pl b/src/roff/grog/grog.pl +index fb7b54c..9baa869 100644 +--- a/src/roff/grog/grog.pl ++++ b/src/roff/grog/grog.pl +@@ -1,4 +1,4 @@ +-#! /usr/bin/env perl ++#! /usr/bin/perl + # grog - guess options for groff command + # Inspired by doctype script in Kernighan & Pike, Unix Programming + # Environment, pp 306-8. +-- +1.9.3 + diff --git a/SOURCES/0005-Add-missing-rule-for-gropdf.patch b/SOURCES/0005-Add-missing-rule-for-gropdf.patch new file mode 100644 index 0000000..2ab9eed --- /dev/null +++ b/SOURCES/0005-Add-missing-rule-for-gropdf.patch @@ -0,0 +1,25 @@ +From 65c9f2f5152b3eebba8494cbead00d79d1dcbb1c Mon Sep 17 00:00:00 2001 +From: Jan Chaloupka +Date: Wed, 12 Nov 2014 08:23:00 +0100 +Subject: [PATCH] Add missing rule for gropdf + +--- + Makefile.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Makefile.in b/Makefile.in +index 4b5a5c6..7ae9ac2 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -896,6 +896,8 @@ $(GNULIBDIRS): FORCE + $(MAKE) ACLOCAL=: AUTOCONF=: AUTOHEADER=: AUTOMAKE=: $(do) ;; \ + esac + ++$(SHPROGDIRS): $(PROGDEPDIRS) ++ + $(OTHERDIRS): $(PROGDEPDIRS) $(CCPROGDIRS) $(CPROGDIRS) $(SHPROGDIRS) + + $(INCDIRS) $(PROGDEPDIRS) $(SHPROGDIRS) $(OTHERDIRS): FORCE +-- +1.9.3 + diff --git a/SOURCES/groff-1.22.3-coverity.patch b/SOURCES/groff-1.22.3-coverity.patch new file mode 100644 index 0000000..12fcaba --- /dev/null +++ b/SOURCES/groff-1.22.3-coverity.patch @@ -0,0 +1,10614 @@ +From e492d60b92dce680f7dadb2bed1bbf575e085bac Mon Sep 17 00:00:00 2001 +From: groff owner +Date: Mon, 12 Nov 2018 15:32:30 +0100 +Subject: [PATCH] Fix important Covscan defects + +--- + contrib/pic2graph/pic2graph.sh | 1 - + src/devices/grohtml/post-html.cpp | 26 +- + src/devices/grolbp/lbp.cpp | 4 +- + src/include/relocate.h | 7 + + src/libs/libbib/index.cpp | 4 +- + src/libs/libgroff/localcharset.c | 6 +- + src/libs/libgroff/relocate.cpp | 6 + + src/preproc/eqn/eqn.cpp | 2163 ------------- + src/preproc/grn/main.cpp | 3 + + src/preproc/html/pre-html.cpp | 46 +- + src/preproc/pic/pic.cpp | 5008 ----------------------------- + src/preproc/refer/label.cpp | 2701 ---------------- + src/preproc/refer/label.y | 2 +- + src/preproc/tbl/table.cpp | 4 +- + src/roff/troff/dictionary.cpp | 5 + + src/roff/troff/dictionary.h | 1 + + src/roff/troff/env.cpp | 11 +- + src/roff/troff/input.cpp | 5 + + src/roff/troff/mtsm.cpp | 6 +- + src/utils/addftinfo/addftinfo.cpp | 1 + + src/utils/hpftodit/hpftodit.cpp | 28 +- + src/utils/indxbib/indxbib.cpp | 7 + + src/utils/tfmtodit/tfmtodit.cpp | 8 + + 23 files changed, 152 insertions(+), 9901 deletions(-) + delete mode 100644 src/preproc/eqn/eqn.cpp + delete mode 100644 src/preproc/pic/pic.cpp + delete mode 100644 src/preproc/refer/label.cpp + +diff --git a/contrib/pic2graph/pic2graph.sh b/contrib/pic2graph/pic2graph.sh +index 6b3360d..3e1e788 100644 +--- a/contrib/pic2graph/pic2graph.sh ++++ b/contrib/pic2graph/pic2graph.sh +@@ -33,7 +33,6 @@ + # intended as a pic translator; we can live with eqn defaults. + # + groffpic_opts="" +-gs_opts="" + convert_opts="" + format="png" + eqndelim='$$' +diff --git a/src/devices/grohtml/post-html.cpp b/src/devices/grohtml/post-html.cpp +index fefbf01..c775826 100644 +--- a/src/devices/grohtml/post-html.cpp ++++ b/src/devices/grohtml/post-html.cpp +@@ -2353,7 +2353,7 @@ static string &generate_img_src (const char *filename) + + void html_printer::do_auto_image (text_glob *g, const char *filename) + { +- string buffer = generate_img_src(filename); ++ string &buffer = generate_img_src(filename); + + if (! buffer.empty()) { + /* +@@ -2366,6 +2366,8 @@ void html_printer::do_auto_image (text_glob *g, const char *filename) + emit_raw(&h); + } else + next_tag = INLINE; ++ ++ delete &buffer; + } + + /* +@@ -2397,7 +2399,7 @@ void html_printer::do_title (void) + t = page_contents->glyphs.get_data(); + removed_from_head = FALSE; + if (t->is_auto_img()) { +- string img = generate_img_src((char *)(t->text_string + 20)); ++ string &img = generate_img_src((char *)(t->text_string + 20)); + + if (! img.empty()) { + if (found_title_start) +@@ -2406,6 +2408,8 @@ void html_printer::do_title (void) + title.has_been_found = TRUE; + title.text += img; + } ++ delete &img; ++ + page_contents->glyphs.sub_move_right(); /* move onto next word */ + removed_from_head = ((!page_contents->glyphs.is_empty()) && + (page_contents->glyphs.is_equal_to_head())); +@@ -2607,7 +2611,7 @@ void html_printer::do_heading (char *arg) + horiz = g->minh; + do { + if (g->is_auto_img()) { +- string img=generate_img_src((char *)(g->text_string + 20)); ++ string &img=generate_img_src((char *)(g->text_string + 20)); + + if (! img.empty()) { + simple_anchors = TRUE; // we cannot use full heading anchors with images +@@ -2616,6 +2620,7 @@ void html_printer::do_heading (char *arg) + + header.header_buffer += img; + } ++ delete &img; + } + else if (g->is_in() || g->is_ti() || g->is_po() || g->is_ce() || g->is_ll()) + troff_tag(g); +@@ -5158,6 +5163,8 @@ html_printer::~html_printer() + fputs("\n", stdout); + fputs("\n", stdout); + } ++ ++ delete page_contents; + } + + /* +@@ -5248,6 +5255,12 @@ void html_printer::handle_assertion (int minv, int minh, int maxv, int maxh, con + if (strncmp(cmd, "assertion:[", strlen("assertion:[")) == 0) + page_contents->add_tag(&sbuf_style, string(s), + line_number, minv, minh, maxv, maxh); ++ ++ a_delete cmd; ++ a_delete id; ++ a_delete val; ++ a_delete file; ++ a_delete line; + } + + /* +@@ -5261,11 +5274,16 @@ void html_printer::handle_state_assertion (text_glob *g) + char *n = (char *)&g->text_string[11]; + char *cmd = get_str(n, &n); + char *val = get_str(n, &n); +- (void)get_str(n, &n); // unused ++ a_delete get_str(n, &n); // unused + char *file= get_str(n, &n); + char *line= get_str(n, &n); + + as.build(cmd, val, file, line); ++ ++ a_delete cmd; ++ a_delete val; ++ a_delete file; ++ a_delete line; + } + } + +diff --git a/src/devices/grolbp/lbp.cpp b/src/devices/grolbp/lbp.cpp +index fbd1bbf..9ebf4c5 100644 +--- a/src/devices/grolbp/lbp.cpp ++++ b/src/devices/grolbp/lbp.cpp +@@ -271,6 +271,7 @@ char *lbp_printer::font_name(const lbp_font *f, const int siz) + sprintf(bfont_name, "%c%s%d", ori, nam, cpi); + else + sprintf(bfont_name, "%c%s%d%c", ori, nam, cpi, type); ++ a_delete nam; + return bfont_name; + } + +@@ -390,7 +391,7 @@ inline void lbp_printer::setfillmode(int mode) + else + vdmsetfillmode(mode, 1, 1); // To get black we must use white + // inverted +- fill_mode = mode; ++ fill_mode = mode; + } + } + +@@ -406,6 +407,7 @@ inline void lbp_printer::polygon(int hpos, int vpos, int np, int *p) + // for (i = 0; i < np; i++) fprintf(stderr, " %d ", p[i]); + // fprintf(stderr, "\n"); + vdmpolygon((np /2) + 1, points); ++ a_delete points; + } + + void lbp_printer::draw(int code, int *p, int np, const environment *env) +diff --git a/src/include/relocate.h b/src/include/relocate.h +index 905dcbb..3fbfa7d 100644 +--- a/src/include/relocate.h ++++ b/src/include/relocate.h +@@ -32,6 +32,13 @@ extern + #endif + char *relocatep (const char *path); + ++/* This function has C linkage. */ ++extern ++#ifdef __cplusplus ++"C" ++#endif ++void free_relocated_path(char *path); ++ + #ifdef __cplusplus + char *relocate (const char *path); + #endif +diff --git a/src/libs/libbib/index.cpp b/src/libs/libbib/index.cpp +index ea4df53..051f5ce 100644 +--- a/src/libs/libbib/index.cpp ++++ b/src/libs/libbib/index.cpp +@@ -275,8 +275,10 @@ search_item *make_index_search_item(const char *filename, int fid) + strcpy(index_filename, filename); + strcat(index_filename, INDEX_SUFFIX); + int fd = open(index_filename, O_RDONLY | O_BINARY); +- if (fd < 0) ++ if (fd < 0) { ++ a_delete index_filename; + return 0; ++ } + index_search_item *item = new index_search_item(index_filename, fid); + a_delete index_filename; + if (!item->load(fd)) { +diff --git a/src/libs/libgroff/localcharset.c b/src/libs/libgroff/localcharset.c +index 1c17af0..2848038 100644 +--- a/src/libs/libgroff/localcharset.c ++++ b/src/libs/libgroff/localcharset.c +@@ -130,6 +130,7 @@ get_charset_aliases (void) + { + #if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__) + const char *dir; ++ const char *libdir = NULL; + const char *base = "charset.alias"; + char *file_name; + +@@ -137,7 +138,7 @@ get_charset_aliases (void) + necessary for running the testsuite before "make install". */ + dir = getenv ("CHARSETALIASDIR"); + if (dir == NULL || dir[0] == '\0') +- dir = relocate (LIBDIR); ++ dir = libdir = relocate (LIBDIR); + + /* Concatenate dir and base into freshly allocated file_name. */ + { +@@ -154,6 +155,9 @@ get_charset_aliases (void) + } + } + ++ if (libdir != NULL) ++ free_relocated_path ((char *) libdir); ++ + if (file_name == NULL) + /* Out of memory. Treat the file as empty. */ + cp = ""; +diff --git a/src/libs/libgroff/relocate.cpp b/src/libs/libgroff/relocate.cpp +index ead2d6b..a82dd82 100644 +--- a/src/libs/libgroff/relocate.cpp ++++ b/src/libs/libgroff/relocate.cpp +@@ -172,6 +172,7 @@ void set_current_prefix() + fprintf(stderr, "curr_prefix: %s\n", curr_prefix); + # endif /* DEBUG */ + #else /* !_WIN32 */ ++ a_delete curr_prefix; + curr_prefix = searchpath(program_name, getenv("PATH")); + if (!curr_prefix && !strchr(program_name, '.')) { // try with extensions + pathextstr = strsave(getenv("PATHEXT")); +@@ -220,6 +221,11 @@ char *relocatep(const char *path) + return relocated_path; + } + ++void free_relocated_path(char *path) ++{ ++ a_delete path; ++} ++ + // Return the original pathname if it exists; + // otherwise return the relocated path. + char *relocate(const char *path) +diff --git a/src/preproc/eqn/eqn.cpp b/src/preproc/eqn/eqn.cpp +deleted file mode 100644 +index ea96fc1..0000000 +--- a/src/preproc/eqn/eqn.cpp ++++ /dev/null +@@ -1,2163 +0,0 @@ +-/* A Bison parser, made by GNU Bison 3.0.2. */ +- +-/* Bison implementation for Yacc-like parsers in C +- +- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. +- +- This program is free software: you can redistribute it and/or modify +- it under the terms of the GNU General Public License as published by +- the Free Software Foundation, either version 3 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU General Public License for more details. +- +- You should have received a copy of the GNU General Public License +- along with this program. If not, see . */ +- +-/* 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. +- +- This special exception was added by the Free Software Foundation in +- version 2.2 of Bison. */ +- +-/* 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 +- variables, as they might otherwise be expanded by user macros. +- There are some unavoidable exceptions within include files to +- define necessary library symbols; they are noted "INFRINGES ON +- USER NAME SPACE" below. */ +- +-/* Identify Bison output. */ +-#define YYBISON 1 +- +-/* Bison version. */ +-#define YYBISON_VERSION "3.0.2" +- +-/* Skeleton name. */ +-#define YYSKELETON_NAME "yacc.c" +- +-/* Pure parsers. */ +-#define YYPURE 0 +- +-/* Push parsers. */ +-#define YYPUSH 0 +- +-/* Pull parsers. */ +-#define YYPULL 1 +- +- +- +- +-/* Copy the first part of user declarations. */ +-#line 18 "eqn.y" /* yacc.c:339 */ +- +-#include +-#include +-#include +- +-#include "lib.h" +-#include "box.h" +-extern int non_empty_flag; +-int yylex(); +-void yyerror(const char *); +- +-#line 78 "eqn.cpp" /* yacc.c:339 */ +- +-# ifndef YY_NULLPTR +-# if defined __cplusplus && 201103L <= __cplusplus +-# define YY_NULLPTR nullptr +-# else +-# define YY_NULLPTR 0 +-# endif +-# endif +- +-/* Enabling verbose error messages. */ +-#ifdef YYERROR_VERBOSE +-# undef YYERROR_VERBOSE +-# define YYERROR_VERBOSE 1 +-#else +-# define YYERROR_VERBOSE 0 +-#endif +- +-/* In a future release of Bison, this section will be replaced +- by #include "y.tab.h". */ +-#ifndef YY_YY_Y_TAB_H_INCLUDED +-# define YY_YY_Y_TAB_H_INCLUDED +-/* Debug traces. */ +-#ifndef YYDEBUG +-# define YYDEBUG 0 +-#endif +-#if YYDEBUG +-extern int yydebug; +-#endif +- +-/* Token type. */ +-#ifndef YYTOKENTYPE +-# define YYTOKENTYPE +- enum yytokentype +- { +- OVER = 258, +- SMALLOVER = 259, +- SQRT = 260, +- SUB = 261, +- SUP = 262, +- LPILE = 263, +- RPILE = 264, +- CPILE = 265, +- PILE = 266, +- LEFT = 267, +- RIGHT = 268, +- TO = 269, +- FROM = 270, +- SIZE = 271, +- FONT = 272, +- ROMAN = 273, +- BOLD = 274, +- ITALIC = 275, +- FAT = 276, +- ACCENT = 277, +- BAR = 278, +- UNDER = 279, +- ABOVE = 280, +- TEXT = 281, +- QUOTED_TEXT = 282, +- FWD = 283, +- BACK = 284, +- DOWN = 285, +- UP = 286, +- MATRIX = 287, +- COL = 288, +- LCOL = 289, +- RCOL = 290, +- CCOL = 291, +- MARK = 292, +- LINEUP = 293, +- TYPE = 294, +- VCENTER = 295, +- PRIME = 296, +- SPLIT = 297, +- NOSPLIT = 298, +- UACCENT = 299, +- SPECIAL = 300, +- SPACE = 301, +- GFONT = 302, +- GSIZE = 303, +- DEFINE = 304, +- NDEFINE = 305, +- TDEFINE = 306, +- SDEFINE = 307, +- UNDEF = 308, +- IFDEF = 309, +- INCLUDE = 310, +- DELIM = 311, +- CHARTYPE = 312, +- SET = 313, +- GRFONT = 314, +- GBFONT = 315 +- }; +-#endif +-/* Tokens. */ +-#define OVER 258 +-#define SMALLOVER 259 +-#define SQRT 260 +-#define SUB 261 +-#define SUP 262 +-#define LPILE 263 +-#define RPILE 264 +-#define CPILE 265 +-#define PILE 266 +-#define LEFT 267 +-#define RIGHT 268 +-#define TO 269 +-#define FROM 270 +-#define SIZE 271 +-#define FONT 272 +-#define ROMAN 273 +-#define BOLD 274 +-#define ITALIC 275 +-#define FAT 276 +-#define ACCENT 277 +-#define BAR 278 +-#define UNDER 279 +-#define ABOVE 280 +-#define TEXT 281 +-#define QUOTED_TEXT 282 +-#define FWD 283 +-#define BACK 284 +-#define DOWN 285 +-#define UP 286 +-#define MATRIX 287 +-#define COL 288 +-#define LCOL 289 +-#define RCOL 290 +-#define CCOL 291 +-#define MARK 292 +-#define LINEUP 293 +-#define TYPE 294 +-#define VCENTER 295 +-#define PRIME 296 +-#define SPLIT 297 +-#define NOSPLIT 298 +-#define UACCENT 299 +-#define SPECIAL 300 +-#define SPACE 301 +-#define GFONT 302 +-#define GSIZE 303 +-#define DEFINE 304 +-#define NDEFINE 305 +-#define TDEFINE 306 +-#define SDEFINE 307 +-#define UNDEF 308 +-#define IFDEF 309 +-#define INCLUDE 310 +-#define DELIM 311 +-#define CHARTYPE 312 +-#define SET 313 +-#define GRFONT 314 +-#define GBFONT 315 +- +-/* Value type. */ +-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +-typedef union YYSTYPE YYSTYPE; +-union YYSTYPE +-{ +-#line 30 "eqn.y" /* yacc.c:355 */ +- +- char *str; +- box *b; +- pile_box *pb; +- matrix_box *mb; +- int n; +- column *col; +- +-#line 247 "eqn.cpp" /* yacc.c:355 */ +-}; +-# define YYSTYPE_IS_TRIVIAL 1 +-# define YYSTYPE_IS_DECLARED 1 +-#endif +- +- +-extern YYSTYPE yylval; +- +-int yyparse (void); +- +-#endif /* !YY_YY_Y_TAB_H_INCLUDED */ +- +-/* Copy the second part of user declarations. */ +- +-#line 262 "eqn.cpp" /* yacc.c:358 */ +- +-#ifdef short +-# undef short +-#endif +- +-#ifdef YYTYPE_UINT8 +-typedef YYTYPE_UINT8 yytype_uint8; +-#else +-typedef unsigned char yytype_uint8; +-#endif +- +-#ifdef YYTYPE_INT8 +-typedef YYTYPE_INT8 yytype_int8; +-#else +-typedef signed char 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 +-# include /* INFRINGES ON USER NAME SPACE */ +-# define YYSIZE_T size_t +-# else +-# define YYSIZE_T unsigned int +-# endif +-#endif +- +-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) +- +-#ifndef YY_ +-# if defined YYENABLE_NLS && YYENABLE_NLS +-# if ENABLE_NLS +-# include /* INFRINGES ON USER NAME SPACE */ +-# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +-# endif +-# endif +-# ifndef YY_ +-# define YY_(Msgid) Msgid +-# endif +-#endif +- +-#ifndef YY_ATTRIBUTE +-# if (defined __GNUC__ \ +- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ +- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +-# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +-# else +-# define YY_ATTRIBUTE(Spec) /* empty */ +-# endif +-#endif +- +-#ifndef YY_ATTRIBUTE_PURE +-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +-#endif +- +-#ifndef YY_ATTRIBUTE_UNUSED +-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +-#endif +- +-#if !defined _Noreturn \ +- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +-# if defined _MSC_VER && 1200 <= _MSC_VER +-# define _Noreturn __declspec (noreturn) +-# else +-# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +-# endif +-#endif +- +-/* Suppress unused-variable warnings by "using" E. */ +-#if ! defined lint || defined __GNUC__ +-# define YYUSE(E) ((void) (E)) +-#else +-# define YYUSE(E) /* empty */ +-#endif +- +-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +-/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +- _Pragma ("GCC diagnostic push") \ +- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ +- _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ +- _Pragma ("GCC diagnostic pop") +-#else +-# define YY_INITIAL_VALUE(Value) Value +-#endif +-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +-# define YY_IGNORE_MAYBE_UNINITIALIZED_END +-#endif +-#ifndef YY_INITIAL_VALUE +-# define YY_INITIAL_VALUE(Value) /* Nothing. */ +-#endif +- +- +-#if ! defined yyoverflow || YYERROR_VERBOSE +- +-/* The parser invokes alloca or malloc; define the necessary symbols. */ +- +-# ifdef YYSTACK_USE_ALLOCA +-# if YYSTACK_USE_ALLOCA +-# ifdef __GNUC__ +-# define YYSTACK_ALLOC __builtin_alloca +-# elif defined __BUILTIN_VA_ARG_INCR +-# include /* INFRINGES ON USER NAME SPACE */ +-# elif defined _AIX +-# define YYSTACK_ALLOC __alloca +-# elif defined _MSC_VER +-# include /* INFRINGES ON USER NAME SPACE */ +-# define alloca _alloca +-# else +-# define YYSTACK_ALLOC alloca +-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +-# include /* INFRINGES ON USER NAME SPACE */ +- /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +-# ifndef EXIT_SUCCESS +-# define EXIT_SUCCESS 0 +-# endif +-# endif +-# endif +-# endif +-# endif +- +-# ifdef YYSTACK_ALLOC +- /* Pacify GCC's 'empty if-body' warning. */ +-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +-# ifndef YYSTACK_ALLOC_MAXIMUM +- /* The OS might guarantee only one guard page at the bottom of the stack, +- and a page size can be as small as 4096 bytes. So we cannot safely +- 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 +-# define YYSTACK_ALLOC YYMALLOC +-# define YYSTACK_FREE YYFREE +-# ifndef YYSTACK_ALLOC_MAXIMUM +-# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +-# endif +-# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +- && ! ((defined YYMALLOC || defined malloc) \ +- && (defined YYFREE || defined free))) +-# include /* INFRINGES ON USER NAME SPACE */ +-# ifndef EXIT_SUCCESS +-# define EXIT_SUCCESS 0 +-# endif +-# endif +-# ifndef YYMALLOC +-# define YYMALLOC malloc +-# if ! defined malloc && ! defined EXIT_SUCCESS +-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +-# endif +-# endif +-# ifndef YYFREE +-# define YYFREE free +-# if ! defined free && ! defined EXIT_SUCCESS +-void free (void *); /* INFRINGES ON USER NAME SPACE */ +-# endif +-# endif +-# endif +-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ +- +- +-#if (! defined yyoverflow \ +- && (! defined __cplusplus \ +- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) +- +-/* A type that is properly aligned for any stack member. */ +-union yyalloc +-{ +- yytype_int16 yyss_alloc; +- YYSTYPE yyvs_alloc; +-}; +- +-/* The size of the maximum gap between one aligned stack and the next. */ +-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +- +-/* The size of an array large to enough to hold all stacks, each with +- N elements. */ +-# define YYSTACK_BYTES(N) \ +- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ +- + YYSTACK_GAP_MAXIMUM) +- +-# define YYCOPY_NEEDED 1 +- +-/* Relocate STACK from its old location to the new one. The +- local variables YYSIZE and YYSTACKSIZE give the old and new number of +- elements in the stack, and YYPTR gives the new location of the +- stack. Advance YYPTR to a properly aligned location for the next +- stack. */ +-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ +- do \ +- { \ +- YYSIZE_T yynewbytes; \ +- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ +- Stack = &yyptr->Stack_alloc; \ +- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ +- yyptr += yynewbytes / sizeof (*yyptr); \ +- } \ +- while (0) +- +-#endif +- +-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +-/* Copy COUNT objects from SRC to DST. The source and destination do +- not overlap. */ +-# ifndef YYCOPY +-# if defined __GNUC__ && 1 < __GNUC__ +-# define YYCOPY(Dst, Src, Count) \ +- __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +-# else +-# define YYCOPY(Dst, Src, Count) \ +- do \ +- { \ +- YYSIZE_T yyi; \ +- for (yyi = 0; yyi < (Count); yyi++) \ +- (Dst)[yyi] = (Src)[yyi]; \ +- } \ +- while (0) +-# endif +-# endif +-#endif /* !YYCOPY_NEEDED */ +- +-/* YYFINAL -- State number of the termination state. */ +-#define YYFINAL 72 +-/* YYLAST -- Last index in YYTABLE. */ +-#define YYLAST 379 +- +-/* YYNTOKENS -- Number of terminals. */ +-#define YYNTOKENS 66 +-/* YYNNTS -- Number of nonterminals. */ +-#define YYNNTS 18 +-/* YYNRULES -- Number of rules. */ +-#define YYNRULES 75 +-/* YYNSTATES -- Number of states. */ +-#define YYNSTATES 142 +- +-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned +- by yylex, with out-of-bounds checking. */ +-#define YYUNDEFTOK 2 +-#define YYMAXUTOK 315 +- +-#define YYTRANSLATE(YYX) \ +- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +- +-/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM +- as returned by yylex, without out-of-bounds checking. */ +-static const yytype_uint8 yytranslate[] = +-{ +- 0, 2, 2, 2, 2, 2, 2, 2, 2, 63, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 61, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 64, 2, 65, 62, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, +- 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, +- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, +- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, +- 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, +- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, +- 55, 56, 57, 58, 59, 60 +-}; +- +-#if YYDEBUG +- /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +-static const yytype_uint16 yyrline[] = +-{ +- 0, 121, 121, 123, 128, 130, 141, 143, 145, 150, +- 152, 154, 156, 158, 163, 165, 167, 169, 174, 176, +- 181, 183, 185, 190, 192, 194, 196, 198, 200, 202, +- 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, +- 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, +- 244, 246, 248, 250, 252, 254, 259, 269, 271, 276, +- 278, 283, 285, 290, 292, 297, 299, 304, 306, 308, +- 310, 314, 316, 321, 323, 325 +-}; +-#endif +- +-#if YYDEBUG || YYERROR_VERBOSE || 0 +-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. +- First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +-static const char *const yytname[] = +-{ +- "$end", "error", "$undefined", "OVER", "SMALLOVER", "SQRT", "SUB", +- "SUP", "LPILE", "RPILE", "CPILE", "PILE", "LEFT", "RIGHT", "TO", "FROM", +- "SIZE", "FONT", "ROMAN", "BOLD", "ITALIC", "FAT", "ACCENT", "BAR", +- "UNDER", "ABOVE", "TEXT", "QUOTED_TEXT", "FWD", "BACK", "DOWN", "UP", +- "MATRIX", "COL", "LCOL", "RCOL", "CCOL", "MARK", "LINEUP", "TYPE", +- "VCENTER", "PRIME", "SPLIT", "NOSPLIT", "UACCENT", "SPECIAL", "SPACE", +- "GFONT", "GSIZE", "DEFINE", "NDEFINE", "TDEFINE", "SDEFINE", "UNDEF", +- "IFDEF", "INCLUDE", "DELIM", "CHARTYPE", "SET", "GRFONT", "GBFONT", +- "'^'", "'~'", "'\\t'", "'{'", "'}'", "$accept", "top", "equation", +- "mark", "from_to", "sqrt_over", "script", "nonsup", "simple", "number", +- "pile_element_list", "pile_arg", "column_list", "column_element_list", +- "column_arg", "column", "text", "delim", YY_NULLPTR +-}; +-#endif +- +-# ifdef YYPRINT +-/* YYTOKNUM[NUM] -- (External) token number corresponding to the +- (internal) symbol number NUM (which must be that of a token). */ +-static const yytype_uint16 yytoknum[] = +-{ +- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, +- 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, +- 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, +- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, +- 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, +- 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, +- 315, 94, 126, 9, 123, 125 +-}; +-# endif +- +-#define YYPACT_NINF -76 +- +-#define yypact_value_is_default(Yystate) \ +- (!!((Yystate) == (-76))) +- +-#define YYTABLE_NINF -1 +- +-#define yytable_value_is_error(Yytable_value) \ +- 0 +- +- /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing +- STATE-NUM. */ +-static const yytype_int16 yypact[] = +-{ +- 230, 269, 6, 6, 6, 6, 2, 14, 14, 308, +- 308, 308, 308, -76, -76, 14, 14, 14, 14, -50, +- 230, 230, 14, 308, 4, 23, 14, -76, -76, -76, +- 230, 24, 230, -76, -76, 70, -76, -76, 20, -76, +- -76, -76, 230, -44, -76, -76, -76, -76, -76, -76, +- -76, -76, 230, 308, 308, 57, 57, 57, 57, 308, +- 308, 308, 308, 3, -76, -76, 308, 57, -76, -76, +- 308, 130, -76, -76, 269, 269, 269, 269, 308, 308, +- 308, -76, -76, -76, 308, 230, -12, 230, 191, 57, +- 57, 57, 57, 57, 57, 8, 8, 8, 8, 12, +- -76, 57, 57, -76, -76, -76, -76, 79, -76, 335, +- -76, -76, -76, 230, -76, -6, 2, 230, 28, -76, +- -76, -76, -76, -76, -76, 269, 269, 308, 230, -76, +- -76, 230, -3, 230, -76, -76, -76, 230, -76, -2, +- 230, -76 +-}; +- +- /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. +- Performed when YYTABLE does not specify something else to do. Zero +- means the default is an error. */ +-static const yytype_uint8 yydefact[] = +-{ +- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 23, 24, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 27, 28, 29, +- 0, 0, 3, 4, 6, 9, 14, 18, 20, 15, +- 71, 72, 0, 0, 32, 56, 33, 34, 31, 74, +- 75, 73, 0, 0, 0, 43, 44, 45, 46, 0, +- 0, 0, 0, 0, 7, 8, 0, 54, 25, 26, +- 0, 0, 1, 5, 0, 0, 0, 0, 0, 0, +- 0, 38, 39, 40, 0, 57, 0, 0, 37, 48, +- 47, 49, 50, 52, 51, 0, 0, 0, 0, 0, +- 61, 53, 55, 30, 16, 17, 10, 11, 21, 20, +- 19, 41, 42, 0, 59, 0, 0, 0, 0, 67, +- 68, 69, 70, 35, 62, 0, 0, 0, 58, 60, +- 36, 63, 0, 0, 12, 13, 22, 0, 65, 0, +- 64, 66 +-}; +- +- /* YYPGOTO[NTERM-NUM]. */ +-static const yytype_int8 yypgoto[] = +-{ +- -76, -76, 0, -17, -75, 1, -67, -13, 46, -7, +- 9, 13, -76, -47, 22, -4, -1, -29 +-}; +- +- /* YYDEFGOTO[NTERM-NUM]. */ +-static const yytype_int16 yydefgoto[] = +-{ +- -1, 31, 85, 33, 34, 35, 36, 37, 38, 43, +- 86, 44, 99, 132, 119, 100, 45, 52 +-}; +- +- /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If +- positive, shift that token. If negative, reduce the rule whose +- number is the opposite. If YYTABLE_NINF, syntax error. */ +-static const yytype_uint8 yytable[] = +-{ +- 32, 106, 39, 64, 65, 51, 53, 54, 59, 60, +- 61, 62, 110, 113, 63, 73, 46, 47, 48, 113, +- 87, 66, 137, 137, 72, 70, 78, 79, 40, 41, +- 71, 68, 40, 41, 40, 41, 95, 96, 97, 98, +- 40, 41, 80, 81, 82, 95, 96, 97, 98, 69, +- 134, 135, 88, 114, 73, 55, 56, 57, 58, 129, +- 136, 83, 138, 141, 84, 108, 49, 50, 73, 67, +- 42, 73, 117, 74, 75, 104, 105, 123, 107, 80, +- 81, 82, 74, 75, 76, 77, 139, 130, 118, 118, +- 118, 118, 133, 125, 126, 124, 115, 0, 83, 89, +- 90, 84, 0, 0, 0, 91, 92, 93, 94, 0, +- 0, 73, 101, 128, 73, 51, 102, 131, 120, 121, +- 122, 0, 0, 73, 109, 0, 111, 0, 0, 0, +- 112, 0, 0, 131, 0, 1, 0, 140, 2, 3, +- 4, 5, 6, 0, 0, 0, 7, 8, 9, 10, +- 11, 12, 0, 0, 0, 0, 13, 14, 15, 16, +- 17, 18, 19, 0, 0, 0, 0, 20, 21, 22, +- 23, 0, 24, 25, 0, 26, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +- 0, 27, 28, 29, 30, 103, 1, 0, 0, 2, +- 3, 4, 5, 6, 116, 0, 0, 7, 8, 9, +- 10, 11, 12, 0, 0, 0, 0, 13, 14, 15, +- 16, 17, 18, 19, 0, 0, 0, 0, 20, 21, +- 22, 23, 0, 24, 25, 1, 26, 0, 2, 3, +- 4, 5, 6, 0, 0, 0, 7, 8, 9, 10, +- 11, 12, 27, 28, 29, 30, 13, 14, 15, 16, +- 17, 18, 19, 0, 0, 0, 0, 20, 21, 22, +- 23, 0, 24, 25, 1, 26, 0, 2, 3, 4, +- 5, 6, 0, 0, 0, 7, 8, 9, 10, 11, +- 12, 27, 28, 29, 30, 13, 14, 15, 16, 17, +- 18, 19, 0, 0, 0, 0, 0, 0, 22, 23, +- 0, 24, 25, 0, 26, 0, 2, 3, 4, 5, +- 6, 0, 0, 0, 7, 8, 9, 10, 11, 12, +- 27, 28, 29, 30, 13, 14, 15, 16, 17, 18, +- 19, 78, 127, 0, 0, 0, 0, 22, 23, 0, +- 24, 25, 0, 26, 0, 0, 0, 80, 81, 82, +- 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, +- 28, 29, 30, 0, 0, 0, 83, 0, 0, 84 +-}; +- +-static const yytype_int16 yycheck[] = +-{ +- 0, 76, 1, 20, 21, 6, 7, 8, 15, 16, +- 17, 18, 79, 25, 64, 32, 3, 4, 5, 25, +- 64, 22, 25, 25, 0, 26, 6, 7, 26, 27, +- 30, 27, 26, 27, 26, 27, 33, 34, 35, 36, +- 26, 27, 22, 23, 24, 33, 34, 35, 36, 26, +- 125, 126, 52, 65, 71, 9, 10, 11, 12, 65, +- 127, 41, 65, 65, 44, 78, 64, 65, 85, 23, +- 64, 88, 64, 3, 4, 74, 75, 65, 77, 22, +- 23, 24, 3, 4, 14, 15, 133, 116, 95, 96, +- 97, 98, 64, 14, 15, 99, 87, -1, 41, 53, +- 54, 44, -1, -1, -1, 59, 60, 61, 62, -1, +- -1, 128, 66, 113, 131, 116, 70, 117, 96, 97, +- 98, -1, -1, 140, 78, -1, 80, -1, -1, -1, +- 84, -1, -1, 133, -1, 5, -1, 137, 8, 9, +- 10, 11, 12, -1, -1, -1, 16, 17, 18, 19, +- 20, 21, -1, -1, -1, -1, 26, 27, 28, 29, +- 30, 31, 32, -1, -1, -1, -1, 37, 38, 39, +- 40, -1, 42, 43, -1, 45, -1, -1, -1, -1, +- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +- -1, 61, 62, 63, 64, 65, 5, -1, -1, 8, +- 9, 10, 11, 12, 13, -1, -1, 16, 17, 18, +- 19, 20, 21, -1, -1, -1, -1, 26, 27, 28, +- 29, 30, 31, 32, -1, -1, -1, -1, 37, 38, +- 39, 40, -1, 42, 43, 5, 45, -1, 8, 9, +- 10, 11, 12, -1, -1, -1, 16, 17, 18, 19, +- 20, 21, 61, 62, 63, 64, 26, 27, 28, 29, +- 30, 31, 32, -1, -1, -1, -1, 37, 38, 39, +- 40, -1, 42, 43, 5, 45, -1, 8, 9, 10, +- 11, 12, -1, -1, -1, 16, 17, 18, 19, 20, +- 21, 61, 62, 63, 64, 26, 27, 28, 29, 30, +- 31, 32, -1, -1, -1, -1, -1, -1, 39, 40, +- -1, 42, 43, -1, 45, -1, 8, 9, 10, 11, +- 12, -1, -1, -1, 16, 17, 18, 19, 20, 21, +- 61, 62, 63, 64, 26, 27, 28, 29, 30, 31, +- 32, 6, 7, -1, -1, -1, -1, 39, 40, -1, +- 42, 43, -1, 45, -1, -1, -1, 22, 23, 24, +- -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, +- 62, 63, 64, -1, -1, -1, 41, -1, -1, 44 +-}; +- +- /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing +- symbol of state STATE-NUM. */ +-static const yytype_uint8 yystos[] = +-{ +- 0, 5, 8, 9, 10, 11, 12, 16, 17, 18, +- 19, 20, 21, 26, 27, 28, 29, 30, 31, 32, +- 37, 38, 39, 40, 42, 43, 45, 61, 62, 63, +- 64, 67, 68, 69, 70, 71, 72, 73, 74, 71, +- 26, 27, 64, 75, 77, 82, 77, 77, 77, 64, +- 65, 82, 83, 82, 82, 74, 74, 74, 74, 75, +- 75, 75, 75, 64, 69, 69, 82, 74, 27, 26, +- 82, 68, 0, 69, 3, 4, 14, 15, 6, 7, +- 22, 23, 24, 41, 44, 68, 76, 64, 68, 74, +- 74, 74, 74, 74, 74, 33, 34, 35, 36, 78, +- 81, 74, 74, 65, 71, 71, 70, 71, 73, 74, +- 72, 74, 74, 25, 65, 76, 13, 64, 75, 80, +- 80, 80, 80, 65, 81, 14, 15, 7, 68, 65, +- 83, 68, 79, 64, 70, 70, 72, 25, 65, 79, +- 68, 65 +-}; +- +- /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +-static const yytype_uint8 yyr1[] = +-{ +- 0, 66, 67, 67, 68, 68, 69, 69, 69, 70, +- 70, 70, 70, 70, 71, 71, 71, 71, 72, 72, +- 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, +- 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, +- 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, +- 74, 74, 74, 74, 74, 74, 75, 76, 76, 77, +- 77, 78, 78, 79, 79, 80, 80, 81, 81, 81, +- 81, 82, 82, 83, 83, 83 +-}; +- +- /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +-static const yytype_uint8 yyr2[] = +-{ +- 0, 2, 0, 1, 1, 2, 1, 2, 2, 1, +- 3, 3, 5, 5, 1, 2, 3, 3, 1, 3, +- 1, 3, 5, 1, 1, 2, 2, 1, 1, 1, +- 3, 2, 2, 2, 2, 4, 5, 3, 2, 2, +- 2, 3, 3, 2, 2, 2, 2, 3, 3, 3, +- 3, 3, 3, 3, 2, 3, 1, 1, 3, 3, +- 4, 1, 2, 1, 3, 3, 4, 2, 2, 2, +- 2, 1, 1, 1, 1, 1 +-}; +- +- +-#define yyerrok (yyerrstatus = 0) +-#define yyclearin (yychar = YYEMPTY) +-#define YYEMPTY (-2) +-#define YYEOF 0 +- +-#define YYACCEPT goto yyacceptlab +-#define YYABORT goto yyabortlab +-#define YYERROR goto yyerrorlab +- +- +-#define YYRECOVERING() (!!yyerrstatus) +- +-#define YYBACKUP(Token, Value) \ +-do \ +- if (yychar == YYEMPTY) \ +- { \ +- yychar = (Token); \ +- yylval = (Value); \ +- YYPOPSTACK (yylen); \ +- yystate = *yyssp; \ +- goto yybackup; \ +- } \ +- else \ +- { \ +- yyerror (YY_("syntax error: cannot back up")); \ +- YYERROR; \ +- } \ +-while (0) +- +-/* Error token number */ +-#define YYTERROR 1 +-#define YYERRCODE 256 +- +- +- +-/* Enable debugging if requested. */ +-#if YYDEBUG +- +-# ifndef YYFPRINTF +-# include /* INFRINGES ON USER NAME SPACE */ +-# define YYFPRINTF fprintf +-# endif +- +-# define YYDPRINTF(Args) \ +-do { \ +- if (yydebug) \ +- YYFPRINTF Args; \ +-} while (0) +- +-/* This macro is provided for backward compatibility. */ +-#ifndef YY_LOCATION_PRINT +-# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +-#endif +- +- +-# 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 (0) +- +- +-/*----------------------------------------. +-| Print this symbol's value on YYOUTPUT. | +-`----------------------------------------*/ +- +-static void +-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +-{ +- FILE *yyo = yyoutput; +- YYUSE (yyo); +- if (!yyvaluep) +- return; +-# ifdef YYPRINT +- if (yytype < YYNTOKENS) +- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +-# endif +- YYUSE (yytype); +-} +- +- +-/*--------------------------------. +-| Print this symbol on YYOUTPUT. | +-`--------------------------------*/ +- +-static void +-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +-{ +- YYFPRINTF (yyoutput, "%s %s (", +- yytype < YYNTOKENS ? "token" : "nterm", 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 (included). | +-`------------------------------------------------------------------*/ +- +-static void +-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +-{ +- YYFPRINTF (stderr, "Stack now"); +- for (; yybottom <= yytop; yybottom++) +- { +- int yybot = *yybottom; +- YYFPRINTF (stderr, " %d", yybot); +- } +- YYFPRINTF (stderr, "\n"); +-} +- +-# define YY_STACK_PRINT(Bottom, Top) \ +-do { \ +- if (yydebug) \ +- yy_stack_print ((Bottom), (Top)); \ +-} while (0) +- +- +-/*------------------------------------------------. +-| Report that the YYRULE is going to be reduced. | +-`------------------------------------------------*/ +- +-static void +-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +-{ +- unsigned long int yylno = yyrline[yyrule]; +- int yynrhs = yyr2[yyrule]; +- int yyi; +- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", +- yyrule - 1, yylno); +- /* The symbols being reduced. */ +- for (yyi = 0; yyi < yynrhs; yyi++) +- { +- YYFPRINTF (stderr, " $%d = ", yyi + 1); +- yy_symbol_print (stderr, +- yystos[yyssp[yyi + 1 - yynrhs]], +- &(yyvsp[(yyi + 1) - (yynrhs)]) +- ); +- YYFPRINTF (stderr, "\n"); +- } +-} +- +-# define YY_REDUCE_PRINT(Rule) \ +-do { \ +- if (yydebug) \ +- yy_reduce_print (yyssp, yyvsp, Rule); \ +-} while (0) +- +-/* Nonzero means print parse trace. It is left uninitialized so that +- multiple parsers can coexist. */ +-int yydebug; +-#else /* !YYDEBUG */ +-# define YYDPRINTF(Args) +-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +-# define YY_STACK_PRINT(Bottom, Top) +-# define YY_REDUCE_PRINT(Rule) +-#endif /* !YYDEBUG */ +- +- +-/* YYINITDEPTH -- initial size of the parser's stacks. */ +-#ifndef YYINITDEPTH +-# define YYINITDEPTH 200 +-#endif +- +-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only +- if the built-in stack extension method is used). +- +- Do not make this value too large; the results are undefined if +- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) +- evaluated with infinite-precision integer arithmetic. */ +- +-#ifndef YYMAXDEPTH +-# define YYMAXDEPTH 10000 +-#endif +- +- +-#if YYERROR_VERBOSE +- +-# ifndef yystrlen +-# if defined __GLIBC__ && defined _STRING_H +-# define yystrlen strlen +-# else +-/* Return the length of YYSTR. */ +-static YYSIZE_T +-yystrlen (const char *yystr) +-{ +- YYSIZE_T yylen; +- for (yylen = 0; yystr[yylen]; yylen++) +- continue; +- return yylen; +-} +-# endif +-# endif +- +-# ifndef yystpcpy +-# 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. */ +-static char * +-yystpcpy (char *yydest, const char *yysrc) +-{ +- char *yyd = yydest; +- const char *yys = yysrc; +- +- while ((*yyd++ = *yys++) != '\0') +- continue; +- +- return yyd - 1; +-} +-# endif +-# endif +- +-# 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); +- +- return yystpcpy (yyres, yystr) - yyres; +-} +-# endif +- +-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message +- about the unexpected token YYTOKEN for the state stack whose top is +- YYSSP. +- +- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is +- not large enough to hold the message. In that case, also set +- *YYMSG_ALLOC to the required number of bytes. Return 2 if the +- required number of bytes is too large to store. */ +-static int +-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, +- yytype_int16 *yyssp, int yytoken) +-{ +- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); +- YYSIZE_T yysize = yysize0; +- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; +- /* Internationalized format string. */ +- const char *yyformat = YY_NULLPTR; +- /* Arguments of yyformat. */ +- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; +- /* Number of reported tokens (one for the "unexpected", one per +- "expected"). */ +- int yycount = 0; +- +- /* There are many possibilities here to consider: +- - If this state is a consistent state with a default action, then +- the only way this function was invoked is if the default action +- is an error action. In that case, don't check for expected +- tokens because there are none. +- - The only way there can be no lookahead present (in yychar) is if +- this state is a consistent state with a default action. Thus, +- detecting the absence of a lookahead is sufficient to determine +- that there is no unexpected or expected token to report. In that +- case, just report a simple "syntax error". +- - Don't assume there isn't a lookahead just because this state is a +- consistent state with a default action. There might have been a +- previous inconsistent state, consistent state with a non-default +- action, or user semantic action that manipulated yychar. +- - Of course, the expected token list depends on states to have +- correct lookahead information, and it depends on the parser not +- to perform extra reductions after fetching a lookahead from the +- scanner and before detecting a syntax error. Thus, state merging +- (from LALR or IELR) and default reductions corrupt the expected +- token list. However, the list is correct for canonical LR with +- one exception: it will still contain any token that will not be +- accepted due to an error action in a later state. +- */ +- if (yytoken != YYEMPTY) +- { +- int yyn = yypact[*yyssp]; +- yyarg[yycount++] = yytname[yytoken]; +- if (!yypact_value_is_default (yyn)) +- { +- /* Start YYX at -YYN if negative to avoid negative indexes in +- YYCHECK. In other words, skip the first -YYN actions for +- this state because they are default actions. */ +- int yyxbegin = yyn < 0 ? -yyn : 0; +- /* Stay within bounds of both yycheck and yytname. */ +- int yychecklim = YYLAST - yyn + 1; +- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; +- int yyx; +- +- for (yyx = yyxbegin; yyx < yyxend; ++yyx) +- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR +- && !yytable_value_is_error (yytable[yyx + yyn])) +- { +- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) +- { +- yycount = 1; +- yysize = yysize0; +- break; +- } +- yyarg[yycount++] = yytname[yyx]; +- { +- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); +- if (! (yysize <= yysize1 +- && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) +- return 2; +- yysize = yysize1; +- } +- } +- } +- } +- +- switch (yycount) +- { +-# define YYCASE_(N, S) \ +- case N: \ +- yyformat = S; \ +- break +- YYCASE_(0, YY_("syntax error")); +- YYCASE_(1, YY_("syntax error, unexpected %s")); +- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); +- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); +- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); +- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +-# undef YYCASE_ +- } +- +- { +- YYSIZE_T yysize1 = yysize + yystrlen (yyformat); +- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) +- return 2; +- yysize = yysize1; +- } +- +- if (*yymsg_alloc < yysize) +- { +- *yymsg_alloc = 2 * yysize; +- if (! (yysize <= *yymsg_alloc +- && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) +- *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; +- return 1; +- } +- +- /* Avoid sprintf, as that infringes on the user's name space. +- Don't have undefined behavior even if the translation +- produced a string with the wrong number of "%s"s. */ +- { +- char *yyp = *yymsg; +- int yyi = 0; +- while ((*yyp = *yyformat) != '\0') +- if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) +- { +- yyp += yytnamerr (yyp, yyarg[yyi++]); +- yyformat += 2; +- } +- else +- { +- yyp++; +- yyformat++; +- } +- } +- return 0; +-} +-#endif /* YYERROR_VERBOSE */ +- +-/*-----------------------------------------------. +-| Release the memory associated to this symbol. | +-`-----------------------------------------------*/ +- +-static void +-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +-{ +- YYUSE (yyvaluep); +- if (!yymsg) +- yymsg = "Deleting"; +- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); +- +- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +- YYUSE (yytype); +- YY_IGNORE_MAYBE_UNINITIALIZED_END +-} +- +- +- +- +-/* The lookahead symbol. */ +-int yychar; +- +-/* The semantic value of the lookahead symbol. */ +-YYSTYPE yylval; +-/* Number of syntax errors so far. */ +-int yynerrs; +- +- +-/*----------. +-| yyparse. | +-`----------*/ +- +-int +-yyparse (void) +-{ +- int yystate; +- /* Number of tokens to shift before error messages enabled. */ +- int yyerrstatus; +- +- /* The stacks and their tools: +- 'yyss': related to states. +- 'yyvs': related to semantic values. +- +- Refer to the stacks through separate pointers, to allow yyoverflow +- to reallocate them elsewhere. */ +- +- /* The state stack. */ +- yytype_int16 yyssa[YYINITDEPTH]; +- yytype_int16 *yyss; +- yytype_int16 *yyssp; +- +- /* The semantic value stack. */ +- YYSTYPE yyvsa[YYINITDEPTH]; +- YYSTYPE *yyvs; +- YYSTYPE *yyvsp; +- +- YYSIZE_T yystacksize; +- +- int yyn; +- int yyresult; +- /* Lookahead token as an internal (translated) token number. */ +- int yytoken = 0; +- /* The variables used to return semantic value and location from the +- action routines. */ +- YYSTYPE yyval; +- +-#if YYERROR_VERBOSE +- /* Buffer for error messages, and its allocated size. */ +- char yymsgbuf[128]; +- char *yymsg = yymsgbuf; +- YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +-#endif +- +-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) +- +- /* The number of symbols on the RHS of the reduced rule. +- Keep to zero when no symbol should be popped. */ +- int yylen = 0; +- +- yyssp = yyss = yyssa; +- yyvsp = yyvs = yyvsa; +- yystacksize = YYINITDEPTH; +- +- YYDPRINTF ((stderr, "Starting parse\n")); +- +- yystate = 0; +- yyerrstatus = 0; +- yynerrs = 0; +- yychar = YYEMPTY; /* Cause a token to be read. */ +- goto yysetstate; +- +-/*------------------------------------------------------------. +-| yynewstate -- Push a new state, which is found in yystate. | +-`------------------------------------------------------------*/ +- 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. */ +- yyssp++; +- +- yysetstate: +- *yyssp = yystate; +- +- if (yyss + yystacksize - 1 <= yyssp) +- { +- /* Get the current used size of the three stacks, in elements. */ +- YYSIZE_T yysize = yyssp - yyss + 1; +- +-#ifdef yyoverflow +- { +- /* Give user a chance to reallocate the stack. Use copies of +- these so that the &'s don't force the real ones into +- memory. */ +- YYSTYPE *yyvs1 = yyvs; +- yytype_int16 *yyss1 = yyss; +- +- /* Each stack pointer address is followed by the size of the +- data in use in that stack, in bytes. This used to be a +- conditional around just the two extra args, but that might +- be undefined if yyoverflow is a macro. */ +- yyoverflow (YY_("memory exhausted"), +- &yyss1, yysize * sizeof (*yyssp), +- &yyvs1, yysize * sizeof (*yyvsp), +- &yystacksize); +- +- yyss = yyss1; +- yyvs = yyvs1; +- } +-#else /* no yyoverflow */ +-# ifndef YYSTACK_RELOCATE +- goto yyexhaustedlab; +-# else +- /* Extend the stack our own way. */ +- if (YYMAXDEPTH <= yystacksize) +- goto yyexhaustedlab; +- yystacksize *= 2; +- if (YYMAXDEPTH < yystacksize) +- yystacksize = YYMAXDEPTH; +- +- { +- yytype_int16 *yyss1 = yyss; +- union yyalloc *yyptr = +- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); +- if (! yyptr) +- goto yyexhaustedlab; +- YYSTACK_RELOCATE (yyss_alloc, yyss); +- YYSTACK_RELOCATE (yyvs_alloc, yyvs); +-# undef YYSTACK_RELOCATE +- if (yyss1 != yyssa) +- YYSTACK_FREE (yyss1); +- } +-# endif +-#endif /* no yyoverflow */ +- +- yyssp = yyss + yysize - 1; +- yyvsp = yyvs + yysize - 1; +- +- YYDPRINTF ((stderr, "Stack size increased to %lu\n", +- (unsigned long int) yystacksize)); +- +- if (yyss + yystacksize - 1 <= yyssp) +- YYABORT; +- } +- +- YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +- +- if (yystate == YYFINAL) +- YYACCEPT; +- +- goto yybackup; +- +-/*-----------. +-| yybackup. | +-`-----------*/ +-yybackup: +- +- /* Do appropriate processing given the current state. Read a +- lookahead token if we need one and don't already have one. */ +- +- /* First try to decide what to do without reference to lookahead token. */ +- yyn = yypact[yystate]; +- if (yypact_value_is_default (yyn)) +- goto yydefault; +- +- /* Not known => get a lookahead token if don't already have one. */ +- +- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ +- if (yychar == YYEMPTY) +- { +- YYDPRINTF ((stderr, "Reading a token: ")); +- yychar = yylex (); +- } +- +- if (yychar <= YYEOF) +- { +- yychar = yytoken = YYEOF; +- YYDPRINTF ((stderr, "Now at end of input.\n")); +- } +- else +- { +- yytoken = YYTRANSLATE (yychar); +- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); +- } +- +- /* If the proper action on seeing token YYTOKEN is to reduce or to +- detect an error, take that action. */ +- yyn += yytoken; +- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) +- goto yydefault; +- yyn = yytable[yyn]; +- if (yyn <= 0) +- { +- if (yytable_value_is_error (yyn)) +- goto yyerrlab; +- yyn = -yyn; +- goto yyreduce; +- } +- +- /* Count tokens shifted since error; after three, turn off error +- status. */ +- if (yyerrstatus) +- yyerrstatus--; +- +- /* Shift the lookahead token. */ +- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); +- +- /* Discard the shifted token. */ +- yychar = YYEMPTY; +- +- yystate = yyn; +- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +- *++yyvsp = yylval; +- YY_IGNORE_MAYBE_UNINITIALIZED_END +- +- goto yynewstate; +- +- +-/*-----------------------------------------------------------. +-| yydefault -- do the default action for the current state. | +-`-----------------------------------------------------------*/ +-yydefault: +- yyn = yydefact[yystate]; +- if (yyn == 0) +- goto yyerrlab; +- goto yyreduce; +- +- +-/*-----------------------------. +-| yyreduce -- Do a reduction. | +-`-----------------------------*/ +-yyreduce: +- /* yyn is the number of a rule to reduce with. */ +- yylen = yyr2[yyn]; +- +- /* If YYLEN is nonzero, implement the default value of the action: +- '$$ = $1'. +- +- Otherwise, the following line sets YYVAL to garbage. +- This behavior is undocumented and Bison +- users should not rely upon it. Assigning to YYVAL +- unconditionally makes the parser a bit smaller, and it avoids a +- GCC warning that YYVAL may be used uninitialized. */ +- yyval = yyvsp[1-yylen]; +- +- +- YY_REDUCE_PRINT (yyn); +- switch (yyn) +- { +- case 3: +-#line 124 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[0].b)->top_level(); non_empty_flag = 1; } +-#line 1488 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 4: +-#line 129 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = (yyvsp[0].b); } +-#line 1494 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 5: +-#line 131 "eqn.y" /* yacc.c:1646 */ +- { +- list_box *lb = (yyvsp[-1].b)->to_list_box(); +- if (!lb) +- lb = new list_box((yyvsp[-1].b)); +- lb->append((yyvsp[0].b)); +- (yyval.b) = lb; +- } +-#line 1506 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 6: +-#line 142 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = (yyvsp[0].b); } +-#line 1512 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 7: +-#line 144 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_mark_box((yyvsp[0].b)); } +-#line 1518 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 8: +-#line 146 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_lineup_box((yyvsp[0].b)); } +-#line 1524 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 9: +-#line 151 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = (yyvsp[0].b); } +-#line 1530 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 10: +-#line 153 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_limit_box((yyvsp[-2].b), 0, (yyvsp[0].b)); } +-#line 1536 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 11: +-#line 155 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_limit_box((yyvsp[-2].b), (yyvsp[0].b), 0); } +-#line 1542 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 12: +-#line 157 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_limit_box((yyvsp[-4].b), (yyvsp[-2].b), (yyvsp[0].b)); } +-#line 1548 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 13: +-#line 159 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_limit_box((yyvsp[-4].b), make_limit_box((yyvsp[-2].b), (yyvsp[0].b), 0), 0); } +-#line 1554 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 14: +-#line 164 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = (yyvsp[0].b); } +-#line 1560 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 15: +-#line 166 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_sqrt_box((yyvsp[0].b)); } +-#line 1566 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 16: +-#line 168 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_over_box((yyvsp[-2].b), (yyvsp[0].b)); } +-#line 1572 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 17: +-#line 170 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_small_over_box((yyvsp[-2].b), (yyvsp[0].b)); } +-#line 1578 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 18: +-#line 175 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = (yyvsp[0].b); } +-#line 1584 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 19: +-#line 177 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_script_box((yyvsp[-2].b), 0, (yyvsp[0].b)); } +-#line 1590 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 20: +-#line 182 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = (yyvsp[0].b); } +-#line 1596 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 21: +-#line 184 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_script_box((yyvsp[-2].b), (yyvsp[0].b), 0); } +-#line 1602 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 22: +-#line 186 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_script_box((yyvsp[-4].b), (yyvsp[-2].b), (yyvsp[0].b)); } +-#line 1608 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 23: +-#line 191 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = split_text((yyvsp[0].str)); } +-#line 1614 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 24: +-#line 193 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new quoted_text_box((yyvsp[0].str)); } +-#line 1620 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 25: +-#line 195 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = split_text((yyvsp[0].str)); } +-#line 1626 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 26: +-#line 197 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new quoted_text_box((yyvsp[0].str)); } +-#line 1632 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 27: +-#line 199 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new half_space_box; } +-#line 1638 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 28: +-#line 201 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new space_box; } +-#line 1644 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 29: +-#line 203 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new tab_box; } +-#line 1650 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 30: +-#line 205 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = (yyvsp[-1].b); } +-#line 1656 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 31: +-#line 207 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[0].pb)->set_alignment(CENTER_ALIGN); (yyval.b) = (yyvsp[0].pb); } +-#line 1662 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 32: +-#line 209 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[0].pb)->set_alignment(LEFT_ALIGN); (yyval.b) = (yyvsp[0].pb); } +-#line 1668 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 33: +-#line 211 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[0].pb)->set_alignment(RIGHT_ALIGN); (yyval.b) = (yyvsp[0].pb); } +-#line 1674 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 34: +-#line 213 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[0].pb)->set_alignment(CENTER_ALIGN); (yyval.b) = (yyvsp[0].pb); } +-#line 1680 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 35: +-#line 215 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = (yyvsp[-1].mb); } +-#line 1686 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 36: +-#line 217 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_delim_box((yyvsp[-3].str), (yyvsp[-2].b), (yyvsp[0].str)); } +-#line 1692 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 37: +-#line 219 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_delim_box((yyvsp[-1].str), (yyvsp[0].b), 0); } +-#line 1698 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 38: +-#line 221 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_overline_box((yyvsp[-1].b)); } +-#line 1704 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 39: +-#line 223 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_underline_box((yyvsp[-1].b)); } +-#line 1710 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 40: +-#line 225 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_prime_box((yyvsp[-1].b)); } +-#line 1716 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 41: +-#line 227 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_accent_box((yyvsp[-2].b), (yyvsp[0].b)); } +-#line 1722 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 42: +-#line 229 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_uaccent_box((yyvsp[-2].b), (yyvsp[0].b)); } +-#line 1728 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 43: +-#line 231 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new font_box(strsave(get_grfont()), (yyvsp[0].b)); } +-#line 1734 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 44: +-#line 233 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new font_box(strsave(get_gbfont()), (yyvsp[0].b)); } +-#line 1740 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 45: +-#line 235 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new font_box(strsave(get_gfont()), (yyvsp[0].b)); } +-#line 1746 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 46: +-#line 237 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new fat_box((yyvsp[0].b)); } +-#line 1752 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 47: +-#line 239 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new font_box((yyvsp[-1].str), (yyvsp[0].b)); } +-#line 1758 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 48: +-#line 241 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new size_box((yyvsp[-1].str), (yyvsp[0].b)); } +-#line 1764 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 49: +-#line 243 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new hmotion_box((yyvsp[-1].n), (yyvsp[0].b)); } +-#line 1770 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 50: +-#line 245 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new hmotion_box(-(yyvsp[-1].n), (yyvsp[0].b)); } +-#line 1776 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 51: +-#line 247 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new vmotion_box((yyvsp[-1].n), (yyvsp[0].b)); } +-#line 1782 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 52: +-#line 249 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new vmotion_box(-(yyvsp[-1].n), (yyvsp[0].b)); } +-#line 1788 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 53: +-#line 251 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[0].b)->set_spacing_type((yyvsp[-1].str)); (yyval.b) = (yyvsp[0].b); } +-#line 1794 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 54: +-#line 253 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = new vcenter_box((yyvsp[0].b)); } +-#line 1800 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 55: +-#line 255 "eqn.y" /* yacc.c:1646 */ +- { (yyval.b) = make_special_box((yyvsp[-1].str), (yyvsp[0].b)); } +-#line 1806 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 56: +-#line 260 "eqn.y" /* yacc.c:1646 */ +- { +- int n; +- if (sscanf((yyvsp[0].str), "%d", &n) == 1) +- (yyval.n) = n; +- a_delete (yyvsp[0].str); +- } +-#line 1817 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 57: +-#line 270 "eqn.y" /* yacc.c:1646 */ +- { (yyval.pb) = new pile_box((yyvsp[0].b)); } +-#line 1823 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 58: +-#line 272 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[-2].pb)->append((yyvsp[0].b)); (yyval.pb) = (yyvsp[-2].pb); } +-#line 1829 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 59: +-#line 277 "eqn.y" /* yacc.c:1646 */ +- { (yyval.pb) = (yyvsp[-1].pb); } +-#line 1835 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 60: +-#line 279 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[-1].pb)->set_space((yyvsp[-3].n)); (yyval.pb) = (yyvsp[-1].pb); } +-#line 1841 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 61: +-#line 284 "eqn.y" /* yacc.c:1646 */ +- { (yyval.mb) = new matrix_box((yyvsp[0].col)); } +-#line 1847 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 62: +-#line 286 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[-1].mb)->append((yyvsp[0].col)); (yyval.mb) = (yyvsp[-1].mb); } +-#line 1853 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 63: +-#line 291 "eqn.y" /* yacc.c:1646 */ +- { (yyval.col) = new column((yyvsp[0].b)); } +-#line 1859 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 64: +-#line 293 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[-2].col)->append((yyvsp[0].b)); (yyval.col) = (yyvsp[-2].col); } +-#line 1865 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 65: +-#line 298 "eqn.y" /* yacc.c:1646 */ +- { (yyval.col) = (yyvsp[-1].col); } +-#line 1871 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 66: +-#line 300 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[-1].col)->set_space((yyvsp[-3].n)); (yyval.col) = (yyvsp[-1].col); } +-#line 1877 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 67: +-#line 305 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[0].col)->set_alignment(CENTER_ALIGN); (yyval.col) = (yyvsp[0].col); } +-#line 1883 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 68: +-#line 307 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[0].col)->set_alignment(LEFT_ALIGN); (yyval.col) = (yyvsp[0].col); } +-#line 1889 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 69: +-#line 309 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[0].col)->set_alignment(RIGHT_ALIGN); (yyval.col) = (yyvsp[0].col); } +-#line 1895 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 70: +-#line 311 "eqn.y" /* yacc.c:1646 */ +- { (yyvsp[0].col)->set_alignment(CENTER_ALIGN); (yyval.col) = (yyvsp[0].col); } +-#line 1901 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 71: +-#line 315 "eqn.y" /* yacc.c:1646 */ +- { (yyval.str) = (yyvsp[0].str); } +-#line 1907 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 72: +-#line 317 "eqn.y" /* yacc.c:1646 */ +- { (yyval.str) = (yyvsp[0].str); } +-#line 1913 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 73: +-#line 322 "eqn.y" /* yacc.c:1646 */ +- { (yyval.str) = (yyvsp[0].str); } +-#line 1919 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 74: +-#line 324 "eqn.y" /* yacc.c:1646 */ +- { (yyval.str) = strsave("{"); } +-#line 1925 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- case 75: +-#line 326 "eqn.y" /* yacc.c:1646 */ +- { (yyval.str) = strsave("}"); } +-#line 1931 "eqn.cpp" /* yacc.c:1646 */ +- break; +- +- +-#line 1935 "eqn.cpp" /* yacc.c:1646 */ +- default: break; +- } +- /* User semantic actions sometimes alter yychar, and that requires +- that yytoken be updated with the new translation. We take the +- approach of translating immediately before every use of yytoken. +- One alternative is translating here after every semantic action, +- but that translation would be missed if the semantic action invokes +- YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or +- if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an +- incorrect destructor might then be invoked immediately. In the +- case of YYERROR or YYBACKUP, subsequent parser actions might lead +- to an incorrect destructor call or verbose syntax error message +- before the lookahead is translated. */ +- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); +- +- YYPOPSTACK (yylen); +- yylen = 0; +- YY_STACK_PRINT (yyss, yyssp); +- +- *++yyvsp = yyval; +- +- /* Now 'shift' the result of the reduction. Determine what state +- that goes to, based on the state we popped back to and the rule +- number reduced by. */ +- +- yyn = yyr1[yyn]; +- +- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; +- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) +- yystate = yytable[yystate]; +- else +- yystate = yydefgoto[yyn - YYNTOKENS]; +- +- goto yynewstate; +- +- +-/*--------------------------------------. +-| yyerrlab -- here on detecting error. | +-`--------------------------------------*/ +-yyerrlab: +- /* Make sure we have latest lookahead translation. See comments at +- user semantic actions for why this is necessary. */ +- yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); +- +- /* If not already recovering from an error, report this error. */ +- if (!yyerrstatus) +- { +- ++yynerrs; +-#if ! YYERROR_VERBOSE +- yyerror (YY_("syntax error")); +-#else +-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ +- yyssp, yytoken) +- { +- char const *yymsgp = YY_("syntax error"); +- int yysyntax_error_status; +- yysyntax_error_status = YYSYNTAX_ERROR; +- if (yysyntax_error_status == 0) +- yymsgp = yymsg; +- else if (yysyntax_error_status == 1) +- { +- if (yymsg != yymsgbuf) +- YYSTACK_FREE (yymsg); +- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); +- if (!yymsg) +- { +- yymsg = yymsgbuf; +- yymsg_alloc = sizeof yymsgbuf; +- yysyntax_error_status = 2; +- } +- else +- { +- yysyntax_error_status = YYSYNTAX_ERROR; +- yymsgp = yymsg; +- } +- } +- yyerror (yymsgp); +- if (yysyntax_error_status == 2) +- goto yyexhaustedlab; +- } +-# undef YYSYNTAX_ERROR +-#endif +- } +- +- +- +- if (yyerrstatus == 3) +- { +- /* If just tried and failed to reuse lookahead token after an +- error, discard it. */ +- +- 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 +- token. */ +- goto yyerrlab1; +- +- +-/*---------------------------------------------------. +-| 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; +- +- /* Do not reclaim the symbols of the rule whose action triggered +- this YYERROR. */ +- YYPOPSTACK (yylen); +- yylen = 0; +- YY_STACK_PRINT (yyss, yyssp); +- yystate = *yyssp; +- goto yyerrlab1; +- +- +-/*-------------------------------------------------------------. +-| yyerrlab1 -- common code for both syntax error and YYERROR. | +-`-------------------------------------------------------------*/ +-yyerrlab1: +- yyerrstatus = 3; /* Each real token shifted decrements this. */ +- +- for (;;) +- { +- yyn = yypact[yystate]; +- if (!yypact_value_is_default (yyn)) +- { +- yyn += YYTERROR; +- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) +- { +- yyn = yytable[yyn]; +- if (0 < yyn) +- break; +- } +- } +- +- /* Pop the current state because it cannot handle the error token. */ +- if (yyssp == yyss) +- YYABORT; +- +- +- yydestruct ("Error: popping", +- yystos[yystate], yyvsp); +- YYPOPSTACK (1); +- yystate = *yyssp; +- YY_STACK_PRINT (yyss, yyssp); +- } +- +- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +- *++yyvsp = yylval; +- YY_IGNORE_MAYBE_UNINITIALIZED_END +- +- +- /* Shift the error token. */ +- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); +- +- yystate = yyn; +- goto yynewstate; +- +- +-/*-------------------------------------. +-| yyacceptlab -- YYACCEPT comes here. | +-`-------------------------------------*/ +-yyacceptlab: +- yyresult = 0; +- goto yyreturn; +- +-/*-----------------------------------. +-| yyabortlab -- YYABORT comes here. | +-`-----------------------------------*/ +-yyabortlab: +- yyresult = 1; +- goto yyreturn; +- +-#if !defined yyoverflow || YYERROR_VERBOSE +-/*-------------------------------------------------. +-| yyexhaustedlab -- memory exhaustion comes here. | +-`-------------------------------------------------*/ +-yyexhaustedlab: +- yyerror (YY_("memory exhausted")); +- yyresult = 2; +- /* Fall through. */ +-#endif +- +-yyreturn: +- if (yychar != YYEMPTY) +- { +- /* Make sure we have latest lookahead translation. See comments at +- user semantic actions for why this is necessary. */ +- yytoken = YYTRANSLATE (yychar); +- yydestruct ("Cleanup: discarding lookahead", +- yytoken, &yylval); +- } +- /* Do not reclaim the symbols of the rule whose 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 +-#if YYERROR_VERBOSE +- if (yymsg != yymsgbuf) +- YYSTACK_FREE (yymsg); +-#endif +- return yyresult; +-} +-#line 329 "eqn.y" /* yacc.c:1906 */ +- +diff --git a/src/preproc/grn/main.cpp b/src/preproc/grn/main.cpp +index 55fc27a..ad270c2 100644 +--- a/src/preproc/grn/main.cpp ++++ b/src/preproc/grn/main.cpp +@@ -369,6 +369,9 @@ main(int argc, + } else + fputs(inputline, stdout); + } ++ ++ if (fp != stdin) ++ fclose(fp); + } + + return 0; +diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp +index 978721a..c8b1fc6 100644 +--- a/src/preproc/html/pre-html.cpp ++++ b/src/preproc/html/pre-html.cpp +@@ -935,6 +935,8 @@ int imageList::createPage(int pageno) + sys_fatal("make_message"); + html_system(s, 1); + ++ free(s); ++ + s = make_message("echo showpage | " + "%s%s -q -dBATCH -dSAFER " + "-dDEVICEHEIGHTPOINTS=792 " +@@ -1461,6 +1463,8 @@ int char_buffer::run_output_filter(int filter, int argc, char **argv) + int char_buffer::do_html(int argc, char *argv[]) + { + string s; ++ char **new_argv; ++ int ret; + + alterDeviceTo(argc, argv, 0); + argv += troff_arg; // skip all arguments up to groff +@@ -1472,14 +1476,20 @@ int char_buffer::do_html(int argc, char *argv[]) + s += macroset_template; // do not combine these statements, + // otherwise they will not work + s += '\0'; // the trailing `\0' is ignored +- argv = addRegDef(argc, argv, s.contents()); ++ new_argv = addRegDef(argc, argv, s.contents()); ++ free(argv); ++ argv = new_argv; + argc++; + + if (dialect == xhtml) { +- argv = addRegDef(argc, argv, "-rxhtml=1"); ++ new_argv = addRegDef(argc, argv, "-rxhtml=1"); ++ free(argv); ++ argv = new_argv; + argc++; + if (eqn_flag) { +- argv = addRegDef(argc, argv, "-e"); ++ new_argv = addRegDef(argc, argv, "-e"); ++ free(argv); ++ argv = new_argv; + argc++; + } + } +@@ -1494,7 +1504,9 @@ int char_buffer::do_html(int argc, char *argv[]) + } + #endif + +- return run_output_filter(HTML_OUTPUT_FILTER, argc, argv); ++ ret = run_output_filter(HTML_OUTPUT_FILTER, argc, argv); ++ free(argv); ++ return ret; + } + + /* +@@ -1504,6 +1516,8 @@ int char_buffer::do_html(int argc, char *argv[]) + int char_buffer::do_image(int argc, char *argv[]) + { + string s; ++ char **new_argv; ++ int ret; + + alterDeviceTo(argc, argv, 1); + argv += troff_arg; // skip all arguments up to troff/groff +@@ -1514,19 +1528,27 @@ int char_buffer::do_image(int argc, char *argv[]) + s = "-dwww-image-template="; + s += macroset_template; + s += '\0'; +- argv = addRegDef(argc, argv, s.contents()); ++ new_argv = addRegDef(argc, argv, s.contents()); ++ free(argv); ++ argv = new_argv; + argc++; + + // override local settings and produce a page size letter postscript file +- argv = addRegDef(argc, argv, "-P-pletter"); ++ new_argv = addRegDef(argc, argv, "-P-pletter"); ++ free(argv); ++ argv = new_argv; + argc++; + + if (dialect == xhtml) { + if (eqn_flag) { +- argv = addRegDef(argc, argv, "-rxhtml=1"); ++ new_argv = addRegDef(argc, argv, "-rxhtml=1"); ++ free(argv); ++ argv = new_argv; + argc++; + } +- argv = addRegDef(argc, argv, "-e"); ++ new_argv = addRegDef(argc, argv, "-e"); ++ free(argv); ++ argv = new_argv; + argc++; + } + +@@ -1540,7 +1562,9 @@ int char_buffer::do_image(int argc, char *argv[]) + } + #endif + +- return run_output_filter(IMAGE_OUTPUT_FILTER, argc, argv); ++ ret = run_output_filter(IMAGE_OUTPUT_FILTER, argc, argv); ++ free(argv); ++ return ret; + } + + static char_buffer inputFile; +@@ -1686,8 +1710,10 @@ static int scanArguments(int argc, char **argv) + while (i < argc) { + if (strcmp(argv[i], troff_name) == 0) + troff_arg = i; +- else if (argv[i][0] != '-') ++ else if (argv[i][0] != '-') { ++ a_delete troff_name; + return i; ++ } + i++; + } + a_delete troff_name; +diff --git a/src/preproc/pic/pic.cpp b/src/preproc/pic/pic.cpp +deleted file mode 100644 +index 34dada5..0000000 +--- a/src/preproc/pic/pic.cpp ++++ /dev/null +@@ -1,5008 +0,0 @@ +-/* A Bison parser, made by GNU Bison 3.0.2. */ +- +-/* Bison implementation for Yacc-like parsers in C +- +- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. +- +- This program is free software: you can redistribute it and/or modify +- it under the terms of the GNU General Public License as published by +- the Free Software Foundation, either version 3 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU General Public License for more details. +- +- You should have received a copy of the GNU General Public License +- along with this program. If not, see . */ +- +-/* 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. +- +- This special exception was added by the Free Software Foundation in +- version 2.2 of Bison. */ +- +-/* 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 +- variables, as they might otherwise be expanded by user macros. +- There are some unavoidable exceptions within include files to +- define necessary library symbols; they are noted "INFRINGES ON +- USER NAME SPACE" below. */ +- +-/* Identify Bison output. */ +-#define YYBISON 1 +- +-/* Bison version. */ +-#define YYBISON_VERSION "3.0.2" +- +-/* Skeleton name. */ +-#define YYSKELETON_NAME "yacc.c" +- +-/* Pure parsers. */ +-#define YYPURE 0 +- +-/* Push parsers. */ +-#define YYPUSH 0 +- +-/* Pull parsers. */ +-#define YYPULL 1 +- +- +- +- +-/* Copy the first part of user declarations. */ +-#line 19 "pic.y" /* yacc.c:339 */ +- +-#include "pic.h" +-#include "ptable.h" +-#include "object.h" +- +-extern int delim_flag; +-extern void copy_rest_thru(const char *, const char *); +-extern void copy_file_thru(const char *, const char *, const char *); +-extern void push_body(const char *); +-extern void do_for(char *var, double from, double to, +- int by_is_multiplicative, double by, char *body); +-extern void do_lookahead(); +- +-/* Maximum number of characters produced by printf("%g") */ +-#define GDIGITS 14 +- +-int yylex(); +-void yyerror(const char *); +- +-void reset(const char *nm); +-void reset_all(); +- +-place *lookup_label(const char *); +-void define_label(const char *label, const place *pl); +- +-direction current_direction; +-position current_position; +- +-implement_ptable(place) +- +-PTABLE(place) top_table; +- +-PTABLE(place) *current_table = &top_table; +-saved_state *current_saved_state = 0; +- +-object_list olist; +- +-const char *ordinal_postfix(int n); +-const char *object_type_name(object_type type); +-char *format_number(const char *form, double n); +-char *do_sprintf(const char *form, const double *v, int nv); +- +- +-#line 110 "pic.cpp" /* yacc.c:339 */ +- +-# ifndef YY_NULLPTR +-# if defined __cplusplus && 201103L <= __cplusplus +-# define YY_NULLPTR nullptr +-# else +-# define YY_NULLPTR 0 +-# endif +-# endif +- +-/* Enabling verbose error messages. */ +-#ifdef YYERROR_VERBOSE +-# undef YYERROR_VERBOSE +-# define YYERROR_VERBOSE 1 +-#else +-# define YYERROR_VERBOSE 0 +-#endif +- +-/* In a future release of Bison, this section will be replaced +- by #include "y.tab.h". */ +-#ifndef YY_YY_Y_TAB_H_INCLUDED +-# define YY_YY_Y_TAB_H_INCLUDED +-/* Debug traces. */ +-#ifndef YYDEBUG +-# define YYDEBUG 0 +-#endif +-#if YYDEBUG +-extern int yydebug; +-#endif +- +-/* Token type. */ +-#ifndef YYTOKENTYPE +-# define YYTOKENTYPE +- enum yytokentype +- { +- LABEL = 258, +- VARIABLE = 259, +- NUMBER = 260, +- TEXT = 261, +- COMMAND_LINE = 262, +- DELIMITED = 263, +- ORDINAL = 264, +- TH = 265, +- LEFT_ARROW_HEAD = 266, +- RIGHT_ARROW_HEAD = 267, +- DOUBLE_ARROW_HEAD = 268, +- LAST = 269, +- BOX = 270, +- CIRCLE = 271, +- ELLIPSE = 272, +- ARC = 273, +- LINE = 274, +- ARROW = 275, +- MOVE = 276, +- SPLINE = 277, +- HEIGHT = 278, +- RADIUS = 279, +- FIGNAME = 280, +- WIDTH = 281, +- DIAMETER = 282, +- UP = 283, +- DOWN = 284, +- RIGHT = 285, +- LEFT = 286, +- FROM = 287, +- TO = 288, +- AT = 289, +- WITH = 290, +- BY = 291, +- THEN = 292, +- SOLID = 293, +- DOTTED = 294, +- DASHED = 295, +- CHOP = 296, +- SAME = 297, +- INVISIBLE = 298, +- LJUST = 299, +- RJUST = 300, +- ABOVE = 301, +- BELOW = 302, +- OF = 303, +- THE = 304, +- WAY = 305, +- BETWEEN = 306, +- AND = 307, +- HERE = 308, +- DOT_N = 309, +- DOT_E = 310, +- DOT_W = 311, +- DOT_S = 312, +- DOT_NE = 313, +- DOT_SE = 314, +- DOT_NW = 315, +- DOT_SW = 316, +- DOT_C = 317, +- DOT_START = 318, +- DOT_END = 319, +- DOT_X = 320, +- DOT_Y = 321, +- DOT_HT = 322, +- DOT_WID = 323, +- DOT_RAD = 324, +- SIN = 325, +- COS = 326, +- ATAN2 = 327, +- LOG = 328, +- EXP = 329, +- SQRT = 330, +- K_MAX = 331, +- K_MIN = 332, +- INT = 333, +- RAND = 334, +- SRAND = 335, +- COPY = 336, +- THRU = 337, +- TOP = 338, +- BOTTOM = 339, +- UPPER = 340, +- LOWER = 341, +- SH = 342, +- PRINT = 343, +- CW = 344, +- CCW = 345, +- FOR = 346, +- DO = 347, +- IF = 348, +- ELSE = 349, +- ANDAND = 350, +- OROR = 351, +- NOTEQUAL = 352, +- EQUALEQUAL = 353, +- LESSEQUAL = 354, +- GREATEREQUAL = 355, +- LEFT_CORNER = 356, +- RIGHT_CORNER = 357, +- NORTH = 358, +- SOUTH = 359, +- EAST = 360, +- WEST = 361, +- CENTER = 362, +- END = 363, +- START = 364, +- RESET = 365, +- UNTIL = 366, +- PLOT = 367, +- THICKNESS = 368, +- FILL = 369, +- COLORED = 370, +- OUTLINED = 371, +- SHADED = 372, +- XSLANTED = 373, +- YSLANTED = 374, +- ALIGNED = 375, +- SPRINTF = 376, +- COMMAND = 377, +- DEFINE = 378, +- UNDEF = 379 +- }; +-#endif +-/* Tokens. */ +-#define LABEL 258 +-#define VARIABLE 259 +-#define NUMBER 260 +-#define TEXT 261 +-#define COMMAND_LINE 262 +-#define DELIMITED 263 +-#define ORDINAL 264 +-#define TH 265 +-#define LEFT_ARROW_HEAD 266 +-#define RIGHT_ARROW_HEAD 267 +-#define DOUBLE_ARROW_HEAD 268 +-#define LAST 269 +-#define BOX 270 +-#define CIRCLE 271 +-#define ELLIPSE 272 +-#define ARC 273 +-#define LINE 274 +-#define ARROW 275 +-#define MOVE 276 +-#define SPLINE 277 +-#define HEIGHT 278 +-#define RADIUS 279 +-#define FIGNAME 280 +-#define WIDTH 281 +-#define DIAMETER 282 +-#define UP 283 +-#define DOWN 284 +-#define RIGHT 285 +-#define LEFT 286 +-#define FROM 287 +-#define TO 288 +-#define AT 289 +-#define WITH 290 +-#define BY 291 +-#define THEN 292 +-#define SOLID 293 +-#define DOTTED 294 +-#define DASHED 295 +-#define CHOP 296 +-#define SAME 297 +-#define INVISIBLE 298 +-#define LJUST 299 +-#define RJUST 300 +-#define ABOVE 301 +-#define BELOW 302 +-#define OF 303 +-#define THE 304 +-#define WAY 305 +-#define BETWEEN 306 +-#define AND 307 +-#define HERE 308 +-#define DOT_N 309 +-#define DOT_E 310 +-#define DOT_W 311 +-#define DOT_S 312 +-#define DOT_NE 313 +-#define DOT_SE 314 +-#define DOT_NW 315 +-#define DOT_SW 316 +-#define DOT_C 317 +-#define DOT_START 318 +-#define DOT_END 319 +-#define DOT_X 320 +-#define DOT_Y 321 +-#define DOT_HT 322 +-#define DOT_WID 323 +-#define DOT_RAD 324 +-#define SIN 325 +-#define COS 326 +-#define ATAN2 327 +-#define LOG 328 +-#define EXP 329 +-#define SQRT 330 +-#define K_MAX 331 +-#define K_MIN 332 +-#define INT 333 +-#define RAND 334 +-#define SRAND 335 +-#define COPY 336 +-#define THRU 337 +-#define TOP 338 +-#define BOTTOM 339 +-#define UPPER 340 +-#define LOWER 341 +-#define SH 342 +-#define PRINT 343 +-#define CW 344 +-#define CCW 345 +-#define FOR 346 +-#define DO 347 +-#define IF 348 +-#define ELSE 349 +-#define ANDAND 350 +-#define OROR 351 +-#define NOTEQUAL 352 +-#define EQUALEQUAL 353 +-#define LESSEQUAL 354 +-#define GREATEREQUAL 355 +-#define LEFT_CORNER 356 +-#define RIGHT_CORNER 357 +-#define NORTH 358 +-#define SOUTH 359 +-#define EAST 360 +-#define WEST 361 +-#define CENTER 362 +-#define END 363 +-#define START 364 +-#define RESET 365 +-#define UNTIL 366 +-#define PLOT 367 +-#define THICKNESS 368 +-#define FILL 369 +-#define COLORED 370 +-#define OUTLINED 371 +-#define SHADED 372 +-#define XSLANTED 373 +-#define YSLANTED 374 +-#define ALIGNED 375 +-#define SPRINTF 376 +-#define COMMAND 377 +-#define DEFINE 378 +-#define UNDEF 379 +- +-/* Value type. */ +-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +-typedef union YYSTYPE YYSTYPE; +-union YYSTYPE +-{ +-#line 65 "pic.y" /* yacc.c:355 */ +- +- char *str; +- int n; +- double x; +- struct { double x, y; } pair; +- struct { double x; char *body; } if_data; +- struct { char *str; const char *filename; int lineno; } lstr; +- struct { double *v; int nv; int maxv; } dv; +- struct { double val; int is_multiplicative; } by; +- place pl; +- object *obj; +- corner crn; +- path *pth; +- object_spec *spec; +- saved_state *pstate; +- graphics_state state; +- object_type obtype; +- +-#line 417 "pic.cpp" /* yacc.c:355 */ +-}; +-# define YYSTYPE_IS_TRIVIAL 1 +-# define YYSTYPE_IS_DECLARED 1 +-#endif +- +- +-extern YYSTYPE yylval; +- +-int yyparse (void); +- +-#endif /* !YY_YY_Y_TAB_H_INCLUDED */ +- +-/* Copy the second part of user declarations. */ +- +-#line 432 "pic.cpp" /* yacc.c:358 */ +- +-#ifdef short +-# undef short +-#endif +- +-#ifdef YYTYPE_UINT8 +-typedef YYTYPE_UINT8 yytype_uint8; +-#else +-typedef unsigned char yytype_uint8; +-#endif +- +-#ifdef YYTYPE_INT8 +-typedef YYTYPE_INT8 yytype_int8; +-#else +-typedef signed char 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 +-# include /* INFRINGES ON USER NAME SPACE */ +-# define YYSIZE_T size_t +-# else +-# define YYSIZE_T unsigned int +-# endif +-#endif +- +-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) +- +-#ifndef YY_ +-# if defined YYENABLE_NLS && YYENABLE_NLS +-# if ENABLE_NLS +-# include /* INFRINGES ON USER NAME SPACE */ +-# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +-# endif +-# endif +-# ifndef YY_ +-# define YY_(Msgid) Msgid +-# endif +-#endif +- +-#ifndef YY_ATTRIBUTE +-# if (defined __GNUC__ \ +- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ +- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +-# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +-# else +-# define YY_ATTRIBUTE(Spec) /* empty */ +-# endif +-#endif +- +-#ifndef YY_ATTRIBUTE_PURE +-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +-#endif +- +-#ifndef YY_ATTRIBUTE_UNUSED +-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +-#endif +- +-#if !defined _Noreturn \ +- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +-# if defined _MSC_VER && 1200 <= _MSC_VER +-# define _Noreturn __declspec (noreturn) +-# else +-# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +-# endif +-#endif +- +-/* Suppress unused-variable warnings by "using" E. */ +-#if ! defined lint || defined __GNUC__ +-# define YYUSE(E) ((void) (E)) +-#else +-# define YYUSE(E) /* empty */ +-#endif +- +-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +-/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +- _Pragma ("GCC diagnostic push") \ +- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ +- _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ +- _Pragma ("GCC diagnostic pop") +-#else +-# define YY_INITIAL_VALUE(Value) Value +-#endif +-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +-# define YY_IGNORE_MAYBE_UNINITIALIZED_END +-#endif +-#ifndef YY_INITIAL_VALUE +-# define YY_INITIAL_VALUE(Value) /* Nothing. */ +-#endif +- +- +-#if ! defined yyoverflow || YYERROR_VERBOSE +- +-/* The parser invokes alloca or malloc; define the necessary symbols. */ +- +-# ifdef YYSTACK_USE_ALLOCA +-# if YYSTACK_USE_ALLOCA +-# ifdef __GNUC__ +-# define YYSTACK_ALLOC __builtin_alloca +-# elif defined __BUILTIN_VA_ARG_INCR +-# include /* INFRINGES ON USER NAME SPACE */ +-# elif defined _AIX +-# define YYSTACK_ALLOC __alloca +-# elif defined _MSC_VER +-# include /* INFRINGES ON USER NAME SPACE */ +-# define alloca _alloca +-# else +-# define YYSTACK_ALLOC alloca +-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +-# include /* INFRINGES ON USER NAME SPACE */ +- /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +-# ifndef EXIT_SUCCESS +-# define EXIT_SUCCESS 0 +-# endif +-# endif +-# endif +-# endif +-# endif +- +-# ifdef YYSTACK_ALLOC +- /* Pacify GCC's 'empty if-body' warning. */ +-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +-# ifndef YYSTACK_ALLOC_MAXIMUM +- /* The OS might guarantee only one guard page at the bottom of the stack, +- and a page size can be as small as 4096 bytes. So we cannot safely +- 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 +-# define YYSTACK_ALLOC YYMALLOC +-# define YYSTACK_FREE YYFREE +-# ifndef YYSTACK_ALLOC_MAXIMUM +-# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +-# endif +-# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +- && ! ((defined YYMALLOC || defined malloc) \ +- && (defined YYFREE || defined free))) +-# include /* INFRINGES ON USER NAME SPACE */ +-# ifndef EXIT_SUCCESS +-# define EXIT_SUCCESS 0 +-# endif +-# endif +-# ifndef YYMALLOC +-# define YYMALLOC malloc +-# if ! defined malloc && ! defined EXIT_SUCCESS +-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +-# endif +-# endif +-# ifndef YYFREE +-# define YYFREE free +-# if ! defined free && ! defined EXIT_SUCCESS +-void free (void *); /* INFRINGES ON USER NAME SPACE */ +-# endif +-# endif +-# endif +-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ +- +- +-#if (! defined yyoverflow \ +- && (! defined __cplusplus \ +- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) +- +-/* A type that is properly aligned for any stack member. */ +-union yyalloc +-{ +- yytype_int16 yyss_alloc; +- YYSTYPE yyvs_alloc; +-}; +- +-/* The size of the maximum gap between one aligned stack and the next. */ +-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +- +-/* The size of an array large to enough to hold all stacks, each with +- N elements. */ +-# define YYSTACK_BYTES(N) \ +- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ +- + YYSTACK_GAP_MAXIMUM) +- +-# define YYCOPY_NEEDED 1 +- +-/* Relocate STACK from its old location to the new one. The +- local variables YYSIZE and YYSTACKSIZE give the old and new number of +- elements in the stack, and YYPTR gives the new location of the +- stack. Advance YYPTR to a properly aligned location for the next +- stack. */ +-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ +- do \ +- { \ +- YYSIZE_T yynewbytes; \ +- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ +- Stack = &yyptr->Stack_alloc; \ +- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ +- yyptr += yynewbytes / sizeof (*yyptr); \ +- } \ +- while (0) +- +-#endif +- +-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +-/* Copy COUNT objects from SRC to DST. The source and destination do +- not overlap. */ +-# ifndef YYCOPY +-# if defined __GNUC__ && 1 < __GNUC__ +-# define YYCOPY(Dst, Src, Count) \ +- __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +-# else +-# define YYCOPY(Dst, Src, Count) \ +- do \ +- { \ +- YYSIZE_T yyi; \ +- for (yyi = 0; yyi < (Count); yyi++) \ +- (Dst)[yyi] = (Src)[yyi]; \ +- } \ +- while (0) +-# endif +-# endif +-#endif /* !YYCOPY_NEEDED */ +- +-/* YYFINAL -- State number of the termination state. */ +-#define YYFINAL 6 +-/* YYLAST -- Last index in YYTABLE. */ +-#define YYLAST 2438 +- +-/* YYNTOKENS -- Number of terminals. */ +-#define YYNTOKENS 146 +-/* YYNNTS -- Number of nonterminals. */ +-#define YYNNTS 49 +-/* YYNRULES -- Number of rules. */ +-#define YYNRULES 260 +-/* YYNSTATES -- Number of states. */ +-#define YYNSTATES 454 +- +-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned +- by yylex, with out-of-bounds checking. */ +-#define YYUNDEFTOK 2 +-#define YYMAXUTOK 379 +- +-#define YYTRANSLATE(YYX) \ +- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +- +-/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM +- as returned by yylex, without out-of-bounds checking. */ +-static const yytype_uint8 yytranslate[] = +-{ +- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 137, 2, 2, 2, 136, 2, 2, +- 126, 145, 134, 132, 129, 133, 125, 135, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 141, 139, +- 130, 140, 131, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 128, 2, 144, 138, 2, 127, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 142, 2, 143, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, +- 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, +- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, +- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, +- 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, +- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, +- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, +- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, +- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, +- 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, +- 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, +- 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, +- 115, 116, 117, 118, 119, 120, 121, 122, 123, 124 +-}; +- +-#if YYDEBUG +- /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +-static const yytype_uint16 yyrline[] = +-{ +- 0, 275, 275, 276, 285, 290, 292, 296, 298, 302, +- 303, 307, 315, 320, 332, 334, 336, 338, 340, 345, +- 350, 357, 356, 367, 375, 377, 374, 388, 390, 387, +- 400, 399, 408, 417, 416, 430, 431, 436, 437, 441, +- 446, 451, 459, 461, 480, 487, 489, 500, 499, 511, +- 512, 517, 519, 524, 530, 536, 538, 540, 542, 544, +- 546, 548, 555, 559, 564, 572, 586, 592, 600, 607, +- 613, 606, 622, 632, 633, 638, 640, 642, 644, 649, +- 656, 663, 670, 677, 682, 687, 695, 694, 721, 727, +- 733, 739, 745, 764, 771, 778, 785, 792, 799, 806, +- 813, 820, 827, 842, 854, 860, 869, 876, 901, 905, +- 911, 917, 923, 929, 934, 940, 946, 952, 959, 968, +- 975, 991, 1008, 1013, 1018, 1023, 1028, 1033, 1038, 1043, +- 1051, 1061, 1071, 1081, 1091, 1097, 1105, 1107, 1119, 1124, +- 1154, 1156, 1162, 1171, 1173, 1178, 1183, 1188, 1193, 1198, +- 1203, 1209, 1214, 1222, 1223, 1227, 1232, 1238, 1240, 1246, +- 1252, 1258, 1267, 1277, 1279, 1288, 1290, 1298, 1300, 1305, +- 1320, 1338, 1340, 1342, 1344, 1346, 1348, 1350, 1352, 1354, +- 1359, 1361, 1369, 1373, 1375, 1383, 1385, 1391, 1397, 1403, +- 1409, 1418, 1420, 1422, 1424, 1426, 1428, 1430, 1432, 1434, +- 1436, 1438, 1440, 1442, 1444, 1446, 1448, 1450, 1452, 1454, +- 1456, 1458, 1460, 1462, 1464, 1466, 1468, 1470, 1472, 1474, +- 1476, 1478, 1480, 1485, 1487, 1492, 1497, 1505, 1507, 1514, +- 1521, 1528, 1535, 1542, 1544, 1546, 1548, 1556, 1564, 1577, +- 1579, 1581, 1590, 1599, 1612, 1621, 1630, 1639, 1641, 1643, +- 1645, 1647, 1653, 1658, 1660, 1662, 1664, 1666, 1668, 1670, +- 1672 +-}; +-#endif +- +-#if YYDEBUG || YYERROR_VERBOSE || 0 +-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. +- First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +-static const char *const yytname[] = +-{ +- "$end", "error", "$undefined", "LABEL", "VARIABLE", "NUMBER", "TEXT", +- "COMMAND_LINE", "DELIMITED", "ORDINAL", "TH", "LEFT_ARROW_HEAD", +- "RIGHT_ARROW_HEAD", "DOUBLE_ARROW_HEAD", "LAST", "BOX", "CIRCLE", +- "ELLIPSE", "ARC", "LINE", "ARROW", "MOVE", "SPLINE", "HEIGHT", "RADIUS", +- "FIGNAME", "WIDTH", "DIAMETER", "UP", "DOWN", "RIGHT", "LEFT", "FROM", +- "TO", "AT", "WITH", "BY", "THEN", "SOLID", "DOTTED", "DASHED", "CHOP", +- "SAME", "INVISIBLE", "LJUST", "RJUST", "ABOVE", "BELOW", "OF", "THE", +- "WAY", "BETWEEN", "AND", "HERE", "DOT_N", "DOT_E", "DOT_W", "DOT_S", +- "DOT_NE", "DOT_SE", "DOT_NW", "DOT_SW", "DOT_C", "DOT_START", "DOT_END", +- "DOT_X", "DOT_Y", "DOT_HT", "DOT_WID", "DOT_RAD", "SIN", "COS", "ATAN2", +- "LOG", "EXP", "SQRT", "K_MAX", "K_MIN", "INT", "RAND", "SRAND", "COPY", +- "THRU", "TOP", "BOTTOM", "UPPER", "LOWER", "SH", "PRINT", "CW", "CCW", +- "FOR", "DO", "IF", "ELSE", "ANDAND", "OROR", "NOTEQUAL", "EQUALEQUAL", +- "LESSEQUAL", "GREATEREQUAL", "LEFT_CORNER", "RIGHT_CORNER", "NORTH", +- "SOUTH", "EAST", "WEST", "CENTER", "END", "START", "RESET", "UNTIL", +- "PLOT", "THICKNESS", "FILL", "COLORED", "OUTLINED", "SHADED", "XSLANTED", +- "YSLANTED", "ALIGNED", "SPRINTF", "COMMAND", "DEFINE", "UNDEF", "'.'", +- "'('", "'`'", "'['", "','", "'<'", "'>'", "'+'", "'-'", "'*'", "'/'", +- "'%'", "'!'", "'^'", "';'", "'='", "':'", "'{'", "'}'", "']'", "')'", +- "$accept", "top", "element_list", "middle_element_list", +- "optional_separator", "separator", "placeless_element", "$@1", "$@2", +- "$@3", "$@4", "$@5", "$@6", "$@7", "macro_name", "reset_variables", +- "print_args", "print_arg", "simple_if", "$@8", "until", "any_expr", +- "text_expr", "optional_by", "element", "@9", "$@10", "optional_element", +- "object_spec", "@11", "text", "sprintf_args", "position", +- "position_not_place", "between", "expr_pair", "place", "label", +- "ordinal", "optional_ordinal_last", "nth_primitive", "object_type", +- "label_path", "relative_path", "path", "corner", "expr", +- "expr_lower_than", "expr_not_lower_than", YY_NULLPTR +-}; +-#endif +- +-# ifdef YYPRINT +-/* YYTOKNUM[NUM] -- (External) token number corresponding to the +- (internal) symbol number NUM (which must be that of a token). */ +-static const yytype_uint16 yytoknum[] = +-{ +- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, +- 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, +- 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, +- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, +- 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, +- 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, +- 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, +- 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, +- 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, +- 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, +- 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, +- 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, +- 375, 376, 377, 378, 379, 46, 40, 96, 91, 44, +- 60, 62, 43, 45, 42, 47, 37, 33, 94, 59, +- 61, 58, 123, 125, 93, 41 +-}; +-# endif +- +-#define YYPACT_NINF -240 +- +-#define yypact_value_is_default(Yystate) \ +- (!!((Yystate) == (-240))) +- +-#define YYTABLE_NINF -206 +- +-#define yytable_value_is_error(Yytable_value) \ +- 0 +- +- /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing +- STATE-NUM. */ +-static const yytype_int16 yypact[] = +-{ +- -114, -240, 20, -240, 757, -107, -240, -98, -123, -240, +- -240, -240, -240, -240, -240, -240, -240, -240, -240, -106, +- -240, -240, -240, -240, 9, -240, 1087, 46, 1172, 49, +- 1597, -70, 1087, -240, -240, -114, -240, 3, -33, -240, +- 877, -240, -240, -114, 1172, -60, 36, -14, -240, 74, +- -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, +- -240, -240, -240, -240, -240, -240, -240, -240, -240, -34, +- -18, 8, 38, 47, 51, 65, 101, 102, 112, 122, +- -240, -240, 21, 150, -240, -240, -240, -240, -240, -240, +- -240, -240, -240, 1257, 1172, 1597, 1597, 1087, -240, -240, +- -43, -240, -240, 357, 2242, 59, 258, -240, 10, 2147, +- -240, 1, 6, 1172, 1172, 145, -1, 2, 357, 2273, +- -240, -240, 220, 249, 1087, -114, -114, -240, 721, -240, +- 252, -240, -240, -240, -240, 1597, 1597, 1597, 1597, 2024, +- 2024, 1853, 1939, 1682, 1682, 1682, 1427, 1767, -240, -240, +- 2024, 2024, 2024, -240, -240, -240, -240, -240, -240, -240, +- -240, 1597, 2024, 23, 23, 23, 1597, 1597, -240, -240, +- 2282, 593, -240, 1172, -240, -240, -240, -240, 250, -240, +- 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 458, +- 1172, -240, -240, -240, -240, -240, -240, -240, -240, 121, +- 107, 123, 256, 2157, 137, 261, 134, 134, -240, 1767, +- 1767, -240, -240, -240, -240, -240, 276, -240, -240, -240, +- -240, -240, -240, -240, -240, -240, -240, 138, -240, -240, +- 24, 156, 235, -240, 1597, 1597, 1597, 1597, 1597, 1597, +- 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1682, +- 1682, 1597, -240, 134, -240, 1172, 1172, 23, 23, 1172, +- 1172, -240, -240, 143, 757, 153, -240, -240, 280, 2282, +- 2282, 2282, 2282, 2282, 2282, 2282, 2282, -43, 2147, -43, +- -43, 2253, 275, 275, 295, 1002, -43, 2081, -240, -240, +- 10, 1342, -240, 694, 2282, 2282, 2282, 2282, 2282, -240, +- -240, -240, 2282, 2282, -98, -123, 16, 28, -240, -43, +- 56, 302, -240, 291, -240, 155, 160, 172, 161, 164, +- 167, 184, 185, 181, -240, 186, 188, -240, 1682, 1767, +- 1767, -240, -240, 1682, 1682, -240, -240, -240, -240, -240, +- 156, 279, 314, 2291, 440, 440, 413, 413, 2282, 413, +- 413, -72, -72, 134, 134, 134, 134, -49, 117, 343, +- 322, -240, 314, 239, 2300, -240, -240, -240, 314, 239, +- 2300, -119, -240, -240, -240, -240, -240, 2116, 2116, -240, +- 206, 333, -240, 123, 2131, -240, 228, -240, -240, 1172, +- -240, -240, -240, 1172, 1172, -240, -240, -240, -110, 195, +- 197, -47, 128, 292, 1682, 1682, 1597, -240, 1597, -240, +- 757, -240, -240, 2116, -240, 228, 338, -240, 200, 202, +- 212, -240, -240, -240, 1682, 1682, -240, -43, -27, 360, +- 2282, -240, -240, 214, -240, -240, -240, -240, -240, -73, +- 30, -240, 1512, 268, -240, -240, 216, 1597, 2282, -240, +- -240, 2282, 354, -240 +-}; +- +- /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. +- Performed when YYTABLE does not specify something else to do. Zero +- means the default is an error. */ +-static const yytype_uint16 yydefact[] = +-{ +- 7, 9, 0, 3, 2, 8, 1, 0, 0, 136, +- 18, 75, 76, 77, 78, 79, 80, 81, 82, 0, +- 14, 15, 17, 16, 0, 21, 0, 0, 0, 36, +- 0, 0, 0, 86, 69, 7, 72, 35, 32, 5, +- 65, 83, 10, 7, 0, 0, 0, 23, 27, 0, +- 162, 226, 227, 165, 167, 205, 204, 161, 191, 192, +- 193, 194, 195, 196, 197, 198, 199, 200, 201, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +- 202, 203, 0, 0, 210, 211, 216, 217, 218, 219, +- 220, 222, 221, 0, 0, 0, 0, 20, 42, 45, +- 46, 140, 143, 141, 157, 0, 0, 163, 0, 44, +- 223, 224, 0, 0, 0, 0, 52, 0, 0, 51, +- 224, 39, 84, 0, 19, 7, 7, 4, 8, 40, +- 0, 33, 124, 125, 126, 0, 0, 0, 0, 93, +- 95, 97, 99, 0, 0, 0, 0, 0, 107, 108, +- 109, 111, 120, 122, 123, 130, 131, 132, 133, 127, +- 128, 0, 113, 0, 0, 0, 0, 0, 135, 129, +- 92, 0, 12, 0, 38, 37, 11, 24, 0, 22, +- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +- 0, 208, 206, 212, 214, 209, 207, 213, 215, 0, +- 0, 143, 141, 51, 224, 0, 239, 260, 43, 0, +- 0, 228, 229, 230, 231, 232, 0, 158, 179, 168, +- 171, 172, 173, 174, 175, 176, 177, 0, 169, 170, +- 0, 159, 0, 153, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +- 0, 0, 61, 260, 47, 0, 0, 0, 0, 0, +- 0, 85, 138, 0, 0, 0, 6, 41, 0, 88, +- 89, 90, 91, 94, 96, 98, 100, 101, 0, 102, +- 103, 162, 165, 167, 0, 0, 105, 183, 185, 104, +- 182, 0, 106, 0, 110, 112, 121, 134, 114, 118, +- 119, 117, 115, 116, 162, 226, 205, 204, 66, 0, +- 67, 68, 13, 0, 28, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 251, 0, 0, 240, 0, 0, +- 0, 156, 142, 0, 0, 166, 144, 146, 164, 178, +- 160, 0, 258, 259, 257, 256, 253, 255, 155, 225, +- 254, 233, 234, 235, 236, 237, 238, 0, 0, 0, +- 0, 55, 56, 58, 59, 54, 53, 57, 258, 60, +- 259, 0, 87, 70, 34, 190, 182, 0, 0, 180, +- 0, 0, 184, 0, 51, 25, 49, 241, 242, 0, +- 244, 245, 246, 0, 0, 249, 250, 252, 0, 144, +- 146, 0, 0, 0, 0, 0, 0, 48, 0, 137, +- 73, 189, 188, 0, 181, 49, 0, 29, 0, 0, +- 0, 148, 145, 147, 0, 0, 154, 149, 0, 62, +- 139, 74, 71, 0, 26, 50, 243, 247, 248, 149, +- 0, 151, 0, 0, 186, 150, 151, 0, 63, 30, +- 152, 64, 0, 31 +-}; +- +- /* YYPGOTO[NTERM-NUM]. */ +-static const yytype_int16 yypgoto[] = +-{ +- -240, -240, 17, -240, 12, 329, -240, -240, -240, -240, +- -240, -240, -240, -240, -240, -240, 334, -76, -240, -240, +- -42, 13, -103, -240, -127, -240, -240, -240, -240, -240, +- 5, -240, 99, 194, 169, -44, 4, -100, -240, -240, +- -240, -104, -240, -239, -240, -50, -26, -240, 61 +-}; +- +- /* YYDEFGOTO[NTERM-NUM]. */ +-static const yytype_int16 yydefgoto[] = +-{ +- -1, 2, 3, 35, 264, 5, 36, 49, 313, 415, +- 178, 386, 452, 268, 176, 37, 97, 98, 38, 360, +- 417, 199, 116, 443, 39, 126, 410, 432, 40, 125, +- 117, 371, 100, 101, 249, 102, 118, 104, 105, 106, +- 107, 228, 287, 288, 289, 108, 119, 110, 120 +-}; +- +- /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If +- positive, shift that token. If negative, reduce the rule whose +- number is the opposite. If YYTABLE_NINF, syntax error. */ +-static const yytype_int16 yytable[] = +-{ +- 109, 266, 229, 404, 122, 424, 109, 129, 231, 41, +- 408, 252, 4, 50, 170, 47, -17, 44, 45, 53, +- 6, 208, 209, 210, 54, 1, 409, 50, -16, 9, +- 103, 99, 42, 53, 46, 421, 103, 99, 54, 174, +- 175, 115, 375, 43, 308, 169, 380, 127, 208, 201, +- 112, 191, 192, 121, 217, 171, 123, 172, 230, 209, +- 210, 131, 245, 246, 247, 218, 248, 203, 177, 206, +- 207, 109, 445, 219, 220, 221, 222, 223, 224, 225, +- 173, 226, 179, 209, 210, 209, 210, 111, 253, 209, +- 210, 48, 180, 111, 255, 256, 290, 202, 109, 257, +- 258, 103, 99, 292, 441, 209, 210, 205, 181, 269, +- 270, 271, 272, 273, 274, 275, 276, 278, 278, 278, +- 278, 293, 193, 194, 294, 295, 296, 261, 103, 99, +- 340, 250, 130, 41, 182, 297, 298, 94, 411, 412, +- 302, 303, 263, 265, 31, 278, 251, 103, 103, 103, +- 103, 94, 361, 363, 204, -17, 367, 369, 111, -17, +- -17, 446, 209, 210, 183, 336, 337, -16, 299, 300, +- 301, -16, -16, 184, 433, 311, 41, 185, 377, 378, +- 195, 196, 254, 293, 293, 111, 312, 227, -140, -140, +- 231, 186, 200, 315, 316, 317, 318, 319, 320, 321, +- 322, 323, 325, 326, 111, 111, 111, 111, 342, 343, +- 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, +- 354, 355, 356, 278, 278, 359, 9, 187, 188, 362, +- 364, 376, 111, 368, 370, 290, 328, 382, 189, 329, +- 330, 201, 277, 279, 280, 286, 405, 383, 190, 209, +- 210, 197, 198, 103, 103, 262, 267, 425, 314, 203, +- 209, 210, 365, 366, 218, 384, 327, 334, 331, 41, +- 309, 335, 248, 220, 221, 222, 223, 224, 225, 338, +- 226, 216, 339, 431, 341, 399, 400, 372, 374, 202, +- 220, 221, 222, 223, 224, 225, 373, 226, 379, 385, +- 387, 389, 278, 293, 293, 388, 390, 278, 278, 391, +- 111, 111, 392, 393, 394, 234, 235, 236, 237, 238, +- 239, 211, 212, 213, 214, 215, 395, 376, 376, 403, +- 407, 396, 103, 397, 255, 413, 414, 103, 103, 416, +- 422, 31, 423, 426, 435, 436, 204, 437, 357, 358, +- 241, 242, 243, 244, 245, 246, 247, 438, 248, 444, +- 449, 450, 453, 376, 128, 310, 124, 211, 212, 213, +- 214, 215, 333, 434, 0, 0, 406, 0, 278, 278, +- 429, 0, 430, 0, 200, 0, 227, 0, 0, 111, +- 0, 0, 0, 0, 111, 111, 442, 0, 278, 278, +- 0, 332, 418, 227, 0, 0, 419, 420, 103, 103, +- 0, 236, 237, 238, 239, 41, 448, 0, 0, 0, +- 0, 451, 211, 212, 213, 214, 215, 398, 103, 103, +- 0, 0, 401, 402, -141, -141, 0, 0, 234, 235, +- 236, 237, 238, 239, 241, 242, 243, 244, 245, 246, +- 247, 0, 248, 0, 0, 234, 235, 236, 237, 238, +- 239, 50, 51, 52, 9, 111, 111, 53, 0, 0, +- 0, 0, 54, 241, 242, 243, 244, 245, 246, 247, +- 0, 248, 0, 0, 0, 111, 111, 0, 55, 56, +- 241, 242, 243, 244, 245, 246, 247, 0, 248, 0, +- 0, 0, 0, 427, 428, 0, 0, 0, 0, 0, +- 0, 57, 58, 59, 60, 61, 62, 63, 64, 65, +- 66, 67, 68, 439, 440, 0, 0, 0, 69, 70, +- 71, 72, 73, 74, 75, 76, 77, 78, 79, 238, +- 239, 80, 81, 82, 83, 243, 244, 245, 246, 247, +- 0, 248, 0, 0, 0, 0, 0, 0, 0, 84, +- 85, 86, 87, 88, 89, 90, 91, 92, 0, 0, +- 241, 242, 243, 244, 245, 246, 247, 0, 248, 31, +- 0, 0, 0, 0, 113, 94, 0, 0, 0, 0, +- 0, 95, 0, 0, 0, 114, 304, 305, 52, 9, +- 10, 0, 53, 324, 0, 0, 0, 54, 11, 12, +- 13, 14, 15, 16, 17, 18, 0, 0, 19, 0, +- 0, 20, 21, 306, 307, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 0, 57, 58, 59, 60, +- 61, 62, 63, 64, 65, 66, 67, 68, 0, 0, +- 0, 0, 0, 69, 70, 71, 72, 73, 74, 75, +- 76, 77, 78, 79, 24, 0, 80, 81, 82, 83, +- 25, 26, 0, 0, 27, 0, 28, 0, 0, 0, +- 0, 0, 0, 0, 84, 85, 86, 87, 88, 89, +- 90, 91, 92, 29, 0, 30, 0, 0, 0, 0, +- 0, 0, 0, 0, 31, 32, 0, 0, 0, 93, +- 94, 33, 0, 0, 7, 8, 95, 9, 10, 0, +- 96, 0, 0, 0, 0, 34, 11, 12, 13, 14, +- 15, 16, 17, 18, 0, 0, 19, 0, 0, 20, +- 21, 22, 23, 0, 0, 0, 0, 0, 0, 0, +- 7, 8, 0, 9, 10, 0, 0, 0, 0, 0, +- 0, 0, 11, 12, 13, 14, 15, 16, 17, 18, +- 0, 0, 19, 0, 0, 20, 21, 22, 23, 234, +- 235, 236, 237, 238, 239, 0, 0, 0, 0, 0, +- 0, 0, 24, 0, 0, 0, 0, 0, 25, 26, +- 0, 0, 27, 0, 28, 0, 0, 0, 0, 0, +- 0, 0, 0, 240, 241, 242, 243, 244, 245, 246, +- 247, 29, 248, 30, 0, 0, 0, 0, 24, 0, +- 0, 0, 31, 32, 25, 26, 0, 0, 27, 33, +- 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, +- 42, 0, 0, 34, 0, 0, 0, 29, 0, 30, +- 0, 0, 0, 0, 0, 0, 0, 0, 31, 32, +- 50, 51, 52, 9, 0, 33, 53, 0, 132, 133, +- 134, 54, 0, 0, 0, 0, 0, 0, 0, 34, +- 135, 136, 0, 137, 138, 139, 140, 141, 142, 143, +- 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, +- 154, 155, 156, 157, 158, 0, 0, 0, 0, 0, +- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, +- 67, 68, 0, 0, 0, 0, 0, 69, 70, 71, +- 72, 73, 74, 75, 76, 77, 78, 79, 0, 0, +- 80, 81, 82, 83, 0, 0, 159, 160, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 84, 85, +- 86, 87, 88, 89, 90, 91, 92, 0, 0, 0, +- 161, 162, 163, 164, 165, 166, 167, 168, 31, 0, +- 0, 0, 0, 113, 94, 50, 51, 52, 9, 0, +- 95, 53, 0, 0, 96, 0, 54, 0, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +- 0, 0, 55, 56, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 57, 58, 59, 60, 61, +- 62, 63, 64, 65, 66, 67, 68, 0, 0, 0, +- 0, 0, 69, 70, 71, 72, 73, 74, 75, 76, +- 77, 78, 79, 0, 0, 80, 81, 82, 83, 0, +- 50, 51, 52, 9, 0, 0, 53, 0, 0, 0, +- 0, 54, 0, 84, 85, 86, 87, 88, 89, 90, +- 91, 92, 0, 0, 0, 0, 0, 55, 56, 0, +- 0, 0, 0, 31, 0, 0, 0, 284, 93, 94, +- 0, 0, 0, 0, 0, 95, 0, 0, 0, 114, +- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, +- 67, 68, 0, 0, 0, 0, 0, 69, 70, 71, +- 72, 73, 74, 75, 76, 77, 78, 79, 0, 0, +- 80, 81, 82, 83, 0, 50, 51, 52, 9, 0, +- 0, 53, 0, 0, 0, 0, 54, 0, 84, 85, +- 86, 87, 88, 89, 90, 91, 92, 0, 0, 0, +- 0, 0, 55, 56, 0, 0, 0, 0, 31, 0, +- 0, 0, 0, 93, 94, 0, 0, 0, 0, 0, +- 95, 0, 0, 0, 96, 57, 58, 59, 60, 61, +- 62, 63, 64, 65, 66, 67, 68, 0, 0, 0, +- 0, 0, 69, 70, 71, 72, 73, 74, 75, 76, +- 77, 78, 79, 0, 0, 80, 81, 82, 83, 0, +- 50, 51, 52, 9, 0, 0, 53, 0, 0, 0, +- 0, 54, 0, 84, 85, 86, 87, 88, 89, 90, +- 91, 92, 0, 0, 0, 0, 0, 55, 56, 0, +- 0, 0, 0, 31, 0, 0, 0, 0, 113, 94, +- 0, 0, 0, 0, 0, 95, 0, 0, 0, 114, +- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, +- 67, 68, 0, 0, 0, 0, 0, 69, 70, 71, +- 72, 73, 74, 75, 76, 77, 78, 79, 0, 0, +- 80, 81, 82, 83, 0, 50, 51, 52, 9, 0, +- 0, 53, 0, 0, 0, 0, 54, 0, 84, 85, +- 86, 87, 88, 89, 90, 91, 92, 0, 0, 0, +- 0, 0, 55, 56, 0, 0, 0, 0, 31, 0, +- 0, 0, 0, 93, 94, 0, 0, 0, 0, 0, +- 95, 0, 0, 0, 114, 57, 58, 59, 60, 61, +- 62, 63, 64, 65, 66, 67, 68, 0, 0, 0, +- 0, 0, 69, 70, 71, 72, 73, 74, 75, 76, +- 77, 78, 79, 0, 0, 80, 81, 82, 83, 0, +- 281, 51, 52, 0, 0, 0, 282, 0, 0, 0, +- 0, 283, 0, 84, 85, 86, 87, 88, 89, 90, +- 91, 92, 0, 0, 0, 0, 0, 55, 56, 0, +- 0, 0, 0, 31, 0, 0, 0, 0, 291, 94, +- 0, 0, 0, 0, 0, 95, 0, 0, 0, 114, +- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, +- 67, 68, 0, 0, 0, 0, 0, 69, 70, 71, +- 72, 73, 74, 75, 76, 77, 78, 79, 0, 0, +- 80, 81, 82, 83, 0, 50, 51, 52, 0, 0, +- 0, 53, 0, 0, 0, 0, 54, 0, 84, 85, +- 86, 87, 88, 89, 90, 91, 92, 0, 0, 0, +- 0, 0, 55, 56, 0, 0, 0, 0, 0, 0, +- 0, 0, 284, 285, 94, 0, 0, 0, 0, 0, +- 95, 0, 0, 0, 96, 57, 58, 59, 60, 61, +- 62, 63, 64, 65, 66, 67, 68, 0, 0, 0, +- 0, 0, 69, 70, 71, 72, 73, 74, 75, 76, +- 77, 78, 79, 0, 0, 80, 81, 82, 83, 0, +- 50, 51, 52, 0, 0, 0, 53, 0, 0, 0, +- 0, 54, 0, 84, 85, 86, 87, 88, 89, 90, +- 91, 92, 0, 0, 0, 0, 0, 55, 56, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 113, 94, +- 0, 0, 0, 0, 0, 95, 447, 0, 0, 96, +- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, +- 67, 68, 0, 0, 0, 0, 0, 69, 70, 71, +- 72, 73, 74, 75, 76, 77, 78, 79, 0, 0, +- 80, 81, 82, 83, 0, 50, 51, 52, 0, 0, +- 0, 53, 0, 0, 0, 0, 54, 0, 84, 85, +- 86, 87, 88, 89, 90, 91, 92, 0, 0, 0, +- 0, 0, 55, 56, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 113, 94, 0, 0, 0, 0, 0, +- 95, 0, 0, 0, 96, 57, 58, 59, 60, 61, +- 62, 63, 64, 65, 66, 67, 68, 0, 0, 0, +- 0, 0, 69, 70, 71, 72, 73, 74, 75, 76, +- 77, 78, 79, 0, 0, 80, 81, 82, 83, 0, +- 50, 51, 52, 0, 0, 0, 53, 0, 0, 0, +- 0, 54, 0, 84, 85, 86, 87, 88, 89, 90, +- 91, 92, 0, 0, 0, 0, 0, 55, 56, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 93, 94, +- 0, 0, 0, 0, 0, 95, 0, 0, 0, 96, +- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, +- 67, 68, 0, 0, 0, 0, 0, 69, 70, 71, +- 72, 73, 74, 75, 76, 77, 78, 79, 0, 0, +- 80, 81, 82, 83, 0, 0, 50, 51, 52, 0, +- 0, 0, 53, 0, 0, 0, 0, 54, 84, 85, +- 86, 87, 88, 89, 90, 91, 92, 0, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 291, 94, 0, 0, 0, 0, 0, +- 95, -205, 0, 0, 96, 0, 57, 58, 59, 60, +- 61, 62, 63, 64, 65, 66, 67, 68, 0, 0, +- 0, 0, 0, 69, 70, 71, 72, 73, 74, 75, +- 76, 77, 78, 79, 0, 0, 80, 81, 82, 83, +- 0, 0, 50, 51, 52, 0, 0, 0, 53, 0, +- 0, 0, 0, 54, 84, 85, 86, 87, 88, 89, +- 90, 91, 92, 0, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, +- 94, 0, 0, 0, 0, 0, 95, -204, 0, 0, +- 96, 0, 57, 58, 59, 60, 61, 62, 63, 64, +- 65, 66, 67, 68, 0, 0, 0, 0, 0, 69, +- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, +- 0, 0, 80, 81, 82, 83, 0, 50, 51, 52, +- 0, 0, 0, 53, 0, 0, 0, 0, 54, 0, +- 84, 85, 86, 87, 88, 89, 90, 91, 92, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 113, 94, 0, 0, 0, +- 0, 0, 95, 0, 0, 0, 96, 57, 58, 59, +- 60, 61, 62, 63, 64, 65, 66, 67, 68, 0, +- 0, 0, 0, 0, 69, 70, 71, 72, 73, 74, +- 75, 76, 77, 78, 79, 0, 0, 80, 81, 82, +- 83, 55, 56, 0, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 84, 85, 86, 87, 88, +- 89, 90, 91, 92, 0, 58, 59, 60, 61, 62, +- 63, 64, 65, 66, 67, 68, 55, 56, 0, 0, +- 113, 94, 0, 0, 0, 0, 0, 95, 0, 0, +- 0, 96, 0, 0, 80, 81, 82, 83, 0, 0, +- 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, +- 68, 0, 84, 85, 86, 87, 88, 89, 90, 91, +- 92, 0, 0, 0, 0, 232, 0, 0, 233, 80, +- 81, 82, 83, 0, 0, 232, 381, 0, 233, 0, +- 0, 0, 0, 0, 0, 0, 0, 84, 85, 86, +- 87, 88, 89, 90, 91, 92, 259, 260, 236, 237, +- 238, 239, 0, 0, 0, 0, 0, 0, 0, 0, +- 0, 284, 234, 235, 236, 237, 238, 239, 0, 0, +- 0, 0, 259, 260, 236, 237, 238, 239, 0, 0, +- 240, 241, 242, 243, 244, 245, 246, 247, 0, 248, +- 0, 0, 0, 0, 0, 0, 240, 241, 242, 243, +- 244, 245, 246, 247, 0, 248, 240, 241, 242, 243, +- 244, 245, 246, 247, 0, 248, 58, 59, 60, 61, +- 62, 63, 64, 65, 66, 67, 68, 58, 59, 60, +- 61, 62, 63, 64, 65, 66, 67, 68, 0, 0, +- 0, 0, 0, 0, 0, 80, 81, 82, 83, 0, +- 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, +- 0, 0, 0, 84, 85, 86, 87, 88, 89, 90, +- 91, 92, 0, 0, 84, 85, 86, 87, 88, 89, +- 90, 91, 92, 0, 0, 0, 0, 216, 259, 260, +- 236, 237, 238, 239, 0, 0, 0, 234, 235, 236, +- 237, 238, 239, 0, 0, 0, 234, 0, 236, 237, +- 238, 239, 0, 0, 0, 259, 0, 236, 237, 238, +- 239, 0, 0, 241, 242, 243, 244, 245, 246, 247, +- 0, 248, 241, 242, 243, 244, 245, 246, 247, 0, +- 248, 241, 242, 243, 244, 245, 246, 247, 0, 248, +- 241, 242, 243, 244, 245, 246, 247, 0, 248 +-}; +- +-static const yytype_int16 yycheck[] = +-{ +- 26, 128, 106, 52, 30, 52, 32, 4, 108, 4, +- 129, 114, 0, 3, 40, 6, 0, 140, 141, 9, +- 0, 97, 132, 133, 14, 139, 145, 3, 0, 6, +- 26, 26, 139, 9, 140, 145, 32, 32, 14, 3, +- 4, 28, 281, 141, 171, 40, 285, 35, 124, 93, +- 4, 30, 31, 4, 104, 43, 126, 44, 48, 132, +- 133, 94, 134, 135, 136, 6, 138, 93, 82, 95, +- 96, 97, 145, 14, 15, 16, 17, 18, 19, 20, +- 140, 22, 8, 132, 133, 132, 133, 26, 114, 132, +- 133, 82, 126, 32, 95, 96, 146, 93, 124, 97, +- 98, 97, 97, 147, 131, 132, 133, 94, 126, 135, +- 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, +- 146, 147, 101, 102, 150, 151, 152, 122, 124, 124, +- 230, 130, 129, 128, 126, 161, 162, 127, 377, 378, +- 166, 167, 125, 126, 121, 171, 140, 143, 144, 145, +- 146, 127, 255, 256, 93, 139, 259, 260, 97, 143, +- 144, 131, 132, 133, 126, 209, 210, 139, 163, 164, +- 165, 143, 144, 126, 413, 171, 171, 126, 282, 283, +- 30, 31, 37, 209, 210, 124, 173, 128, 132, 133, +- 290, 126, 93, 180, 181, 182, 183, 184, 185, 186, +- 187, 188, 189, 190, 143, 144, 145, 146, 234, 235, +- 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, +- 246, 247, 248, 249, 250, 251, 6, 126, 126, 255, +- 256, 281, 171, 259, 260, 285, 129, 287, 126, 132, +- 133, 285, 143, 144, 145, 146, 129, 291, 126, 132, +- 133, 101, 102, 249, 250, 6, 4, 129, 8, 285, +- 132, 133, 257, 258, 6, 291, 145, 130, 145, 264, +- 171, 10, 138, 15, 16, 17, 18, 19, 20, 3, +- 22, 125, 144, 410, 49, 329, 330, 144, 8, 285, +- 15, 16, 17, 18, 19, 20, 143, 22, 3, 8, +- 145, 129, 328, 329, 330, 145, 145, 333, 334, 145, +- 249, 250, 145, 129, 129, 95, 96, 97, 98, 99, +- 100, 65, 66, 67, 68, 69, 145, 377, 378, 50, +- 8, 145, 328, 145, 95, 129, 3, 333, 334, 111, +- 145, 121, 145, 51, 6, 145, 285, 145, 249, 250, +- 130, 131, 132, 133, 134, 135, 136, 145, 138, 145, +- 92, 145, 8, 413, 35, 171, 32, 65, 66, 67, +- 68, 69, 203, 415, -1, -1, 33, -1, 404, 405, +- 406, -1, 408, -1, 285, -1, 128, -1, -1, 328, +- -1, -1, -1, -1, 333, 334, 36, -1, 424, 425, +- -1, 145, 389, 128, -1, -1, 393, 394, 404, 405, +- -1, 97, 98, 99, 100, 410, 442, -1, -1, -1, +- -1, 447, 65, 66, 67, 68, 69, 328, 424, 425, +- -1, -1, 333, 334, 132, 133, -1, -1, 95, 96, +- 97, 98, 99, 100, 130, 131, 132, 133, 134, 135, +- 136, -1, 138, -1, -1, 95, 96, 97, 98, 99, +- 100, 3, 4, 5, 6, 404, 405, 9, -1, -1, +- -1, -1, 14, 130, 131, 132, 133, 134, 135, 136, +- -1, 138, -1, -1, -1, 424, 425, -1, 30, 31, +- 130, 131, 132, 133, 134, 135, 136, -1, 138, -1, +- -1, -1, -1, 404, 405, -1, -1, -1, -1, -1, +- -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, +- 62, 63, 64, 424, 425, -1, -1, -1, 70, 71, +- 72, 73, 74, 75, 76, 77, 78, 79, 80, 99, +- 100, 83, 84, 85, 86, 132, 133, 134, 135, 136, +- -1, 138, -1, -1, -1, -1, -1, -1, -1, 101, +- 102, 103, 104, 105, 106, 107, 108, 109, -1, -1, +- 130, 131, 132, 133, 134, 135, 136, -1, 138, 121, +- -1, -1, -1, -1, 126, 127, -1, -1, -1, -1, +- -1, 133, -1, -1, -1, 137, 3, 4, 5, 6, +- 7, -1, 9, 145, -1, -1, -1, 14, 15, 16, +- 17, 18, 19, 20, 21, 22, -1, -1, 25, -1, +- -1, 28, 29, 30, 31, -1, -1, -1, -1, -1, +- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +- -1, -1, -1, -1, -1, -1, 53, 54, 55, 56, +- 57, 58, 59, 60, 61, 62, 63, 64, -1, -1, +- -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, +- 77, 78, 79, 80, 81, -1, 83, 84, 85, 86, +- 87, 88, -1, -1, 91, -1, 93, -1, -1, -1, +- -1, -1, -1, -1, 101, 102, 103, 104, 105, 106, +- 107, 108, 109, 110, -1, 112, -1, -1, -1, -1, +- -1, -1, -1, -1, 121, 122, -1, -1, -1, 126, +- 127, 128, -1, -1, 3, 4, 133, 6, 7, -1, +- 137, -1, -1, -1, -1, 142, 15, 16, 17, 18, +- 19, 20, 21, 22, -1, -1, 25, -1, -1, 28, +- 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, +- 3, 4, -1, 6, 7, -1, -1, -1, -1, -1, +- -1, -1, 15, 16, 17, 18, 19, 20, 21, 22, +- -1, -1, 25, -1, -1, 28, 29, 30, 31, 95, +- 96, 97, 98, 99, 100, -1, -1, -1, -1, -1, +- -1, -1, 81, -1, -1, -1, -1, -1, 87, 88, +- -1, -1, 91, -1, 93, -1, -1, -1, -1, -1, +- -1, -1, -1, 129, 130, 131, 132, 133, 134, 135, +- 136, 110, 138, 112, -1, -1, -1, -1, 81, -1, +- -1, -1, 121, 122, 87, 88, -1, -1, 91, 128, +- 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, +- 139, -1, -1, 142, -1, -1, -1, 110, -1, 112, +- -1, -1, -1, -1, -1, -1, -1, -1, 121, 122, +- 3, 4, 5, 6, -1, 128, 9, -1, 11, 12, +- 13, 14, -1, -1, -1, -1, -1, -1, -1, 142, +- 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, +- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, +- 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, +- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, +- 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, +- 73, 74, 75, 76, 77, 78, 79, 80, -1, -1, +- 83, 84, 85, 86, -1, -1, 89, 90, -1, -1, +- -1, -1, -1, -1, -1, -1, -1, -1, 101, 102, +- 103, 104, 105, 106, 107, 108, 109, -1, -1, -1, +- 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, +- -1, -1, -1, 126, 127, 3, 4, 5, 6, -1, +- 133, 9, -1, -1, 137, -1, 14, -1, -1, -1, +- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +- -1, -1, 30, 31, -1, -1, -1, -1, -1, -1, +- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +- -1, -1, -1, -1, -1, 53, 54, 55, 56, 57, +- 58, 59, 60, 61, 62, 63, 64, -1, -1, -1, +- -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, +- 78, 79, 80, -1, -1, 83, 84, 85, 86, -1, +- 3, 4, 5, 6, -1, -1, 9, -1, -1, -1, +- -1, 14, -1, 101, 102, 103, 104, 105, 106, 107, +- 108, 109, -1, -1, -1, -1, -1, 30, 31, -1, +- -1, -1, -1, 121, -1, -1, -1, 125, 126, 127, +- -1, -1, -1, -1, -1, 133, -1, -1, -1, 137, +- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, +- 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, +- 73, 74, 75, 76, 77, 78, 79, 80, -1, -1, +- 83, 84, 85, 86, -1, 3, 4, 5, 6, -1, +- -1, 9, -1, -1, -1, -1, 14, -1, 101, 102, +- 103, 104, 105, 106, 107, 108, 109, -1, -1, -1, +- -1, -1, 30, 31, -1, -1, -1, -1, 121, -1, +- -1, -1, -1, 126, 127, -1, -1, -1, -1, -1, +- 133, -1, -1, -1, 137, 53, 54, 55, 56, 57, +- 58, 59, 60, 61, 62, 63, 64, -1, -1, -1, +- -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, +- 78, 79, 80, -1, -1, 83, 84, 85, 86, -1, +- 3, 4, 5, 6, -1, -1, 9, -1, -1, -1, +- -1, 14, -1, 101, 102, 103, 104, 105, 106, 107, +- 108, 109, -1, -1, -1, -1, -1, 30, 31, -1, +- -1, -1, -1, 121, -1, -1, -1, -1, 126, 127, +- -1, -1, -1, -1, -1, 133, -1, -1, -1, 137, +- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, +- 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, +- 73, 74, 75, 76, 77, 78, 79, 80, -1, -1, +- 83, 84, 85, 86, -1, 3, 4, 5, 6, -1, +- -1, 9, -1, -1, -1, -1, 14, -1, 101, 102, +- 103, 104, 105, 106, 107, 108, 109, -1, -1, -1, +- -1, -1, 30, 31, -1, -1, -1, -1, 121, -1, +- -1, -1, -1, 126, 127, -1, -1, -1, -1, -1, +- 133, -1, -1, -1, 137, 53, 54, 55, 56, 57, +- 58, 59, 60, 61, 62, 63, 64, -1, -1, -1, +- -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, +- 78, 79, 80, -1, -1, 83, 84, 85, 86, -1, +- 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, +- -1, 14, -1, 101, 102, 103, 104, 105, 106, 107, +- 108, 109, -1, -1, -1, -1, -1, 30, 31, -1, +- -1, -1, -1, 121, -1, -1, -1, -1, 126, 127, +- -1, -1, -1, -1, -1, 133, -1, -1, -1, 137, +- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, +- 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, +- 73, 74, 75, 76, 77, 78, 79, 80, -1, -1, +- 83, 84, 85, 86, -1, 3, 4, 5, -1, -1, +- -1, 9, -1, -1, -1, -1, 14, -1, 101, 102, +- 103, 104, 105, 106, 107, 108, 109, -1, -1, -1, +- -1, -1, 30, 31, -1, -1, -1, -1, -1, -1, +- -1, -1, 125, 126, 127, -1, -1, -1, -1, -1, +- 133, -1, -1, -1, 137, 53, 54, 55, 56, 57, +- 58, 59, 60, 61, 62, 63, 64, -1, -1, -1, +- -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, +- 78, 79, 80, -1, -1, 83, 84, 85, 86, -1, +- 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, +- -1, 14, -1, 101, 102, 103, 104, 105, 106, 107, +- 108, 109, -1, -1, -1, -1, -1, 30, 31, -1, +- -1, -1, -1, -1, -1, -1, -1, -1, 126, 127, +- -1, -1, -1, -1, -1, 133, 134, -1, -1, 137, +- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, +- 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, +- 73, 74, 75, 76, 77, 78, 79, 80, -1, -1, +- 83, 84, 85, 86, -1, 3, 4, 5, -1, -1, +- -1, 9, -1, -1, -1, -1, 14, -1, 101, 102, +- 103, 104, 105, 106, 107, 108, 109, -1, -1, -1, +- -1, -1, 30, 31, -1, -1, -1, -1, -1, -1, +- -1, -1, -1, 126, 127, -1, -1, -1, -1, -1, +- 133, -1, -1, -1, 137, 53, 54, 55, 56, 57, +- 58, 59, 60, 61, 62, 63, 64, -1, -1, -1, +- -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, +- 78, 79, 80, -1, -1, 83, 84, 85, 86, -1, +- 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, +- -1, 14, -1, 101, 102, 103, 104, 105, 106, 107, +- 108, 109, -1, -1, -1, -1, -1, 30, 31, -1, +- -1, -1, -1, -1, -1, -1, -1, -1, 126, 127, +- -1, -1, -1, -1, -1, 133, -1, -1, -1, 137, +- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, +- 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, +- 73, 74, 75, 76, 77, 78, 79, 80, -1, -1, +- 83, 84, 85, 86, -1, -1, 3, 4, 5, -1, +- -1, -1, 9, -1, -1, -1, -1, 14, 101, 102, +- 103, 104, 105, 106, 107, 108, 109, -1, -1, -1, +- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +- -1, -1, -1, 126, 127, -1, -1, -1, -1, -1, +- 133, 48, -1, -1, 137, -1, 53, 54, 55, 56, +- 57, 58, 59, 60, 61, 62, 63, 64, -1, -1, +- -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, +- 77, 78, 79, 80, -1, -1, 83, 84, 85, 86, +- -1, -1, 3, 4, 5, -1, -1, -1, 9, -1, +- -1, -1, -1, 14, 101, 102, 103, 104, 105, 106, +- 107, 108, 109, -1, -1, -1, -1, -1, -1, -1, +- -1, -1, -1, -1, -1, -1, -1, -1, -1, 126, +- 127, -1, -1, -1, -1, -1, 133, 48, -1, -1, +- 137, -1, 53, 54, 55, 56, 57, 58, 59, 60, +- 61, 62, 63, 64, -1, -1, -1, -1, -1, 70, +- 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, +- -1, -1, 83, 84, 85, 86, -1, 3, 4, 5, +- -1, -1, -1, 9, -1, -1, -1, -1, 14, -1, +- 101, 102, 103, 104, 105, 106, 107, 108, 109, -1, +- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +- -1, -1, -1, -1, -1, 126, 127, -1, -1, -1, +- -1, -1, 133, -1, -1, -1, 137, 53, 54, 55, +- 56, 57, 58, 59, 60, 61, 62, 63, 64, -1, +- -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, +- 76, 77, 78, 79, 80, -1, -1, 83, 84, 85, +- 86, 30, 31, -1, -1, -1, -1, -1, -1, -1, +- -1, -1, -1, -1, -1, 101, 102, 103, 104, 105, +- 106, 107, 108, 109, -1, 54, 55, 56, 57, 58, +- 59, 60, 61, 62, 63, 64, 30, 31, -1, -1, +- 126, 127, -1, -1, -1, -1, -1, 133, -1, -1, +- -1, 137, -1, -1, 83, 84, 85, 86, -1, -1, +- 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, +- 64, -1, 101, 102, 103, 104, 105, 106, 107, 108, +- 109, -1, -1, -1, -1, 48, -1, -1, 51, 83, +- 84, 85, 86, -1, -1, 48, 125, -1, 51, -1, +- -1, -1, -1, -1, -1, -1, -1, 101, 102, 103, +- 104, 105, 106, 107, 108, 109, 95, 96, 97, 98, +- 99, 100, -1, -1, -1, -1, -1, -1, -1, -1, +- -1, 125, 95, 96, 97, 98, 99, 100, -1, -1, +- -1, -1, 95, 96, 97, 98, 99, 100, -1, -1, +- 129, 130, 131, 132, 133, 134, 135, 136, -1, 138, +- -1, -1, -1, -1, -1, -1, 129, 130, 131, 132, +- 133, 134, 135, 136, -1, 138, 129, 130, 131, 132, +- 133, 134, 135, 136, -1, 138, 54, 55, 56, 57, +- 58, 59, 60, 61, 62, 63, 64, 54, 55, 56, +- 57, 58, 59, 60, 61, 62, 63, 64, -1, -1, +- -1, -1, -1, -1, -1, 83, 84, 85, 86, -1, +- -1, -1, -1, -1, -1, -1, 83, 84, 85, 86, +- -1, -1, -1, 101, 102, 103, 104, 105, 106, 107, +- 108, 109, -1, -1, 101, 102, 103, 104, 105, 106, +- 107, 108, 109, -1, -1, -1, -1, 125, 95, 96, +- 97, 98, 99, 100, -1, -1, -1, 95, 96, 97, +- 98, 99, 100, -1, -1, -1, 95, -1, 97, 98, +- 99, 100, -1, -1, -1, 95, -1, 97, 98, 99, +- 100, -1, -1, 130, 131, 132, 133, 134, 135, 136, +- -1, 138, 130, 131, 132, 133, 134, 135, 136, -1, +- 138, 130, 131, 132, 133, 134, 135, 136, -1, 138, +- 130, 131, 132, 133, 134, 135, 136, -1, 138 +-}; +- +- /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing +- symbol of state STATE-NUM. */ +-static const yytype_uint8 yystos[] = +-{ +- 0, 139, 147, 148, 150, 151, 0, 3, 4, 6, +- 7, 15, 16, 17, 18, 19, 20, 21, 22, 25, +- 28, 29, 30, 31, 81, 87, 88, 91, 93, 110, +- 112, 121, 122, 128, 142, 149, 152, 161, 164, 170, +- 174, 176, 139, 141, 140, 141, 140, 6, 82, 153, +- 3, 4, 5, 9, 14, 30, 31, 53, 54, 55, +- 56, 57, 58, 59, 60, 61, 62, 63, 64, 70, +- 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, +- 83, 84, 85, 86, 101, 102, 103, 104, 105, 106, +- 107, 108, 109, 126, 127, 133, 137, 162, 163, 176, +- 178, 179, 181, 182, 183, 184, 185, 186, 191, 192, +- 193, 194, 4, 126, 137, 167, 168, 176, 182, 192, +- 194, 4, 192, 126, 162, 175, 171, 150, 151, 4, +- 129, 94, 11, 12, 13, 23, 24, 26, 27, 28, +- 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, +- 39, 40, 41, 42, 43, 44, 45, 46, 47, 89, +- 90, 113, 114, 115, 116, 117, 118, 119, 120, 176, +- 192, 150, 167, 140, 3, 4, 160, 82, 156, 8, +- 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, +- 126, 30, 31, 101, 102, 30, 31, 101, 102, 167, +- 178, 181, 182, 192, 194, 167, 192, 192, 163, 132, +- 133, 65, 66, 67, 68, 69, 125, 191, 6, 14, +- 15, 16, 17, 18, 19, 20, 22, 128, 187, 187, +- 48, 183, 48, 51, 95, 96, 97, 98, 99, 100, +- 129, 130, 131, 132, 133, 134, 135, 136, 138, 180, +- 130, 140, 168, 192, 37, 95, 96, 97, 98, 95, +- 96, 176, 6, 148, 150, 148, 170, 4, 159, 192, +- 192, 192, 192, 192, 192, 192, 192, 178, 192, 178, +- 178, 3, 9, 14, 125, 126, 178, 188, 189, 190, +- 191, 126, 181, 192, 192, 192, 192, 192, 192, 176, +- 176, 176, 192, 192, 3, 4, 30, 31, 170, 178, +- 179, 182, 167, 154, 8, 167, 167, 167, 167, 167, +- 167, 167, 167, 167, 145, 167, 167, 145, 129, 132, +- 133, 145, 145, 180, 130, 10, 181, 181, 3, 144, +- 183, 49, 192, 192, 192, 192, 192, 192, 192, 192, +- 192, 192, 192, 192, 192, 192, 192, 178, 178, 192, +- 165, 168, 192, 168, 192, 176, 176, 168, 192, 168, +- 192, 177, 144, 143, 8, 189, 191, 187, 187, 3, +- 189, 125, 191, 181, 192, 8, 157, 145, 145, 129, +- 145, 145, 145, 129, 129, 145, 145, 145, 178, 181, +- 181, 178, 178, 50, 52, 129, 33, 8, 129, 145, +- 172, 189, 189, 129, 3, 155, 111, 166, 167, 167, +- 167, 145, 145, 145, 52, 129, 51, 178, 178, 192, +- 192, 170, 173, 189, 166, 6, 145, 145, 145, 178, +- 178, 131, 36, 169, 145, 145, 131, 134, 192, 92, +- 145, 192, 158, 8 +-}; +- +- /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +-static const yytype_uint8 yyr1[] = +-{ +- 0, 146, 147, 147, 148, 149, 149, 150, 150, 151, +- 151, 152, 152, 152, 152, 152, 152, 152, 152, 152, +- 152, 153, 152, 152, 154, 155, 152, 156, 157, 152, +- 158, 152, 152, 159, 152, 152, 152, 160, 160, 161, +- 161, 161, 162, 162, 163, 163, 163, 165, 164, 166, +- 166, 167, 167, 168, 168, 168, 168, 168, 168, 168, +- 168, 168, 169, 169, 169, 170, 170, 170, 170, 171, +- 172, 170, 170, 173, 173, 174, 174, 174, 174, 174, +- 174, 174, 174, 174, 174, 174, 175, 174, 174, 174, +- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, +- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, +- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, +- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, +- 174, 174, 174, 174, 174, 174, 176, 176, 177, 177, +- 178, 178, 178, 179, 179, 179, 179, 179, 179, 179, +- 179, 179, 179, 180, 180, 181, 181, 182, 182, 182, +- 182, 182, 183, 183, 183, 184, 184, 185, 185, 186, +- 186, 187, 187, 187, 187, 187, 187, 187, 187, 187, +- 188, 188, 189, 189, 189, 190, 190, 190, 190, 190, +- 190, 191, 191, 191, 191, 191, 191, 191, 191, 191, +- 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, +- 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, +- 191, 191, 191, 192, 192, 193, 194, 194, 194, 194, +- 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, +- 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, +- 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, +- 194 +-}; +- +- /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +-static const yytype_uint8 yyr2[] = +-{ +- 0, 2, 1, 1, 3, 1, 3, 0, 1, 1, +- 2, 3, 3, 4, 1, 1, 1, 1, 1, 2, +- 2, 0, 3, 2, 0, 0, 7, 0, 0, 6, +- 0, 10, 1, 0, 4, 1, 1, 1, 1, 2, +- 2, 3, 1, 2, 1, 1, 1, 0, 5, 0, +- 2, 1, 1, 3, 3, 3, 3, 3, 3, 3, +- 3, 2, 0, 2, 3, 1, 4, 4, 4, 0, +- 0, 6, 1, 0, 1, 1, 1, 1, 1, 1, +- 1, 1, 1, 1, 2, 3, 0, 4, 3, 3, +- 3, 3, 2, 2, 3, 2, 3, 2, 3, 2, +- 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, +- 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, +- 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 3, 2, 1, 5, 0, 3, +- 1, 1, 3, 1, 3, 5, 3, 5, 5, 5, +- 7, 6, 8, 1, 4, 3, 3, 1, 2, 2, +- 3, 1, 1, 1, 3, 1, 3, 1, 2, 2, +- 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, +- 2, 3, 1, 1, 2, 1, 5, 4, 3, 3, +- 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, +- 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, +- 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, +- 1, 1, 1, 1, 1, 3, 1, 1, 2, 2, +- 2, 2, 2, 3, 3, 3, 3, 3, 3, 2, +- 3, 4, 4, 6, 4, 4, 4, 6, 6, 4, +- 4, 3, 4, 3, 3, 3, 3, 3, 3, 3, +- 2 +-}; +- +- +-#define yyerrok (yyerrstatus = 0) +-#define yyclearin (yychar = YYEMPTY) +-#define YYEMPTY (-2) +-#define YYEOF 0 +- +-#define YYACCEPT goto yyacceptlab +-#define YYABORT goto yyabortlab +-#define YYERROR goto yyerrorlab +- +- +-#define YYRECOVERING() (!!yyerrstatus) +- +-#define YYBACKUP(Token, Value) \ +-do \ +- if (yychar == YYEMPTY) \ +- { \ +- yychar = (Token); \ +- yylval = (Value); \ +- YYPOPSTACK (yylen); \ +- yystate = *yyssp; \ +- goto yybackup; \ +- } \ +- else \ +- { \ +- yyerror (YY_("syntax error: cannot back up")); \ +- YYERROR; \ +- } \ +-while (0) +- +-/* Error token number */ +-#define YYTERROR 1 +-#define YYERRCODE 256 +- +- +- +-/* Enable debugging if requested. */ +-#if YYDEBUG +- +-# ifndef YYFPRINTF +-# include /* INFRINGES ON USER NAME SPACE */ +-# define YYFPRINTF fprintf +-# endif +- +-# define YYDPRINTF(Args) \ +-do { \ +- if (yydebug) \ +- YYFPRINTF Args; \ +-} while (0) +- +-/* This macro is provided for backward compatibility. */ +-#ifndef YY_LOCATION_PRINT +-# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +-#endif +- +- +-# 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 (0) +- +- +-/*----------------------------------------. +-| Print this symbol's value on YYOUTPUT. | +-`----------------------------------------*/ +- +-static void +-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +-{ +- FILE *yyo = yyoutput; +- YYUSE (yyo); +- if (!yyvaluep) +- return; +-# ifdef YYPRINT +- if (yytype < YYNTOKENS) +- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +-# endif +- YYUSE (yytype); +-} +- +- +-/*--------------------------------. +-| Print this symbol on YYOUTPUT. | +-`--------------------------------*/ +- +-static void +-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +-{ +- YYFPRINTF (yyoutput, "%s %s (", +- yytype < YYNTOKENS ? "token" : "nterm", 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 (included). | +-`------------------------------------------------------------------*/ +- +-static void +-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +-{ +- YYFPRINTF (stderr, "Stack now"); +- for (; yybottom <= yytop; yybottom++) +- { +- int yybot = *yybottom; +- YYFPRINTF (stderr, " %d", yybot); +- } +- YYFPRINTF (stderr, "\n"); +-} +- +-# define YY_STACK_PRINT(Bottom, Top) \ +-do { \ +- if (yydebug) \ +- yy_stack_print ((Bottom), (Top)); \ +-} while (0) +- +- +-/*------------------------------------------------. +-| Report that the YYRULE is going to be reduced. | +-`------------------------------------------------*/ +- +-static void +-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +-{ +- unsigned long int yylno = yyrline[yyrule]; +- int yynrhs = yyr2[yyrule]; +- int yyi; +- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", +- yyrule - 1, yylno); +- /* The symbols being reduced. */ +- for (yyi = 0; yyi < yynrhs; yyi++) +- { +- YYFPRINTF (stderr, " $%d = ", yyi + 1); +- yy_symbol_print (stderr, +- yystos[yyssp[yyi + 1 - yynrhs]], +- &(yyvsp[(yyi + 1) - (yynrhs)]) +- ); +- YYFPRINTF (stderr, "\n"); +- } +-} +- +-# define YY_REDUCE_PRINT(Rule) \ +-do { \ +- if (yydebug) \ +- yy_reduce_print (yyssp, yyvsp, Rule); \ +-} while (0) +- +-/* Nonzero means print parse trace. It is left uninitialized so that +- multiple parsers can coexist. */ +-int yydebug; +-#else /* !YYDEBUG */ +-# define YYDPRINTF(Args) +-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +-# define YY_STACK_PRINT(Bottom, Top) +-# define YY_REDUCE_PRINT(Rule) +-#endif /* !YYDEBUG */ +- +- +-/* YYINITDEPTH -- initial size of the parser's stacks. */ +-#ifndef YYINITDEPTH +-# define YYINITDEPTH 200 +-#endif +- +-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only +- if the built-in stack extension method is used). +- +- Do not make this value too large; the results are undefined if +- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) +- evaluated with infinite-precision integer arithmetic. */ +- +-#ifndef YYMAXDEPTH +-# define YYMAXDEPTH 10000 +-#endif +- +- +-#if YYERROR_VERBOSE +- +-# ifndef yystrlen +-# if defined __GLIBC__ && defined _STRING_H +-# define yystrlen strlen +-# else +-/* Return the length of YYSTR. */ +-static YYSIZE_T +-yystrlen (const char *yystr) +-{ +- YYSIZE_T yylen; +- for (yylen = 0; yystr[yylen]; yylen++) +- continue; +- return yylen; +-} +-# endif +-# endif +- +-# ifndef yystpcpy +-# 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. */ +-static char * +-yystpcpy (char *yydest, const char *yysrc) +-{ +- char *yyd = yydest; +- const char *yys = yysrc; +- +- while ((*yyd++ = *yys++) != '\0') +- continue; +- +- return yyd - 1; +-} +-# endif +-# endif +- +-# 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); +- +- return yystpcpy (yyres, yystr) - yyres; +-} +-# endif +- +-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message +- about the unexpected token YYTOKEN for the state stack whose top is +- YYSSP. +- +- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is +- not large enough to hold the message. In that case, also set +- *YYMSG_ALLOC to the required number of bytes. Return 2 if the +- required number of bytes is too large to store. */ +-static int +-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, +- yytype_int16 *yyssp, int yytoken) +-{ +- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); +- YYSIZE_T yysize = yysize0; +- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; +- /* Internationalized format string. */ +- const char *yyformat = YY_NULLPTR; +- /* Arguments of yyformat. */ +- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; +- /* Number of reported tokens (one for the "unexpected", one per +- "expected"). */ +- int yycount = 0; +- +- /* There are many possibilities here to consider: +- - If this state is a consistent state with a default action, then +- the only way this function was invoked is if the default action +- is an error action. In that case, don't check for expected +- tokens because there are none. +- - The only way there can be no lookahead present (in yychar) is if +- this state is a consistent state with a default action. Thus, +- detecting the absence of a lookahead is sufficient to determine +- that there is no unexpected or expected token to report. In that +- case, just report a simple "syntax error". +- - Don't assume there isn't a lookahead just because this state is a +- consistent state with a default action. There might have been a +- previous inconsistent state, consistent state with a non-default +- action, or user semantic action that manipulated yychar. +- - Of course, the expected token list depends on states to have +- correct lookahead information, and it depends on the parser not +- to perform extra reductions after fetching a lookahead from the +- scanner and before detecting a syntax error. Thus, state merging +- (from LALR or IELR) and default reductions corrupt the expected +- token list. However, the list is correct for canonical LR with +- one exception: it will still contain any token that will not be +- accepted due to an error action in a later state. +- */ +- if (yytoken != YYEMPTY) +- { +- int yyn = yypact[*yyssp]; +- yyarg[yycount++] = yytname[yytoken]; +- if (!yypact_value_is_default (yyn)) +- { +- /* Start YYX at -YYN if negative to avoid negative indexes in +- YYCHECK. In other words, skip the first -YYN actions for +- this state because they are default actions. */ +- int yyxbegin = yyn < 0 ? -yyn : 0; +- /* Stay within bounds of both yycheck and yytname. */ +- int yychecklim = YYLAST - yyn + 1; +- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; +- int yyx; +- +- for (yyx = yyxbegin; yyx < yyxend; ++yyx) +- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR +- && !yytable_value_is_error (yytable[yyx + yyn])) +- { +- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) +- { +- yycount = 1; +- yysize = yysize0; +- break; +- } +- yyarg[yycount++] = yytname[yyx]; +- { +- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); +- if (! (yysize <= yysize1 +- && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) +- return 2; +- yysize = yysize1; +- } +- } +- } +- } +- +- switch (yycount) +- { +-# define YYCASE_(N, S) \ +- case N: \ +- yyformat = S; \ +- break +- YYCASE_(0, YY_("syntax error")); +- YYCASE_(1, YY_("syntax error, unexpected %s")); +- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); +- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); +- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); +- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +-# undef YYCASE_ +- } +- +- { +- YYSIZE_T yysize1 = yysize + yystrlen (yyformat); +- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) +- return 2; +- yysize = yysize1; +- } +- +- if (*yymsg_alloc < yysize) +- { +- *yymsg_alloc = 2 * yysize; +- if (! (yysize <= *yymsg_alloc +- && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) +- *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; +- return 1; +- } +- +- /* Avoid sprintf, as that infringes on the user's name space. +- Don't have undefined behavior even if the translation +- produced a string with the wrong number of "%s"s. */ +- { +- char *yyp = *yymsg; +- int yyi = 0; +- while ((*yyp = *yyformat) != '\0') +- if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) +- { +- yyp += yytnamerr (yyp, yyarg[yyi++]); +- yyformat += 2; +- } +- else +- { +- yyp++; +- yyformat++; +- } +- } +- return 0; +-} +-#endif /* YYERROR_VERBOSE */ +- +-/*-----------------------------------------------. +-| Release the memory associated to this symbol. | +-`-----------------------------------------------*/ +- +-static void +-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +-{ +- YYUSE (yyvaluep); +- if (!yymsg) +- yymsg = "Deleting"; +- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); +- +- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +- YYUSE (yytype); +- YY_IGNORE_MAYBE_UNINITIALIZED_END +-} +- +- +- +- +-/* The lookahead symbol. */ +-int yychar; +- +-/* The semantic value of the lookahead symbol. */ +-YYSTYPE yylval; +-/* Number of syntax errors so far. */ +-int yynerrs; +- +- +-/*----------. +-| yyparse. | +-`----------*/ +- +-int +-yyparse (void) +-{ +- int yystate; +- /* Number of tokens to shift before error messages enabled. */ +- int yyerrstatus; +- +- /* The stacks and their tools: +- 'yyss': related to states. +- 'yyvs': related to semantic values. +- +- Refer to the stacks through separate pointers, to allow yyoverflow +- to reallocate them elsewhere. */ +- +- /* The state stack. */ +- yytype_int16 yyssa[YYINITDEPTH]; +- yytype_int16 *yyss; +- yytype_int16 *yyssp; +- +- /* The semantic value stack. */ +- YYSTYPE yyvsa[YYINITDEPTH]; +- YYSTYPE *yyvs; +- YYSTYPE *yyvsp; +- +- YYSIZE_T yystacksize; +- +- int yyn; +- int yyresult; +- /* Lookahead token as an internal (translated) token number. */ +- int yytoken = 0; +- /* The variables used to return semantic value and location from the +- action routines. */ +- YYSTYPE yyval; +- +-#if YYERROR_VERBOSE +- /* Buffer for error messages, and its allocated size. */ +- char yymsgbuf[128]; +- char *yymsg = yymsgbuf; +- YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +-#endif +- +-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) +- +- /* The number of symbols on the RHS of the reduced rule. +- Keep to zero when no symbol should be popped. */ +- int yylen = 0; +- +- yyssp = yyss = yyssa; +- yyvsp = yyvs = yyvsa; +- yystacksize = YYINITDEPTH; +- +- YYDPRINTF ((stderr, "Starting parse\n")); +- +- yystate = 0; +- yyerrstatus = 0; +- yynerrs = 0; +- yychar = YYEMPTY; /* Cause a token to be read. */ +- goto yysetstate; +- +-/*------------------------------------------------------------. +-| yynewstate -- Push a new state, which is found in yystate. | +-`------------------------------------------------------------*/ +- 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. */ +- yyssp++; +- +- yysetstate: +- *yyssp = yystate; +- +- if (yyss + yystacksize - 1 <= yyssp) +- { +- /* Get the current used size of the three stacks, in elements. */ +- YYSIZE_T yysize = yyssp - yyss + 1; +- +-#ifdef yyoverflow +- { +- /* Give user a chance to reallocate the stack. Use copies of +- these so that the &'s don't force the real ones into +- memory. */ +- YYSTYPE *yyvs1 = yyvs; +- yytype_int16 *yyss1 = yyss; +- +- /* Each stack pointer address is followed by the size of the +- data in use in that stack, in bytes. This used to be a +- conditional around just the two extra args, but that might +- be undefined if yyoverflow is a macro. */ +- yyoverflow (YY_("memory exhausted"), +- &yyss1, yysize * sizeof (*yyssp), +- &yyvs1, yysize * sizeof (*yyvsp), +- &yystacksize); +- +- yyss = yyss1; +- yyvs = yyvs1; +- } +-#else /* no yyoverflow */ +-# ifndef YYSTACK_RELOCATE +- goto yyexhaustedlab; +-# else +- /* Extend the stack our own way. */ +- if (YYMAXDEPTH <= yystacksize) +- goto yyexhaustedlab; +- yystacksize *= 2; +- if (YYMAXDEPTH < yystacksize) +- yystacksize = YYMAXDEPTH; +- +- { +- yytype_int16 *yyss1 = yyss; +- union yyalloc *yyptr = +- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); +- if (! yyptr) +- goto yyexhaustedlab; +- YYSTACK_RELOCATE (yyss_alloc, yyss); +- YYSTACK_RELOCATE (yyvs_alloc, yyvs); +-# undef YYSTACK_RELOCATE +- if (yyss1 != yyssa) +- YYSTACK_FREE (yyss1); +- } +-# endif +-#endif /* no yyoverflow */ +- +- yyssp = yyss + yysize - 1; +- yyvsp = yyvs + yysize - 1; +- +- YYDPRINTF ((stderr, "Stack size increased to %lu\n", +- (unsigned long int) yystacksize)); +- +- if (yyss + yystacksize - 1 <= yyssp) +- YYABORT; +- } +- +- YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +- +- if (yystate == YYFINAL) +- YYACCEPT; +- +- goto yybackup; +- +-/*-----------. +-| yybackup. | +-`-----------*/ +-yybackup: +- +- /* Do appropriate processing given the current state. Read a +- lookahead token if we need one and don't already have one. */ +- +- /* First try to decide what to do without reference to lookahead token. */ +- yyn = yypact[yystate]; +- if (yypact_value_is_default (yyn)) +- goto yydefault; +- +- /* Not known => get a lookahead token if don't already have one. */ +- +- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ +- if (yychar == YYEMPTY) +- { +- YYDPRINTF ((stderr, "Reading a token: ")); +- yychar = yylex (); +- } +- +- if (yychar <= YYEOF) +- { +- yychar = yytoken = YYEOF; +- YYDPRINTF ((stderr, "Now at end of input.\n")); +- } +- else +- { +- yytoken = YYTRANSLATE (yychar); +- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); +- } +- +- /* If the proper action on seeing token YYTOKEN is to reduce or to +- detect an error, take that action. */ +- yyn += yytoken; +- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) +- goto yydefault; +- yyn = yytable[yyn]; +- if (yyn <= 0) +- { +- if (yytable_value_is_error (yyn)) +- goto yyerrlab; +- yyn = -yyn; +- goto yyreduce; +- } +- +- /* Count tokens shifted since error; after three, turn off error +- status. */ +- if (yyerrstatus) +- yyerrstatus--; +- +- /* Shift the lookahead token. */ +- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); +- +- /* Discard the shifted token. */ +- yychar = YYEMPTY; +- +- yystate = yyn; +- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +- *++yyvsp = yylval; +- YY_IGNORE_MAYBE_UNINITIALIZED_END +- +- goto yynewstate; +- +- +-/*-----------------------------------------------------------. +-| yydefault -- do the default action for the current state. | +-`-----------------------------------------------------------*/ +-yydefault: +- yyn = yydefact[yystate]; +- if (yyn == 0) +- goto yyerrlab; +- goto yyreduce; +- +- +-/*-----------------------------. +-| yyreduce -- Do a reduction. | +-`-----------------------------*/ +-yyreduce: +- /* yyn is the number of a rule to reduce with. */ +- yylen = yyr2[yyn]; +- +- /* If YYLEN is nonzero, implement the default value of the action: +- '$$ = $1'. +- +- Otherwise, the following line sets YYVAL to garbage. +- This behavior is undocumented and Bison +- users should not rely upon it. Assigning to YYVAL +- unconditionally makes the parser a bit smaller, and it avoids a +- GCC warning that YYVAL may be used uninitialized. */ +- yyval = yyvsp[1-yylen]; +- +- +- YY_REDUCE_PRINT (yyn); +- switch (yyn) +- { +- case 3: +-#line 277 "pic.y" /* yacc.c:1646 */ +- { +- if (olist.head) +- print_picture(olist.head); +- } +-#line 2260 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 4: +-#line 286 "pic.y" /* yacc.c:1646 */ +- { (yyval.pl) = (yyvsp[-1].pl); } +-#line 2266 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 5: +-#line 291 "pic.y" /* yacc.c:1646 */ +- { (yyval.pl) = (yyvsp[0].pl); } +-#line 2272 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 6: +-#line 293 "pic.y" /* yacc.c:1646 */ +- { (yyval.pl) = (yyvsp[-2].pl); } +-#line 2278 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 11: +-#line 308 "pic.y" /* yacc.c:1646 */ +- { +- a_delete graphname; +- graphname = new char[strlen((yyvsp[0].str)) + 1]; +- strcpy(graphname, (yyvsp[0].str)); +- a_delete (yyvsp[0].str); +- } +-#line 2289 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 12: +-#line 316 "pic.y" /* yacc.c:1646 */ +- { +- define_variable((yyvsp[-2].str), (yyvsp[0].x)); +- a_delete (yyvsp[-2].str); +- } +-#line 2298 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 13: +-#line 321 "pic.y" /* yacc.c:1646 */ +- { +- place *p = lookup_label((yyvsp[-3].str)); +- if (!p) { +- lex_error("variable `%1' not defined", (yyvsp[-3].str)); +- YYABORT; +- } +- p->obj = 0; +- p->x = (yyvsp[0].x); +- p->y = 0.0; +- a_delete (yyvsp[-3].str); +- } +-#line 2314 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 14: +-#line 333 "pic.y" /* yacc.c:1646 */ +- { current_direction = UP_DIRECTION; } +-#line 2320 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 15: +-#line 335 "pic.y" /* yacc.c:1646 */ +- { current_direction = DOWN_DIRECTION; } +-#line 2326 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 16: +-#line 337 "pic.y" /* yacc.c:1646 */ +- { current_direction = LEFT_DIRECTION; } +-#line 2332 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 17: +-#line 339 "pic.y" /* yacc.c:1646 */ +- { current_direction = RIGHT_DIRECTION; } +-#line 2338 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 18: +-#line 341 "pic.y" /* yacc.c:1646 */ +- { +- olist.append(make_command_object((yyvsp[0].lstr).str, (yyvsp[0].lstr).filename, +- (yyvsp[0].lstr).lineno)); +- } +-#line 2347 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 19: +-#line 346 "pic.y" /* yacc.c:1646 */ +- { +- olist.append(make_command_object((yyvsp[0].lstr).str, (yyvsp[0].lstr).filename, +- (yyvsp[0].lstr).lineno)); +- } +-#line 2356 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 20: +-#line 351 "pic.y" /* yacc.c:1646 */ +- { +- fprintf(stderr, "%s\n", (yyvsp[0].lstr).str); +- a_delete (yyvsp[0].lstr).str; +- fflush(stderr); +- } +-#line 2366 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 21: +-#line 357 "pic.y" /* yacc.c:1646 */ +- { delim_flag = 1; } +-#line 2372 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 22: +-#line 359 "pic.y" /* yacc.c:1646 */ +- { +- delim_flag = 0; +- if (safer_flag) +- lex_error("unsafe to run command `%1'", (yyvsp[0].str)); +- else +- system((yyvsp[0].str)); +- a_delete (yyvsp[0].str); +- } +-#line 2385 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 23: +-#line 368 "pic.y" /* yacc.c:1646 */ +- { +- if (yychar < 0) +- do_lookahead(); +- do_copy((yyvsp[0].lstr).str); +- // do not delete the filename +- } +-#line 2396 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 24: +-#line 375 "pic.y" /* yacc.c:1646 */ +- { delim_flag = 2; } +-#line 2402 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 25: +-#line 377 "pic.y" /* yacc.c:1646 */ +- { delim_flag = 0; } +-#line 2408 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 26: +-#line 379 "pic.y" /* yacc.c:1646 */ +- { +- if (yychar < 0) +- do_lookahead(); +- copy_file_thru((yyvsp[-5].lstr).str, (yyvsp[-2].str), (yyvsp[0].str)); +- // do not delete the filename +- a_delete (yyvsp[-2].str); +- a_delete (yyvsp[0].str); +- } +-#line 2421 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 27: +-#line 388 "pic.y" /* yacc.c:1646 */ +- { delim_flag = 2; } +-#line 2427 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 28: +-#line 390 "pic.y" /* yacc.c:1646 */ +- { delim_flag = 0; } +-#line 2433 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 29: +-#line 392 "pic.y" /* yacc.c:1646 */ +- { +- if (yychar < 0) +- do_lookahead(); +- copy_rest_thru((yyvsp[-2].str), (yyvsp[0].str)); +- a_delete (yyvsp[-2].str); +- a_delete (yyvsp[0].str); +- } +-#line 2445 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 30: +-#line 400 "pic.y" /* yacc.c:1646 */ +- { delim_flag = 1; } +-#line 2451 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 31: +-#line 402 "pic.y" /* yacc.c:1646 */ +- { +- delim_flag = 0; +- if (yychar < 0) +- do_lookahead(); +- do_for((yyvsp[-8].str), (yyvsp[-6].x), (yyvsp[-4].x), (yyvsp[-3].by).is_multiplicative, (yyvsp[-3].by).val, (yyvsp[0].str)); +- } +-#line 2462 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 32: +-#line 409 "pic.y" /* yacc.c:1646 */ +- { +- if (yychar < 0) +- do_lookahead(); +- if ((yyvsp[0].if_data).x != 0.0) +- push_body((yyvsp[0].if_data).body); +- a_delete (yyvsp[0].if_data).body; +- } +-#line 2474 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 33: +-#line 417 "pic.y" /* yacc.c:1646 */ +- { delim_flag = 1; } +-#line 2480 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 34: +-#line 419 "pic.y" /* yacc.c:1646 */ +- { +- delim_flag = 0; +- if (yychar < 0) +- do_lookahead(); +- if ((yyvsp[-3].if_data).x != 0.0) +- push_body((yyvsp[-3].if_data).body); +- else +- push_body((yyvsp[0].str)); +- a_delete (yyvsp[-3].if_data).body; +- a_delete (yyvsp[0].str); +- } +-#line 2496 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 36: +-#line 432 "pic.y" /* yacc.c:1646 */ +- { define_variable("scale", 1.0); } +-#line 2502 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 39: +-#line 442 "pic.y" /* yacc.c:1646 */ +- { +- reset((yyvsp[0].str)); +- a_delete (yyvsp[0].str); +- } +-#line 2511 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 40: +-#line 447 "pic.y" /* yacc.c:1646 */ +- { +- reset((yyvsp[0].str)); +- a_delete (yyvsp[0].str); +- } +-#line 2520 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 41: +-#line 452 "pic.y" /* yacc.c:1646 */ +- { +- reset((yyvsp[0].str)); +- a_delete (yyvsp[0].str); +- } +-#line 2529 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 42: +-#line 460 "pic.y" /* yacc.c:1646 */ +- { (yyval.lstr) = (yyvsp[0].lstr); } +-#line 2535 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 43: +-#line 462 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.lstr).str = new char[strlen((yyvsp[-1].lstr).str) + strlen((yyvsp[0].lstr).str) + 1]; +- strcpy((yyval.lstr).str, (yyvsp[-1].lstr).str); +- strcat((yyval.lstr).str, (yyvsp[0].lstr).str); +- a_delete (yyvsp[-1].lstr).str; +- a_delete (yyvsp[0].lstr).str; +- if ((yyvsp[-1].lstr).filename) { +- (yyval.lstr).filename = (yyvsp[-1].lstr).filename; +- (yyval.lstr).lineno = (yyvsp[-1].lstr).lineno; +- } +- else if ((yyvsp[0].lstr).filename) { +- (yyval.lstr).filename = (yyvsp[0].lstr).filename; +- (yyval.lstr).lineno = (yyvsp[0].lstr).lineno; +- } +- } +-#line 2555 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 44: +-#line 481 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.lstr).str = new char[GDIGITS + 1]; +- sprintf((yyval.lstr).str, "%g", (yyvsp[0].x)); +- (yyval.lstr).filename = 0; +- (yyval.lstr).lineno = 0; +- } +-#line 2566 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 45: +-#line 488 "pic.y" /* yacc.c:1646 */ +- { (yyval.lstr) = (yyvsp[0].lstr); } +-#line 2572 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 46: +-#line 490 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.lstr).str = new char[GDIGITS + 2 + GDIGITS + 1]; +- sprintf((yyval.lstr).str, "%g, %g", (yyvsp[0].pair).x, (yyvsp[0].pair).y); +- (yyval.lstr).filename = 0; +- (yyval.lstr).lineno = 0; +- } +-#line 2583 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 47: +-#line 500 "pic.y" /* yacc.c:1646 */ +- { delim_flag = 1; } +-#line 2589 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 48: +-#line 502 "pic.y" /* yacc.c:1646 */ +- { +- delim_flag = 0; +- (yyval.if_data).x = (yyvsp[-3].x); +- (yyval.if_data).body = (yyvsp[0].str); +- } +-#line 2599 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 49: +-#line 511 "pic.y" /* yacc.c:1646 */ +- { (yyval.str) = 0; } +-#line 2605 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 50: +-#line 513 "pic.y" /* yacc.c:1646 */ +- { (yyval.str) = (yyvsp[0].lstr).str; } +-#line 2611 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 51: +-#line 518 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[0].x); } +-#line 2617 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 52: +-#line 520 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[0].x); } +-#line 2623 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 53: +-#line 525 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.x) = strcmp((yyvsp[-2].lstr).str, (yyvsp[0].lstr).str) == 0; +- a_delete (yyvsp[-2].lstr).str; +- a_delete (yyvsp[0].lstr).str; +- } +-#line 2633 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 54: +-#line 531 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.x) = strcmp((yyvsp[-2].lstr).str, (yyvsp[0].lstr).str) != 0; +- a_delete (yyvsp[-2].lstr).str; +- a_delete (yyvsp[0].lstr).str; +- } +-#line 2643 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 55: +-#line 537 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) != 0.0 && (yyvsp[0].x) != 0.0); } +-#line 2649 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 56: +-#line 539 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) != 0.0 && (yyvsp[0].x) != 0.0); } +-#line 2655 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 57: +-#line 541 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) != 0.0 && (yyvsp[0].x) != 0.0); } +-#line 2661 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 58: +-#line 543 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) != 0.0 || (yyvsp[0].x) != 0.0); } +-#line 2667 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 59: +-#line 545 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) != 0.0 || (yyvsp[0].x) != 0.0); } +-#line 2673 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 60: +-#line 547 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) != 0.0 || (yyvsp[0].x) != 0.0); } +-#line 2679 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 61: +-#line 549 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[0].x) == 0.0); } +-#line 2685 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 62: +-#line 555 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.by).val = 1.0; +- (yyval.by).is_multiplicative = 0; +- } +-#line 2694 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 63: +-#line 560 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.by).val = (yyvsp[0].x); +- (yyval.by).is_multiplicative = 0; +- } +-#line 2703 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 64: +-#line 565 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.by).val = (yyvsp[0].x); +- (yyval.by).is_multiplicative = 1; +- } +-#line 2712 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 65: +-#line 573 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pl).obj = (yyvsp[0].spec)->make_object(¤t_position, +- ¤t_direction); +- if ((yyval.pl).obj == 0) +- YYABORT; +- delete (yyvsp[0].spec); +- if ((yyval.pl).obj) +- olist.append((yyval.pl).obj); +- else { +- (yyval.pl).x = current_position.x; +- (yyval.pl).y = current_position.y; +- } +- } +-#line 2730 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 66: +-#line 587 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pl) = (yyvsp[0].pl); +- define_label((yyvsp[-3].str), & (yyval.pl)); +- a_delete (yyvsp[-3].str); +- } +-#line 2740 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 67: +-#line 593 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pl).obj = 0; +- (yyval.pl).x = (yyvsp[0].pair).x; +- (yyval.pl).y = (yyvsp[0].pair).y; +- define_label((yyvsp[-3].str), & (yyval.pl)); +- a_delete (yyvsp[-3].str); +- } +-#line 2752 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 68: +-#line 601 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pl) = (yyvsp[0].pl); +- define_label((yyvsp[-3].str), & (yyval.pl)); +- a_delete (yyvsp[-3].str); +- } +-#line 2762 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 69: +-#line 607 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.state).x = current_position.x; +- (yyval.state).y = current_position.y; +- (yyval.state).dir = current_direction; +- } +-#line 2772 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 70: +-#line 613 "pic.y" /* yacc.c:1646 */ +- { +- current_position.x = (yyvsp[-2].state).x; +- current_position.y = (yyvsp[-2].state).y; +- current_direction = (yyvsp[-2].state).dir; +- } +-#line 2782 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 71: +-#line 619 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pl) = (yyvsp[-3].pl); +- } +-#line 2790 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 72: +-#line 623 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pl).obj = 0; +- (yyval.pl).x = current_position.x; +- (yyval.pl).y = current_position.y; +- } +-#line 2800 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 73: +-#line 632 "pic.y" /* yacc.c:1646 */ +- {} +-#line 2806 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 74: +-#line 634 "pic.y" /* yacc.c:1646 */ +- {} +-#line 2812 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 75: +-#line 639 "pic.y" /* yacc.c:1646 */ +- { (yyval.spec) = new object_spec(BOX_OBJECT); } +-#line 2818 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 76: +-#line 641 "pic.y" /* yacc.c:1646 */ +- { (yyval.spec) = new object_spec(CIRCLE_OBJECT); } +-#line 2824 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 77: +-#line 643 "pic.y" /* yacc.c:1646 */ +- { (yyval.spec) = new object_spec(ELLIPSE_OBJECT); } +-#line 2830 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 78: +-#line 645 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = new object_spec(ARC_OBJECT); +- (yyval.spec)->dir = current_direction; +- } +-#line 2839 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 79: +-#line 650 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = new object_spec(LINE_OBJECT); +- lookup_variable("lineht", & (yyval.spec)->segment_height); +- lookup_variable("linewid", & (yyval.spec)->segment_width); +- (yyval.spec)->dir = current_direction; +- } +-#line 2850 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 80: +-#line 657 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = new object_spec(ARROW_OBJECT); +- lookup_variable("lineht", & (yyval.spec)->segment_height); +- lookup_variable("linewid", & (yyval.spec)->segment_width); +- (yyval.spec)->dir = current_direction; +- } +-#line 2861 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 81: +-#line 664 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = new object_spec(MOVE_OBJECT); +- lookup_variable("moveht", & (yyval.spec)->segment_height); +- lookup_variable("movewid", & (yyval.spec)->segment_width); +- (yyval.spec)->dir = current_direction; +- } +-#line 2872 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 82: +-#line 671 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = new object_spec(SPLINE_OBJECT); +- lookup_variable("lineht", & (yyval.spec)->segment_height); +- lookup_variable("linewid", & (yyval.spec)->segment_width); +- (yyval.spec)->dir = current_direction; +- } +-#line 2883 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 83: +-#line 678 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = new object_spec(TEXT_OBJECT); +- (yyval.spec)->text = new text_item((yyvsp[0].lstr).str, (yyvsp[0].lstr).filename, (yyvsp[0].lstr).lineno); +- } +-#line 2892 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 84: +-#line 683 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = new object_spec(TEXT_OBJECT); +- (yyval.spec)->text = new text_item(format_number(0, (yyvsp[0].x)), 0, -1); +- } +-#line 2901 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 85: +-#line 688 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = new object_spec(TEXT_OBJECT); +- (yyval.spec)->text = new text_item(format_number((yyvsp[0].lstr).str, (yyvsp[-1].x)), +- (yyvsp[0].lstr).filename, (yyvsp[0].lstr).lineno); +- a_delete (yyvsp[0].lstr).str; +- } +-#line 2912 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 86: +-#line 695 "pic.y" /* yacc.c:1646 */ +- { +- saved_state *p = new saved_state; +- (yyval.pstate) = p; +- p->x = current_position.x; +- p->y = current_position.y; +- p->dir = current_direction; +- p->tbl = current_table; +- p->prev = current_saved_state; +- current_position.x = 0.0; +- current_position.y = 0.0; +- current_table = new PTABLE(place); +- current_saved_state = p; +- olist.append(make_mark_object()); +- } +-#line 2931 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 87: +-#line 710 "pic.y" /* yacc.c:1646 */ +- { +- current_position.x = (yyvsp[-2].pstate)->x; +- current_position.y = (yyvsp[-2].pstate)->y; +- current_direction = (yyvsp[-2].pstate)->dir; +- (yyval.spec) = new object_spec(BLOCK_OBJECT); +- olist.wrap_up_block(& (yyval.spec)->oblist); +- (yyval.spec)->tbl = current_table; +- current_table = (yyvsp[-2].pstate)->tbl; +- current_saved_state = (yyvsp[-2].pstate)->prev; +- delete (yyvsp[-2].pstate); +- } +-#line 2947 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 88: +-#line 722 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->height = (yyvsp[0].x); +- (yyval.spec)->flags |= HAS_HEIGHT; +- } +-#line 2957 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 89: +-#line 728 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->radius = (yyvsp[0].x); +- (yyval.spec)->flags |= HAS_RADIUS; +- } +-#line 2967 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 90: +-#line 734 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->width = (yyvsp[0].x); +- (yyval.spec)->flags |= HAS_WIDTH; +- } +-#line 2977 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 91: +-#line 740 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->radius = (yyvsp[0].x)/2.0; +- (yyval.spec)->flags |= HAS_RADIUS; +- } +-#line 2987 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 92: +-#line 746 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags |= HAS_SEGMENT; +- switch ((yyval.spec)->dir) { +- case UP_DIRECTION: +- (yyval.spec)->segment_pos.y += (yyvsp[0].x); +- break; +- case DOWN_DIRECTION: +- (yyval.spec)->segment_pos.y -= (yyvsp[0].x); +- break; +- case RIGHT_DIRECTION: +- (yyval.spec)->segment_pos.x += (yyvsp[0].x); +- break; +- case LEFT_DIRECTION: +- (yyval.spec)->segment_pos.x -= (yyvsp[0].x); +- break; +- } +- } +-#line 3010 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 93: +-#line 765 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->dir = UP_DIRECTION; +- (yyval.spec)->flags |= HAS_SEGMENT; +- (yyval.spec)->segment_pos.y += (yyval.spec)->segment_height; +- } +-#line 3021 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 94: +-#line 772 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->dir = UP_DIRECTION; +- (yyval.spec)->flags |= HAS_SEGMENT; +- (yyval.spec)->segment_pos.y += (yyvsp[0].x); +- } +-#line 3032 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 95: +-#line 779 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->dir = DOWN_DIRECTION; +- (yyval.spec)->flags |= HAS_SEGMENT; +- (yyval.spec)->segment_pos.y -= (yyval.spec)->segment_height; +- } +-#line 3043 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 96: +-#line 786 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->dir = DOWN_DIRECTION; +- (yyval.spec)->flags |= HAS_SEGMENT; +- (yyval.spec)->segment_pos.y -= (yyvsp[0].x); +- } +-#line 3054 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 97: +-#line 793 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->dir = RIGHT_DIRECTION; +- (yyval.spec)->flags |= HAS_SEGMENT; +- (yyval.spec)->segment_pos.x += (yyval.spec)->segment_width; +- } +-#line 3065 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 98: +-#line 800 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->dir = RIGHT_DIRECTION; +- (yyval.spec)->flags |= HAS_SEGMENT; +- (yyval.spec)->segment_pos.x += (yyvsp[0].x); +- } +-#line 3076 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 99: +-#line 807 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->dir = LEFT_DIRECTION; +- (yyval.spec)->flags |= HAS_SEGMENT; +- (yyval.spec)->segment_pos.x -= (yyval.spec)->segment_width; +- } +-#line 3087 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 100: +-#line 814 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->dir = LEFT_DIRECTION; +- (yyval.spec)->flags |= HAS_SEGMENT; +- (yyval.spec)->segment_pos.x -= (yyvsp[0].x); +- } +-#line 3098 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 101: +-#line 821 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= HAS_FROM; +- (yyval.spec)->from.x = (yyvsp[0].pair).x; +- (yyval.spec)->from.y = (yyvsp[0].pair).y; +- } +-#line 3109 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 102: +-#line 828 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- if ((yyval.spec)->flags & HAS_SEGMENT) +- (yyval.spec)->segment_list = new segment((yyval.spec)->segment_pos, +- (yyval.spec)->segment_is_absolute, +- (yyval.spec)->segment_list); +- (yyval.spec)->flags |= HAS_SEGMENT; +- (yyval.spec)->segment_pos.x = (yyvsp[0].pair).x; +- (yyval.spec)->segment_pos.y = (yyvsp[0].pair).y; +- (yyval.spec)->segment_is_absolute = 1; +- (yyval.spec)->flags |= HAS_TO; +- (yyval.spec)->to.x = (yyvsp[0].pair).x; +- (yyval.spec)->to.y = (yyvsp[0].pair).y; +- } +-#line 3128 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 103: +-#line 843 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= HAS_AT; +- (yyval.spec)->at.x = (yyvsp[0].pair).x; +- (yyval.spec)->at.y = (yyvsp[0].pair).y; +- if ((yyval.spec)->type != ARC_OBJECT) { +- (yyval.spec)->flags |= HAS_FROM; +- (yyval.spec)->from.x = (yyvsp[0].pair).x; +- (yyval.spec)->from.y = (yyvsp[0].pair).y; +- } +- } +-#line 3144 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 104: +-#line 855 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= HAS_WITH; +- (yyval.spec)->with = (yyvsp[0].pth); +- } +-#line 3154 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 105: +-#line 861 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= HAS_WITH; +- position pos; +- pos.x = (yyvsp[0].pair).x; +- pos.y = (yyvsp[0].pair).y; +- (yyval.spec)->with = new path(pos); +- } +-#line 3167 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 106: +-#line 870 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= HAS_SEGMENT; +- (yyval.spec)->segment_pos.x += (yyvsp[0].pair).x; +- (yyval.spec)->segment_pos.y += (yyvsp[0].pair).y; +- } +-#line 3178 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 107: +-#line 877 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- if (!((yyval.spec)->flags & HAS_SEGMENT)) +- switch ((yyval.spec)->dir) { +- case UP_DIRECTION: +- (yyval.spec)->segment_pos.y += (yyval.spec)->segment_width; +- break; +- case DOWN_DIRECTION: +- (yyval.spec)->segment_pos.y -= (yyval.spec)->segment_width; +- break; +- case RIGHT_DIRECTION: +- (yyval.spec)->segment_pos.x += (yyval.spec)->segment_width; +- break; +- case LEFT_DIRECTION: +- (yyval.spec)->segment_pos.x -= (yyval.spec)->segment_width; +- break; +- } +- (yyval.spec)->segment_list = new segment((yyval.spec)->segment_pos, +- (yyval.spec)->segment_is_absolute, +- (yyval.spec)->segment_list); +- (yyval.spec)->flags &= ~HAS_SEGMENT; +- (yyval.spec)->segment_pos.x = (yyval.spec)->segment_pos.y = 0.0; +- (yyval.spec)->segment_is_absolute = 0; +- } +-#line 3207 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 108: +-#line 902 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); // nothing +- } +-#line 3215 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 109: +-#line 906 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags |= IS_DOTTED; +- lookup_variable("dashwid", & (yyval.spec)->dash_width); +- } +-#line 3225 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 110: +-#line 912 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= IS_DOTTED; +- (yyval.spec)->dash_width = (yyvsp[0].x); +- } +-#line 3235 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 111: +-#line 918 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags |= IS_DASHED; +- lookup_variable("dashwid", & (yyval.spec)->dash_width); +- } +-#line 3245 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 112: +-#line 924 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= IS_DASHED; +- (yyval.spec)->dash_width = (yyvsp[0].x); +- } +-#line 3255 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 113: +-#line 930 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags |= IS_DEFAULT_FILLED; +- } +-#line 3264 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 114: +-#line 935 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= IS_FILLED; +- (yyval.spec)->fill = (yyvsp[0].x); +- } +-#line 3274 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 115: +-#line 941 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= IS_XSLANTED; +- (yyval.spec)->xslanted = (yyvsp[0].x); +- } +-#line 3284 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 116: +-#line 947 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= IS_YSLANTED; +- (yyval.spec)->yslanted = (yyvsp[0].x); +- } +-#line 3294 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 117: +-#line 953 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= (IS_SHADED | IS_FILLED); +- (yyval.spec)->shaded = new char[strlen((yyvsp[0].lstr).str)+1]; +- strcpy((yyval.spec)->shaded, (yyvsp[0].lstr).str); +- } +-#line 3305 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 118: +-#line 960 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= (IS_SHADED | IS_OUTLINED | IS_FILLED); +- (yyval.spec)->shaded = new char[strlen((yyvsp[0].lstr).str)+1]; +- strcpy((yyval.spec)->shaded, (yyvsp[0].lstr).str); +- (yyval.spec)->outlined = new char[strlen((yyvsp[0].lstr).str)+1]; +- strcpy((yyval.spec)->outlined, (yyvsp[0].lstr).str); +- } +-#line 3318 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 119: +-#line 969 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= IS_OUTLINED; +- (yyval.spec)->outlined = new char[strlen((yyvsp[0].lstr).str)+1]; +- strcpy((yyval.spec)->outlined, (yyvsp[0].lstr).str); +- } +-#line 3329 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 120: +-#line 976 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- // line chop chop means line chop 0 chop 0 +- if ((yyval.spec)->flags & IS_DEFAULT_CHOPPED) { +- (yyval.spec)->flags |= IS_CHOPPED; +- (yyval.spec)->flags &= ~IS_DEFAULT_CHOPPED; +- (yyval.spec)->start_chop = (yyval.spec)->end_chop = 0.0; +- } +- else if ((yyval.spec)->flags & IS_CHOPPED) { +- (yyval.spec)->end_chop = 0.0; +- } +- else { +- (yyval.spec)->flags |= IS_DEFAULT_CHOPPED; +- } +- } +-#line 3349 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 121: +-#line 992 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- if ((yyval.spec)->flags & IS_DEFAULT_CHOPPED) { +- (yyval.spec)->flags |= IS_CHOPPED; +- (yyval.spec)->flags &= ~IS_DEFAULT_CHOPPED; +- (yyval.spec)->start_chop = 0.0; +- (yyval.spec)->end_chop = (yyvsp[0].x); +- } +- else if ((yyval.spec)->flags & IS_CHOPPED) { +- (yyval.spec)->end_chop = (yyvsp[0].x); +- } +- else { +- (yyval.spec)->start_chop = (yyval.spec)->end_chop = (yyvsp[0].x); +- (yyval.spec)->flags |= IS_CHOPPED; +- } +- } +-#line 3370 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 122: +-#line 1009 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags |= IS_SAME; +- } +-#line 3379 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 123: +-#line 1014 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags |= IS_INVISIBLE; +- } +-#line 3388 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 124: +-#line 1019 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags |= HAS_LEFT_ARROW_HEAD; +- } +-#line 3397 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 125: +-#line 1024 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags |= HAS_RIGHT_ARROW_HEAD; +- } +-#line 3406 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 126: +-#line 1029 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags |= (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD); +- } +-#line 3415 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 127: +-#line 1034 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags |= IS_CLOCKWISE; +- } +-#line 3424 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 128: +-#line 1039 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags &= ~IS_CLOCKWISE; +- } +-#line 3433 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 129: +-#line 1044 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- text_item **p; +- for (p = & (yyval.spec)->text; *p; p = &(*p)->next) +- ; +- *p = new text_item((yyvsp[0].lstr).str, (yyvsp[0].lstr).filename, (yyvsp[0].lstr).lineno); +- } +-#line 3445 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 130: +-#line 1052 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- if ((yyval.spec)->text) { +- text_item *p; +- for (p = (yyval.spec)->text; p->next; p = p->next) +- ; +- p->adj.h = LEFT_ADJUST; +- } +- } +-#line 3459 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 131: +-#line 1062 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- if ((yyval.spec)->text) { +- text_item *p; +- for (p = (yyval.spec)->text; p->next; p = p->next) +- ; +- p->adj.h = RIGHT_ADJUST; +- } +- } +-#line 3473 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 132: +-#line 1072 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- if ((yyval.spec)->text) { +- text_item *p; +- for (p = (yyval.spec)->text; p->next; p = p->next) +- ; +- p->adj.v = ABOVE_ADJUST; +- } +- } +-#line 3487 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 133: +-#line 1082 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- if ((yyval.spec)->text) { +- text_item *p; +- for (p = (yyval.spec)->text; p->next; p = p->next) +- ; +- p->adj.v = BELOW_ADJUST; +- } +- } +-#line 3501 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 134: +-#line 1092 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-2].spec); +- (yyval.spec)->flags |= HAS_THICKNESS; +- (yyval.spec)->thickness = (yyvsp[0].x); +- } +-#line 3511 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 135: +-#line 1098 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.spec) = (yyvsp[-1].spec); +- (yyval.spec)->flags |= IS_ALIGNED; +- } +-#line 3520 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 136: +-#line 1106 "pic.y" /* yacc.c:1646 */ +- { (yyval.lstr) = (yyvsp[0].lstr); } +-#line 3526 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 137: +-#line 1108 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.lstr).filename = (yyvsp[-2].lstr).filename; +- (yyval.lstr).lineno = (yyvsp[-2].lstr).lineno; +- (yyval.lstr).str = do_sprintf((yyvsp[-2].lstr).str, (yyvsp[-1].dv).v, (yyvsp[-1].dv).nv); +- a_delete (yyvsp[-1].dv).v; +- a_delete (yyvsp[-2].lstr).str; +- } +-#line 3538 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 138: +-#line 1119 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.dv).v = 0; +- (yyval.dv).nv = 0; +- (yyval.dv).maxv = 0; +- } +-#line 3548 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 139: +-#line 1125 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.dv) = (yyvsp[-2].dv); +- if ((yyval.dv).nv >= (yyval.dv).maxv) { +- if ((yyval.dv).nv == 0) { +- (yyval.dv).v = new double[4]; +- (yyval.dv).maxv = 4; +- } +- else { +- double *oldv = (yyval.dv).v; +- (yyval.dv).maxv *= 2; +-#if 0 +- (yyval.dv).v = new double[(yyval.dv).maxv]; +- memcpy((yyval.dv).v, oldv, (yyval.dv).nv*sizeof(double)); +-#else +- // workaround for bug in Compaq C++ V6.5-033 +- // for Compaq Tru64 UNIX V5.1A (Rev. 1885) +- double *foo = new double[(yyval.dv).maxv]; +- memcpy(foo, oldv, (yyval.dv).nv*sizeof(double)); +- (yyval.dv).v = foo; +-#endif +- a_delete oldv; +- } +- } +- (yyval.dv).v[(yyval.dv).nv] = (yyvsp[0].x); +- (yyval.dv).nv += 1; +- } +-#line 3579 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 140: +-#line 1155 "pic.y" /* yacc.c:1646 */ +- { (yyval.pair) = (yyvsp[0].pair); } +-#line 3585 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 141: +-#line 1157 "pic.y" /* yacc.c:1646 */ +- { +- position pos = (yyvsp[0].pl); +- (yyval.pair).x = pos.x; +- (yyval.pair).y = pos.y; +- } +-#line 3595 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 142: +-#line 1163 "pic.y" /* yacc.c:1646 */ +- { +- position pos = (yyvsp[-1].pl); +- (yyval.pair).x = pos.x; +- (yyval.pair).y = pos.y; +- } +-#line 3605 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 143: +-#line 1172 "pic.y" /* yacc.c:1646 */ +- { (yyval.pair) = (yyvsp[0].pair); } +-#line 3611 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 144: +-#line 1174 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pair).x = (yyvsp[-2].pair).x + (yyvsp[0].pair).x; +- (yyval.pair).y = (yyvsp[-2].pair).y + (yyvsp[0].pair).y; +- } +-#line 3620 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 145: +-#line 1179 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pair).x = (yyvsp[-3].pair).x + (yyvsp[-1].pair).x; +- (yyval.pair).y = (yyvsp[-3].pair).y + (yyvsp[-1].pair).y; +- } +-#line 3629 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 146: +-#line 1184 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pair).x = (yyvsp[-2].pair).x - (yyvsp[0].pair).x; +- (yyval.pair).y = (yyvsp[-2].pair).y - (yyvsp[0].pair).y; +- } +-#line 3638 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 147: +-#line 1189 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pair).x = (yyvsp[-3].pair).x - (yyvsp[-1].pair).x; +- (yyval.pair).y = (yyvsp[-3].pair).y - (yyvsp[-1].pair).y; +- } +-#line 3647 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 148: +-#line 1194 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pair).x = (yyvsp[-3].pair).x; +- (yyval.pair).y = (yyvsp[-1].pair).y; +- } +-#line 3656 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 149: +-#line 1199 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pair).x = (1.0 - (yyvsp[-4].x))*(yyvsp[-2].pair).x + (yyvsp[-4].x)*(yyvsp[0].pair).x; +- (yyval.pair).y = (1.0 - (yyvsp[-4].x))*(yyvsp[-2].pair).y + (yyvsp[-4].x)*(yyvsp[0].pair).y; +- } +-#line 3665 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 150: +-#line 1204 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pair).x = (1.0 - (yyvsp[-5].x))*(yyvsp[-3].pair).x + (yyvsp[-5].x)*(yyvsp[-1].pair).x; +- (yyval.pair).y = (1.0 - (yyvsp[-5].x))*(yyvsp[-3].pair).y + (yyvsp[-5].x)*(yyvsp[-1].pair).y; +- } +-#line 3674 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 151: +-#line 1210 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pair).x = (1.0 - (yyvsp[-5].x))*(yyvsp[-3].pair).x + (yyvsp[-5].x)*(yyvsp[-1].pair).x; +- (yyval.pair).y = (1.0 - (yyvsp[-5].x))*(yyvsp[-3].pair).y + (yyvsp[-5].x)*(yyvsp[-1].pair).y; +- } +-#line 3683 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 152: +-#line 1215 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pair).x = (1.0 - (yyvsp[-6].x))*(yyvsp[-4].pair).x + (yyvsp[-6].x)*(yyvsp[-2].pair).x; +- (yyval.pair).y = (1.0 - (yyvsp[-6].x))*(yyvsp[-4].pair).y + (yyvsp[-6].x)*(yyvsp[-2].pair).y; +- } +-#line 3692 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 155: +-#line 1228 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pair).x = (yyvsp[-2].x); +- (yyval.pair).y = (yyvsp[0].x); +- } +-#line 3701 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 156: +-#line 1233 "pic.y" /* yacc.c:1646 */ +- { (yyval.pair) = (yyvsp[-1].pair); } +-#line 3707 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 157: +-#line 1239 "pic.y" /* yacc.c:1646 */ +- { (yyval.pl) = (yyvsp[0].pl); } +-#line 3713 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 158: +-#line 1241 "pic.y" /* yacc.c:1646 */ +- { +- path pth((yyvsp[0].crn)); +- if (!pth.follow((yyvsp[-1].pl), & (yyval.pl))) +- YYABORT; +- } +-#line 3723 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 159: +-#line 1247 "pic.y" /* yacc.c:1646 */ +- { +- path pth((yyvsp[-1].crn)); +- if (!pth.follow((yyvsp[0].pl), & (yyval.pl))) +- YYABORT; +- } +-#line 3733 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 160: +-#line 1253 "pic.y" /* yacc.c:1646 */ +- { +- path pth((yyvsp[-2].crn)); +- if (!pth.follow((yyvsp[0].pl), & (yyval.pl))) +- YYABORT; +- } +-#line 3743 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 161: +-#line 1259 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pl).x = current_position.x; +- (yyval.pl).y = current_position.y; +- (yyval.pl).obj = 0; +- } +-#line 3753 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 162: +-#line 1268 "pic.y" /* yacc.c:1646 */ +- { +- place *p = lookup_label((yyvsp[0].str)); +- if (!p) { +- lex_error("there is no place `%1'", (yyvsp[0].str)); +- YYABORT; +- } +- (yyval.pl) = *p; +- a_delete (yyvsp[0].str); +- } +-#line 3767 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 163: +-#line 1278 "pic.y" /* yacc.c:1646 */ +- { (yyval.pl).obj = (yyvsp[0].obj); } +-#line 3773 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 164: +-#line 1280 "pic.y" /* yacc.c:1646 */ +- { +- path pth((yyvsp[0].str)); +- if (!pth.follow((yyvsp[-2].pl), & (yyval.pl))) +- YYABORT; +- } +-#line 3783 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 165: +-#line 1289 "pic.y" /* yacc.c:1646 */ +- { (yyval.n) = (yyvsp[0].n); } +-#line 3789 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 166: +-#line 1291 "pic.y" /* yacc.c:1646 */ +- { +- // XXX Check for overflow (and non-integers?). +- (yyval.n) = (int)(yyvsp[-1].x); +- } +-#line 3798 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 167: +-#line 1299 "pic.y" /* yacc.c:1646 */ +- { (yyval.n) = 1; } +-#line 3804 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 168: +-#line 1301 "pic.y" /* yacc.c:1646 */ +- { (yyval.n) = (yyvsp[-1].n); } +-#line 3810 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 169: +-#line 1306 "pic.y" /* yacc.c:1646 */ +- { +- int count = 0; +- object *p; +- for (p = olist.head; p != 0; p = p->next) +- if (p->type() == (yyvsp[0].obtype) && ++count == (yyvsp[-1].n)) { +- (yyval.obj) = p; +- break; +- } +- if (p == 0) { +- lex_error("there is no %1%2 %3", (yyvsp[-1].n), ordinal_postfix((yyvsp[-1].n)), +- object_type_name((yyvsp[0].obtype))); +- YYABORT; +- } +- } +-#line 3829 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 170: +-#line 1321 "pic.y" /* yacc.c:1646 */ +- { +- int count = 0; +- object *p; +- for (p = olist.tail; p != 0; p = p->prev) +- if (p->type() == (yyvsp[0].obtype) && ++count == (yyvsp[-1].n)) { +- (yyval.obj) = p; +- break; +- } +- if (p == 0) { +- lex_error("there is no %1%2 last %3", (yyvsp[-1].n), +- ordinal_postfix((yyvsp[-1].n)), object_type_name((yyvsp[0].obtype))); +- YYABORT; +- } +- } +-#line 3848 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 171: +-#line 1339 "pic.y" /* yacc.c:1646 */ +- { (yyval.obtype) = BOX_OBJECT; } +-#line 3854 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 172: +-#line 1341 "pic.y" /* yacc.c:1646 */ +- { (yyval.obtype) = CIRCLE_OBJECT; } +-#line 3860 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 173: +-#line 1343 "pic.y" /* yacc.c:1646 */ +- { (yyval.obtype) = ELLIPSE_OBJECT; } +-#line 3866 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 174: +-#line 1345 "pic.y" /* yacc.c:1646 */ +- { (yyval.obtype) = ARC_OBJECT; } +-#line 3872 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 175: +-#line 1347 "pic.y" /* yacc.c:1646 */ +- { (yyval.obtype) = LINE_OBJECT; } +-#line 3878 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 176: +-#line 1349 "pic.y" /* yacc.c:1646 */ +- { (yyval.obtype) = ARROW_OBJECT; } +-#line 3884 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 177: +-#line 1351 "pic.y" /* yacc.c:1646 */ +- { (yyval.obtype) = SPLINE_OBJECT; } +-#line 3890 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 178: +-#line 1353 "pic.y" /* yacc.c:1646 */ +- { (yyval.obtype) = BLOCK_OBJECT; } +-#line 3896 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 179: +-#line 1355 "pic.y" /* yacc.c:1646 */ +- { (yyval.obtype) = TEXT_OBJECT; } +-#line 3902 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 180: +-#line 1360 "pic.y" /* yacc.c:1646 */ +- { (yyval.pth) = new path((yyvsp[0].str)); } +-#line 3908 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 181: +-#line 1362 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pth) = (yyvsp[-2].pth); +- (yyval.pth)->append((yyvsp[0].str)); +- } +-#line 3917 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 182: +-#line 1370 "pic.y" /* yacc.c:1646 */ +- { (yyval.pth) = new path((yyvsp[0].crn)); } +-#line 3923 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 183: +-#line 1374 "pic.y" /* yacc.c:1646 */ +- { (yyval.pth) = (yyvsp[0].pth); } +-#line 3929 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 184: +-#line 1376 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pth) = (yyvsp[-1].pth); +- (yyval.pth)->append((yyvsp[0].crn)); +- } +-#line 3938 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 185: +-#line 1384 "pic.y" /* yacc.c:1646 */ +- { (yyval.pth) = (yyvsp[0].pth); } +-#line 3944 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 186: +-#line 1386 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.pth) = (yyvsp[-3].pth); +- (yyval.pth)->set_ypath((yyvsp[-1].pth)); +- } +-#line 3953 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 187: +-#line 1392 "pic.y" /* yacc.c:1646 */ +- { +- lex_warning("`%1%2 last %3' in `with' argument ignored", +- (yyvsp[-3].n), ordinal_postfix((yyvsp[-3].n)), object_type_name((yyvsp[-1].obtype))); +- (yyval.pth) = (yyvsp[0].pth); +- } +-#line 3963 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 188: +-#line 1398 "pic.y" /* yacc.c:1646 */ +- { +- lex_warning("`last %1' in `with' argument ignored", +- object_type_name((yyvsp[-1].obtype))); +- (yyval.pth) = (yyvsp[0].pth); +- } +-#line 3973 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 189: +-#line 1404 "pic.y" /* yacc.c:1646 */ +- { +- lex_warning("`%1%2 %3' in `with' argument ignored", +- (yyvsp[-2].n), ordinal_postfix((yyvsp[-2].n)), object_type_name((yyvsp[-1].obtype))); +- (yyval.pth) = (yyvsp[0].pth); +- } +-#line 3983 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 190: +-#line 1410 "pic.y" /* yacc.c:1646 */ +- { +- lex_warning("initial `%1' in `with' argument ignored", (yyvsp[-1].str)); +- a_delete (yyvsp[-1].str); +- (yyval.pth) = (yyvsp[0].pth); +- } +-#line 3993 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 191: +-#line 1419 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::north; } +-#line 3999 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 192: +-#line 1421 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::east; } +-#line 4005 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 193: +-#line 1423 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::west; } +-#line 4011 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 194: +-#line 1425 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::south; } +-#line 4017 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 195: +-#line 1427 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::north_east; } +-#line 4023 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 196: +-#line 1429 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object:: south_east; } +-#line 4029 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 197: +-#line 1431 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::north_west; } +-#line 4035 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 198: +-#line 1433 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::south_west; } +-#line 4041 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 199: +-#line 1435 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::center; } +-#line 4047 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 200: +-#line 1437 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::start; } +-#line 4053 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 201: +-#line 1439 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::end; } +-#line 4059 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 202: +-#line 1441 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::north; } +-#line 4065 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 203: +-#line 1443 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::south; } +-#line 4071 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 204: +-#line 1445 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::west; } +-#line 4077 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 205: +-#line 1447 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::east; } +-#line 4083 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 206: +-#line 1449 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::north_west; } +-#line 4089 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 207: +-#line 1451 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::south_west; } +-#line 4095 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 208: +-#line 1453 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::north_east; } +-#line 4101 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 209: +-#line 1455 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::south_east; } +-#line 4107 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 210: +-#line 1457 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::west; } +-#line 4113 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 211: +-#line 1459 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::east; } +-#line 4119 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 212: +-#line 1461 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::north_west; } +-#line 4125 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 213: +-#line 1463 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::south_west; } +-#line 4131 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 214: +-#line 1465 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::north_east; } +-#line 4137 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 215: +-#line 1467 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::south_east; } +-#line 4143 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 216: +-#line 1469 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::north; } +-#line 4149 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 217: +-#line 1471 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::south; } +-#line 4155 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 218: +-#line 1473 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::east; } +-#line 4161 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 219: +-#line 1475 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::west; } +-#line 4167 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 220: +-#line 1477 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::center; } +-#line 4173 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 221: +-#line 1479 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::start; } +-#line 4179 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 222: +-#line 1481 "pic.y" /* yacc.c:1646 */ +- { (yyval.crn) = &object::end; } +-#line 4185 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 223: +-#line 1486 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[0].x); } +-#line 4191 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 224: +-#line 1488 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[0].x); } +-#line 4197 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 225: +-#line 1493 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) < (yyvsp[0].x)); } +-#line 4203 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 226: +-#line 1498 "pic.y" /* yacc.c:1646 */ +- { +- if (!lookup_variable((yyvsp[0].str), & (yyval.x))) { +- lex_error("there is no variable `%1'", (yyvsp[0].str)); +- YYABORT; +- } +- a_delete (yyvsp[0].str); +- } +-#line 4215 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 227: +-#line 1506 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[0].x); } +-#line 4221 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 228: +-#line 1508 "pic.y" /* yacc.c:1646 */ +- { +- if ((yyvsp[-1].pl).obj != 0) +- (yyval.x) = (yyvsp[-1].pl).obj->origin().x; +- else +- (yyval.x) = (yyvsp[-1].pl).x; +- } +-#line 4232 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 229: +-#line 1515 "pic.y" /* yacc.c:1646 */ +- { +- if ((yyvsp[-1].pl).obj != 0) +- (yyval.x) = (yyvsp[-1].pl).obj->origin().y; +- else +- (yyval.x) = (yyvsp[-1].pl).y; +- } +-#line 4243 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 230: +-#line 1522 "pic.y" /* yacc.c:1646 */ +- { +- if ((yyvsp[-1].pl).obj != 0) +- (yyval.x) = (yyvsp[-1].pl).obj->height(); +- else +- (yyval.x) = 0.0; +- } +-#line 4254 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 231: +-#line 1529 "pic.y" /* yacc.c:1646 */ +- { +- if ((yyvsp[-1].pl).obj != 0) +- (yyval.x) = (yyvsp[-1].pl).obj->width(); +- else +- (yyval.x) = 0.0; +- } +-#line 4265 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 232: +-#line 1536 "pic.y" /* yacc.c:1646 */ +- { +- if ((yyvsp[-1].pl).obj != 0) +- (yyval.x) = (yyvsp[-1].pl).obj->radius(); +- else +- (yyval.x) = 0.0; +- } +-#line 4276 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 233: +-#line 1543 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[-2].x) + (yyvsp[0].x); } +-#line 4282 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 234: +-#line 1545 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[-2].x) - (yyvsp[0].x); } +-#line 4288 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 235: +-#line 1547 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[-2].x) * (yyvsp[0].x); } +-#line 4294 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 236: +-#line 1549 "pic.y" /* yacc.c:1646 */ +- { +- if ((yyvsp[0].x) == 0.0) { +- lex_error("division by zero"); +- YYABORT; +- } +- (yyval.x) = (yyvsp[-2].x)/(yyvsp[0].x); +- } +-#line 4306 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 237: +-#line 1557 "pic.y" /* yacc.c:1646 */ +- { +- if ((yyvsp[0].x) == 0.0) { +- lex_error("modulus by zero"); +- YYABORT; +- } +- (yyval.x) = fmod((yyvsp[-2].x), (yyvsp[0].x)); +- } +-#line 4318 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 238: +-#line 1565 "pic.y" /* yacc.c:1646 */ +- { +- errno = 0; +- (yyval.x) = pow((yyvsp[-2].x), (yyvsp[0].x)); +- if (errno == EDOM) { +- lex_error("arguments to `^' operator out of domain"); +- YYABORT; +- } +- if (errno == ERANGE) { +- lex_error("result of `^' operator out of range"); +- YYABORT; +- } +- } +-#line 4335 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 239: +-#line 1578 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = -(yyvsp[0].x); } +-#line 4341 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 240: +-#line 1580 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[-1].x); } +-#line 4347 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 241: +-#line 1582 "pic.y" /* yacc.c:1646 */ +- { +- errno = 0; +- (yyval.x) = sin((yyvsp[-1].x)); +- if (errno == ERANGE) { +- lex_error("sin result out of range"); +- YYABORT; +- } +- } +-#line 4360 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 242: +-#line 1591 "pic.y" /* yacc.c:1646 */ +- { +- errno = 0; +- (yyval.x) = cos((yyvsp[-1].x)); +- if (errno == ERANGE) { +- lex_error("cos result out of range"); +- YYABORT; +- } +- } +-#line 4373 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 243: +-#line 1600 "pic.y" /* yacc.c:1646 */ +- { +- errno = 0; +- (yyval.x) = atan2((yyvsp[-3].x), (yyvsp[-1].x)); +- if (errno == EDOM) { +- lex_error("atan2 argument out of domain"); +- YYABORT; +- } +- if (errno == ERANGE) { +- lex_error("atan2 result out of range"); +- YYABORT; +- } +- } +-#line 4390 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 244: +-#line 1613 "pic.y" /* yacc.c:1646 */ +- { +- errno = 0; +- (yyval.x) = log10((yyvsp[-1].x)); +- if (errno == ERANGE) { +- lex_error("log result out of range"); +- YYABORT; +- } +- } +-#line 4403 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 245: +-#line 1622 "pic.y" /* yacc.c:1646 */ +- { +- errno = 0; +- (yyval.x) = pow(10.0, (yyvsp[-1].x)); +- if (errno == ERANGE) { +- lex_error("exp result out of range"); +- YYABORT; +- } +- } +-#line 4416 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 246: +-#line 1631 "pic.y" /* yacc.c:1646 */ +- { +- errno = 0; +- (yyval.x) = sqrt((yyvsp[-1].x)); +- if (errno == EDOM) { +- lex_error("sqrt argument out of domain"); +- YYABORT; +- } +- } +-#line 4429 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 247: +-#line 1640 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[-3].x) > (yyvsp[-1].x) ? (yyvsp[-3].x) : (yyvsp[-1].x); } +-#line 4435 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 248: +-#line 1642 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[-3].x) < (yyvsp[-1].x) ? (yyvsp[-3].x) : (yyvsp[-1].x); } +-#line 4441 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 249: +-#line 1644 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = (yyvsp[-1].x) < 0 ? -floor(-(yyvsp[-1].x)) : floor((yyvsp[-1].x)); } +-#line 4447 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 250: +-#line 1646 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = 1.0 + floor(((rand()&0x7fff)/double(0x7fff))*(yyvsp[-1].x)); } +-#line 4453 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 251: +-#line 1648 "pic.y" /* yacc.c:1646 */ +- { +- /* return a random number in the range [0,1) */ +- /* portable, but not very random */ +- (yyval.x) = (rand() & 0x7fff) / double(0x8000); +- } +-#line 4463 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 252: +-#line 1654 "pic.y" /* yacc.c:1646 */ +- { +- (yyval.x) = 0; +- srand((unsigned int)(yyvsp[-1].x)); +- } +-#line 4472 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 253: +-#line 1659 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) <= (yyvsp[0].x)); } +-#line 4478 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 254: +-#line 1661 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) > (yyvsp[0].x)); } +-#line 4484 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 255: +-#line 1663 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) >= (yyvsp[0].x)); } +-#line 4490 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 256: +-#line 1665 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) == (yyvsp[0].x)); } +-#line 4496 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 257: +-#line 1667 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) != (yyvsp[0].x)); } +-#line 4502 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 258: +-#line 1669 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) != 0.0 && (yyvsp[0].x) != 0.0); } +-#line 4508 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 259: +-#line 1671 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[-2].x) != 0.0 || (yyvsp[0].x) != 0.0); } +-#line 4514 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- case 260: +-#line 1673 "pic.y" /* yacc.c:1646 */ +- { (yyval.x) = ((yyvsp[0].x) == 0.0); } +-#line 4520 "pic.cpp" /* yacc.c:1646 */ +- break; +- +- +-#line 4524 "pic.cpp" /* yacc.c:1646 */ +- default: break; +- } +- /* User semantic actions sometimes alter yychar, and that requires +- that yytoken be updated with the new translation. We take the +- approach of translating immediately before every use of yytoken. +- One alternative is translating here after every semantic action, +- but that translation would be missed if the semantic action invokes +- YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or +- if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an +- incorrect destructor might then be invoked immediately. In the +- case of YYERROR or YYBACKUP, subsequent parser actions might lead +- to an incorrect destructor call or verbose syntax error message +- before the lookahead is translated. */ +- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); +- +- YYPOPSTACK (yylen); +- yylen = 0; +- YY_STACK_PRINT (yyss, yyssp); +- +- *++yyvsp = yyval; +- +- /* Now 'shift' the result of the reduction. Determine what state +- that goes to, based on the state we popped back to and the rule +- number reduced by. */ +- +- yyn = yyr1[yyn]; +- +- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; +- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) +- yystate = yytable[yystate]; +- else +- yystate = yydefgoto[yyn - YYNTOKENS]; +- +- goto yynewstate; +- +- +-/*--------------------------------------. +-| yyerrlab -- here on detecting error. | +-`--------------------------------------*/ +-yyerrlab: +- /* Make sure we have latest lookahead translation. See comments at +- user semantic actions for why this is necessary. */ +- yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); +- +- /* If not already recovering from an error, report this error. */ +- if (!yyerrstatus) +- { +- ++yynerrs; +-#if ! YYERROR_VERBOSE +- yyerror (YY_("syntax error")); +-#else +-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ +- yyssp, yytoken) +- { +- char const *yymsgp = YY_("syntax error"); +- int yysyntax_error_status; +- yysyntax_error_status = YYSYNTAX_ERROR; +- if (yysyntax_error_status == 0) +- yymsgp = yymsg; +- else if (yysyntax_error_status == 1) +- { +- if (yymsg != yymsgbuf) +- YYSTACK_FREE (yymsg); +- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); +- if (!yymsg) +- { +- yymsg = yymsgbuf; +- yymsg_alloc = sizeof yymsgbuf; +- yysyntax_error_status = 2; +- } +- else +- { +- yysyntax_error_status = YYSYNTAX_ERROR; +- yymsgp = yymsg; +- } +- } +- yyerror (yymsgp); +- if (yysyntax_error_status == 2) +- goto yyexhaustedlab; +- } +-# undef YYSYNTAX_ERROR +-#endif +- } +- +- +- +- if (yyerrstatus == 3) +- { +- /* If just tried and failed to reuse lookahead token after an +- error, discard it. */ +- +- 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 +- token. */ +- goto yyerrlab1; +- +- +-/*---------------------------------------------------. +-| 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; +- +- /* Do not reclaim the symbols of the rule whose action triggered +- this YYERROR. */ +- YYPOPSTACK (yylen); +- yylen = 0; +- YY_STACK_PRINT (yyss, yyssp); +- yystate = *yyssp; +- goto yyerrlab1; +- +- +-/*-------------------------------------------------------------. +-| yyerrlab1 -- common code for both syntax error and YYERROR. | +-`-------------------------------------------------------------*/ +-yyerrlab1: +- yyerrstatus = 3; /* Each real token shifted decrements this. */ +- +- for (;;) +- { +- yyn = yypact[yystate]; +- if (!yypact_value_is_default (yyn)) +- { +- yyn += YYTERROR; +- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) +- { +- yyn = yytable[yyn]; +- if (0 < yyn) +- break; +- } +- } +- +- /* Pop the current state because it cannot handle the error token. */ +- if (yyssp == yyss) +- YYABORT; +- +- +- yydestruct ("Error: popping", +- yystos[yystate], yyvsp); +- YYPOPSTACK (1); +- yystate = *yyssp; +- YY_STACK_PRINT (yyss, yyssp); +- } +- +- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +- *++yyvsp = yylval; +- YY_IGNORE_MAYBE_UNINITIALIZED_END +- +- +- /* Shift the error token. */ +- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); +- +- yystate = yyn; +- goto yynewstate; +- +- +-/*-------------------------------------. +-| yyacceptlab -- YYACCEPT comes here. | +-`-------------------------------------*/ +-yyacceptlab: +- yyresult = 0; +- goto yyreturn; +- +-/*-----------------------------------. +-| yyabortlab -- YYABORT comes here. | +-`-----------------------------------*/ +-yyabortlab: +- yyresult = 1; +- goto yyreturn; +- +-#if !defined yyoverflow || YYERROR_VERBOSE +-/*-------------------------------------------------. +-| yyexhaustedlab -- memory exhaustion comes here. | +-`-------------------------------------------------*/ +-yyexhaustedlab: +- yyerror (YY_("memory exhausted")); +- yyresult = 2; +- /* Fall through. */ +-#endif +- +-yyreturn: +- if (yychar != YYEMPTY) +- { +- /* Make sure we have latest lookahead translation. See comments at +- user semantic actions for why this is necessary. */ +- yytoken = YYTRANSLATE (yychar); +- yydestruct ("Cleanup: discarding lookahead", +- yytoken, &yylval); +- } +- /* Do not reclaim the symbols of the rule whose 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 +-#if YYERROR_VERBOSE +- if (yymsg != yymsgbuf) +- YYSTACK_FREE (yymsg); +-#endif +- return yyresult; +-} +-#line 1677 "pic.y" /* yacc.c:1906 */ +- +- +-/* bison defines const to be empty unless __STDC__ is defined, which it +-isn't under cfront */ +- +-#ifdef const +-#undef const +-#endif +- +-static struct { +- const char *name; +- double val; +- int scaled; // non-zero if val should be multiplied by scale +-} defaults_table[] = { +- { "arcrad", .25, 1 }, +- { "arrowht", .1, 1 }, +- { "arrowwid", .05, 1 }, +- { "circlerad", .25, 1 }, +- { "boxht", .5, 1 }, +- { "boxwid", .75, 1 }, +- { "boxrad", 0.0, 1 }, +- { "dashwid", .05, 1 }, +- { "ellipseht", .5, 1 }, +- { "ellipsewid", .75, 1 }, +- { "moveht", .5, 1 }, +- { "movewid", .5, 1 }, +- { "lineht", .5, 1 }, +- { "linewid", .5, 1 }, +- { "textht", 0.0, 1 }, +- { "textwid", 0.0, 1 }, +- { "scale", 1.0, 0 }, +- { "linethick", -1.0, 0 }, // in points +- { "fillval", .5, 0 }, +- { "arrowhead", 1.0, 0 }, +- { "maxpswid", 8.5, 0 }, +- { "maxpsht", 11.0, 0 }, +-}; +- +-place *lookup_label(const char *label) +-{ +- saved_state *state = current_saved_state; +- PTABLE(place) *tbl = current_table; +- for (;;) { +- place *pl = tbl->lookup(label); +- if (pl) +- return pl; +- if (!state) +- return 0; +- tbl = state->tbl; +- state = state->prev; +- } +-} +- +-void define_label(const char *label, const place *pl) +-{ +- place *p = new place[1]; +- *p = *pl; +- current_table->define(label, p); +-} +- +-int lookup_variable(const char *name, double *val) +-{ +- place *pl = lookup_label(name); +- if (pl) { +- *val = pl->x; +- return 1; +- } +- return 0; +-} +- +-void define_variable(const char *name, double val) +-{ +- place *p = new place[1]; +- p->obj = 0; +- p->x = val; +- p->y = 0.0; +- current_table->define(name, p); +- if (strcmp(name, "scale") == 0) { +- // When the scale changes, reset all scaled pre-defined variables to +- // their default values. +- for (unsigned int i = 0; +- i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) +- if (defaults_table[i].scaled) +- define_variable(defaults_table[i].name, val*defaults_table[i].val); +- } +-} +- +-// called once only (not once per parse) +- +-void parse_init() +-{ +- current_direction = RIGHT_DIRECTION; +- current_position.x = 0.0; +- current_position.y = 0.0; +- // This resets everything to its default value. +- reset_all(); +-} +- +-void reset(const char *nm) +-{ +- for (unsigned int i = 0; +- i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) +- if (strcmp(nm, defaults_table[i].name) == 0) { +- double val = defaults_table[i].val; +- if (defaults_table[i].scaled) { +- double scale; +- lookup_variable("scale", &scale); +- val *= scale; +- } +- define_variable(defaults_table[i].name, val); +- return; +- } +- lex_error("`%1' is not a predefined variable", nm); +-} +- +-void reset_all() +-{ +- // We only have to explicitly reset the pre-defined variables that +- // aren't scaled because `scale' is not scaled, and changing the +- // value of `scale' will reset all the pre-defined variables that +- // are scaled. +- for (unsigned int i = 0; +- i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) +- if (!defaults_table[i].scaled) +- define_variable(defaults_table[i].name, defaults_table[i].val); +-} +- +-// called after each parse +- +-void parse_cleanup() +-{ +- while (current_saved_state != 0) { +- delete current_table; +- current_table = current_saved_state->tbl; +- saved_state *tem = current_saved_state; +- current_saved_state = current_saved_state->prev; +- delete tem; +- } +- assert(current_table == &top_table); +- PTABLE_ITERATOR(place) iter(current_table); +- const char *key; +- place *pl; +- while (iter.next(&key, &pl)) +- if (pl->obj != 0) { +- position pos = pl->obj->origin(); +- pl->obj = 0; +- pl->x = pos.x; +- pl->y = pos.y; +- } +- while (olist.head != 0) { +- object *tem = olist.head; +- olist.head = olist.head->next; +- delete tem; +- } +- olist.tail = 0; +- current_direction = RIGHT_DIRECTION; +- current_position.x = 0.0; +- current_position.y = 0.0; +-} +- +-const char *ordinal_postfix(int n) +-{ +- if (n < 10 || n > 20) +- switch (n % 10) { +- case 1: +- return "st"; +- case 2: +- return "nd"; +- case 3: +- return "rd"; +- } +- return "th"; +-} +- +-const char *object_type_name(object_type type) +-{ +- switch (type) { +- case BOX_OBJECT: +- return "box"; +- case CIRCLE_OBJECT: +- return "circle"; +- case ELLIPSE_OBJECT: +- return "ellipse"; +- case ARC_OBJECT: +- return "arc"; +- case SPLINE_OBJECT: +- return "spline"; +- case LINE_OBJECT: +- return "line"; +- case ARROW_OBJECT: +- return "arrow"; +- case MOVE_OBJECT: +- return "move"; +- case TEXT_OBJECT: +- return "\"\""; +- case BLOCK_OBJECT: +- return "[]"; +- case OTHER_OBJECT: +- case MARK_OBJECT: +- default: +- break; +- } +- return "object"; +-} +- +-static char sprintf_buf[1024]; +- +-char *format_number(const char *form, double n) +-{ +- if (form == 0) +- form = "%g"; +- return do_sprintf(form, &n, 1); +-} +- +-char *do_sprintf(const char *form, const double *v, int nv) +-{ +- string result; +- int i = 0; +- string one_format; +- while (*form) { +- if (*form == '%') { +- one_format += *form++; +- for (; *form != '\0' && strchr("#-+ 0123456789.", *form) != 0; form++) +- one_format += *form; +- if (*form == '\0' || strchr("eEfgG%", *form) == 0) { +- lex_error("bad sprintf format"); +- result += one_format; +- result += form; +- break; +- } +- if (*form == '%') { +- one_format += *form++; +- one_format += '\0'; +- snprintf(sprintf_buf, sizeof(sprintf_buf), +- "%s", one_format.contents()); +- } +- else { +- if (i >= nv) { +- lex_error("too few arguments to snprintf"); +- result += one_format; +- result += form; +- break; +- } +- one_format += *form++; +- one_format += '\0'; +- snprintf(sprintf_buf, sizeof(sprintf_buf), +- one_format.contents(), v[i++]); +- } +- one_format.clear(); +- result += sprintf_buf; +- } +- else +- result += *form++; +- } +- result += '\0'; +- return strsave(result.contents()); +-} +diff --git a/src/preproc/refer/label.cpp b/src/preproc/refer/label.cpp +deleted file mode 100644 +index 12d2dfa..0000000 +--- a/src/preproc/refer/label.cpp ++++ /dev/null +@@ -1,2701 +0,0 @@ +-/* A Bison parser, made by GNU Bison 3.0.2. */ +- +-/* Bison implementation for Yacc-like parsers in C +- +- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. +- +- This program is free software: you can redistribute it and/or modify +- it under the terms of the GNU General Public License as published by +- the Free Software Foundation, either version 3 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU General Public License for more details. +- +- You should have received a copy of the GNU General Public License +- along with this program. If not, see . */ +- +-/* 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. +- +- This special exception was added by the Free Software Foundation in +- version 2.2 of Bison. */ +- +-/* 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 +- variables, as they might otherwise be expanded by user macros. +- There are some unavoidable exceptions within include files to +- define necessary library symbols; they are noted "INFRINGES ON +- USER NAME SPACE" below. */ +- +-/* Identify Bison output. */ +-#define YYBISON 1 +- +-/* Bison version. */ +-#define YYBISON_VERSION "3.0.2" +- +-/* Skeleton name. */ +-#define YYSKELETON_NAME "yacc.c" +- +-/* Pure parsers. */ +-#define YYPURE 0 +- +-/* Push parsers. */ +-#define YYPUSH 0 +- +-/* Pull parsers. */ +-#define YYPULL 1 +- +- +- +- +-/* Copy the first part of user declarations. */ +-#line 20 "label.y" /* yacc.c:339 */ +- +- +-#include "refer.h" +-#include "refid.h" +-#include "ref.h" +-#include "token.h" +- +-int yylex(); +-void yyerror(const char *); +-int yyparse(); +- +-static const char *format_serial(char c, int n); +- +-struct label_info { +- int start; +- int length; +- int count; +- int total; +- label_info(const string &); +-}; +- +-label_info *lookup_label(const string &label); +- +-struct expression { +- enum { +- // Does the tentative label depend on the reference? +- CONTAINS_VARIABLE = 01, +- CONTAINS_STAR = 02, +- CONTAINS_FORMAT = 04, +- CONTAINS_AT = 010 +- }; +- virtual ~expression() { } +- virtual void evaluate(int, const reference &, string &, +- substring_position &) = 0; +- virtual unsigned analyze() { return 0; } +-}; +- +-class at_expr : public expression { +-public: +- at_expr() { } +- void evaluate(int, const reference &, string &, substring_position &); +- unsigned analyze() { return CONTAINS_VARIABLE|CONTAINS_AT; } +-}; +- +-class format_expr : public expression { +- char type; +- int width; +- int first_number; +-public: +- format_expr(char c, int w = 0, int f = 1) +- : type(c), width(w), first_number(f) { } +- void evaluate(int, const reference &, string &, substring_position &); +- unsigned analyze() { return CONTAINS_FORMAT; } +-}; +- +-class field_expr : public expression { +- int number; +- char name; +-public: +- field_expr(char nm, int num) : number(num), name(nm) { } +- void evaluate(int, const reference &, string &, substring_position &); +- unsigned analyze() { return CONTAINS_VARIABLE; } +-}; +- +-class literal_expr : public expression { +- string s; +-public: +- literal_expr(const char *ptr, int len) : s(ptr, len) { } +- void evaluate(int, const reference &, string &, substring_position &); +-}; +- +-class unary_expr : public expression { +-protected: +- expression *expr; +-public: +- unary_expr(expression *e) : expr(e) { } +- ~unary_expr() { delete expr; } +- void evaluate(int, const reference &, string &, substring_position &) = 0; +- unsigned analyze() { return expr ? expr->analyze() : 0; } +-}; +- +-// This caches the analysis of an expression. +- +-class analyzed_expr : public unary_expr { +- unsigned flags; +-public: +- analyzed_expr(expression *); +- void evaluate(int, const reference &, string &, substring_position &); +- unsigned analyze() { return flags; } +-}; +- +-class star_expr : public unary_expr { +-public: +- star_expr(expression *e) : unary_expr(e) { } +- void evaluate(int, const reference &, string &, substring_position &); +- unsigned analyze() { +- return ((expr ? (expr->analyze() & ~CONTAINS_VARIABLE) : 0) +- | CONTAINS_STAR); +- } +-}; +- +-typedef void map_func(const char *, const char *, string &); +- +-class map_expr : public unary_expr { +- map_func *func; +-public: +- map_expr(expression *e, map_func *f) : unary_expr(e), func(f) { } +- void evaluate(int, const reference &, string &, substring_position &); +-}; +- +-typedef const char *extractor_func(const char *, const char *, const char **); +- +-class extractor_expr : public unary_expr { +- int part; +- extractor_func *func; +-public: +- enum { BEFORE = +1, MATCH = 0, AFTER = -1 }; +- extractor_expr(expression *e, extractor_func *f, int pt) +- : unary_expr(e), part(pt), func(f) { } +- void evaluate(int, const reference &, string &, substring_position &); +-}; +- +-class truncate_expr : public unary_expr { +- int n; +-public: +- truncate_expr(expression *e, int i) : unary_expr(e), n(i) { } +- void evaluate(int, const reference &, string &, substring_position &); +-}; +- +-class separator_expr : public unary_expr { +-public: +- separator_expr(expression *e) : unary_expr(e) { } +- void evaluate(int, const reference &, string &, substring_position &); +-}; +- +-class binary_expr : public expression { +-protected: +- expression *expr1; +- expression *expr2; +-public: +- binary_expr(expression *e1, expression *e2) : expr1(e1), expr2(e2) { } +- ~binary_expr() { delete expr1; delete expr2; } +- void evaluate(int, const reference &, string &, substring_position &) = 0; +- unsigned analyze() { +- return (expr1 ? expr1->analyze() : 0) | (expr2 ? expr2->analyze() : 0); +- } +-}; +- +-class alternative_expr : public binary_expr { +-public: +- alternative_expr(expression *e1, expression *e2) : binary_expr(e1, e2) { } +- void evaluate(int, const reference &, string &, substring_position &); +-}; +- +-class list_expr : public binary_expr { +-public: +- list_expr(expression *e1, expression *e2) : binary_expr(e1, e2) { } +- void evaluate(int, const reference &, string &, substring_position &); +-}; +- +-class substitute_expr : public binary_expr { +-public: +- substitute_expr(expression *e1, expression *e2) : binary_expr(e1, e2) { } +- void evaluate(int, const reference &, string &, substring_position &); +-}; +- +-class ternary_expr : public expression { +-protected: +- expression *expr1; +- expression *expr2; +- expression *expr3; +-public: +- ternary_expr(expression *e1, expression *e2, expression *e3) +- : expr1(e1), expr2(e2), expr3(e3) { } +- ~ternary_expr() { delete expr1; delete expr2; delete expr3; } +- void evaluate(int, const reference &, string &, substring_position &) = 0; +- unsigned analyze() { +- return ((expr1 ? expr1->analyze() : 0) +- | (expr2 ? expr2->analyze() : 0) +- | (expr3 ? expr3->analyze() : 0)); +- } +-}; +- +-class conditional_expr : public ternary_expr { +-public: +- conditional_expr(expression *e1, expression *e2, expression *e3) +- : ternary_expr(e1, e2, e3) { } +- void evaluate(int, const reference &, string &, substring_position &); +-}; +- +-static expression *parsed_label = 0; +-static expression *parsed_date_label = 0; +-static expression *parsed_short_label = 0; +- +-static expression *parse_result; +- +-string literals; +- +- +-#line 266 "label.cpp" /* yacc.c:339 */ +- +-# ifndef YY_NULLPTR +-# if defined __cplusplus && 201103L <= __cplusplus +-# define YY_NULLPTR nullptr +-# else +-# define YY_NULLPTR 0 +-# endif +-# endif +- +-/* Enabling verbose error messages. */ +-#ifdef YYERROR_VERBOSE +-# undef YYERROR_VERBOSE +-# define YYERROR_VERBOSE 1 +-#else +-# define YYERROR_VERBOSE 0 +-#endif +- +- +-/* Debug traces. */ +-#ifndef YYDEBUG +-# define YYDEBUG 0 +-#endif +-#if YYDEBUG +-extern int yydebug; +-#endif +- +-/* Token type. */ +-#ifndef YYTOKENTYPE +-# define YYTOKENTYPE +- enum yytokentype +- { +- TOKEN_LETTER = 258, +- TOKEN_LITERAL = 259, +- TOKEN_DIGIT = 260 +- }; +-#endif +-/* Tokens. */ +-#define TOKEN_LETTER 258 +-#define TOKEN_LITERAL 259 +-#define TOKEN_DIGIT 260 +- +-/* Value type. */ +-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +-typedef union YYSTYPE YYSTYPE; +-union YYSTYPE +-{ +-#line 220 "label.y" /* yacc.c:355 */ +- +- int num; +- expression *expr; +- struct { int ndigits; int val; } dig; +- struct { int start; int len; } str; +- +-#line 320 "label.cpp" /* yacc.c:355 */ +-}; +-# define YYSTYPE_IS_TRIVIAL 1 +-# define YYSTYPE_IS_DECLARED 1 +-#endif +- +- +-extern YYSTYPE yylval; +- +-int yyparse (void); +- +- +- +-/* Copy the second part of user declarations. */ +- +-#line 335 "label.cpp" /* yacc.c:358 */ +- +-#ifdef short +-# undef short +-#endif +- +-#ifdef YYTYPE_UINT8 +-typedef YYTYPE_UINT8 yytype_uint8; +-#else +-typedef unsigned char yytype_uint8; +-#endif +- +-#ifdef YYTYPE_INT8 +-typedef YYTYPE_INT8 yytype_int8; +-#else +-typedef signed char 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 +-# include /* INFRINGES ON USER NAME SPACE */ +-# define YYSIZE_T size_t +-# else +-# define YYSIZE_T unsigned int +-# endif +-#endif +- +-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) +- +-#ifndef YY_ +-# if defined YYENABLE_NLS && YYENABLE_NLS +-# if ENABLE_NLS +-# include /* INFRINGES ON USER NAME SPACE */ +-# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +-# endif +-# endif +-# ifndef YY_ +-# define YY_(Msgid) Msgid +-# endif +-#endif +- +-#ifndef YY_ATTRIBUTE +-# if (defined __GNUC__ \ +- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ +- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +-# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +-# else +-# define YY_ATTRIBUTE(Spec) /* empty */ +-# endif +-#endif +- +-#ifndef YY_ATTRIBUTE_PURE +-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +-#endif +- +-#ifndef YY_ATTRIBUTE_UNUSED +-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +-#endif +- +-#if !defined _Noreturn \ +- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +-# if defined _MSC_VER && 1200 <= _MSC_VER +-# define _Noreturn __declspec (noreturn) +-# else +-# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +-# endif +-#endif +- +-/* Suppress unused-variable warnings by "using" E. */ +-#if ! defined lint || defined __GNUC__ +-# define YYUSE(E) ((void) (E)) +-#else +-# define YYUSE(E) /* empty */ +-#endif +- +-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +-/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +- _Pragma ("GCC diagnostic push") \ +- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ +- _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ +- _Pragma ("GCC diagnostic pop") +-#else +-# define YY_INITIAL_VALUE(Value) Value +-#endif +-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +-# define YY_IGNORE_MAYBE_UNINITIALIZED_END +-#endif +-#ifndef YY_INITIAL_VALUE +-# define YY_INITIAL_VALUE(Value) /* Nothing. */ +-#endif +- +- +-#if ! defined yyoverflow || YYERROR_VERBOSE +- +-/* The parser invokes alloca or malloc; define the necessary symbols. */ +- +-# ifdef YYSTACK_USE_ALLOCA +-# if YYSTACK_USE_ALLOCA +-# ifdef __GNUC__ +-# define YYSTACK_ALLOC __builtin_alloca +-# elif defined __BUILTIN_VA_ARG_INCR +-# include /* INFRINGES ON USER NAME SPACE */ +-# elif defined _AIX +-# define YYSTACK_ALLOC __alloca +-# elif defined _MSC_VER +-# include /* INFRINGES ON USER NAME SPACE */ +-# define alloca _alloca +-# else +-# define YYSTACK_ALLOC alloca +-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +-# include /* INFRINGES ON USER NAME SPACE */ +- /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +-# ifndef EXIT_SUCCESS +-# define EXIT_SUCCESS 0 +-# endif +-# endif +-# endif +-# endif +-# endif +- +-# ifdef YYSTACK_ALLOC +- /* Pacify GCC's 'empty if-body' warning. */ +-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +-# ifndef YYSTACK_ALLOC_MAXIMUM +- /* The OS might guarantee only one guard page at the bottom of the stack, +- and a page size can be as small as 4096 bytes. So we cannot safely +- 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 +-# define YYSTACK_ALLOC YYMALLOC +-# define YYSTACK_FREE YYFREE +-# ifndef YYSTACK_ALLOC_MAXIMUM +-# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +-# endif +-# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +- && ! ((defined YYMALLOC || defined malloc) \ +- && (defined YYFREE || defined free))) +-# include /* INFRINGES ON USER NAME SPACE */ +-# ifndef EXIT_SUCCESS +-# define EXIT_SUCCESS 0 +-# endif +-# endif +-# ifndef YYMALLOC +-# define YYMALLOC malloc +-# if ! defined malloc && ! defined EXIT_SUCCESS +-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +-# endif +-# endif +-# ifndef YYFREE +-# define YYFREE free +-# if ! defined free && ! defined EXIT_SUCCESS +-void free (void *); /* INFRINGES ON USER NAME SPACE */ +-# endif +-# endif +-# endif +-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ +- +- +-#if (! defined yyoverflow \ +- && (! defined __cplusplus \ +- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) +- +-/* A type that is properly aligned for any stack member. */ +-union yyalloc +-{ +- yytype_int16 yyss_alloc; +- YYSTYPE yyvs_alloc; +-}; +- +-/* The size of the maximum gap between one aligned stack and the next. */ +-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +- +-/* The size of an array large to enough to hold all stacks, each with +- N elements. */ +-# define YYSTACK_BYTES(N) \ +- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ +- + YYSTACK_GAP_MAXIMUM) +- +-# define YYCOPY_NEEDED 1 +- +-/* Relocate STACK from its old location to the new one. The +- local variables YYSIZE and YYSTACKSIZE give the old and new number of +- elements in the stack, and YYPTR gives the new location of the +- stack. Advance YYPTR to a properly aligned location for the next +- stack. */ +-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ +- do \ +- { \ +- YYSIZE_T yynewbytes; \ +- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ +- Stack = &yyptr->Stack_alloc; \ +- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ +- yyptr += yynewbytes / sizeof (*yyptr); \ +- } \ +- while (0) +- +-#endif +- +-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +-/* Copy COUNT objects from SRC to DST. The source and destination do +- not overlap. */ +-# ifndef YYCOPY +-# if defined __GNUC__ && 1 < __GNUC__ +-# define YYCOPY(Dst, Src, Count) \ +- __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +-# else +-# define YYCOPY(Dst, Src, Count) \ +- do \ +- { \ +- YYSIZE_T yyi; \ +- for (yyi = 0; yyi < (Count); yyi++) \ +- (Dst)[yyi] = (Src)[yyi]; \ +- } \ +- while (0) +-# endif +-# endif +-#endif /* !YYCOPY_NEEDED */ +- +-/* YYFINAL -- State number of the termination state. */ +-#define YYFINAL 21 +-/* YYLAST -- Last index in YYTABLE. */ +-#define YYLAST 39 +- +-/* YYNTOKENS -- Number of terminals. */ +-#define YYNTOKENS 21 +-/* YYNNTS -- Number of nonterminals. */ +-#define YYNNTS 12 +-/* YYNRULES -- Number of rules. */ +-#define YYNRULES 34 +-/* YYNSTATES -- Number of states. */ +-#define YYNSTATES 49 +- +-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned +- by yylex, with out-of-bounds checking. */ +-#define YYUNDEFTOK 2 +-#define YYMAXUTOK 260 +- +-#define YYTRANSLATE(YYX) \ +- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +- +-/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM +- as returned by yylex, without out-of-bounds checking. */ +-static const yytype_uint8 yytranslate[] = +-{ +- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 12, 9, 2, +- 17, 18, 16, 14, 2, 15, 13, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 7, 2, +- 19, 2, 20, 6, 11, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 8, 2, 10, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, +- 5 +-}; +- +-#if YYDEBUG +- /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +-static const yytype_uint16 yyrline[] = +-{ +- 0, 248, 248, 253, 255, 261, 262, 267, 269, 271, +- 276, 278, 283, 285, 290, 292, 297, 299, 301, 317, +- 321, 352, 354, 356, 358, 360, 366, 367, 372, 374, +- 379, 381, 388, 389, 391 +-}; +-#endif +- +-#if YYDEBUG || YYERROR_VERBOSE || 0 +-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. +- First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +-static const char *const yytname[] = +-{ +- "$end", "error", "$undefined", "TOKEN_LETTER", "TOKEN_LITERAL", +- "TOKEN_DIGIT", "'?'", "':'", "'|'", "'&'", "'~'", "'@'", "'%'", "'.'", +- "'+'", "'-'", "'*'", "'('", "')'", "'<'", "'>'", "$accept", "expr", +- "conditional", "optional_conditional", "alternative", "list", +- "substitute", "string", "optional_number", "number", "digits", "flag", YY_NULLPTR +-}; +-#endif +- +-# ifdef YYPRINT +-/* YYTOKNUM[NUM] -- (External) token number corresponding to the +- (internal) symbol number NUM (which must be that of a token). */ +-static const yytype_uint16 yytoknum[] = +-{ +- 0, 256, 257, 258, 259, 260, 63, 58, 124, 38, +- 126, 64, 37, 46, 43, 45, 42, 40, 41, 60, +- 62 +-}; +-# endif +- +-#define YYPACT_NINF -26 +- +-#define yypact_value_is_default(Yystate) \ +- (!!((Yystate) == (-26))) +- +-#define YYTABLE_NINF -1 +- +-#define yytable_value_is_error(Yytable_value) \ +- 0 +- +- /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing +- STATE-NUM. */ +-static const yytype_int8 yypact[] = +-{ +- 2, 11, -26, -26, 12, 2, 2, 24, -26, -26, +- 21, 2, 18, -6, -26, 26, -26, -26, 27, 15, +- 14, -26, 2, 2, 2, 18, 2, -3, 11, 11, +- -26, -26, -26, -26, -26, 28, 2, 2, -6, -26, +- -26, 33, 26, 26, 2, 11, -26, -26, 26 +-}; +- +- /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. +- Performed when YYTABLE does not specify something else to do. Zero +- means the default is an error. */ +-static const yytype_uint8 yydefact[] = +-{ +- 5, 16, 15, 14, 0, 5, 5, 0, 6, 2, +- 3, 7, 10, 12, 28, 17, 18, 30, 19, 0, +- 0, 1, 5, 0, 0, 11, 0, 32, 0, 0, +- 23, 29, 31, 24, 25, 0, 8, 9, 13, 33, +- 34, 0, 21, 22, 0, 26, 4, 20, 27 +-}; +- +- /* YYPGOTO[NTERM-NUM]. */ +-static const yytype_int8 yypgoto[] = +-{ +- -26, -26, -7, -4, -26, -1, -11, 13, -26, -25, +- -26, -26 +-}; +- +- /* YYDEFGOTO[NTERM-NUM]. */ +-static const yytype_int8 yydefgoto[] = +-{ +- -1, 7, 8, 9, 10, 11, 12, 13, 47, 15, +- 18, 41 +-}; +- +- /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If +- positive, shift that token. If negative, reduce the rule whose +- number is the opposite. If YYTABLE_NINF, syntax error. */ +-static const yytype_uint8 yytable[] = +-{ +- 25, 19, 20, 42, 43, 1, 2, 27, 28, 29, +- 30, 39, 40, 3, 4, 16, 14, 17, 35, 5, +- 48, 6, 36, 37, 21, 25, 25, 22, 26, 23, +- 24, 31, 32, 33, 34, 44, 45, 46, 0, 38 +-}; +- +-static const yytype_int8 yycheck[] = +-{ +- 11, 5, 6, 28, 29, 3, 4, 13, 14, 15, +- 16, 14, 15, 11, 12, 3, 5, 5, 22, 17, +- 45, 19, 23, 24, 0, 36, 37, 6, 10, 8, +- 9, 5, 5, 18, 20, 7, 3, 44, -1, 26 +-}; +- +- /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing +- symbol of state STATE-NUM. */ +-static const yytype_uint8 yystos[] = +-{ +- 0, 3, 4, 11, 12, 17, 19, 22, 23, 24, +- 25, 26, 27, 28, 5, 30, 3, 5, 31, 24, +- 24, 0, 6, 8, 9, 27, 10, 13, 14, 15, +- 16, 5, 5, 18, 20, 24, 26, 26, 28, 14, +- 15, 32, 30, 30, 7, 3, 23, 29, 30 +-}; +- +- /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +-static const yytype_uint8 yyr1[] = +-{ +- 0, 21, 22, 23, 23, 24, 24, 25, 25, 25, +- 26, 26, 27, 27, 28, 28, 28, 28, 28, 28, +- 28, 28, 28, 28, 28, 28, 29, 29, 30, 30, +- 31, 31, 32, 32, 32 +-}; +- +- /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +-static const yytype_uint8 yyr2[] = +-{ +- 0, 2, 1, 1, 5, 0, 1, 1, 3, 3, +- 1, 2, 1, 3, 1, 1, 1, 2, 2, 2, +- 5, 3, 3, 2, 3, 3, 0, 1, 1, 2, +- 1, 2, 0, 1, 1 +-}; +- +- +-#define yyerrok (yyerrstatus = 0) +-#define yyclearin (yychar = YYEMPTY) +-#define YYEMPTY (-2) +-#define YYEOF 0 +- +-#define YYACCEPT goto yyacceptlab +-#define YYABORT goto yyabortlab +-#define YYERROR goto yyerrorlab +- +- +-#define YYRECOVERING() (!!yyerrstatus) +- +-#define YYBACKUP(Token, Value) \ +-do \ +- if (yychar == YYEMPTY) \ +- { \ +- yychar = (Token); \ +- yylval = (Value); \ +- YYPOPSTACK (yylen); \ +- yystate = *yyssp; \ +- goto yybackup; \ +- } \ +- else \ +- { \ +- yyerror (YY_("syntax error: cannot back up")); \ +- YYERROR; \ +- } \ +-while (0) +- +-/* Error token number */ +-#define YYTERROR 1 +-#define YYERRCODE 256 +- +- +- +-/* Enable debugging if requested. */ +-#if YYDEBUG +- +-# ifndef YYFPRINTF +-# include /* INFRINGES ON USER NAME SPACE */ +-# define YYFPRINTF fprintf +-# endif +- +-# define YYDPRINTF(Args) \ +-do { \ +- if (yydebug) \ +- YYFPRINTF Args; \ +-} while (0) +- +-/* This macro is provided for backward compatibility. */ +-#ifndef YY_LOCATION_PRINT +-# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +-#endif +- +- +-# 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 (0) +- +- +-/*----------------------------------------. +-| Print this symbol's value on YYOUTPUT. | +-`----------------------------------------*/ +- +-static void +-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +-{ +- FILE *yyo = yyoutput; +- YYUSE (yyo); +- if (!yyvaluep) +- return; +-# ifdef YYPRINT +- if (yytype < YYNTOKENS) +- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +-# endif +- YYUSE (yytype); +-} +- +- +-/*--------------------------------. +-| Print this symbol on YYOUTPUT. | +-`--------------------------------*/ +- +-static void +-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +-{ +- YYFPRINTF (yyoutput, "%s %s (", +- yytype < YYNTOKENS ? "token" : "nterm", 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 (included). | +-`------------------------------------------------------------------*/ +- +-static void +-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +-{ +- YYFPRINTF (stderr, "Stack now"); +- for (; yybottom <= yytop; yybottom++) +- { +- int yybot = *yybottom; +- YYFPRINTF (stderr, " %d", yybot); +- } +- YYFPRINTF (stderr, "\n"); +-} +- +-# define YY_STACK_PRINT(Bottom, Top) \ +-do { \ +- if (yydebug) \ +- yy_stack_print ((Bottom), (Top)); \ +-} while (0) +- +- +-/*------------------------------------------------. +-| Report that the YYRULE is going to be reduced. | +-`------------------------------------------------*/ +- +-static void +-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +-{ +- unsigned long int yylno = yyrline[yyrule]; +- int yynrhs = yyr2[yyrule]; +- int yyi; +- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", +- yyrule - 1, yylno); +- /* The symbols being reduced. */ +- for (yyi = 0; yyi < yynrhs; yyi++) +- { +- YYFPRINTF (stderr, " $%d = ", yyi + 1); +- yy_symbol_print (stderr, +- yystos[yyssp[yyi + 1 - yynrhs]], +- &(yyvsp[(yyi + 1) - (yynrhs)]) +- ); +- YYFPRINTF (stderr, "\n"); +- } +-} +- +-# define YY_REDUCE_PRINT(Rule) \ +-do { \ +- if (yydebug) \ +- yy_reduce_print (yyssp, yyvsp, Rule); \ +-} while (0) +- +-/* Nonzero means print parse trace. It is left uninitialized so that +- multiple parsers can coexist. */ +-int yydebug; +-#else /* !YYDEBUG */ +-# define YYDPRINTF(Args) +-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +-# define YY_STACK_PRINT(Bottom, Top) +-# define YY_REDUCE_PRINT(Rule) +-#endif /* !YYDEBUG */ +- +- +-/* YYINITDEPTH -- initial size of the parser's stacks. */ +-#ifndef YYINITDEPTH +-# define YYINITDEPTH 200 +-#endif +- +-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only +- if the built-in stack extension method is used). +- +- Do not make this value too large; the results are undefined if +- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) +- evaluated with infinite-precision integer arithmetic. */ +- +-#ifndef YYMAXDEPTH +-# define YYMAXDEPTH 10000 +-#endif +- +- +-#if YYERROR_VERBOSE +- +-# ifndef yystrlen +-# if defined __GLIBC__ && defined _STRING_H +-# define yystrlen strlen +-# else +-/* Return the length of YYSTR. */ +-static YYSIZE_T +-yystrlen (const char *yystr) +-{ +- YYSIZE_T yylen; +- for (yylen = 0; yystr[yylen]; yylen++) +- continue; +- return yylen; +-} +-# endif +-# endif +- +-# ifndef yystpcpy +-# 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. */ +-static char * +-yystpcpy (char *yydest, const char *yysrc) +-{ +- char *yyd = yydest; +- const char *yys = yysrc; +- +- while ((*yyd++ = *yys++) != '\0') +- continue; +- +- return yyd - 1; +-} +-# endif +-# endif +- +-# 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); +- +- return yystpcpy (yyres, yystr) - yyres; +-} +-# endif +- +-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message +- about the unexpected token YYTOKEN for the state stack whose top is +- YYSSP. +- +- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is +- not large enough to hold the message. In that case, also set +- *YYMSG_ALLOC to the required number of bytes. Return 2 if the +- required number of bytes is too large to store. */ +-static int +-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, +- yytype_int16 *yyssp, int yytoken) +-{ +- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); +- YYSIZE_T yysize = yysize0; +- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; +- /* Internationalized format string. */ +- const char *yyformat = YY_NULLPTR; +- /* Arguments of yyformat. */ +- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; +- /* Number of reported tokens (one for the "unexpected", one per +- "expected"). */ +- int yycount = 0; +- +- /* There are many possibilities here to consider: +- - If this state is a consistent state with a default action, then +- the only way this function was invoked is if the default action +- is an error action. In that case, don't check for expected +- tokens because there are none. +- - The only way there can be no lookahead present (in yychar) is if +- this state is a consistent state with a default action. Thus, +- detecting the absence of a lookahead is sufficient to determine +- that there is no unexpected or expected token to report. In that +- case, just report a simple "syntax error". +- - Don't assume there isn't a lookahead just because this state is a +- consistent state with a default action. There might have been a +- previous inconsistent state, consistent state with a non-default +- action, or user semantic action that manipulated yychar. +- - Of course, the expected token list depends on states to have +- correct lookahead information, and it depends on the parser not +- to perform extra reductions after fetching a lookahead from the +- scanner and before detecting a syntax error. Thus, state merging +- (from LALR or IELR) and default reductions corrupt the expected +- token list. However, the list is correct for canonical LR with +- one exception: it will still contain any token that will not be +- accepted due to an error action in a later state. +- */ +- if (yytoken != YYEMPTY) +- { +- int yyn = yypact[*yyssp]; +- yyarg[yycount++] = yytname[yytoken]; +- if (!yypact_value_is_default (yyn)) +- { +- /* Start YYX at -YYN if negative to avoid negative indexes in +- YYCHECK. In other words, skip the first -YYN actions for +- this state because they are default actions. */ +- int yyxbegin = yyn < 0 ? -yyn : 0; +- /* Stay within bounds of both yycheck and yytname. */ +- int yychecklim = YYLAST - yyn + 1; +- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; +- int yyx; +- +- for (yyx = yyxbegin; yyx < yyxend; ++yyx) +- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR +- && !yytable_value_is_error (yytable[yyx + yyn])) +- { +- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) +- { +- yycount = 1; +- yysize = yysize0; +- break; +- } +- yyarg[yycount++] = yytname[yyx]; +- { +- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); +- if (! (yysize <= yysize1 +- && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) +- return 2; +- yysize = yysize1; +- } +- } +- } +- } +- +- switch (yycount) +- { +-# define YYCASE_(N, S) \ +- case N: \ +- yyformat = S; \ +- break +- YYCASE_(0, YY_("syntax error")); +- YYCASE_(1, YY_("syntax error, unexpected %s")); +- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); +- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); +- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); +- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +-# undef YYCASE_ +- } +- +- { +- YYSIZE_T yysize1 = yysize + yystrlen (yyformat); +- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) +- return 2; +- yysize = yysize1; +- } +- +- if (*yymsg_alloc < yysize) +- { +- *yymsg_alloc = 2 * yysize; +- if (! (yysize <= *yymsg_alloc +- && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) +- *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; +- return 1; +- } +- +- /* Avoid sprintf, as that infringes on the user's name space. +- Don't have undefined behavior even if the translation +- produced a string with the wrong number of "%s"s. */ +- { +- char *yyp = *yymsg; +- int yyi = 0; +- while ((*yyp = *yyformat) != '\0') +- if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) +- { +- yyp += yytnamerr (yyp, yyarg[yyi++]); +- yyformat += 2; +- } +- else +- { +- yyp++; +- yyformat++; +- } +- } +- return 0; +-} +-#endif /* YYERROR_VERBOSE */ +- +-/*-----------------------------------------------. +-| Release the memory associated to this symbol. | +-`-----------------------------------------------*/ +- +-static void +-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +-{ +- YYUSE (yyvaluep); +- if (!yymsg) +- yymsg = "Deleting"; +- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); +- +- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +- YYUSE (yytype); +- YY_IGNORE_MAYBE_UNINITIALIZED_END +-} +- +- +- +- +-/* The lookahead symbol. */ +-int yychar; +- +-/* The semantic value of the lookahead symbol. */ +-YYSTYPE yylval; +-/* Number of syntax errors so far. */ +-int yynerrs; +- +- +-/*----------. +-| yyparse. | +-`----------*/ +- +-int +-yyparse (void) +-{ +- int yystate; +- /* Number of tokens to shift before error messages enabled. */ +- int yyerrstatus; +- +- /* The stacks and their tools: +- 'yyss': related to states. +- 'yyvs': related to semantic values. +- +- Refer to the stacks through separate pointers, to allow yyoverflow +- to reallocate them elsewhere. */ +- +- /* The state stack. */ +- yytype_int16 yyssa[YYINITDEPTH]; +- yytype_int16 *yyss; +- yytype_int16 *yyssp; +- +- /* The semantic value stack. */ +- YYSTYPE yyvsa[YYINITDEPTH]; +- YYSTYPE *yyvs; +- YYSTYPE *yyvsp; +- +- YYSIZE_T yystacksize; +- +- int yyn; +- int yyresult; +- /* Lookahead token as an internal (translated) token number. */ +- int yytoken = 0; +- /* The variables used to return semantic value and location from the +- action routines. */ +- YYSTYPE yyval; +- +-#if YYERROR_VERBOSE +- /* Buffer for error messages, and its allocated size. */ +- char yymsgbuf[128]; +- char *yymsg = yymsgbuf; +- YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +-#endif +- +-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) +- +- /* The number of symbols on the RHS of the reduced rule. +- Keep to zero when no symbol should be popped. */ +- int yylen = 0; +- +- yyssp = yyss = yyssa; +- yyvsp = yyvs = yyvsa; +- yystacksize = YYINITDEPTH; +- +- YYDPRINTF ((stderr, "Starting parse\n")); +- +- yystate = 0; +- yyerrstatus = 0; +- yynerrs = 0; +- yychar = YYEMPTY; /* Cause a token to be read. */ +- goto yysetstate; +- +-/*------------------------------------------------------------. +-| yynewstate -- Push a new state, which is found in yystate. | +-`------------------------------------------------------------*/ +- 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. */ +- yyssp++; +- +- yysetstate: +- *yyssp = yystate; +- +- if (yyss + yystacksize - 1 <= yyssp) +- { +- /* Get the current used size of the three stacks, in elements. */ +- YYSIZE_T yysize = yyssp - yyss + 1; +- +-#ifdef yyoverflow +- { +- /* Give user a chance to reallocate the stack. Use copies of +- these so that the &'s don't force the real ones into +- memory. */ +- YYSTYPE *yyvs1 = yyvs; +- yytype_int16 *yyss1 = yyss; +- +- /* Each stack pointer address is followed by the size of the +- data in use in that stack, in bytes. This used to be a +- conditional around just the two extra args, but that might +- be undefined if yyoverflow is a macro. */ +- yyoverflow (YY_("memory exhausted"), +- &yyss1, yysize * sizeof (*yyssp), +- &yyvs1, yysize * sizeof (*yyvsp), +- &yystacksize); +- +- yyss = yyss1; +- yyvs = yyvs1; +- } +-#else /* no yyoverflow */ +-# ifndef YYSTACK_RELOCATE +- goto yyexhaustedlab; +-# else +- /* Extend the stack our own way. */ +- if (YYMAXDEPTH <= yystacksize) +- goto yyexhaustedlab; +- yystacksize *= 2; +- if (YYMAXDEPTH < yystacksize) +- yystacksize = YYMAXDEPTH; +- +- { +- yytype_int16 *yyss1 = yyss; +- union yyalloc *yyptr = +- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); +- if (! yyptr) +- goto yyexhaustedlab; +- YYSTACK_RELOCATE (yyss_alloc, yyss); +- YYSTACK_RELOCATE (yyvs_alloc, yyvs); +-# undef YYSTACK_RELOCATE +- if (yyss1 != yyssa) +- YYSTACK_FREE (yyss1); +- } +-# endif +-#endif /* no yyoverflow */ +- +- yyssp = yyss + yysize - 1; +- yyvsp = yyvs + yysize - 1; +- +- YYDPRINTF ((stderr, "Stack size increased to %lu\n", +- (unsigned long int) yystacksize)); +- +- if (yyss + yystacksize - 1 <= yyssp) +- YYABORT; +- } +- +- YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +- +- if (yystate == YYFINAL) +- YYACCEPT; +- +- goto yybackup; +- +-/*-----------. +-| yybackup. | +-`-----------*/ +-yybackup: +- +- /* Do appropriate processing given the current state. Read a +- lookahead token if we need one and don't already have one. */ +- +- /* First try to decide what to do without reference to lookahead token. */ +- yyn = yypact[yystate]; +- if (yypact_value_is_default (yyn)) +- goto yydefault; +- +- /* Not known => get a lookahead token if don't already have one. */ +- +- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ +- if (yychar == YYEMPTY) +- { +- YYDPRINTF ((stderr, "Reading a token: ")); +- yychar = yylex (); +- } +- +- if (yychar <= YYEOF) +- { +- yychar = yytoken = YYEOF; +- YYDPRINTF ((stderr, "Now at end of input.\n")); +- } +- else +- { +- yytoken = YYTRANSLATE (yychar); +- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); +- } +- +- /* If the proper action on seeing token YYTOKEN is to reduce or to +- detect an error, take that action. */ +- yyn += yytoken; +- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) +- goto yydefault; +- yyn = yytable[yyn]; +- if (yyn <= 0) +- { +- if (yytable_value_is_error (yyn)) +- goto yyerrlab; +- yyn = -yyn; +- goto yyreduce; +- } +- +- /* Count tokens shifted since error; after three, turn off error +- status. */ +- if (yyerrstatus) +- yyerrstatus--; +- +- /* Shift the lookahead token. */ +- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); +- +- /* Discard the shifted token. */ +- yychar = YYEMPTY; +- +- yystate = yyn; +- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +- *++yyvsp = yylval; +- YY_IGNORE_MAYBE_UNINITIALIZED_END +- +- goto yynewstate; +- +- +-/*-----------------------------------------------------------. +-| yydefault -- do the default action for the current state. | +-`-----------------------------------------------------------*/ +-yydefault: +- yyn = yydefact[yystate]; +- if (yyn == 0) +- goto yyerrlab; +- goto yyreduce; +- +- +-/*-----------------------------. +-| yyreduce -- Do a reduction. | +-`-----------------------------*/ +-yyreduce: +- /* yyn is the number of a rule to reduce with. */ +- yylen = yyr2[yyn]; +- +- /* If YYLEN is nonzero, implement the default value of the action: +- '$$ = $1'. +- +- Otherwise, the following line sets YYVAL to garbage. +- This behavior is undocumented and Bison +- users should not rely upon it. Assigning to YYVAL +- unconditionally makes the parser a bit smaller, and it avoids a +- GCC warning that YYVAL may be used uninitialized. */ +- yyval = yyvsp[1-yylen]; +- +- +- YY_REDUCE_PRINT (yyn); +- switch (yyn) +- { +- case 2: +-#line 249 "label.y" /* yacc.c:1646 */ +- { parse_result = ((yyvsp[0].expr) ? new analyzed_expr((yyvsp[0].expr)) : 0); } +-#line 1435 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 3: +-#line 254 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = (yyvsp[0].expr); } +-#line 1441 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 4: +-#line 256 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new conditional_expr((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } +-#line 1447 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 5: +-#line 261 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = 0; } +-#line 1453 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 6: +-#line 263 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = (yyvsp[0].expr); } +-#line 1459 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 7: +-#line 268 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = (yyvsp[0].expr); } +-#line 1465 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 8: +-#line 270 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new alternative_expr((yyvsp[-2].expr), (yyvsp[0].expr)); } +-#line 1471 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 9: +-#line 272 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new conditional_expr((yyvsp[-2].expr), (yyvsp[0].expr), 0); } +-#line 1477 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 10: +-#line 277 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = (yyvsp[0].expr); } +-#line 1483 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 11: +-#line 279 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new list_expr((yyvsp[-1].expr), (yyvsp[0].expr)); } +-#line 1489 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 12: +-#line 284 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = (yyvsp[0].expr); } +-#line 1495 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 13: +-#line 286 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new substitute_expr((yyvsp[-2].expr), (yyvsp[0].expr)); } +-#line 1501 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 14: +-#line 291 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new at_expr; } +-#line 1507 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 15: +-#line 293 "label.y" /* yacc.c:1646 */ +- { +- (yyval.expr) = new literal_expr(literals.contents() + (yyvsp[0].str).start, +- (yyvsp[0].str).len); +- } +-#line 1516 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 16: +-#line 298 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new field_expr((yyvsp[0].num), 0); } +-#line 1522 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 17: +-#line 300 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new field_expr((yyvsp[-1].num), (yyvsp[0].num) - 1); } +-#line 1528 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 18: +-#line 302 "label.y" /* yacc.c:1646 */ +- { +- switch ((yyvsp[0].num)) { +- case 'I': +- case 'i': +- case 'A': +- case 'a': +- (yyval.expr) = new format_expr((yyvsp[0].num)); +- break; +- default: +- command_error("unrecognized format `%1'", char((yyvsp[0].num))); +- (yyval.expr) = new format_expr('a'); +- break; +- } +- } +-#line 1547 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 19: +-#line 318 "label.y" /* yacc.c:1646 */ +- { +- (yyval.expr) = new format_expr('0', (yyvsp[0].dig).ndigits, (yyvsp[0].dig).val); +- } +-#line 1555 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 20: +-#line 322 "label.y" /* yacc.c:1646 */ +- { +- switch ((yyvsp[-1].num)) { +- case 'l': +- (yyval.expr) = new map_expr((yyvsp[-4].expr), lowercase); +- break; +- case 'u': +- (yyval.expr) = new map_expr((yyvsp[-4].expr), uppercase); +- break; +- case 'c': +- (yyval.expr) = new map_expr((yyvsp[-4].expr), capitalize); +- break; +- case 'r': +- (yyval.expr) = new map_expr((yyvsp[-4].expr), reverse_name); +- break; +- case 'a': +- (yyval.expr) = new map_expr((yyvsp[-4].expr), abbreviate_name); +- break; +- case 'y': +- (yyval.expr) = new extractor_expr((yyvsp[-4].expr), find_year, (yyvsp[-2].num)); +- break; +- case 'n': +- (yyval.expr) = new extractor_expr((yyvsp[-4].expr), find_last_name, (yyvsp[-2].num)); +- break; +- default: +- (yyval.expr) = (yyvsp[-4].expr); +- command_error("unknown function `%1'", char((yyvsp[-1].num))); +- break; +- } +- } +-#line 1589 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 21: +-#line 353 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new truncate_expr((yyvsp[-2].expr), (yyvsp[0].num)); } +-#line 1595 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 22: +-#line 355 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new truncate_expr((yyvsp[-2].expr), -(yyvsp[0].num)); } +-#line 1601 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 23: +-#line 357 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new star_expr((yyvsp[-1].expr)); } +-#line 1607 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 24: +-#line 359 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = (yyvsp[-1].expr); } +-#line 1613 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 25: +-#line 361 "label.y" /* yacc.c:1646 */ +- { (yyval.expr) = new separator_expr((yyvsp[-1].expr)); } +-#line 1619 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 26: +-#line 366 "label.y" /* yacc.c:1646 */ +- { (yyval.num) = -1; } +-#line 1625 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 27: +-#line 368 "label.y" /* yacc.c:1646 */ +- { (yyval.num) = (yyvsp[0].num); } +-#line 1631 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 28: +-#line 373 "label.y" /* yacc.c:1646 */ +- { (yyval.num) = (yyvsp[0].num); } +-#line 1637 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 29: +-#line 375 "label.y" /* yacc.c:1646 */ +- { (yyval.num) = (yyvsp[-1].num)*10 + (yyvsp[0].num); } +-#line 1643 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 30: +-#line 380 "label.y" /* yacc.c:1646 */ +- { (yyval.dig).ndigits = 1; (yyval.dig).val = (yyvsp[0].num); } +-#line 1649 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 31: +-#line 382 "label.y" /* yacc.c:1646 */ +- { (yyval.dig).ndigits = (yyvsp[-1].dig).ndigits + 1; (yyval.dig).val = (yyvsp[-1].dig).val*10 + (yyvsp[0].num); } +-#line 1655 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 32: +-#line 388 "label.y" /* yacc.c:1646 */ +- { (yyval.num) = 0; } +-#line 1661 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 33: +-#line 390 "label.y" /* yacc.c:1646 */ +- { (yyval.num) = 1; } +-#line 1667 "label.cpp" /* yacc.c:1646 */ +- break; +- +- case 34: +-#line 392 "label.y" /* yacc.c:1646 */ +- { (yyval.num) = -1; } +-#line 1673 "label.cpp" /* yacc.c:1646 */ +- break; +- +- +-#line 1677 "label.cpp" /* yacc.c:1646 */ +- default: break; +- } +- /* User semantic actions sometimes alter yychar, and that requires +- that yytoken be updated with the new translation. We take the +- approach of translating immediately before every use of yytoken. +- One alternative is translating here after every semantic action, +- but that translation would be missed if the semantic action invokes +- YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or +- if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an +- incorrect destructor might then be invoked immediately. In the +- case of YYERROR or YYBACKUP, subsequent parser actions might lead +- to an incorrect destructor call or verbose syntax error message +- before the lookahead is translated. */ +- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); +- +- YYPOPSTACK (yylen); +- yylen = 0; +- YY_STACK_PRINT (yyss, yyssp); +- +- *++yyvsp = yyval; +- +- /* Now 'shift' the result of the reduction. Determine what state +- that goes to, based on the state we popped back to and the rule +- number reduced by. */ +- +- yyn = yyr1[yyn]; +- +- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; +- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) +- yystate = yytable[yystate]; +- else +- yystate = yydefgoto[yyn - YYNTOKENS]; +- +- goto yynewstate; +- +- +-/*--------------------------------------. +-| yyerrlab -- here on detecting error. | +-`--------------------------------------*/ +-yyerrlab: +- /* Make sure we have latest lookahead translation. See comments at +- user semantic actions for why this is necessary. */ +- yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); +- +- /* If not already recovering from an error, report this error. */ +- if (!yyerrstatus) +- { +- ++yynerrs; +-#if ! YYERROR_VERBOSE +- yyerror (YY_("syntax error")); +-#else +-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ +- yyssp, yytoken) +- { +- char const *yymsgp = YY_("syntax error"); +- int yysyntax_error_status; +- yysyntax_error_status = YYSYNTAX_ERROR; +- if (yysyntax_error_status == 0) +- yymsgp = yymsg; +- else if (yysyntax_error_status == 1) +- { +- if (yymsg != yymsgbuf) +- YYSTACK_FREE (yymsg); +- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); +- if (!yymsg) +- { +- yymsg = yymsgbuf; +- yymsg_alloc = sizeof yymsgbuf; +- yysyntax_error_status = 2; +- } +- else +- { +- yysyntax_error_status = YYSYNTAX_ERROR; +- yymsgp = yymsg; +- } +- } +- yyerror (yymsgp); +- if (yysyntax_error_status == 2) +- goto yyexhaustedlab; +- } +-# undef YYSYNTAX_ERROR +-#endif +- } +- +- +- +- if (yyerrstatus == 3) +- { +- /* If just tried and failed to reuse lookahead token after an +- error, discard it. */ +- +- 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 +- token. */ +- goto yyerrlab1; +- +- +-/*---------------------------------------------------. +-| 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; +- +- /* Do not reclaim the symbols of the rule whose action triggered +- this YYERROR. */ +- YYPOPSTACK (yylen); +- yylen = 0; +- YY_STACK_PRINT (yyss, yyssp); +- yystate = *yyssp; +- goto yyerrlab1; +- +- +-/*-------------------------------------------------------------. +-| yyerrlab1 -- common code for both syntax error and YYERROR. | +-`-------------------------------------------------------------*/ +-yyerrlab1: +- yyerrstatus = 3; /* Each real token shifted decrements this. */ +- +- for (;;) +- { +- yyn = yypact[yystate]; +- if (!yypact_value_is_default (yyn)) +- { +- yyn += YYTERROR; +- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) +- { +- yyn = yytable[yyn]; +- if (0 < yyn) +- break; +- } +- } +- +- /* Pop the current state because it cannot handle the error token. */ +- if (yyssp == yyss) +- YYABORT; +- +- +- yydestruct ("Error: popping", +- yystos[yystate], yyvsp); +- YYPOPSTACK (1); +- yystate = *yyssp; +- YY_STACK_PRINT (yyss, yyssp); +- } +- +- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +- *++yyvsp = yylval; +- YY_IGNORE_MAYBE_UNINITIALIZED_END +- +- +- /* Shift the error token. */ +- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); +- +- yystate = yyn; +- goto yynewstate; +- +- +-/*-------------------------------------. +-| yyacceptlab -- YYACCEPT comes here. | +-`-------------------------------------*/ +-yyacceptlab: +- yyresult = 0; +- goto yyreturn; +- +-/*-----------------------------------. +-| yyabortlab -- YYABORT comes here. | +-`-----------------------------------*/ +-yyabortlab: +- yyresult = 1; +- goto yyreturn; +- +-#if !defined yyoverflow || YYERROR_VERBOSE +-/*-------------------------------------------------. +-| yyexhaustedlab -- memory exhaustion comes here. | +-`-------------------------------------------------*/ +-yyexhaustedlab: +- yyerror (YY_("memory exhausted")); +- yyresult = 2; +- /* Fall through. */ +-#endif +- +-yyreturn: +- if (yychar != YYEMPTY) +- { +- /* Make sure we have latest lookahead translation. See comments at +- user semantic actions for why this is necessary. */ +- yytoken = YYTRANSLATE (yychar); +- yydestruct ("Cleanup: discarding lookahead", +- yytoken, &yylval); +- } +- /* Do not reclaim the symbols of the rule whose 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 +-#if YYERROR_VERBOSE +- if (yymsg != yymsgbuf) +- YYSTACK_FREE (yymsg); +-#endif +- return yyresult; +-} +-#line 395 "label.y" /* yacc.c:1906 */ +- +- +-/* bison defines const to be empty unless __STDC__ is defined, which it +-isn't under cfront */ +- +-#ifdef const +-#undef const +-#endif +- +-const char *spec_ptr; +-const char *spec_end; +-const char *spec_cur; +- +-static char uppercase_array[] = { +- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', +- 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', +- 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', +- 'Y', 'Z', +-}; +- +-static char lowercase_array[] = { +- 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', +- 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', +- 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', +- 'y', 'z', +-}; +- +-int yylex() +-{ +- while (spec_ptr < spec_end && csspace(*spec_ptr)) +- spec_ptr++; +- spec_cur = spec_ptr; +- if (spec_ptr >= spec_end) +- return 0; +- unsigned char c = *spec_ptr++; +- if (csalpha(c)) { +- yylval.num = c; +- return TOKEN_LETTER; +- } +- if (csdigit(c)) { +- yylval.num = c - '0'; +- return TOKEN_DIGIT; +- } +- if (c == '\'') { +- yylval.str.start = literals.length(); +- for (; spec_ptr < spec_end; spec_ptr++) { +- if (*spec_ptr == '\'') { +- if (++spec_ptr < spec_end && *spec_ptr == '\'') +- literals += '\''; +- else { +- yylval.str.len = literals.length() - yylval.str.start; +- return TOKEN_LITERAL; +- } +- } +- else +- literals += *spec_ptr; +- } +- yylval.str.len = literals.length() - yylval.str.start; +- return TOKEN_LITERAL; +- } +- return c; +-} +- +-int set_label_spec(const char *label_spec) +-{ +- spec_cur = spec_ptr = label_spec; +- spec_end = strchr(label_spec, '\0'); +- literals.clear(); +- if (yyparse()) +- return 0; +- delete parsed_label; +- parsed_label = parse_result; +- return 1; +-} +- +-int set_date_label_spec(const char *label_spec) +-{ +- spec_cur = spec_ptr = label_spec; +- spec_end = strchr(label_spec, '\0'); +- literals.clear(); +- if (yyparse()) +- return 0; +- delete parsed_date_label; +- parsed_date_label = parse_result; +- return 1; +-} +- +-int set_short_label_spec(const char *label_spec) +-{ +- spec_cur = spec_ptr = label_spec; +- spec_end = strchr(label_spec, '\0'); +- literals.clear(); +- if (yyparse()) +- return 0; +- delete parsed_short_label; +- parsed_short_label = parse_result; +- return 1; +-} +- +-void yyerror(const char *message) +-{ +- if (spec_cur < spec_end) +- command_error("label specification %1 before `%2'", message, spec_cur); +- else +- command_error("label specification %1 at end of string", +- message, spec_cur); +-} +- +-void at_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &) +-{ +- if (tentative) +- ref.canonicalize_authors(result); +- else { +- const char *end, *start = ref.get_authors(&end); +- if (start) +- result.append(start, end - start); +- } +-} +- +-void format_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &) +-{ +- if (tentative) +- return; +- const label_info *lp = ref.get_label_ptr(); +- int num = lp == 0 ? ref.get_number() : lp->count; +- if (type != '0') +- result += format_serial(type, num + 1); +- else { +- const char *ptr = i_to_a(num + first_number); +- int pad = width - strlen(ptr); +- while (--pad >= 0) +- result += '0'; +- result += ptr; +- } +-} +- +-static const char *format_serial(char c, int n) +-{ +- assert(n > 0); +- static char buf[128]; // more than enough. +- switch (c) { +- case 'i': +- case 'I': +- { +- char *p = buf; +- // troff uses z and w to represent 10000 and 5000 in Roman +- // numerals; I can find no historical basis for this usage +- const char *s = c == 'i' ? "zwmdclxvi" : "ZWMDCLXVI"; +- if (n >= 40000) +- return i_to_a(n); +- while (n >= 10000) { +- *p++ = s[0]; +- n -= 10000; +- } +- for (int i = 1000; i > 0; i /= 10, s += 2) { +- int m = n/i; +- n -= m*i; +- switch (m) { +- case 3: +- *p++ = s[2]; +- /* falls through */ +- case 2: +- *p++ = s[2]; +- /* falls through */ +- case 1: +- *p++ = s[2]; +- break; +- case 4: +- *p++ = s[2]; +- *p++ = s[1]; +- break; +- case 8: +- *p++ = s[1]; +- *p++ = s[2]; +- *p++ = s[2]; +- *p++ = s[2]; +- break; +- case 7: +- *p++ = s[1]; +- *p++ = s[2]; +- *p++ = s[2]; +- break; +- case 6: +- *p++ = s[1]; +- *p++ = s[2]; +- break; +- case 5: +- *p++ = s[1]; +- break; +- case 9: +- *p++ = s[2]; +- *p++ = s[0]; +- } +- } +- *p = 0; +- break; +- } +- case 'a': +- case 'A': +- { +- char *p = buf; +- // this is derived from troff/reg.c +- while (n > 0) { +- int d = n % 26; +- if (d == 0) +- d = 26; +- n -= d; +- n /= 26; +- *p++ = c == 'a' ? lowercase_array[d - 1] : +- uppercase_array[d - 1]; +- } +- *p-- = 0; +- // Reverse it. +- char *q = buf; +- while (q < p) { +- char temp = *q; +- *q = *p; +- *p = temp; +- --p; +- ++q; +- } +- break; +- } +- default: +- assert(0); +- } +- return buf; +-} +- +-void field_expr::evaluate(int, const reference &ref, +- string &result, substring_position &) +-{ +- const char *end; +- const char *start = ref.get_field(name, &end); +- if (start) { +- start = nth_field(number, start, &end); +- if (start) +- result.append(start, end - start); +- } +-} +- +-void literal_expr::evaluate(int, const reference &, +- string &result, substring_position &) +-{ +- result += s; +-} +- +-analyzed_expr::analyzed_expr(expression *e) +-: unary_expr(e), flags(e ? e->analyze() : 0) +-{ +-} +- +-void analyzed_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &pos) +-{ +- if (expr) +- expr->evaluate(tentative, ref, result, pos); +-} +- +-void star_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &pos) +-{ +- const label_info *lp = ref.get_label_ptr(); +- if (!tentative +- && (lp == 0 || lp->total > 1) +- && expr) +- expr->evaluate(tentative, ref, result, pos); +-} +- +-void separator_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &pos) +-{ +- int start_length = result.length(); +- int is_first = pos.start < 0; +- if (expr) +- expr->evaluate(tentative, ref, result, pos); +- if (is_first) { +- pos.start = start_length; +- pos.length = result.length() - start_length; +- } +-} +- +-void map_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &) +-{ +- if (expr) { +- string temp; +- substring_position temp_pos; +- expr->evaluate(tentative, ref, temp, temp_pos); +- (*func)(temp.contents(), temp.contents() + temp.length(), result); +- } +-} +- +-void extractor_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &) +-{ +- if (expr) { +- string temp; +- substring_position temp_pos; +- expr->evaluate(tentative, ref, temp, temp_pos); +- const char *end, *start = (*func)(temp.contents(), +- temp.contents() + temp.length(), +- &end); +- switch (part) { +- case BEFORE: +- if (start) +- result.append(temp.contents(), start - temp.contents()); +- else +- result += temp; +- break; +- case MATCH: +- if (start) +- result.append(start, end - start); +- break; +- case AFTER: +- if (start) +- result.append(end, temp.contents() + temp.length() - end); +- break; +- default: +- assert(0); +- } +- } +-} +- +-static void first_part(int len, const char *ptr, const char *end, +- string &result) +-{ +- for (;;) { +- const char *token_start = ptr; +- if (!get_token(&ptr, end)) +- break; +- const token_info *ti = lookup_token(token_start, ptr); +- int counts = ti->sortify_non_empty(token_start, ptr); +- if (counts && --len < 0) +- break; +- if (counts || ti->is_accent()) +- result.append(token_start, ptr - token_start); +- } +-} +- +-static void last_part(int len, const char *ptr, const char *end, +- string &result) +-{ +- const char *start = ptr; +- int count = 0; +- for (;;) { +- const char *token_start = ptr; +- if (!get_token(&ptr, end)) +- break; +- const token_info *ti = lookup_token(token_start, ptr); +- if (ti->sortify_non_empty(token_start, ptr)) +- count++; +- } +- ptr = start; +- int skip = count - len; +- if (skip > 0) { +- for (;;) { +- const char *token_start = ptr; +- if (!get_token(&ptr, end)) +- assert(0); +- const token_info *ti = lookup_token(token_start, ptr); +- if (ti->sortify_non_empty(token_start, ptr) && --skip < 0) { +- ptr = token_start; +- break; +- } +- } +- } +- first_part(len, ptr, end, result); +-} +- +-void truncate_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &) +-{ +- if (expr) { +- string temp; +- substring_position temp_pos; +- expr->evaluate(tentative, ref, temp, temp_pos); +- const char *start = temp.contents(); +- const char *end = start + temp.length(); +- if (n > 0) +- first_part(n, start, end, result); +- else if (n < 0) +- last_part(-n, start, end, result); +- } +-} +- +-void alternative_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &pos) +-{ +- int start_length = result.length(); +- if (expr1) +- expr1->evaluate(tentative, ref, result, pos); +- if (result.length() == start_length && expr2) +- expr2->evaluate(tentative, ref, result, pos); +-} +- +-void list_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &pos) +-{ +- if (expr1) +- expr1->evaluate(tentative, ref, result, pos); +- if (expr2) +- expr2->evaluate(tentative, ref, result, pos); +-} +- +-void substitute_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &pos) +-{ +- int start_length = result.length(); +- if (expr1) +- expr1->evaluate(tentative, ref, result, pos); +- if (result.length() > start_length && result[result.length() - 1] == '-') { +- // ought to see if pos covers the - +- result.set_length(result.length() - 1); +- if (expr2) +- expr2->evaluate(tentative, ref, result, pos); +- } +-} +- +-void conditional_expr::evaluate(int tentative, const reference &ref, +- string &result, substring_position &pos) +-{ +- string temp; +- substring_position temp_pos; +- if (expr1) +- expr1->evaluate(tentative, ref, temp, temp_pos); +- if (temp.length() > 0) { +- if (expr2) +- expr2->evaluate(tentative, ref, result, pos); +- } +- else { +- if (expr3) +- expr3->evaluate(tentative, ref, result, pos); +- } +-} +- +-void reference::pre_compute_label() +-{ +- if (parsed_label != 0 +- && (parsed_label->analyze() & expression::CONTAINS_VARIABLE)) { +- label.clear(); +- substring_position temp_pos; +- parsed_label->evaluate(1, *this, label, temp_pos); +- label_ptr = lookup_label(label); +- } +-} +- +-void reference::compute_label() +-{ +- label.clear(); +- if (parsed_label) +- parsed_label->evaluate(0, *this, label, separator_pos); +- if (short_label_flag && parsed_short_label) +- parsed_short_label->evaluate(0, *this, short_label, short_separator_pos); +- if (date_as_label) { +- string new_date; +- if (parsed_date_label) { +- substring_position temp_pos; +- parsed_date_label->evaluate(0, *this, new_date, temp_pos); +- } +- set_date(new_date); +- } +- if (label_ptr) +- label_ptr->count += 1; +-} +- +-void reference::immediate_compute_label() +-{ +- if (label_ptr) +- label_ptr->total = 2; // force use of disambiguator +- compute_label(); +-} +- +-int reference::merge_labels(reference **v, int n, label_type type, +- string &result) +-{ +- if (abbreviate_label_ranges) +- return merge_labels_by_number(v, n, type, result); +- else +- return merge_labels_by_parts(v, n, type, result); +-} +- +-int reference::merge_labels_by_number(reference **v, int n, label_type type, +- string &result) +-{ +- if (n <= 1) +- return 0; +- int num = get_number(); +- // Only merge three or more labels. +- if (v[0]->get_number() != num + 1 +- || v[1]->get_number() != num + 2) +- return 0; +- int i; +- for (i = 2; i < n; i++) +- if (v[i]->get_number() != num + i + 1) +- break; +- result = get_label(type); +- result += label_range_indicator; +- result += v[i - 1]->get_label(type); +- return i; +-} +- +-const substring_position &reference::get_separator_pos(label_type type) const +-{ +- if (type == SHORT_LABEL && short_label_flag) +- return short_separator_pos; +- else +- return separator_pos; +-} +- +-const string &reference::get_label(label_type type) const +-{ +- if (type == SHORT_LABEL && short_label_flag) +- return short_label; +- else +- return label; +-} +- +-int reference::merge_labels_by_parts(reference **v, int n, label_type type, +- string &result) +-{ +- if (n <= 0) +- return 0; +- const string &lb = get_label(type); +- const substring_position &sp = get_separator_pos(type); +- if (sp.start < 0 +- || sp.start != v[0]->get_separator_pos(type).start +- || memcmp(lb.contents(), v[0]->get_label(type).contents(), +- sp.start) != 0) +- return 0; +- result = lb; +- int i = 0; +- do { +- result += separate_label_second_parts; +- const substring_position &s = v[i]->get_separator_pos(type); +- int sep_end_pos = s.start + s.length; +- result.append(v[i]->get_label(type).contents() + sep_end_pos, +- v[i]->get_label(type).length() - sep_end_pos); +- } while (++i < n +- && sp.start == v[i]->get_separator_pos(type).start +- && memcmp(lb.contents(), v[i]->get_label(type).contents(), +- sp.start) == 0); +- return i; +-} +- +-string label_pool; +- +-label_info::label_info(const string &s) +-: start(label_pool.length()), length(s.length()), count(0), total(1) +-{ +- label_pool += s; +-} +- +-static label_info **label_table = 0; +-static int label_table_size = 0; +-static int label_table_used = 0; +- +-label_info *lookup_label(const string &label) +-{ +- if (label_table == 0) { +- label_table = new label_info *[17]; +- label_table_size = 17; +- for (int i = 0; i < 17; i++) +- label_table[i] = 0; +- } +- unsigned h = hash_string(label.contents(), label.length()) % label_table_size; +- label_info **ptr; +- for (ptr = label_table + h; +- *ptr != 0; +- (ptr == label_table) +- ? (ptr = label_table + label_table_size - 1) +- : ptr--) +- if ((*ptr)->length == label.length() +- && memcmp(label_pool.contents() + (*ptr)->start, label.contents(), +- label.length()) == 0) { +- (*ptr)->total += 1; +- return *ptr; +- } +- label_info *result = *ptr = new label_info(label); +- if (++label_table_used * 2 > label_table_size) { +- // Rehash the table. +- label_info **old_table = label_table; +- int old_size = label_table_size; +- label_table_size = next_size(label_table_size); +- label_table = new label_info *[label_table_size]; +- int i; +- for (i = 0; i < label_table_size; i++) +- label_table[i] = 0; +- for (i = 0; i < old_size; i++) +- if (old_table[i]) { +- h = hash_string(label_pool.contents() + old_table[i]->start, +- old_table[i]->length); +- label_info **p; +- for (p = label_table + (h % label_table_size); +- *p != 0; +- (p == label_table) +- ? (p = label_table + label_table_size - 1) +- : --p) +- ; +- *p = old_table[i]; +- } +- a_delete old_table; +- } +- return result; +-} +- +-void clear_labels() +-{ +- for (int i = 0; i < label_table_size; i++) { +- delete label_table[i]; +- label_table[i] = 0; +- } +- label_table_used = 0; +- label_pool.clear(); +-} +- +-static void consider_authors(reference **start, reference **end, int i); +- +-void compute_labels(reference **v, int n) +-{ +- if (parsed_label +- && (parsed_label->analyze() & expression::CONTAINS_AT) +- && sort_fields.length() >= 2 +- && sort_fields[0] == 'A' +- && sort_fields[1] == '+') +- consider_authors(v, v + n, 0); +- for (int i = 0; i < n; i++) +- v[i]->compute_label(); +-} +- +- +-/* A reference with a list of authors _needs_ author i +-where 0 <= i <= N if there exists a reference with a list of authors +- such that != and M >= i +-and Aj = Bj for 0 <= j < i. In this case if we can't say ``A0, +-A1,...,A(i-1) et al'' because this would match both and +-. If a reference needs author i we only have to call +-need_author(j) for some j >= i such that the reference also needs +-author j. */ +- +-/* This function handles 2 tasks: +-determine which authors are needed (cannot be elided with et al.); +-determine which authors can have only last names in the labels. +- +-References >= start and < end have the same first i author names. +-Also they're sorted by A+. */ +- +-static void consider_authors(reference **start, reference **end, int i) +-{ +- if (start >= end) +- return; +- reference **p = start; +- if (i >= (*p)->get_nauthors()) { +- for (++p; p < end && i >= (*p)->get_nauthors(); p++) +- ; +- if (p < end && i > 0) { +- // If we have an author list and an author list , +- // then both lists need C. +- for (reference **q = start; q < end; q++) +- (*q)->need_author(i - 1); +- } +- start = p; +- } +- while (p < end) { +- reference **last_name_start = p; +- reference **name_start = p; +- for (++p; +- p < end && i < (*p)->get_nauthors() +- && same_author_last_name(**last_name_start, **p, i); +- p++) { +- if (!same_author_name(**name_start, **p, i)) { +- consider_authors(name_start, p, i + 1); +- name_start = p; +- } +- } +- consider_authors(name_start, p, i + 1); +- if (last_name_start == name_start) { +- for (reference **q = last_name_start; q < p; q++) +- (*q)->set_last_name_unambiguous(i); +- } +- // If we have an author list and , then the lists +- // need author D and E respectively. +- if (name_start > start || p < end) { +- for (reference **q = last_name_start; q < p; q++) +- (*q)->need_author(i); +- } +- } +-} +- +-int same_author_last_name(const reference &r1, const reference &r2, int n) +-{ +- const char *ae1; +- const char *as1 = r1.get_sort_field(0, n, 0, &ae1); +- const char *ae2; +- const char *as2 = r2.get_sort_field(0, n, 0, &ae2); +- if (!as1 && !as2) return 1; // they are the same +- if (!as1 || !as2) return 0; +- return ae1 - as1 == ae2 - as2 && memcmp(as1, as2, ae1 - as1) == 0; +-} +- +-int same_author_name(const reference &r1, const reference &r2, int n) +-{ +- const char *ae1; +- const char *as1 = r1.get_sort_field(0, n, -1, &ae1); +- const char *ae2; +- const char *as2 = r2.get_sort_field(0, n, -1, &ae2); +- if (!as1 && !as2) return 1; // they are the same +- if (!as1 || !as2) return 0; +- return ae1 - as1 == ae2 - as2 && memcmp(as1, as2, ae1 - as1) == 0; +-} +- +- +-void int_set::set(int i) +-{ +- assert(i >= 0); +- int bytei = i >> 3; +- if (bytei >= v.length()) { +- int old_length = v.length(); +- v.set_length(bytei + 1); +- for (int j = old_length; j <= bytei; j++) +- v[j] = 0; +- } +- v[bytei] |= 1 << (i & 7); +-} +- +-int int_set::get(int i) const +-{ +- assert(i >= 0); +- int bytei = i >> 3; +- return bytei >= v.length() ? 0 : (v[bytei] & (1 << (i & 7))) != 0; +-} +- +-void reference::set_last_name_unambiguous(int i) +-{ +- last_name_unambiguous.set(i); +-} +- +-void reference::need_author(int n) +-{ +- if (n > last_needed_author) +- last_needed_author = n; +-} +- +-const char *reference::get_authors(const char **end) const +-{ +- if (!computed_authors) { +- ((reference *)this)->computed_authors = 1; +- string &result = ((reference *)this)->authors; +- int na = get_nauthors(); +- result.clear(); +- for (int i = 0; i < na; i++) { +- if (last_name_unambiguous.get(i)) { +- const char *e, *start = get_author_last_name(i, &e); +- assert(start != 0); +- result.append(start, e - start); +- } +- else { +- const char *e, *start = get_author(i, &e); +- assert(start != 0); +- result.append(start, e - start); +- } +- if (i == last_needed_author +- && et_al.length() > 0 +- && et_al_min_elide > 0 +- && last_needed_author + et_al_min_elide < na +- && na >= et_al_min_total) { +- result += et_al; +- break; +- } +- if (i < na - 1) { +- if (na == 2) +- result += join_authors_exactly_two; +- else if (i < na - 2) +- result += join_authors_default; +- else +- result += join_authors_last_two; +- } +- } +- } +- const char *start = authors.contents(); +- *end = start + authors.length(); +- return start; +-} +- +-int reference::get_nauthors() const +-{ +- if (nauthors < 0) { +- const char *dummy; +- int na; +- for (na = 0; get_author(na, &dummy) != 0; na++) +- ; +- ((reference *)this)->nauthors = na; +- } +- return nauthors; +-} +diff --git a/src/preproc/refer/label.y b/src/preproc/refer/label.y +index 7d0708a..850c3a3 100644 +--- a/src/preproc/refer/label.y ++++ b/src/preproc/refer/label.y +@@ -246,7 +246,7 @@ string literals; + + expr: + optional_conditional +- { parse_result = ($1 ? new analyzed_expr($1) : 0); } ++ { if (parse_result) delete parse_result; parse_result = ($1 ? new analyzed_expr($1) : 0); } + ; + + conditional: +diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp +index f43fe7d..01b5162 100644 +--- a/src/preproc/tbl/table.cpp ++++ b/src/preproc/tbl/table.cpp +@@ -858,7 +858,7 @@ void single_line_entry::simple_print(int dont_move) + printfs("\\s[\\n[" LINESIZE_REG "]]" "\\D'l |\\n[%1]u", + column_divide_reg(end_col+1)); + if (double_vrule_on_right) { +- prints(double_vrule_on_left == 1 ? "+" : "-"); ++ prints(double_vrule_on_right == 1 ? "+" : "-"); + prints(HALF_DOUBLE_LINE_SEP); + } + prints("0'\\s0"); +@@ -903,7 +903,7 @@ void double_line_entry::simple_print(int dont_move) + "\\D'l |\\n[%1]u", + column_divide_reg(start_col)); + if (double_vrule_on_right) { +- prints(double_vrule_on_left == 1 ? "+" : "-"); ++ prints(double_vrule_on_right == 1 ? "+" : "-"); + prints(HALF_DOUBLE_LINE_SEP); + } + prints(" 0'"); +diff --git a/src/roff/troff/dictionary.cpp b/src/roff/troff/dictionary.cpp +index 538531a..2dececa 100644 +--- a/src/roff/troff/dictionary.cpp ++++ b/src/roff/troff/dictionary.cpp +@@ -41,6 +41,11 @@ dictionary::dictionary(int n) : size(n), used(0), threshold(0.5), factor(1.5) + table = new association[n]; + } + ++dictionary::~dictionary() ++{ ++ a_delete table; ++} ++ + // see Knuth, Sorting and Searching, p518, Algorithm L + // we can't use double-hashing because we want a remove function + +diff --git a/src/roff/troff/dictionary.h b/src/roff/troff/dictionary.h +index 422a58e..d5ffff8 100644 +--- a/src/roff/troff/dictionary.h ++++ b/src/roff/troff/dictionary.h +@@ -47,6 +47,7 @@ class dictionary { + void rehash(int); + public: + dictionary(int); ++ ~dictionary(); + void *lookup(symbol s, void *v=0); // returns value associated with key + void *lookup(const char *); + // if second parameter not NULL, value will be replaced +diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp +index 9fbd592..2a0fe8c 100644 +--- a/src/roff/troff/env.cpp ++++ b/src/roff/troff/env.cpp +@@ -430,6 +430,9 @@ void environment::space_newline() + w->next = new width_list(sw, ssw); + if (line != 0 && line->merge_space(x, sw, ssw)) { + width_total += x; ++ if (w->next) ++ delete w->next; ++ delete w; + return; + } + add_node(new word_space_node(x, get_fill_color(), w)); +@@ -1243,8 +1246,10 @@ void override_sizes() + int *sizes = new int[n]; + int i = 0; + char *buf = read_string(); +- if (!buf) ++ if (!buf) { ++ a_delete sizes; + return; ++ } + char *p = strtok(buf, " \t"); + for (;;) { + if (!p) +@@ -1260,6 +1265,8 @@ void override_sizes() + // fall through + default: + warning(WARN_RANGE, "bad size range `%1'", p); ++ a_delete sizes; ++ a_delete buf; + return; + } + if (i + 2 > n) { +@@ -1276,6 +1283,8 @@ void override_sizes() + p = strtok(0, " \t"); + } + font_size::init_size_table(sizes); ++ a_delete sizes; ++ a_delete buf; + } + + void space_size() +diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp +index 9594f07..f2c8f68 100644 +--- a/src/roff/troff/input.cpp ++++ b/src/roff/troff/input.cpp +@@ -7693,6 +7693,11 @@ static void parse_output_page_list(char *p) + } + if (*p != '\0') { + error("bad output page list"); ++ while (output_page_list) { ++ page_range *l = output_page_list; ++ output_page_list = output_page_list->next; ++ delete l; ++ } + output_page_list = 0; + } + } +diff --git a/src/roff/troff/mtsm.cpp b/src/roff/troff/mtsm.cpp +index 0fd2d33..dcf31ad 100644 +--- a/src/roff/troff/mtsm.cpp ++++ b/src/roff/troff/mtsm.cpp +@@ -374,8 +374,9 @@ void mtsm::push_state(statem *n) + { + if (is_html) { + #if defined(DEBUGGING) +- if (debug_state) ++ if (debug_state) { + fprintf(stderr, "--> state %d pushed\n", n->issue_no) ; fflush(stderr); ++ } + #endif + sp = new stack(n, sp); + } +@@ -385,8 +386,9 @@ void mtsm::pop_state() + { + if (is_html) { + #if defined(DEBUGGING) +- if (debug_state) ++ if (debug_state) { + fprintf(stderr, "--> state popped\n") ; fflush(stderr); ++ } + #endif + if (sp == 0) + fatal("empty state machine stack"); +diff --git a/src/utils/addftinfo/addftinfo.cpp b/src/utils/addftinfo/addftinfo.cpp +index 88095bf..a5afbfb 100644 +--- a/src/utils/addftinfo/addftinfo.cpp ++++ b/src/utils/addftinfo/addftinfo.cpp +@@ -125,6 +125,7 @@ int main(int argc, char **argv) + if (infp == 0) + fatal("can't open `%1': %2", font, strerror(errno)); + convert_font(param, infp, stdout); ++ fclose(infp); + return 0; + } + +diff --git a/src/utils/hpftodit/hpftodit.cpp b/src/utils/hpftodit/hpftodit.cpp +index 069608d..7bde0b6 100644 +--- a/src/utils/hpftodit/hpftodit.cpp ++++ b/src/utils/hpftodit/hpftodit.cpp +@@ -140,6 +140,7 @@ typedef unsigned int uint32; + class File { + public: + File(const char *); ++ ~File(); + void skip(int n); + byte get_byte(); + uint16 get_uint16(); +@@ -412,6 +413,7 @@ File::File(const char *s) + fatal("not a regular file"); + buf_ = new unsigned char[sb.st_size]; + long nread = read(fd, buf_, sb.st_size); ++ close(fd); + if (nread < 0) + fatal("read error: %1", strerror(errno)); + if (nread != sb.st_size) +@@ -420,6 +422,11 @@ File::File(const char *s) + end_ = buf_ + sb.st_size; + } + ++File::~File() ++{ ++ a_delete buf_; ++} ++ + void + File::skip(int n) + { +@@ -868,10 +875,15 @@ output_charset(const int tfm_type) + printf("%s", charcode_name_table[charcode]->name); + else if (!all_flag) + continue; +- else if (tfm_type == MSL) +- printf("%s", hp_msl_to_ucode_name(charcode)); +- else +- printf("%s", unicode_to_ucode_name(charcode)); ++ else if (tfm_type == MSL) { ++ char *name = hp_msl_to_ucode_name(charcode); ++ printf("%s", name); ++ a_delete name; ++ } else { ++ char *name = unicode_to_ucode_name(charcode); ++ printf("%s", name); ++ a_delete name; ++ } + + printf("\t%d,%d", + scale(char_table[i].width), scale(char_table[i].ascent)); +@@ -1383,6 +1395,7 @@ read_map(const char *file, const int tfm_type) + } + if (strlen(ptr) != 4) { + error("bad Unicode value (%1)", ptr); ++ fclose(fp); + return 0; + } + +@@ -1399,6 +1412,8 @@ read_map(const char *file, const int tfm_type) + return 0; + } + ++ char *name = NULL; ++ + ptr = strtok(NULL, " \n\t"); + if (!ptr) { // groff name + error("missing name(s)"); +@@ -1407,7 +1422,7 @@ read_map(const char *file, const int tfm_type) + } + // leave decomposed Unicode values alone + else if (is_uname(ptr) && !is_decomposed(ptr)) +- ptr = unicode_to_ucode_name(strtol(ptr + 1, &nonum, 16)); ++ ptr = name = unicode_to_ucode_name(strtol(ptr + 1, &nonum, 16)); + + if (size_t(n) >= charcode_name_table_size) { + size_t old_size = charcode_name_table_size; +@@ -1428,6 +1443,9 @@ read_map(const char *file, const int tfm_type) + break; + charcode_name_table[n] = new name_list(ptr, charcode_name_table[n]); + } ++ ++ if (name != NULL) ++ a_delete name; + } + fclose(fp); + return 1; +diff --git a/src/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp +index ee568d8..d9d4c3e 100644 +--- a/src/utils/indxbib/indxbib.cpp ++++ b/src/utils/indxbib/indxbib.cpp +@@ -70,6 +70,7 @@ struct word_list { + char *str; + int len; + word_list(const char *, int, word_list *); ++ ~word_list(); + }; + + table_entry *hash_table; +@@ -314,6 +315,7 @@ int main(int argc, char **argv) + if (unlink(temp_index_file) < 0) + fatal("can't unlink temporary index file: %1", strerror(errno)); + #endif /* not HAVE_RENAME */ ++ a_delete index_file; + temp_index_file = 0; + return failed; + } +@@ -372,6 +374,11 @@ word_list::word_list(const char *s, int n, word_list *p) + memcpy(str, s, n); + } + ++word_list::~word_list() ++{ ++ a_delete str; ++} ++ + static void read_common_words_file() + { + if (n_ignore_words <= 0) +diff --git a/src/utils/tfmtodit/tfmtodit.cpp b/src/utils/tfmtodit/tfmtodit.cpp +index 6fef258..c5c8865 100644 +--- a/src/utils/tfmtodit/tfmtodit.cpp ++++ b/src/utils/tfmtodit/tfmtodit.cpp +@@ -421,6 +421,7 @@ int gf::load(const char *file) + } + if (getc(fp) != pre || getc(fp) != gf_id_byte) { + error("bad gf file"); ++ fclose(fp); + return 0; + } + int n = getc(fp); +@@ -537,11 +538,13 @@ int gf::load(const char *file) + break; + } + } ++ fclose(fp); + if (!got_an_adjustment) + warning("no adjustment specials found in gf file"); + return 1; + eof: + error("unexpected end of file"); ++ fclose(fp); + return 0; + } + +@@ -590,12 +593,17 @@ struct char_list { + char *ch; + char_list *next; + char_list(const char *, char_list * = 0); ++ ~char_list(); + }; + + char_list::char_list(const char *s, char_list *p) : ch(strsave(s)), next(p) + { + } + ++char_list::~char_list() ++{ ++ a_delete ch; ++} + + int read_map(const char *file, char_list **table) + { +-- +2.17.2 + diff --git a/SPECS/groff.spec b/SPECS/groff.spec new file mode 100644 index 0000000..58f4f0b --- /dev/null +++ b/SPECS/groff.spec @@ -0,0 +1,1007 @@ +%{!?with_x:%global with_x 1} + +Summary: A document formatting system +Name: groff +Version: 1.22.3 +Release: 18%{?dist} +License: GPLv3+ and GFDL and BSD and MIT +Group: Applications/Publishing +URL: http://www.gnu.org/software/groff/ +Source: ftp://ftp.gnu.org/gnu/groff/groff-%{version}.tar.gz + +# resolves: #530788 +Patch0: 0001-missing-groff-x11-info-message-when-gxditview-not-fo.patch +Patch1: 0002-load-site-font-and-site-tmac-from-etc-groff.patch +# resolves: #709413, #720058, #720057 +Patch2: 0003-various-security-fixes.patch +# resolves: #987069 +Patch3: 0004-don-t-use-usr-bin-env-in-shebang.patch +# SSIA +Patch4: 0005-Add-missing-rule-for-gropdf.patch +# resolves: #1602530 +Patch5: groff-1.22.3-coverity.patch + +Requires: coreutils, /sbin/install-info, groff-base = %{version}-%{release} +Requires(post): info +Requires(preun): info +BuildRequires: gcc, gcc-c++ +BuildRequires: byacc +BuildRequires: git, netpbm-progs, perl-generators, psutils, ghostscript +Provides: nroff-i18n = %{version}-%{release} +Provides: bundled(gnulib) + +%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\([^.]*\\.pl\\) + +%description +Groff is a document formatting system. Groff takes standard text and +formatting commands as input and produces formatted output. The +created documents can be shown on a display or printed on a printer. +Groff's formatting commands allow you to specify font type and size, +bold type, italic type, the number and size of columns on a page, and +more. + +Groff can also be used to format man pages. If you are going to use +groff with the X Window System, you will also need to install the +groff-x11 package. + +%package base +Summary: Parts of the groff formatting system required to display manual pages +Group: Applications/Publishing + +%description base +The groff-base package contains only necessary parts of groff formatting +system which are required to display manual pages, and the groff's default +display device (PostScript). + +%package perl +Summary: Parts of the groff formatting system that require Perl +Group: Applications/Publishing +Requires: groff-base = %{version}-%{release} + +%description perl +The groff-perl package contains the parts of the groff text processor +package that require Perl. These include the afmtodit (font processor +for creating PostScript font files), groffer (tool for displaying groff +files), grog (utility that can be used to automatically determine groff +command-line options), chem (groff preprocessor for producing chemical +structure diagrams), mmroff (reference preprocessor) and roff2dvi +roff2html roff2pdf roff2ps roff2text roff2x (roff code converters). + +%if %{with_x} +%package x11 +Summary: Parts of the groff formatting system that require X Windows System +Group: Applications/Publishing +Requires: groff-base = %{version}-%{release} +BuildRequires: libXaw-devel, libXmu-devel +Provides: groff-gxditview = %{version}-%{release} +Obsoletes: groff-gxditview < 1.20.1 + +%description x11 +The groff-x11 package contains the parts of the groff text processor +package that require X Windows System. These include gxditview (display +groff intermediate output files on X Window System display) and +xtotroff (converts X font metrics into groff font metrics). +%endif + +%package doc +Summary: Documentation for groff document formatting system +Group: Documentation +BuildArch: noarch +Requires: groff = %{version}-%{release} +Requires(post): info +Requires(preun): info + +%description doc +The groff-doc package includes additional documentation for groff +text processor package. It contains examples, documentation for PIC +language and documentation for creating PDF files. + +%prep +%setup -q +git init +git config user.email groff-owner@fedoraproject.org +git config user.name "groff owner" +git add . +git commit -n -m "release %{version}" +git am %{patches} + +for file in NEWS src/devices/grolbp/grolbp.man doc/{groff.info*,webpage.ms} \ + contrib/mm/*.man contrib/mom/examples/{README.txt,*.mom,mom.vim}; do + iconv -f iso-8859-1 -t utf-8 < "$file" > "${file}_" + mv "${file}_" "$file" +done + +%build +%configure \ + --docdir=%{_pkgdocdir} \ + --with-appresdir=%{_datadir}/X11/app-defaults \ + --with-grofferdir=%{_datadir}/%{name}/%{version}/groffer +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} + +# some binaries need alias with 'g' or 'z' prefix +for file in g{nroff,troff,tbl,pic,eqn,neqn,refer,lookbib,indxbib,soelim} zsoelim; do + ln -s ${file#?} %{buildroot}%{_bindir}/${file} + ln -s ${file#?}.1.gz %{buildroot}%{_mandir}/man1/${file}.1.gz +done + +# fix absolute symlink to relative symlink +rm -f %{buildroot}%{_pkgdocdir}/pdf/mom-pdf.pdf +ln -s ../examples/mom/mom-pdf.pdf %{buildroot}%{_pkgdocdir}/pdf/mom-pdf.pdf + +# rename groff downloadable postscript fonts to meet Fedora Font Packaging guidelines, +# as these files are more PS instructions, than general-purpose fonts (bz #477394) +for file in $(find %{buildroot}%{_datadir}/%{name}/%{version}/font/devps -name "*.pfa"); do + mv ${file} ${file}_ +done +sed --in-place 's/\.pfa$/.pfa_/' %{buildroot}%{_datadir}/%{name}/%{version}/font/devps/download + +# remove unnecessary files +rm -f %{buildroot}%{_infodir}/dir + +# fix privileges +chmod 755 %{buildroot}%{_datadir}/groff/%{version}/groffer/version.sh +chmod 755 %{buildroot}%{_datadir}/groff/%{version}/font/devlj4/generate/special.awk + +# remove CreationDate from documentation +pushd %{buildroot}%{_pkgdocdir} + find -name "*.html" | xargs sed -i "/^