Merge ^/head r306412 through r306905.
This commit is contained in:
commit
242b248284
@ -1,5 +1,4 @@
|
||||
{
|
||||
"repository.callsign" : "S",
|
||||
"phabricator.uri" : "https://reviews.freebsd.org/",
|
||||
"history.immutable" : true
|
||||
}
|
||||
|
@ -1586,7 +1586,7 @@ _strfile= usr.bin/fortune/strfile
|
||||
_gperf= gnu/usr.bin/gperf
|
||||
.endif
|
||||
|
||||
.if ${MK_GROFF} != "no"
|
||||
.if ${MK_SHAREDOCS} != "no" || ${MK_GROFF} != "no"
|
||||
_groff= gnu/usr.bin/groff \
|
||||
usr.bin/soelim
|
||||
.endif
|
||||
|
@ -130,6 +130,9 @@ OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_
|
||||
OLD_DIRS+=usr/lib/clang/3.8.0/lib/freebsd
|
||||
OLD_DIRS+=usr/lib/clang/3.8.0/lib
|
||||
OLD_DIRS+=usr/lib/clang/3.8.0
|
||||
# 20161003: MK_ELFCOPY_AS_OBJCOPY option retired
|
||||
OLD_FILES+=usr/bin/elfcopy
|
||||
OLD_FILES+=usr/share/man/man1/elfcopy.1.gz
|
||||
# 20160906: libkqueue tests moved to /usr/tests/sys/kqueue/libkqueue
|
||||
OLD_FILES+=usr/tests/sys/kqueue/kqtest
|
||||
OLD_FILES+=usr/tests/sys/kqueue/kqueue_test
|
||||
|
4
UPDATING
4
UPDATING
@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
|
||||
disable the most expensive debugging functionality run
|
||||
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
||||
|
||||
20161003:
|
||||
The WITHOUT_ELFCOPY_AS_OBJCOPY src.conf(5) knob has been retired.
|
||||
ELF Tool Chain's elfcopy is always installed as /usr/bin/objcopy.
|
||||
|
||||
20160924:
|
||||
Relocatable object files with the extension of .So have been renamed
|
||||
to use an extension of .pico instead. The purpose of this change is
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 14, 1998
|
||||
.Dd October 5, 2016
|
||||
.Dt CHIO 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -61,10 +61,6 @@ rather than the default device
|
||||
.Pa /dev/ch0 .
|
||||
.El
|
||||
.Pp
|
||||
The default changer may be overridden by setting the environment variable
|
||||
.Ev CHANGER
|
||||
to the desired changer device.
|
||||
.Pp
|
||||
A medium changer apparatus is made up of
|
||||
.Em elements .
|
||||
There are five element types:
|
||||
@ -265,6 +261,12 @@ Element supports passing media (exporting) to an outside human operator.
|
||||
.It INENAB
|
||||
Element supports receiving media (importing) from an outside human operator.
|
||||
.El
|
||||
.Sh ENVIRONMENT
|
||||
.Bl -tag -width CHANGER
|
||||
.It Ev CHANGER
|
||||
The default changer may be overridden by setting this environmental
|
||||
variable to the desired changer device.
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width /dev/ch0 -compact
|
||||
.It Pa /dev/ch0
|
||||
@ -285,6 +287,14 @@ Configure the changer to use picker 2 (third picker) for operations.
|
||||
.Sh SEE ALSO
|
||||
.Xr mt 1 ,
|
||||
.Xr mount 8
|
||||
.Sh HISTORY
|
||||
A
|
||||
.Nm
|
||||
utility appeared in
|
||||
.Nx 1.3 .
|
||||
.Nm
|
||||
first appeared in
|
||||
.Fx 2.2 .
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
The
|
||||
|
@ -91,12 +91,11 @@ main(int argc, char *argv[])
|
||||
break;
|
||||
case 'h':
|
||||
/*
|
||||
* In System V (and probably POSIX.2) the -h option
|
||||
* causes chmod to change the mode of the symbolic
|
||||
* link. 4.4BSD's symbolic links didn't have modes,
|
||||
* so it was an undocumented noop. In FreeBSD 3.0,
|
||||
* lchmod(2) is introduced and this option does real
|
||||
* work.
|
||||
* In System V the -h option causes chmod to change
|
||||
* the mode of the symbolic link. 4.4BSD's symbolic
|
||||
* links didn't have modes, so it was an undocumented
|
||||
* noop. In FreeBSD 3.0, lchmod(2) is introduced and
|
||||
* this option does real work.
|
||||
*/
|
||||
hflag = 1;
|
||||
break;
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" @(#)dd.1 8.2 (Berkeley) 1/13/94
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd August 25, 2016
|
||||
.Dd October 5, 2016
|
||||
.Dt DD 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -447,6 +447,11 @@ and
|
||||
values are extensions to the
|
||||
.Tn POSIX
|
||||
standard.
|
||||
.Sh HISTORY
|
||||
A
|
||||
.Nm
|
||||
command appeared in
|
||||
.At v5 .
|
||||
.Sh BUGS
|
||||
Protection mechanisms in the
|
||||
.Xr geom 4
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" @(#)echo.1 8.1 (Berkeley) 7/22/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd November 12, 2010
|
||||
.Dd October 5, 2016
|
||||
.Dt ECHO 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -103,3 +103,8 @@ The
|
||||
utility conforms to
|
||||
.St -p1003.1-2001
|
||||
as amended by Cor.\& 1-2002.
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
command appeared in
|
||||
.At v2 .
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\" $FreeBSD$
|
||||
.Dd July 3, 2004
|
||||
.Dd October 2, 2016
|
||||
.Dt ED 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -998,7 +998,7 @@ per line overhead: 4 ints
|
||||
An
|
||||
.Nm
|
||||
command appeared in
|
||||
Version 1 AT&T UNIX.
|
||||
.At v1 .
|
||||
.Sh BUGS
|
||||
The
|
||||
.Nm
|
||||
|
@ -30,7 +30,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd February 25, 2012
|
||||
.Dd October 5, 2016
|
||||
.Dt EXPR 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -309,3 +309,19 @@ these arguments are treated just as their respective string values.
|
||||
The
|
||||
.Fl e
|
||||
flag is an extension.
|
||||
.Sh HISTORY
|
||||
An
|
||||
.Nm
|
||||
utility first appeared in the Programmer's Workbench (PWB/UNIX).
|
||||
A public domain version of
|
||||
.Nm
|
||||
written by
|
||||
.An Pace Willisson Aq Mt pace@blitz.com
|
||||
appeared in
|
||||
.Bx 386 0.1 .
|
||||
.Sh AUTHORS
|
||||
Initial implementation by
|
||||
.An Pace Willisson Aq Mt pace@blitz.com
|
||||
was largely rewritten by
|
||||
.An -nosplit
|
||||
.An J.T. Conklin Aq Mt jtc@FreeBSD.org .
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" @(#)kill.1 8.2 (Berkeley) 4/28/95
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd April 28, 1995
|
||||
.Dd October 3, 2016
|
||||
.Dt KILL 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -147,7 +147,8 @@ compatible.
|
||||
A
|
||||
.Nm
|
||||
command appeared in
|
||||
.At v3 .
|
||||
.At v3
|
||||
in section 8 of the manual.
|
||||
.Sh BUGS
|
||||
A replacement for the command
|
||||
.Dq Li kill 0
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" @(#)pwd.1 8.2 (Berkeley) 4/28/95
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd April 12, 2003
|
||||
.Dd October 5, 2016
|
||||
.Dt PWD 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -85,6 +85,11 @@ The
|
||||
.Nm
|
||||
utility conforms to
|
||||
.St -p1003.1-2001 .
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
command appeared in
|
||||
.At v5 .
|
||||
.Sh BUGS
|
||||
In
|
||||
.Xr csh 1
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 30, 2016
|
||||
.Dd October 8, 2016
|
||||
.Dt SH 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -1349,13 +1349,13 @@ used in tilde expansion and as a default directory for the
|
||||
built-in.
|
||||
.It Va IFS
|
||||
Input Field Separators.
|
||||
The default value is
|
||||
This is initialized at startup to
|
||||
.Aq space ,
|
||||
.Aq tab ,
|
||||
and
|
||||
.Aq newline
|
||||
in that order.
|
||||
This default also applies if
|
||||
This value also applies if
|
||||
.Va IFS
|
||||
is unset, but not if it is set to the empty string.
|
||||
See the
|
||||
|
@ -9,6 +9,7 @@ ATF_TESTS_SH= functional_test
|
||||
|
||||
${PACKAGE}FILES+= env1.0
|
||||
${PACKAGE}FILES+= exitstatus1.0
|
||||
${PACKAGE}FILES+= ifs1.0
|
||||
${PACKAGE}FILES+= mail1.0
|
||||
${PACKAGE}FILES+= mail2.0
|
||||
${PACKAGE}FILES+= optind1.0
|
||||
|
10
bin/sh/tests/parameters/ifs1.0
Normal file
10
bin/sh/tests/parameters/ifs1.0
Normal file
@ -0,0 +1,10 @@
|
||||
# $FreeBSD$
|
||||
|
||||
env IFS=_ ${SH} -c '
|
||||
rc=2
|
||||
nosuchtool_function() {
|
||||
rc=0
|
||||
}
|
||||
v=nosuchtool_function
|
||||
$v && exit "$rc"
|
||||
'
|
@ -186,6 +186,7 @@ initvar(void)
|
||||
}
|
||||
}
|
||||
setvareq_const("OPTIND=1", 0);
|
||||
setvareq_const("IFS= \t\n", 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" @(#)stty.1 8.4 (Berkeley) 4/18/94
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd August 23, 2008
|
||||
.Dd October 5, 2016
|
||||
.Dt STTY 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -601,3 +601,8 @@ and
|
||||
.Fl f
|
||||
are
|
||||
extensions to the standard.
|
||||
.Sh HISTORY
|
||||
A
|
||||
.Nm
|
||||
command appeared in
|
||||
.At v2 .
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" @(#)test.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 1, 2013
|
||||
.Dd October 5, 2016
|
||||
.Dt TEST 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -376,6 +376,11 @@ The primaries
|
||||
and
|
||||
.Fl O
|
||||
are extensions.
|
||||
.Sh HISTORY
|
||||
A
|
||||
.Nm
|
||||
utility appeared in
|
||||
.At v7 .
|
||||
.Sh BUGS
|
||||
Both sides are always evaluated in
|
||||
.Fl a
|
||||
|
@ -346,9 +346,10 @@ std::auto_ptr< atf::check::check_result >
|
||||
execute_with_shell(char* const* argv)
|
||||
{
|
||||
const std::string cmd = flatten_argv(argv);
|
||||
const std::string shell = atf::env::get("ATF_SHELL", ATF_SHELL);
|
||||
|
||||
const char* sh_argv[4];
|
||||
sh_argv[0] = atf::env::get("ATF_SHELL", ATF_SHELL).c_str();
|
||||
sh_argv[0] = shell.c_str();
|
||||
sh_argv[1] = "-c";
|
||||
sh_argv[2] = cmd.c_str();
|
||||
sh_argv[3] = NULL;
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: blacklistd.8,v 1.15 2016/03/11 17:16:40 christos Exp $
|
||||
.\" $NetBSD: blacklistd.8,v 1.18 2016/07/30 06:09:29 dholland Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
@ -47,7 +47,7 @@
|
||||
.Nm
|
||||
is a daemon similar to
|
||||
.Xr syslogd 8
|
||||
that listens to a sockets at paths specified in the
|
||||
that listens to sockets at paths specified in the
|
||||
.Ar sockpathsfile
|
||||
for notifications from other daemons about successful or failed connection
|
||||
attempts.
|
||||
@ -218,7 +218,8 @@ Socket to receive connection notifications.
|
||||
.Nm
|
||||
first appeared in
|
||||
.Nx 7 .
|
||||
.Fx support for
|
||||
.Fx
|
||||
support for
|
||||
.Nm
|
||||
was implemented in
|
||||
.Fx 11 .
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: blacklistd.c,v 1.34 2016/04/04 15:52:56 christos Exp $ */
|
||||
/* $NetBSD: blacklistd.c,v 1.35 2016/09/26 19:43:43 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||
@ -32,7 +32,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
__RCSID("$NetBSD: blacklistd.c,v 1.34 2016/04/04 15:52:56 christos Exp $");
|
||||
__RCSID("$NetBSD: blacklistd.c,v 1.35 2016/09/26 19:43:43 christos Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
@ -473,9 +473,6 @@ main(int argc, char *argv[])
|
||||
flags |= O_TRUNC;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
rules_restore();
|
||||
|
||||
struct pollfd *pfd = NULL;
|
||||
bl_t *bl = NULL;
|
||||
size_t nfd = 0;
|
||||
@ -500,6 +497,9 @@ main(int argc, char *argv[])
|
||||
if (state == NULL)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
if (restore)
|
||||
rules_restore();
|
||||
|
||||
if (!debug) {
|
||||
if (daemon(0, 0) == -1)
|
||||
err(EXIT_FAILURE, "daemon failed");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: state.c,v 1.18 2016/04/04 15:52:56 christos Exp $ */
|
||||
/* $NetBSD: state.c,v 1.19 2016/09/26 19:43:43 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||
@ -33,7 +33,7 @@
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__RCSID("$NetBSD: state.c,v 1.18 2016/04/04 15:52:56 christos Exp $");
|
||||
__RCSID("$NetBSD: state.c,v 1.19 2016/09/26 19:43:43 christos Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
@ -200,8 +200,10 @@ state_iterate(DB *db, struct conf *c, struct dbinfo *dbi, unsigned int first)
|
||||
int rv;
|
||||
DBT k, v;
|
||||
|
||||
if (db == NULL)
|
||||
if (db == NULL) {
|
||||
(*lfun)(LOG_ERR, "%s: called with no database file", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
first = first ? R_FIRST : R_NEXT;
|
||||
|
||||
|
@ -19,8 +19,8 @@ fi
|
||||
if [ -z "$pf" ]; then
|
||||
for f in npf pf ipf; do
|
||||
if [ -f "/etc/$f.conf" ]; then
|
||||
pf="$f"
|
||||
break
|
||||
pf="$f"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@ -54,8 +54,8 @@ add)
|
||||
ipf)
|
||||
/sbin/ipfstat -io | /sbin/ipf -I -f - >/dev/null 2>&1
|
||||
echo block in quick $proto from $addr/$mask to \
|
||||
any port=$6 head port$6 | \
|
||||
/sbin/ipf -I -f - -s >/dev/null 2>&1
|
||||
any port=$6 head port$6 | \
|
||||
/sbin/ipf -I -f - -s >/dev/null 2>&1 && echo OK
|
||||
;;
|
||||
ipfw)
|
||||
# use $ipfw_offset+$port for rule number
|
||||
@ -64,17 +64,21 @@ add)
|
||||
/sbin/ipfw table $tname create type addr 2>/dev/null
|
||||
/sbin/ipfw -q table $tname add "$addr/$mask"
|
||||
/sbin/ipfw -q add $rule drop $3 from "table("$tname")" to \
|
||||
any dst-port $6
|
||||
any dst-port $6 && echo OK
|
||||
;;
|
||||
npf)
|
||||
/sbin/npfctl rule "$2" add block in final $proto from \
|
||||
"$addr/$mask" to any $port
|
||||
;;
|
||||
pf)
|
||||
# insert $ip/$mask into per-protocol anchored table
|
||||
/sbin/pfctl -a "$2" -t "port$6" -T add "$addr/$mask"
|
||||
echo "block in quick $proto from <port$6> to any $port" | \
|
||||
/sbin/pfctl -a "$2" -f -
|
||||
# if the filtering rule does not exist, create it
|
||||
/sbin/pfctl -a "$2/$6" -sr 2>/dev/null | \
|
||||
grep -q "<port$6>" || \
|
||||
echo "block in quick $proto from <port$6> to any $port" | \
|
||||
/sbin/pfctl -a "$2/$6" -f -
|
||||
# insert $ip/$mask into per-protocol/port anchored table
|
||||
/sbin/pfctl -a "$2/$6" -t "port$6" -T add "$addr/$mask" && \
|
||||
echo OK
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@ -83,33 +87,35 @@ rem)
|
||||
ipf)
|
||||
/sbin/ipfstat -io | /sbin/ipf -I -f - >/dev/null 2>&1
|
||||
echo block in quick $proto from $addr/$mask to \
|
||||
any port=$6 head port$6 | \
|
||||
/sbin/ipf -I -r -f - -s >/dev/null 2>&1
|
||||
any port=$6 head port$6 | \
|
||||
/sbin/ipf -I -r -f - -s >/dev/null 2>&1 && echo OK
|
||||
;;
|
||||
ipfw)
|
||||
/sbin/ipfw table "port$6" delete "$addr/$mask" 2>/dev/null
|
||||
/sbin/ipfw table "port$6" delete "$addr/$mask" 2>/dev/null && \
|
||||
echo OK
|
||||
;;
|
||||
npf)
|
||||
/sbin/npfctl rule "$2" rem-id "$7"
|
||||
;;
|
||||
pf)
|
||||
/sbin/pfctl -a "$2" -t "port$6" -T delete "$addr/$mask"
|
||||
/sbin/pfctl -a "$2/$6" -t "port$6" -T delete "$addr/$mask" && \
|
||||
echo OK
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
flush)
|
||||
case "$pf" in
|
||||
ipf)
|
||||
/sbin/ipf -Z -I -Fi -s > /dev/null
|
||||
/sbin/ipf -Z -I -Fi -s > /dev/null && echo OK
|
||||
;;
|
||||
ipfw)
|
||||
/sbin/ipfw table "port$6" flush 2>/dev/null
|
||||
/sbin/ipfw table "port$6" flush 2>/dev/null && echo OK
|
||||
;;
|
||||
npf)
|
||||
/sbin/npfctl rule "$2" flush
|
||||
;;
|
||||
pf)
|
||||
/sbin/pfctl -a "$2" -t "port$6" -T flush
|
||||
/sbin/pfctl -a "$2/$6" -t "port$6" -T flush && echo OK
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
@ -1,3 +1,82 @@
|
||||
2016-06-06 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* configure: regen
|
||||
|
||||
* aclocal.m4: improved autoconf macros:
|
||||
CF_CC_ENV_FLAGS - don't limit the check to -I, -U and -D options, since the
|
||||
added options can include various compiler options before and after
|
||||
preprocessor options.
|
||||
CF_PROG_LINT - add cpplint to programs to use; drop ad hoc tdlint and alint.
|
||||
|
||||
* VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
|
||||
bump
|
||||
|
||||
* lalr.c: indented
|
||||
|
||||
* btyaccpar.c: regen
|
||||
|
||||
* skel2c:
|
||||
adjust whitespace so that generated skeleton will follow the same format
|
||||
as other code
|
||||
|
||||
* mkpar.c, verbose.c, lr0.c, reader.c, error.c, output.c: indented
|
||||
|
||||
* reader.c: fix two compiler warnings
|
||||
|
||||
* test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/rename_debug.c, btyaccpar.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/rename_debug.c, yaccpar.c:
|
||||
regen
|
||||
|
||||
2016-06-06 Tom.Shields
|
||||
|
||||
* btyaccpar.skel, yaccpar.skel:
|
||||
small fix for an edge case of initialized data in Chris Dodd's btyacc changes:
|
||||
"Avoid crash when input pops up an Action error at the first token"
|
||||
|
||||
2016-06-01 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax24.error, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_calc.tab.h, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/rename_debug.c, yaccpar.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.error, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.output, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.error, test/btyacc/btyacc_demo.output, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_calc.tab.c, test/btyacc/code_calc.tab.h, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.output, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.output, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/rename_debug.c, btyaccpar.c:
|
||||
regen
|
||||
|
||||
2016-06-01 Tom.Shields
|
||||
|
||||
* btyaccpar.skel, defs.h, error.c, output.c, reader.c, test/code_calc.y, test/err_inherit4.y, test/run_make.sh, yaccpar.skel:
|
||||
fixes for issues in btyacc (report by Francis Andre):
|
||||
|
||||
+ correction to the placement of the #line directive for a %union specification
|
||||
|
||||
+ recovery of a set of casts originally added into btyaccpar.c rather than into
|
||||
btyaccpar.skel, and so are lost whenever building from scratch
|
||||
|
||||
+ Chris Dodd's btyacc improved handling of inherited attributes to eliminate
|
||||
implicit empty copy rules that are not necessary, and thereby avoiding the
|
||||
introduction of extra parsing ambiguity
|
||||
|
||||
+ Chris Dodd's added support for @-N syntax to reference inherited position
|
||||
information
|
||||
|
||||
+ correction to bad interaction between %token-table and YYDEBUG, where YYDEBUG
|
||||
was required to be defined in order to compile the generated code
|
||||
|
||||
+ correction to yyname[] access in code included with YYDEBUG defined for
|
||||
single character symbols not recognized (e.g., input containing '&' character
|
||||
where grammar doesn't define that as a symbol) - map to existing
|
||||
"illegal-symbol" entry in byname[]
|
||||
|
||||
+ fixes to test/run_make.sh: skip test-err_* files; in the bison test phase
|
||||
skip additional files that contain features not supported by bison and
|
||||
inhibit new bison warning messages
|
||||
|
||||
+ minor changes to btyaccpar.skel & yaccpar.skel so they are more similar in
|
||||
their commonality; makes it easier to maintain the pair of files using
|
||||
vimdiff
|
||||
|
||||
+ changes to a couple of test cases for coverage of #3, #4 and #5 above
|
||||
|
||||
2016-06-01 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
|
||||
bump
|
||||
|
||||
2016-03-24 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* reader.c: unused variable
|
||||
|
@ -1,4 +1,4 @@
|
||||
MANIFEST for byacc-20160324, version t20160324
|
||||
MANIFEST for byacc-20160606, version t20160606
|
||||
--------------------------------------------------------------------------------
|
||||
MANIFEST this file
|
||||
ACKNOWLEDGEMENTS original version of byacc - 1993
|
||||
|
@ -1 +1 @@
|
||||
20160324
|
||||
20160606
|
||||
|
19
contrib/byacc/aclocal.m4
vendored
19
contrib/byacc/aclocal.m4
vendored
@ -1,4 +1,4 @@
|
||||
dnl $Id: aclocal.m4,v 1.39 2016/03/25 00:06:44 tom Exp $
|
||||
dnl $Id: aclocal.m4,v 1.40 2016/06/07 00:48:07 tom Exp $
|
||||
dnl Macros for byacc configure script (Thomas E. Dickey)
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Copyright 2004-2015,2016 Thomas E. Dickey
|
||||
@ -171,11 +171,15 @@ ifelse([$3],,[ :]dnl
|
||||
])dnl
|
||||
])])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_CC_ENV_FLAGS version: 2 updated: 2015/04/12 15:39:00
|
||||
dnl CF_CC_ENV_FLAGS version: 3 updated: 2016/05/21 18:10:17
|
||||
dnl ---------------
|
||||
dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
|
||||
dnl into CC. This will not help with broken scripts that wrap the compiler with
|
||||
dnl options, but eliminates a more common category of user confusion.
|
||||
dnl
|
||||
dnl Caveat: this also disallows blanks in the pathname for the compiler, but
|
||||
dnl the nuisance of having inconsistent settings for compiler and preprocessor
|
||||
dnl outweighs that limitation.
|
||||
AC_DEFUN([CF_CC_ENV_FLAGS],
|
||||
[
|
||||
# This should have been defined by AC_PROG_CC
|
||||
@ -183,13 +187,16 @@ AC_DEFUN([CF_CC_ENV_FLAGS],
|
||||
|
||||
AC_MSG_CHECKING(\$CC variable)
|
||||
case "$CC" in
|
||||
(*[[\ \ ]]-[[IUD]]*)
|
||||
(*[[\ \ ]]-*)
|
||||
AC_MSG_RESULT(broken)
|
||||
AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
|
||||
# humor him...
|
||||
cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'`
|
||||
cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]][[ ]]*//'`
|
||||
CC=`echo "$CC" | sed -e 's/[[ ]].*//'`
|
||||
CF_ADD_CFLAGS($cf_flags)
|
||||
CF_VERBOSE(resulting CC: '$CC')
|
||||
CF_VERBOSE(resulting CFLAGS: '$CFLAGS')
|
||||
CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS')
|
||||
;;
|
||||
(*)
|
||||
AC_MSG_RESULT(ok)
|
||||
@ -1010,11 +1017,11 @@ AC_SUBST(GROFF_NOTE)
|
||||
AC_SUBST(NROFF_NOTE)
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14
|
||||
dnl CF_PROG_LINT version: 3 updated: 2016/05/22 15:25:54
|
||||
dnl ------------
|
||||
AC_DEFUN([CF_PROG_LINT],
|
||||
[
|
||||
AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint)
|
||||
AC_CHECK_PROGS(LINT, lint cppcheck splint)
|
||||
AC_SUBST(LINT_OPTS)
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Id: skel2c,v 1.3 2014/04/06 19:48:04 tom Exp @
|
||||
*/
|
||||
|
||||
/* @Id: btyaccpar.skel,v 1.1 2014/04/02 22:44:41 tom Exp @ */
|
||||
/* @Id: btyaccpar.skel,v 1.3 2016/06/06 23:35:55 Tom.Shields Exp @ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -18,7 +18,7 @@ const char *const banner[] =
|
||||
{
|
||||
"/* original parser id follows */",
|
||||
"/* yysccsid[] = \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\" */",
|
||||
"/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */",
|
||||
"/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */",
|
||||
"",
|
||||
"#define YYBYACC 1",
|
||||
CONCAT1("#define YYMAJOR ", YYMAJOR),
|
||||
@ -66,8 +66,10 @@ const char *const tables[] =
|
||||
"#endif /* YYBTYACC */",
|
||||
#endif /* defined(YYBTYACC) */
|
||||
"",
|
||||
"#if YYDEBUG",
|
||||
"#if YYDEBUG || defined(yytname)",
|
||||
"extern const char *const yyname[];",
|
||||
"#endif",
|
||||
"#if YYDEBUG",
|
||||
"extern const char *const yyrule[];",
|
||||
"#endif",
|
||||
0
|
||||
@ -148,9 +150,9 @@ const char *const hdr_defs[] =
|
||||
"",
|
||||
"typedef struct {",
|
||||
" unsigned stacksize;",
|
||||
" short *s_base;",
|
||||
" short *s_mark;",
|
||||
" short *s_last;",
|
||||
" YYINT *s_base;",
|
||||
" YYINT *s_mark;",
|
||||
" YYINT *s_last;",
|
||||
" YYSTYPE *l_base;",
|
||||
" YYSTYPE *l_mark;",
|
||||
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
|
||||
@ -293,18 +295,18 @@ const char *const body_1[] =
|
||||
#endif /* defined(YYBTYACC) */
|
||||
"",
|
||||
"#if YYDEBUG",
|
||||
"#include <stdio.h> /* needed for printf */",
|
||||
"#include <stdio.h> /* needed for printf */",
|
||||
"#endif",
|
||||
"",
|
||||
"#include <stdlib.h> /* needed for malloc, etc */",
|
||||
"#include <string.h> /* needed for memset */",
|
||||
"#include <stdlib.h> /* needed for malloc, etc */",
|
||||
"#include <string.h> /* needed for memset */",
|
||||
"",
|
||||
"/* allocate initial stack or double stack size, up to YYMAXDEPTH */",
|
||||
"static int yygrowstack(YYSTACKDATA *data)",
|
||||
"{",
|
||||
" int i;",
|
||||
" unsigned newsize;",
|
||||
" short *newss;",
|
||||
" YYINT *newss;",
|
||||
" YYSTYPE *newvs;",
|
||||
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
|
||||
" YYLTYPE *newps;",
|
||||
@ -318,7 +320,7 @@ const char *const body_1[] =
|
||||
" newsize = YYMAXDEPTH;",
|
||||
"",
|
||||
" i = (int) (data->s_mark - data->s_base);",
|
||||
" newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));",
|
||||
" newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));",
|
||||
" if (newss == 0)",
|
||||
" return YYENOMEM;",
|
||||
"",
|
||||
@ -383,7 +385,7 @@ const char *const body_1[] =
|
||||
"#endif",
|
||||
" return p;",
|
||||
" }",
|
||||
" p->yystack.s_base = (short *) malloc(size * sizeof(short));",
|
||||
" p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));",
|
||||
" if (p->yystack.s_base == NULL) return NULL;",
|
||||
" p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));",
|
||||
" if (p->yystack.l_base == NULL) return NULL;",
|
||||
@ -455,6 +457,8 @@ const char *const body_2[] =
|
||||
" yyps->save = 0;",
|
||||
"#endif /* YYBTYACC */",
|
||||
#endif /* defined(YYBTYACC) */
|
||||
" yym = 0;",
|
||||
" yyn = 0;",
|
||||
" yynerrs = 0;",
|
||||
" yyerrflag = 0;",
|
||||
" yychar = YYEMPTY;",
|
||||
@ -532,11 +536,10 @@ const char *const body_2[] =
|
||||
"#endif /* YYBTYACC */",
|
||||
#endif /* defined(YYBTYACC) */
|
||||
" if (yychar < 0) yychar = YYEOF;",
|
||||
" /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */",
|
||||
"#if YYDEBUG",
|
||||
" if (yydebug)",
|
||||
" {",
|
||||
" yys = yyname[YYTRANSLATE(yychar)];",
|
||||
" if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];",
|
||||
" fprintf(stderr, \"%s[%d]: state %d, reading token %d (%s)\",",
|
||||
" YYDEBUGSTR, yydepth, yystate, yychar, yys);",
|
||||
"#ifdef YYSTYPE_TOSTRING",
|
||||
@ -598,7 +601,7 @@ const char *const body_2[] =
|
||||
" save->state = yystate;",
|
||||
" save->errflag = yyerrflag;",
|
||||
" save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);",
|
||||
" memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));",
|
||||
" memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));",
|
||||
" save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);",
|
||||
" memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));",
|
||||
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
|
||||
@ -679,7 +682,7 @@ const char *const body_2[] =
|
||||
" if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)",
|
||||
" goto yyoverflow;",
|
||||
" yystate = yyctable[ctry];",
|
||||
" *++yystack.s_mark = (short) yystate;",
|
||||
" *++yystack.s_mark = (YYINT) yystate;",
|
||||
" *++yystack.l_mark = yylval;",
|
||||
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
|
||||
" *++yystack.p_mark = yylloc;",
|
||||
@ -727,9 +730,18 @@ const char *const body_2[] =
|
||||
"",
|
||||
" yynewerrflag = 1;",
|
||||
" goto yyerrhandler;",
|
||||
" goto yyerrlab;",
|
||||
" goto yyerrlab; /* redundant goto avoids 'unused label' warning */",
|
||||
"",
|
||||
"yyerrlab:",
|
||||
" /* explicit YYERROR from an action -- pop the rhs of the rule reduced",
|
||||
" * before looking for error recovery */",
|
||||
" yystack.s_mark -= yym;",
|
||||
" yystate = *yystack.s_mark;",
|
||||
" yystack.l_mark -= yym;",
|
||||
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
|
||||
" yystack.p_mark -= yym;",
|
||||
"#endif",
|
||||
"",
|
||||
" yynewerrflag = 0;",
|
||||
"yyerrhandler:",
|
||||
" while (yyps->save)",
|
||||
@ -754,7 +766,7 @@ const char *const body_2[] =
|
||||
" yyerrctx->state = yystate;",
|
||||
" yyerrctx->errflag = yyerrflag;",
|
||||
" yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);",
|
||||
" memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));",
|
||||
" memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));",
|
||||
" yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);",
|
||||
" memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));",
|
||||
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
|
||||
@ -770,7 +782,7 @@ const char *const body_2[] =
|
||||
" yylexp = yylexemes + save->lexeme;",
|
||||
" yychar = YYEMPTY;",
|
||||
" yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);",
|
||||
" memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));",
|
||||
" memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));",
|
||||
" yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);",
|
||||
" memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));",
|
||||
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
|
||||
@ -805,7 +817,7 @@ const char *const body_2[] =
|
||||
" yylloc = yylpp[-1];",
|
||||
"#endif",
|
||||
" yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);",
|
||||
" memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));",
|
||||
" memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));",
|
||||
" yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);",
|
||||
" memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));",
|
||||
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
|
||||
@ -828,7 +840,7 @@ const char *const body_2[] =
|
||||
"#endif",
|
||||
"",
|
||||
"#if !YYBTYACC",
|
||||
" goto yyerrlab;",
|
||||
" goto yyerrlab; /* redundant goto avoids 'unused label' warning */",
|
||||
"yyerrlab:",
|
||||
"#endif",
|
||||
" ++yynerrs;",
|
||||
@ -899,7 +911,7 @@ const char *const body_2[] =
|
||||
"#if YYDEBUG",
|
||||
" if (yydebug)",
|
||||
" {",
|
||||
" yys = yyname[YYTRANSLATE(yychar)];",
|
||||
" if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];",
|
||||
" fprintf(stderr, \"%s[%d]: state %d, error recovery discarding token %d (%s)\\n\",",
|
||||
" YYDEBUGSTR, yydepth, yystate, yychar, yys);",
|
||||
" }",
|
||||
@ -1070,12 +1082,11 @@ const char *const trailer[] =
|
||||
"#endif /* YYBTYACC */",
|
||||
#endif /* defined(YYBTYACC) */
|
||||
" if (yychar < 0) yychar = YYEOF;",
|
||||
" /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */",
|
||||
"#if YYDEBUG",
|
||||
" if (yydebug)",
|
||||
" {",
|
||||
" yys = yyname[YYTRANSLATE(yychar)];",
|
||||
" fprintf(stderr, \"%s[%d]: state %d, reading %d (%s)\\n\",",
|
||||
" if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];",
|
||||
" fprintf(stderr, \"%s[%d]: state %d, reading token %d (%s)\\n\",",
|
||||
" YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);",
|
||||
" }",
|
||||
"#endif",
|
||||
@ -1104,7 +1115,7 @@ const char *const trailer[] =
|
||||
" }",
|
||||
"#endif",
|
||||
" if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;",
|
||||
" *++yystack.s_mark = (short) yystate;",
|
||||
" *++yystack.s_mark = (YYINT) yystate;",
|
||||
" *++yystack.l_mark = yyval;",
|
||||
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
|
||||
" *++yystack.p_mark = yyloc;",
|
||||
@ -1140,7 +1151,7 @@ const char *const trailer[] =
|
||||
" yylexp = yylexemes + yypath->lexeme;",
|
||||
" yychar = YYEMPTY;",
|
||||
" yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);",
|
||||
" memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));",
|
||||
" memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));",
|
||||
" yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);",
|
||||
" memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));",
|
||||
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: btyaccpar.skel,v 1.1 2014/04/02 22:44:41 tom Exp $ */
|
||||
/* $Id: btyaccpar.skel,v 1.3 2016/06/06 23:35:55 Tom.Shields Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -45,8 +45,10 @@ extern const YYINT yycheck[];
|
||||
extern const YYINT yyctable[];
|
||||
%%endif
|
||||
|
||||
#if YYDEBUG
|
||||
#if YYDEBUG || defined(yytname)
|
||||
extern const char *const yyname[];
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern const char *const yyrule[];
|
||||
#endif
|
||||
%% global_vars
|
||||
@ -113,9 +115,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -238,7 +240,7 @@ static short *yylexemes = 0;
|
||||
%%endif
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
@ -249,7 +251,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -263,7 +265,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -327,7 +329,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -388,6 +390,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
%%endif
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -427,8 +431,8 @@ yyloop:
|
||||
/* in trial mode; save scanner results for future parse attempts */
|
||||
if (yylvp == yylvlim)
|
||||
{ /* Enlarge lexical value queue */
|
||||
int p = yylvp - yylvals;
|
||||
int s = yylvlim - yylvals;
|
||||
size_t p = (size_t) (yylvp - yylvals);
|
||||
size_t s = (size_t) (yylvlim - yylvals);
|
||||
|
||||
s += YYLVQUEUEGROWTH;
|
||||
if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem;
|
||||
@ -461,11 +465,10 @@ yyloop:
|
||||
} while (0);
|
||||
%%endif
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -524,12 +527,12 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
|
||||
memcpy (save->yystack.p_base, yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
|
||||
memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
|
||||
#endif
|
||||
ctry = yytable[yyn];
|
||||
if (yyctable[ctry] == -1)
|
||||
@ -584,7 +587,7 @@ yyloop:
|
||||
yylexp--;
|
||||
yychar = YYEMPTY;
|
||||
}
|
||||
save->lexeme = yylvp - yylvals;
|
||||
save->lexeme = (int) (yylvp - yylvals);
|
||||
yyps->save = save;
|
||||
}
|
||||
if (yytable[yyn] == ctry)
|
||||
@ -605,7 +608,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -651,9 +654,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -678,14 +690,14 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
|
||||
memcpy (yyerrctx->yystack.p_base, yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
|
||||
memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
|
||||
#endif
|
||||
yyerrctx->lexeme = yylvp - yylvals;
|
||||
yyerrctx->lexeme = (int) (yylvp - yylvals);
|
||||
}
|
||||
yylvp = yylvals + save->lexeme;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -694,12 +706,12 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
|
||||
memcpy (yystack.p_base, save->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
|
||||
memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
|
||||
#endif
|
||||
ctry = ++save->ctry;
|
||||
yystate = save->state;
|
||||
@ -729,12 +741,12 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
|
||||
memcpy (yystack.p_base, yyerrctx->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
|
||||
memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
|
||||
#endif
|
||||
yystate = yyerrctx->state;
|
||||
yyFreeState(yyerrctx);
|
||||
@ -751,7 +763,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -820,7 +832,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -938,8 +950,8 @@ yyreduce:
|
||||
/* in trial mode; save scanner results for future parse attempts */
|
||||
if (yylvp == yylvlim)
|
||||
{ /* Enlarge lexical value queue */
|
||||
int p = yylvp - yylvals;
|
||||
int s = yylvlim - yylvals;
|
||||
size_t p = (size_t) (yylvp - yylvals);
|
||||
size_t s = (size_t) (yylvlim - yylvals);
|
||||
|
||||
s += YYLVQUEUEGROWTH;
|
||||
if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL)
|
||||
@ -975,12 +987,11 @@ yyreduce:
|
||||
} while (0);
|
||||
%%endif
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1007,7 +1018,7 @@ yyreduce:
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1042,12 +1053,12 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
|
||||
memcpy (yystack.p_base, yypath->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
|
||||
memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
|
||||
#endif
|
||||
yystate = yypath->state;
|
||||
goto yyloop;
|
||||
|
655
contrib/byacc/configure
vendored
655
contrib/byacc/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
/* $Id: defs.h,v 1.51 2014/10/02 22:38:13 tom Exp $ */
|
||||
/* $Id: defs.h,v 1.52 2016/06/01 22:56:37 Tom.Shields Exp $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
@ -426,7 +426,7 @@ extern void arg_type_disagree_warning(int a_lineno, int i, char *a_name);
|
||||
extern void at_error(int a_lineno, char *a_line, char *a_cptr) GCC_NORETURN;
|
||||
extern void at_warning(int a_lineno, int i);
|
||||
extern void bad_formals(void) GCC_NORETURN;
|
||||
extern void default_action_warning(void);
|
||||
extern void default_action_warning(char *s);
|
||||
extern void destructor_redeclared_warning(int a_lineno, char *a_line, char *a_cptr);
|
||||
extern void dollar_error(int a_lineno, char *a_line, char *a_cptr) GCC_NORETURN;
|
||||
extern void dollar_warning(int a_lineno, int i);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: error.c,v 1.11 2014/04/07 22:22:49 tom Exp $ */
|
||||
/* $Id: error.c,v 1.13 2016/06/07 00:15:16 tom Exp $ */
|
||||
|
||||
/* routines for printing error messages */
|
||||
|
||||
@ -267,11 +267,12 @@ unknown_rhs(int i)
|
||||
}
|
||||
|
||||
void
|
||||
default_action_warning(void)
|
||||
default_action_warning(char *s)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s: w - line %d of \"%s\", the default action assigns an \
|
||||
undefined value to $$\n", myname, lineno, input_file_name);
|
||||
"%s: w - line %d of \"%s\", the default action for %s assigns an \
|
||||
undefined value to $$\n",
|
||||
myname, lineno, input_file_name, s);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: lalr.c,v 1.11 2014/09/18 00:26:39 tom Exp $ */
|
||||
/* $Id: lalr.c,v 1.12 2016/06/07 00:28:03 tom Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -10,12 +10,12 @@ typedef struct shorts
|
||||
shorts;
|
||||
|
||||
static Value_t map_goto(int state, int symbol);
|
||||
static Value_t **transpose(Value_t ** R, int n);
|
||||
static Value_t **transpose(Value_t **R, int n);
|
||||
static void add_lookback_edge(int stateno, int ruleno, int gotono);
|
||||
static void build_relations(void);
|
||||
static void compute_FOLLOWS(void);
|
||||
static void compute_lookaheads(void);
|
||||
static void digraph(Value_t ** relation);
|
||||
static void digraph(Value_t **relation);
|
||||
static void initialize_F(void);
|
||||
static void initialize_LA(void);
|
||||
static void set_accessing_symbol(void);
|
||||
@ -147,12 +147,12 @@ initialize_LA(void)
|
||||
k = 0;
|
||||
for (i = 0; i < nstates; i++)
|
||||
{
|
||||
lookaheads[i] = (Value_t) k;
|
||||
lookaheads[i] = (Value_t)k;
|
||||
rp = reduction_table[i];
|
||||
if (rp)
|
||||
k += rp->nreds;
|
||||
}
|
||||
lookaheads[nstates] = (Value_t) k;
|
||||
lookaheads[nstates] = (Value_t)k;
|
||||
|
||||
LA = NEW2(k * tokensetsize, unsigned);
|
||||
LAruleno = NEW2(k, Value_t);
|
||||
@ -212,15 +212,15 @@ set_goto_map(void)
|
||||
k = 0;
|
||||
for (i = ntokens; i < nsyms; i++)
|
||||
{
|
||||
temp_map[i] = (Value_t) k;
|
||||
temp_map[i] = (Value_t)k;
|
||||
k += goto_map[i];
|
||||
}
|
||||
|
||||
for (i = ntokens; i < nsyms; i++)
|
||||
goto_map[i] = temp_map[i];
|
||||
|
||||
goto_map[nsyms] = (Value_t) ngotos;
|
||||
temp_map[nsyms] = (Value_t) ngotos;
|
||||
goto_map[nsyms] = (Value_t)ngotos;
|
||||
temp_map[nsyms] = (Value_t)ngotos;
|
||||
|
||||
from_state = NEW2(ngotos, Value_t);
|
||||
to_state = NEW2(ngotos, Value_t);
|
||||
@ -264,7 +264,7 @@ map_goto(int state, int symbol)
|
||||
middle = (low + high) >> 1;
|
||||
s = from_state[middle];
|
||||
if (s == state)
|
||||
return (Value_t) (middle);
|
||||
return (Value_t)(middle);
|
||||
else if (s < state)
|
||||
low = middle + 1;
|
||||
else
|
||||
@ -463,12 +463,12 @@ add_lookback_edge(int stateno, int ruleno, int gotono)
|
||||
|
||||
sp = NEW(shorts);
|
||||
sp->next = lookback[i];
|
||||
sp->value = (Value_t) gotono;
|
||||
sp->value = (Value_t)gotono;
|
||||
lookback[i] = sp;
|
||||
}
|
||||
|
||||
static Value_t **
|
||||
transpose(Value_t ** R2, int n)
|
||||
transpose(Value_t **R2, int n)
|
||||
{
|
||||
Value_t **new_R;
|
||||
Value_t **temp_R;
|
||||
@ -512,7 +512,7 @@ transpose(Value_t ** R2, int n)
|
||||
if (sp)
|
||||
{
|
||||
while (*sp >= 0)
|
||||
*temp_R[*sp++]++ = (Value_t) i;
|
||||
*temp_R[*sp++]++ = (Value_t)i;
|
||||
}
|
||||
}
|
||||
|
||||
@ -562,11 +562,11 @@ compute_lookaheads(void)
|
||||
}
|
||||
|
||||
static void
|
||||
digraph(Value_t ** relation)
|
||||
digraph(Value_t **relation)
|
||||
{
|
||||
int i;
|
||||
|
||||
infinity = (Value_t) (ngotos + 2);
|
||||
infinity = (Value_t)(ngotos + 2);
|
||||
INDEX = NEW2(ngotos + 1, Value_t);
|
||||
VERTICES = NEW2(ngotos + 1, Value_t);
|
||||
top = 0;
|
||||
@ -598,7 +598,7 @@ traverse(int i)
|
||||
Value_t height;
|
||||
unsigned *base;
|
||||
|
||||
VERTICES[++top] = (Value_t) i;
|
||||
VERTICES[++top] = (Value_t)i;
|
||||
INDEX[i] = height = top;
|
||||
|
||||
base = F + i * tokensetsize;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: lr0.c,v 1.18 2015/07/11 00:53:38 tom Exp $ */
|
||||
/* $Id: lr0.c,v 1.19 2016/06/07 00:21:53 tom Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -236,7 +236,7 @@ initialize_states(void)
|
||||
p->link = 0;
|
||||
p->number = 0;
|
||||
p->accessing_symbol = 0;
|
||||
p->nitems = (Value_t) i;
|
||||
p->nitems = (Value_t)i;
|
||||
|
||||
for (i = 0; start_derives[i] >= 0; ++i)
|
||||
p->items[i] = rrhs[start_derives[i]];
|
||||
@ -272,7 +272,7 @@ new_itemsets(void)
|
||||
ksp = kernel_base[symbol];
|
||||
}
|
||||
|
||||
*ksp++ = (Value_t) (i + 1);
|
||||
*ksp++ = (Value_t)(i + 1);
|
||||
kernel_end[symbol] = ksp;
|
||||
}
|
||||
}
|
||||
@ -301,9 +301,9 @@ new_state(int symbol)
|
||||
n = (unsigned)(iend - isp1);
|
||||
|
||||
p = (core *)allocate((sizeof(core) + (n - 1) * sizeof(Value_t)));
|
||||
p->accessing_symbol = (Value_t) symbol;
|
||||
p->number = (Value_t) nstates;
|
||||
p->nitems = (Value_t) n;
|
||||
p->accessing_symbol = (Value_t)symbol;
|
||||
p->number = (Value_t)nstates;
|
||||
p->nitems = (Value_t)n;
|
||||
|
||||
isp2 = p->items;
|
||||
while (isp1 < iend)
|
||||
@ -409,7 +409,7 @@ save_shifts(void)
|
||||
(unsigned)(nshifts - 1) * sizeof(Value_t)));
|
||||
|
||||
p->number = this_state->number;
|
||||
p->nshifts = (Value_t) nshifts;
|
||||
p->nshifts = (Value_t)nshifts;
|
||||
|
||||
sp1 = shiftset;
|
||||
sp2 = p->shift;
|
||||
@ -447,7 +447,7 @@ save_reductions(void)
|
||||
item = ritem[*isp];
|
||||
if (item < 0)
|
||||
{
|
||||
redset[count++] = (Value_t) - item;
|
||||
redset[count++] = (Value_t)-item;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: mkpar.c,v 1.14 2014/04/01 23:05:37 tom Exp $ */
|
||||
/* $Id: mkpar.c,v 1.15 2016/06/07 00:22:12 tom Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -84,7 +84,7 @@ get_shifts(int stateno)
|
||||
if (sp)
|
||||
{
|
||||
to_state2 = sp->shift;
|
||||
for (i = (Value_t) (sp->nshifts - 1); i >= 0; i--)
|
||||
for (i = (Value_t)(sp->nshifts - 1); i >= 0; i--)
|
||||
{
|
||||
k = to_state2[i];
|
||||
symbol = accessing_symbol[k];
|
||||
@ -153,8 +153,8 @@ add_reduce(action *actions,
|
||||
|
||||
temp = NEW(action);
|
||||
temp->next = next;
|
||||
temp->symbol = (Value_t) symbol;
|
||||
temp->number = (Value_t) ruleno;
|
||||
temp->symbol = (Value_t)symbol;
|
||||
temp->number = (Value_t)ruleno;
|
||||
temp->prec = rprec[ruleno];
|
||||
temp->action_code = REDUCE;
|
||||
temp->assoc = rassoc[ruleno];
|
||||
@ -372,7 +372,7 @@ defreds(void)
|
||||
|
||||
defred = NEW2(nstates, Value_t);
|
||||
for (i = 0; i < nstates; i++)
|
||||
defred[i] = (Value_t) sole_reduction(i);
|
||||
defred[i] = (Value_t)sole_reduction(i);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: output.c,v 1.74 2014/10/05 23:21:09 tom Exp $ */
|
||||
/* $Id: output.c,v 1.76 2016/06/07 00:14:34 tom Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -54,7 +54,7 @@ puts_code(FILE * fp, const char *s)
|
||||
}
|
||||
|
||||
static void
|
||||
puts_param_types(FILE * fp, param * list, int more)
|
||||
puts_param_types(FILE * fp, param *list, int more)
|
||||
{
|
||||
param *p;
|
||||
|
||||
@ -79,7 +79,7 @@ puts_param_types(FILE * fp, param * list, int more)
|
||||
}
|
||||
|
||||
static void
|
||||
puts_param_names(FILE * fp, param * list, int more)
|
||||
puts_param_names(FILE * fp, param *list, int more)
|
||||
{
|
||||
param *p;
|
||||
|
||||
@ -366,7 +366,7 @@ find_conflict_base(int cbase)
|
||||
if (j + cbase >= nconflicts)
|
||||
break;
|
||||
}
|
||||
return (Value_t) i;
|
||||
return (Value_t)i;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -412,7 +412,7 @@ token_actions(void)
|
||||
conflictcount++;
|
||||
conflicts[nconflicts++] = -1;
|
||||
j = find_conflict_base(cbase);
|
||||
actionrow[csym + 2 * ntokens] = (Value_t) (j + 1);
|
||||
actionrow[csym + 2 * ntokens] = (Value_t)(j + 1);
|
||||
if (j == cbase)
|
||||
{
|
||||
cbase = nconflicts;
|
||||
@ -457,7 +457,7 @@ token_actions(void)
|
||||
else
|
||||
conflicts[nconflicts++] = -1;
|
||||
}
|
||||
conflicts[nconflicts++] = (Value_t) (p->number - 2);
|
||||
conflicts[nconflicts++] = (Value_t)(p->number - 2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -468,7 +468,7 @@ token_actions(void)
|
||||
conflictcount++;
|
||||
conflicts[nconflicts++] = -1;
|
||||
j = find_conflict_base(cbase);
|
||||
actionrow[csym + 2 * ntokens] = (Value_t) (j + 1);
|
||||
actionrow[csym + 2 * ntokens] = (Value_t)(j + 1);
|
||||
if (j == cbase)
|
||||
{
|
||||
cbase = nconflicts;
|
||||
@ -512,7 +512,7 @@ token_actions(void)
|
||||
*s++ = actionrow[j];
|
||||
}
|
||||
}
|
||||
width[i] = (Value_t) (max - min + 1);
|
||||
width[i] = (Value_t)(max - min + 1);
|
||||
}
|
||||
if (reducecount > 0)
|
||||
{
|
||||
@ -529,10 +529,10 @@ token_actions(void)
|
||||
if (max < symbol_value[j])
|
||||
max = symbol_value[j];
|
||||
*r++ = symbol_value[j];
|
||||
*s++ = (Value_t) (actionrow[ntokens + j] - 2);
|
||||
*s++ = (Value_t)(actionrow[ntokens + j] - 2);
|
||||
}
|
||||
}
|
||||
width[nstates + i] = (Value_t) (max - min + 1);
|
||||
width[nstates + i] = (Value_t)(max - min + 1);
|
||||
}
|
||||
#if defined(YYBTYACC)
|
||||
if (backtrack && conflictcount > 0)
|
||||
@ -550,10 +550,10 @@ token_actions(void)
|
||||
if (max < symbol_value[j])
|
||||
max = symbol_value[j];
|
||||
*r++ = symbol_value[j];
|
||||
*s++ = (Value_t) (actionrow[2 * ntokens + j] - 1);
|
||||
*s++ = (Value_t)(actionrow[2 * ntokens + j] - 1);
|
||||
}
|
||||
}
|
||||
width[2 * nstates + i] = (Value_t) (max - min + 1);
|
||||
width[2 * nstates + i] = (Value_t)(max - min + 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -635,7 +635,7 @@ save_column(int symbol, int default_state)
|
||||
}
|
||||
|
||||
tally[symno] = count;
|
||||
width[symno] = (Value_t) (sp1[-1] - sp[0] + 1);
|
||||
width[symno] = (Value_t)(sp1[-1] - sp[0] + 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -871,7 +871,7 @@ pack_table(void)
|
||||
state = matching_vector(i);
|
||||
|
||||
if (state < 0)
|
||||
place = (Value_t) pack_vector(i);
|
||||
place = (Value_t)pack_vector(i);
|
||||
else
|
||||
place = base[state];
|
||||
|
||||
@ -1198,6 +1198,16 @@ output_defines(FILE * fp)
|
||||
if (fp != defines_file || iflag)
|
||||
fprintf(fp, "#define YYERRCODE %d\n", symbol_value[1]);
|
||||
|
||||
if (token_table && rflag && fp != externs_file)
|
||||
{
|
||||
if (fp == code_file)
|
||||
++outline;
|
||||
fputs("#undef yytname\n", fp);
|
||||
if (fp == code_file)
|
||||
++outline;
|
||||
fputs("#define yytname yyname\n", fp);
|
||||
}
|
||||
|
||||
if (fp == defines_file || (iflag && !dflag))
|
||||
{
|
||||
if (unionized)
|
||||
@ -1307,8 +1317,11 @@ output_debug(void)
|
||||
*/
|
||||
if (token_table)
|
||||
{
|
||||
output_line("#undef yytname");
|
||||
output_line("#define yytname yyname");
|
||||
if (!rflag)
|
||||
{
|
||||
output_line("#undef yytname");
|
||||
output_line("#define yytname yyname");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
Summary: byacc - public domain Berkeley LALR Yacc parser generator
|
||||
%define AppProgram byacc
|
||||
%define AppVersion 20160324
|
||||
%define AppVersion 20160606
|
||||
%define UseProgram yacc
|
||||
# $XTermId: byacc.spec,v 1.29 2016/03/24 23:55:52 tom Exp $
|
||||
# $XTermId: byacc.spec,v 1.31 2016/06/07 00:44:26 tom Exp $
|
||||
Name: %{AppProgram}
|
||||
Version: %{AppVersion}
|
||||
Release: 1
|
||||
|
@ -1,3 +1,15 @@
|
||||
byacc (20160606) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 06 Jun 2016 20:44:26 -0400
|
||||
|
||||
byacc (20160601) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 06 Jun 2016 05:21:18 -0400
|
||||
|
||||
byacc (20160324) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
@ -1,8 +1,8 @@
|
||||
Summary: byacc - public domain Berkeley LALR Yacc parser generator
|
||||
%define AppProgram byacc
|
||||
%define AppVersion 20160324
|
||||
%define AppVersion 20160606
|
||||
%define UseProgram yacc
|
||||
# $XTermId: mingw-byacc.spec,v 1.11 2016/03/24 23:55:52 tom Exp $
|
||||
# $XTermId: mingw-byacc.spec,v 1.13 2016/06/07 00:44:26 tom Exp $
|
||||
Name: %{AppProgram}
|
||||
Version: %{AppVersion}
|
||||
Release: 1
|
||||
|
@ -1,7 +1,7 @@
|
||||
# $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $
|
||||
#
|
||||
|
||||
DISTNAME= byacc-20160324
|
||||
DISTNAME= byacc-20160606
|
||||
PKGREVISION= 1
|
||||
CATEGORIES= devel
|
||||
MASTER_SITES= ftp://invisible-island.net/byacc/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: reader.c,v 1.60 2016/03/25 00:51:07 tom Exp $ */
|
||||
/* $Id: reader.c,v 1.63 2016/06/07 00:17:51 tom Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -43,6 +43,9 @@ static bucket *goal;
|
||||
static Value_t prec;
|
||||
static int gensym;
|
||||
static char last_was_action;
|
||||
#if defined(YYBTYACC)
|
||||
static int trialaction;
|
||||
#endif
|
||||
|
||||
static int maxitems;
|
||||
static bucket **pitem;
|
||||
@ -123,7 +126,7 @@ get_line(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (line == 0 || linesize != (LINESIZE + 1))
|
||||
if (line == NULL || linesize != (LINESIZE + 1))
|
||||
{
|
||||
if (line)
|
||||
FREE(line);
|
||||
@ -163,8 +166,8 @@ dup_line(void)
|
||||
{
|
||||
char *p, *s, *t;
|
||||
|
||||
if (line == 0)
|
||||
return (0);
|
||||
if (line == NULL)
|
||||
return (NULL);
|
||||
s = line;
|
||||
while (*s != '\n')
|
||||
++s;
|
||||
@ -199,7 +202,7 @@ skip_comment(void)
|
||||
if (*s == '\n')
|
||||
{
|
||||
get_line();
|
||||
if (line == 0)
|
||||
if (line == NULL)
|
||||
unterminated_comment(st_lineno, st_line, st_cptr);
|
||||
s = cptr;
|
||||
}
|
||||
@ -213,10 +216,10 @@ next_inline(void)
|
||||
{
|
||||
char *s;
|
||||
|
||||
if (line == 0)
|
||||
if (line == NULL)
|
||||
{
|
||||
get_line();
|
||||
if (line == 0)
|
||||
if (line == NULL)
|
||||
return (EOF);
|
||||
}
|
||||
|
||||
@ -236,7 +239,7 @@ next_inline(void)
|
||||
else if (s[1] == '/')
|
||||
{
|
||||
get_line();
|
||||
if (line == 0)
|
||||
if (line == NULL)
|
||||
return (EOF);
|
||||
s = cptr;
|
||||
break;
|
||||
@ -308,8 +311,8 @@ keywords[] = {
|
||||
{ "pure-parser", PURE_PARSER },
|
||||
{ "right", RIGHT },
|
||||
{ "start", START },
|
||||
{ "term", TOKEN },
|
||||
{ "token", TOKEN },
|
||||
{ "term", TOKEN },
|
||||
{ "token", TOKEN },
|
||||
{ "token-table", TOKEN_TABLE },
|
||||
{ "type", TYPE },
|
||||
{ "union", UNION },
|
||||
@ -386,7 +389,7 @@ keyword(void)
|
||||
return (NONASSOC);
|
||||
}
|
||||
syntax_error(lineno, line, t_cptr);
|
||||
return (-1);
|
||||
/*NOTREACHED */
|
||||
}
|
||||
|
||||
static void
|
||||
@ -447,7 +450,7 @@ copy_string(int quote)
|
||||
if (c == '\n')
|
||||
{
|
||||
get_line();
|
||||
if (line == 0)
|
||||
if (line == NULL)
|
||||
unterminated_string(s_lineno, s_line, s_cptr);
|
||||
}
|
||||
}
|
||||
@ -495,7 +498,7 @@ copy_comment(void)
|
||||
if (c == '\n')
|
||||
{
|
||||
get_line();
|
||||
if (line == 0)
|
||||
if (line == NULL)
|
||||
unterminated_comment(c_lineno, c_line, c_cptr);
|
||||
}
|
||||
}
|
||||
@ -516,7 +519,7 @@ copy_text(void)
|
||||
if (*cptr == '\n')
|
||||
{
|
||||
get_line();
|
||||
if (line == 0)
|
||||
if (line == NULL)
|
||||
unterminated_text(t_lineno, t_line, t_cptr);
|
||||
}
|
||||
if (!lflag)
|
||||
@ -603,15 +606,15 @@ copy_union(void)
|
||||
over_unionized(cptr - 6);
|
||||
unionized = 1;
|
||||
|
||||
if (!lflag)
|
||||
fprintf(text_file, line_format, lineno, input_file_name);
|
||||
|
||||
puts_both("#ifdef YYSTYPE\n");
|
||||
puts_both("#undef YYSTYPE_IS_DECLARED\n");
|
||||
puts_both("#define YYSTYPE_IS_DECLARED 1\n");
|
||||
puts_both("#endif\n");
|
||||
puts_both("#ifndef YYSTYPE_IS_DECLARED\n");
|
||||
puts_both("#define YYSTYPE_IS_DECLARED 1\n");
|
||||
|
||||
if (!lflag)
|
||||
fprintf(text_file, line_format, lineno, input_file_name);
|
||||
puts_both("typedef union");
|
||||
|
||||
depth = 0;
|
||||
@ -622,7 +625,7 @@ copy_union(void)
|
||||
{
|
||||
case '\n':
|
||||
get_line();
|
||||
if (line == 0)
|
||||
if (line == NULL)
|
||||
unterminated_union(u_lineno, u_line, u_cptr);
|
||||
goto loop;
|
||||
|
||||
@ -858,7 +861,7 @@ copy_param(int k)
|
||||
else if (c == '\n')
|
||||
{
|
||||
get_line();
|
||||
if (line == 0)
|
||||
if (line == NULL)
|
||||
unexpected_EOF();
|
||||
--cptr;
|
||||
buf_size += (size_t) linesize;
|
||||
@ -993,7 +996,7 @@ get_literal(void)
|
||||
{
|
||||
case '\n':
|
||||
get_line();
|
||||
if (line == 0)
|
||||
if (line == NULL)
|
||||
unterminated_string(s_lineno, s_line, s_cptr);
|
||||
continue;
|
||||
|
||||
@ -1187,7 +1190,7 @@ get_number(void)
|
||||
|
||||
n = 0;
|
||||
for (c = *cptr; isdigit(c); c = *++cptr)
|
||||
n = (Value_t) (10 * n + (c - '0'));
|
||||
n = (Value_t)(10 * n + (c - '0'));
|
||||
|
||||
return (n);
|
||||
}
|
||||
@ -1318,7 +1321,7 @@ declare_tokens(int assoc)
|
||||
{
|
||||
if (bp->prec && prec != bp->prec)
|
||||
reprec_warning(bp->name);
|
||||
bp->assoc = (Assoc_t) assoc;
|
||||
bp->assoc = (Assoc_t)assoc;
|
||||
bp->prec = prec;
|
||||
}
|
||||
|
||||
@ -1326,6 +1329,7 @@ declare_tokens(int assoc)
|
||||
if (c == EOF)
|
||||
unexpected_EOF();
|
||||
|
||||
value = UNDEFINED;
|
||||
if (isdigit(c))
|
||||
{
|
||||
value = get_number();
|
||||
@ -1430,7 +1434,7 @@ static void
|
||||
declare_types(void)
|
||||
{
|
||||
int c;
|
||||
bucket *bp;
|
||||
bucket *bp = NULL;
|
||||
char *tag = NULL;
|
||||
|
||||
c = nextc();
|
||||
@ -1750,7 +1754,7 @@ parse_arginfo(bucket *a, char *args, int argslen)
|
||||
char *p = args, *tmp;
|
||||
int i, redec = 0;
|
||||
|
||||
if (a->args > 0)
|
||||
if (a->args >= 0)
|
||||
{
|
||||
if (a->args != argslen)
|
||||
arg_number_disagree_warning(rescan_lineno, a->name);
|
||||
@ -1832,7 +1836,7 @@ compile_arg(char **theptr, char *yyvaltag)
|
||||
|
||||
for (j = 0, i++; i < nitems; i++)
|
||||
if (pitem[i]->class != ARGUMENT)
|
||||
offsets[++j] = (Value_t) (i - nitems + 1);
|
||||
offsets[++j] = (Value_t)(i - nitems + 1);
|
||||
}
|
||||
rhs = pitem + nitems - 1;
|
||||
|
||||
@ -1884,8 +1888,8 @@ compile_arg(char **theptr, char *yyvaltag)
|
||||
unknown_arg_warning(rescan_lineno, "$", arg, NULL, NULL);
|
||||
else if (!tag)
|
||||
tag = plhs[nrules]->argtags[i];
|
||||
msprintf(c, "yystack.l_mark[%d]", i - plhs[nrules]->args + 1
|
||||
- n);
|
||||
msprintf(c, "yystack.l_mark[%d]",
|
||||
i - plhs[nrules]->args + 1 - n);
|
||||
if (tag)
|
||||
msprintf(c, ".%s", tag);
|
||||
else if (havetags)
|
||||
@ -1911,6 +1915,90 @@ compile_arg(char **theptr, char *yyvaltag)
|
||||
return msdone(c);
|
||||
}
|
||||
|
||||
static int
|
||||
can_elide_arg(char **theptr, char *yyvaltag)
|
||||
{
|
||||
char *p = *theptr;
|
||||
int rv = 0;
|
||||
int i, j, n = 0;
|
||||
Value_t *offsets = NULL, maxoffset = 0;
|
||||
bucket **rhs;
|
||||
char *tag = 0;
|
||||
|
||||
if (*p++ != '$')
|
||||
return 0;
|
||||
if (*p == '<')
|
||||
{
|
||||
if (!(p = parse_id(++p, &tag)) || *p++ != '>')
|
||||
return 0;
|
||||
}
|
||||
for (i = nitems - 1; pitem[i]; --i)
|
||||
{
|
||||
n++;
|
||||
if (pitem[i]->class != ARGUMENT)
|
||||
maxoffset++;
|
||||
}
|
||||
if (maxoffset > 0)
|
||||
{
|
||||
offsets = TMALLOC(Value_t, maxoffset + 1);
|
||||
NO_SPACE(offsets);
|
||||
|
||||
for (j = 0, i++; i < nitems; i++)
|
||||
if (pitem[i]->class != ARGUMENT)
|
||||
offsets[++j] = (Value_t)(i - nitems + 1);
|
||||
}
|
||||
rhs = pitem + nitems - 1;
|
||||
|
||||
if (isdigit(*p) || *p == '-')
|
||||
{
|
||||
int val;
|
||||
if (!(p = parse_int(p, &val)))
|
||||
rv = 0;
|
||||
else
|
||||
{
|
||||
if (val <= 0)
|
||||
rv = 1 - val + n;
|
||||
else if (val > maxoffset)
|
||||
rv = 0;
|
||||
else
|
||||
{
|
||||
i = offsets[val];
|
||||
rv = 1 - i;
|
||||
if (!tag)
|
||||
tag = rhs[i]->tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (isalpha(*p) || *p == '_')
|
||||
{
|
||||
char *arg;
|
||||
if (!(p = parse_id(p, &arg)))
|
||||
return 0;
|
||||
for (i = plhs[nrules]->args - 1; i >= 0; i--)
|
||||
if (arg == plhs[nrules]->argnames[i])
|
||||
break;
|
||||
if (i >= 0)
|
||||
{
|
||||
if (!tag)
|
||||
tag = plhs[nrules]->argtags[i];
|
||||
rv = plhs[nrules]->args + n - i;
|
||||
}
|
||||
}
|
||||
if (tag && yyvaltag)
|
||||
{
|
||||
if (strcmp(tag, yyvaltag))
|
||||
rv = 0;
|
||||
}
|
||||
else if (tag || yyvaltag)
|
||||
rv = 0;
|
||||
if (maxoffset > 0)
|
||||
FREE(offsets);
|
||||
if (*p || rv <= 0)
|
||||
return 0;
|
||||
*theptr = p + 1;
|
||||
return rv;
|
||||
}
|
||||
|
||||
#define ARG_CACHE_SIZE 1024
|
||||
static struct arg_cache
|
||||
{
|
||||
@ -1962,7 +2050,7 @@ clean_arg_cache(void)
|
||||
arg_cache[i] = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* defined(YYBTYACC) */
|
||||
|
||||
static void
|
||||
advance_to_start(void)
|
||||
@ -2061,12 +2149,10 @@ end_rule(void)
|
||||
for (i = nitems - 1; (i > 0) && pitem[i]; --i)
|
||||
continue;
|
||||
if (pitem[i + 1] == 0 || pitem[i + 1]->tag != plhs[nrules]->tag)
|
||||
default_action_warning();
|
||||
default_action_warning(plhs[nrules]->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
default_action_warning();
|
||||
}
|
||||
default_action_warning(plhs[nrules]->name);
|
||||
}
|
||||
|
||||
last_was_action = 0;
|
||||
@ -2094,7 +2180,7 @@ insert_empty_rule(void)
|
||||
bp->args = 0;
|
||||
#endif
|
||||
|
||||
nitems = (Value_t) (nitems + 2);
|
||||
nitems = (Value_t)(nitems + 2);
|
||||
if (nitems > maxitems)
|
||||
expand_items();
|
||||
bpp = pitem + nitems - 1;
|
||||
@ -2125,13 +2211,14 @@ insert_arg_rule(char *arg, char *tag)
|
||||
{
|
||||
rule = nrules;
|
||||
insert_arg_cache(code, rule);
|
||||
trialaction = 1; /* arg rules always run in trial mode */
|
||||
fprintf(f, "case %d:\n", rule - 2);
|
||||
if (!lflag)
|
||||
fprintf(f, line_format, line_number, input_file_name);
|
||||
fprintf(f, "%s;\n", code);
|
||||
fprintf(f, "break;\n");
|
||||
insert_empty_rule();
|
||||
plhs[rule]->tag = tag;
|
||||
plhs[rule]->tag = cache_tag(tag, strlen(tag));
|
||||
plhs[rule]->class = ARGUMENT;
|
||||
}
|
||||
else
|
||||
@ -2202,11 +2289,33 @@ add_symbol(void)
|
||||
}
|
||||
else if (bp->args != argslen)
|
||||
wrong_number_args_warning("", bp->name);
|
||||
if (bp->args > 0 && argslen > 0)
|
||||
if (args != 0)
|
||||
{
|
||||
char *ap;
|
||||
int i;
|
||||
for (ap = args, i = 0; i < argslen; i++)
|
||||
char *ap = args;
|
||||
int i = 0;
|
||||
int elide_cnt = can_elide_arg(&ap, bp->argtags[0]);
|
||||
|
||||
if (elide_cnt > argslen)
|
||||
elide_cnt = 0;
|
||||
if (elide_cnt)
|
||||
{
|
||||
for (i = 1; i < elide_cnt; i++)
|
||||
if (can_elide_arg(&ap, bp->argtags[i]) != elide_cnt - i)
|
||||
{
|
||||
elide_cnt = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (elide_cnt)
|
||||
{
|
||||
assert(i == elide_cnt);
|
||||
}
|
||||
else
|
||||
{
|
||||
ap = args;
|
||||
i = 0;
|
||||
}
|
||||
for (; i < argslen; i++)
|
||||
ap = insert_arg_rule(ap, bp->argtags[i]);
|
||||
free(args);
|
||||
}
|
||||
@ -2224,7 +2333,6 @@ copy_action(void)
|
||||
int i, j, n;
|
||||
int depth;
|
||||
#if defined(YYBTYACC)
|
||||
int trialaction = 0;
|
||||
int haveyyval = 0;
|
||||
#endif
|
||||
char *tag;
|
||||
@ -2238,15 +2346,16 @@ copy_action(void)
|
||||
if (last_was_action)
|
||||
insert_empty_rule();
|
||||
last_was_action = 1;
|
||||
#if defined(YYBTYACC)
|
||||
trialaction = (*cptr == L_BRAC);
|
||||
#endif
|
||||
|
||||
fprintf(f, "case %d:\n", nrules - 2);
|
||||
#if defined(YYBTYACC)
|
||||
if (backtrack)
|
||||
{
|
||||
if (*cptr != L_BRAC)
|
||||
if (!trialaction)
|
||||
fprintf(f, " if (!yytrial)\n");
|
||||
else
|
||||
trialaction = 1;
|
||||
}
|
||||
#endif
|
||||
if (!lflag)
|
||||
@ -2278,7 +2387,7 @@ copy_action(void)
|
||||
{
|
||||
if (pitem[i]->class != ARGUMENT)
|
||||
{
|
||||
offsets[++j] = (Value_t) (i - nitems + 1);
|
||||
offsets[++j] = (Value_t)(i - nitems + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2337,8 +2446,8 @@ copy_action(void)
|
||||
break;
|
||||
if (i < 0)
|
||||
unknown_arg_warning(d_lineno, "$", arg, d_line, d_cptr);
|
||||
fprintf(f, "yystack.l_mark[%d].%s", i - plhs[nrules]->args +
|
||||
1 - n, tag);
|
||||
fprintf(f, "yystack.l_mark[%d].%s",
|
||||
i - plhs[nrules]->args + 1 - n, tag);
|
||||
FREE(d_line);
|
||||
goto loop;
|
||||
}
|
||||
@ -2451,6 +2560,13 @@ copy_action(void)
|
||||
fprintf(f, "yystack.p_mark[%d]", offsets[i]);
|
||||
goto loop;
|
||||
}
|
||||
else if (cptr[1] == '-')
|
||||
{
|
||||
cptr += 2;
|
||||
i = get_number();
|
||||
fprintf(f, "yystack.p_mark[%d]", -i - n);
|
||||
goto loop;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (isalpha(c) || c == '_' || c == '$')
|
||||
@ -2511,7 +2627,7 @@ copy_action(void)
|
||||
if (depth > 0)
|
||||
goto loop;
|
||||
fprintf(f, "\nbreak;\n");
|
||||
free(a_line);
|
||||
FREE(a_line);
|
||||
if (maxoffset > 0)
|
||||
FREE(offsets);
|
||||
return;
|
||||
@ -2554,7 +2670,7 @@ copy_action(void)
|
||||
}
|
||||
#endif
|
||||
fprintf(f, "\nbreak;\n");
|
||||
free(a_line);
|
||||
FREE(a_line);
|
||||
if (maxoffset > 0)
|
||||
FREE(offsets);
|
||||
return;
|
||||
@ -2897,6 +3013,7 @@ mark_symbol(void)
|
||||
else
|
||||
{
|
||||
syntax_error(lineno, line, cptr);
|
||||
/*NOTREACHED */
|
||||
}
|
||||
|
||||
if (rprec[nrules] != UNDEFINED && bp->prec != rprec[nrules])
|
||||
@ -3067,8 +3184,8 @@ pack_symbols(void)
|
||||
if (bp->class == TERM)
|
||||
++ntokens;
|
||||
}
|
||||
start_symbol = (Value_t) ntokens;
|
||||
nvars = (Value_t) (nsyms - ntokens);
|
||||
start_symbol = (Value_t)ntokens;
|
||||
nvars = (Value_t)(nsyms - ntokens);
|
||||
|
||||
symbol_name = TMALLOC(char *, nsyms);
|
||||
NO_SPACE(symbol_name);
|
||||
@ -3103,7 +3220,7 @@ pack_symbols(void)
|
||||
v[start_symbol] = 0;
|
||||
|
||||
i = 1;
|
||||
j = (Value_t) (start_symbol + 1);
|
||||
j = (Value_t)(start_symbol + 1);
|
||||
for (bp = first_symbol; bp; bp = bp->next)
|
||||
{
|
||||
if (bp->class == TERM)
|
||||
@ -3116,8 +3233,8 @@ pack_symbols(void)
|
||||
for (i = 1; i < ntokens; ++i)
|
||||
v[i]->index = i;
|
||||
|
||||
goal->index = (Index_t) (start_symbol + 1);
|
||||
k = (Value_t) (start_symbol + 2);
|
||||
goal->index = (Index_t)(start_symbol + 1);
|
||||
k = (Value_t)(start_symbol + 2);
|
||||
while (++i < nsyms)
|
||||
if (v[i] != goal)
|
||||
{
|
||||
@ -3127,7 +3244,7 @@ pack_symbols(void)
|
||||
|
||||
goal->value = 0;
|
||||
k = 1;
|
||||
for (i = (Value_t) (start_symbol + 1); i < nsyms; ++i)
|
||||
for (i = (Value_t)(start_symbol + 1); i < nsyms; ++i)
|
||||
{
|
||||
if (v[i] != goal)
|
||||
{
|
||||
@ -3200,7 +3317,7 @@ pack_symbols(void)
|
||||
symbol_prec[start_symbol] = 0;
|
||||
symbol_assoc[start_symbol] = TOKEN;
|
||||
#if defined(YYBTYACC)
|
||||
symbol_pval[start_symbol] = (Value_t) (max_tok_pval + 1);
|
||||
symbol_pval[start_symbol] = (Value_t)(max_tok_pval + 1);
|
||||
#endif
|
||||
for (++i; i < nsyms; ++i)
|
||||
{
|
||||
@ -3210,7 +3327,7 @@ pack_symbols(void)
|
||||
symbol_prec[k] = v[i]->prec;
|
||||
symbol_assoc[k] = v[i]->assoc;
|
||||
#if defined(YYBTYACC)
|
||||
symbol_pval[k] = (Value_t) ((max_tok_pval + 1) + v[i]->value + 1);
|
||||
symbol_pval[k] = (Value_t)((max_tok_pval + 1) + v[i]->value + 1);
|
||||
if (destructor)
|
||||
{
|
||||
symbol_destructor[k] = v[i]->destructor;
|
||||
@ -3297,7 +3414,7 @@ pack_grammar(void)
|
||||
}
|
||||
++j;
|
||||
}
|
||||
ritem[j] = (Value_t) - i;
|
||||
ritem[j] = (Value_t)-i;
|
||||
++j;
|
||||
if (rprec[i] == UNDEFINED)
|
||||
{
|
||||
@ -3455,7 +3572,7 @@ reader(void)
|
||||
|
||||
#ifdef NO_LEAKS
|
||||
static param *
|
||||
free_declarations(param * list)
|
||||
free_declarations(param *list)
|
||||
{
|
||||
while (list != 0)
|
||||
{
|
||||
|
@ -4,7 +4,7 @@ function noident(given) {
|
||||
return given;
|
||||
}
|
||||
BEGIN { havesection = 0;
|
||||
version = "$Id: skel2c,v 1.3 2014/04/06 19:48:04 tom Exp $";
|
||||
version = "$Id: skel2c,v 1.4 2016/06/07 00:26:09 tom Exp $";
|
||||
nsec = 0;
|
||||
ifdef = "";
|
||||
printf "/* This file generated automatically using\n * %s\n */\n\n",
|
||||
@ -42,10 +42,10 @@ BEGIN { havesection = 0;
|
||||
if (ifdef != "") {
|
||||
if (NF >= 2) {
|
||||
printf " \"#endif /* %s */\",\n", $2;
|
||||
printf "#endif /* defined(%s) */\n", $2;
|
||||
printf "#endif\t\t\t/* defined(%s) */\n", $2;
|
||||
} else {
|
||||
printf " \"#endif /* %s */\",\n", ifdef;
|
||||
printf "#endif /* defined(%s) */\n", ifdef;
|
||||
printf "#endif\t\t\t/* defined(%s) */\n", ifdef;
|
||||
}
|
||||
ifdef = "";
|
||||
} else {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -140,13 +140,13 @@ int dcheck(INTERVAL);
|
||||
double dreg[26];
|
||||
INTERVAL vreg[26];
|
||||
|
||||
#line 29 "btyacc_calc1.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#line 29 "btyacc_calc1.y"
|
||||
typedef union
|
||||
{
|
||||
int ival;
|
||||
@ -438,9 +438,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -622,18 +622,18 @@ vdiv(double a, double b, INTERVAL v)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -647,7 +647,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -711,7 +711,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -821,6 +821,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -894,11 +896,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -957,7 +958,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1038,7 +1039,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -1084,9 +1085,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -1111,7 +1121,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1127,7 +1137,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1162,7 +1172,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1184,7 +1194,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1253,7 +1263,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1513,7 +1523,7 @@ case 28:
|
||||
yyval.vval = yystack.l_mark[-1].vval;
|
||||
}
|
||||
break;
|
||||
#line 1517 "btyacc_calc1.tab.c"
|
||||
#line 1527 "btyacc_calc1.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1601,12 +1611,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1633,7 +1642,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1668,7 +1677,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1 +1 @@
|
||||
YACC: 7 shift/reduce conflicts, 5 reduce/reduce conflicts.
|
||||
YACC: 12 shift/reduce conflicts.
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -141,13 +141,13 @@ extern symbol *mksymbol(type t, class c, name id);
|
||||
#define YYLEX_DECL() yylex(void)
|
||||
#define YYERROR_DECL() yyerror(const char *s)
|
||||
#endif
|
||||
#line 50 "btyacc_destroy1.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#line 50 "btyacc_destroy1.y"
|
||||
typedef union
|
||||
{
|
||||
class cval;
|
||||
@ -415,9 +415,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -516,18 +516,18 @@ YYDESTRUCT_DECL()
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -541,7 +541,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -605,7 +605,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -665,6 +665,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -738,11 +740,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -801,7 +802,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -882,7 +883,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -928,9 +929,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -955,7 +965,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -971,7 +981,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1006,7 +1016,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1028,7 +1038,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1097,7 +1107,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1213,7 +1223,7 @@ case 9:
|
||||
#line 86 "btyacc_destroy1.y"
|
||||
{ yyval.nlist = yystack.l_mark[-5].nlist; }
|
||||
break;
|
||||
#line 1217 "btyacc_destroy1.tab.c"
|
||||
#line 1227 "btyacc_destroy1.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1301,12 +1311,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1333,7 +1342,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1368,7 +1377,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -141,13 +141,13 @@ extern symbol *mksymbol(type t, class c, name id);
|
||||
#define YYLEX_DECL() yylex(void)
|
||||
#define YYERROR_DECL() yyerror(const char *s)
|
||||
#endif
|
||||
#line 50 "btyacc_destroy2.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#line 50 "btyacc_destroy2.y"
|
||||
typedef union
|
||||
{
|
||||
class cval;
|
||||
@ -415,9 +415,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -516,18 +516,18 @@ YYDESTRUCT_DECL()
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -541,7 +541,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -605,7 +605,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -665,6 +665,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -738,11 +740,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -801,7 +802,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -882,7 +883,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -928,9 +929,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -955,7 +965,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -971,7 +981,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1006,7 +1016,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1028,7 +1038,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1097,7 +1107,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1213,7 +1223,7 @@ case 9:
|
||||
#line 86 "btyacc_destroy2.y"
|
||||
{ yyval.nlist = yystack.l_mark[-5].nlist; }
|
||||
break;
|
||||
#line 1217 "btyacc_destroy2.tab.c"
|
||||
#line 1227 "btyacc_destroy2.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1301,12 +1311,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1333,7 +1342,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1368,7 +1377,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -141,13 +141,13 @@ extern symbol *mksymbol(type t, class c, name id);
|
||||
#define YYLEX_DECL() yylex(void)
|
||||
#define YYERROR_DECL() yyerror(const char *s)
|
||||
#endif
|
||||
#line 53 "btyacc_destroy3.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#line 53 "btyacc_destroy3.y"
|
||||
typedef union
|
||||
{
|
||||
class cval;
|
||||
@ -415,9 +415,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -516,18 +516,18 @@ YYDESTRUCT_DECL()
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -541,7 +541,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -605,7 +605,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -665,6 +665,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -738,11 +740,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -801,7 +802,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -882,7 +883,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -928,9 +929,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -955,7 +965,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -971,7 +981,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1006,7 +1016,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1028,7 +1038,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1097,7 +1107,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1213,7 +1223,7 @@ case 9:
|
||||
#line 89 "btyacc_destroy3.y"
|
||||
{ yyval.nlist = yystack.l_mark[-5].nlist; }
|
||||
break;
|
||||
#line 1217 "btyacc_destroy3.tab.c"
|
||||
#line 1227 "btyacc_destroy3.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1301,12 +1311,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1333,7 +1342,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1368,7 +1377,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -396,9 +396,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -511,18 +511,18 @@ yylex(void)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -536,7 +536,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -600,7 +600,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -660,6 +660,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -733,11 +735,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -796,7 +797,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -877,7 +878,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -923,9 +924,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -950,7 +960,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -966,7 +976,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1001,7 +1011,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1023,7 +1033,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1092,7 +1102,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1219,7 +1229,7 @@ case 18:
|
||||
#line 63 "calc.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1223 "calc.tab.c"
|
||||
#line 1233 "calc.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1307,12 +1317,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1339,7 +1348,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1374,7 +1383,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -143,13 +143,13 @@ int dcheck(INTERVAL);
|
||||
double dreg[26];
|
||||
INTERVAL vreg[26];
|
||||
|
||||
#line 31 "calc1.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#line 31 "calc1.y"
|
||||
typedef union
|
||||
{
|
||||
int ival;
|
||||
@ -451,9 +451,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -655,18 +655,18 @@ vdiv(double a, double b, INTERVAL v)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -680,7 +680,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -744,7 +744,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -804,6 +804,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -877,11 +879,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -940,7 +941,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1021,7 +1022,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -1067,9 +1068,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -1094,7 +1104,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1110,7 +1120,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1145,7 +1155,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1167,7 +1177,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1236,7 +1246,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1466,7 +1476,7 @@ case 28:
|
||||
yyval.vval = yystack.l_mark[-1].vval;
|
||||
}
|
||||
break;
|
||||
#line 1470 "calc1.tab.c"
|
||||
#line 1480 "calc1.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1554,12 +1564,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1586,7 +1595,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1621,7 +1630,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -398,9 +398,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -524,18 +524,18 @@ YYLEX_DECL()
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -549,7 +549,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -613,7 +613,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -673,6 +673,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -746,11 +748,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -809,7 +810,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -890,7 +891,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -936,9 +937,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -963,7 +973,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -979,7 +989,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1014,7 +1024,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1036,7 +1046,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1105,7 +1115,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1232,7 +1242,7 @@ case 18:
|
||||
#line 70 "calc2.y"
|
||||
{ yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1236 "calc2.tab.c"
|
||||
#line 1246 "calc2.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1320,12 +1330,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1352,7 +1361,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1387,7 +1396,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -394,9 +394,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -479,18 +479,18 @@ YYLEX_DECL()
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -504,7 +504,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -568,7 +568,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -678,6 +678,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -751,11 +753,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -814,7 +815,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -895,7 +896,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -941,9 +942,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -968,7 +978,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -984,7 +994,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1019,7 +1029,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1041,7 +1051,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1110,7 +1120,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1237,7 +1247,7 @@ case 18:
|
||||
#line 73 "calc3.y"
|
||||
{ yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1241 "calc3.tab.c"
|
||||
#line 1251 "calc3.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1325,12 +1335,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1357,7 +1366,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1392,7 +1401,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -117,7 +117,7 @@
|
||||
|
||||
#define YYPURE 0
|
||||
|
||||
#line 2 "code_calc.y"
|
||||
#line 4 "code_calc.y"
|
||||
# include <stdio.h>
|
||||
# include <ctype.h>
|
||||
|
||||
@ -170,6 +170,8 @@ typedef int YYSTYPE;
|
||||
#define LETTER 258
|
||||
#define UMINUS 259
|
||||
#define YYERRCODE 256
|
||||
#undef yytname
|
||||
#define yytname yyname
|
||||
#define YYTABLESIZE 220
|
||||
#define YYFINAL 1
|
||||
#ifndef YYDEBUG
|
||||
@ -198,8 +200,10 @@ extern const YYINT yycheck[];
|
||||
extern const YYINT yyctable[];
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#if YYDEBUG || defined(yytname)
|
||||
extern const char *const yyname[];
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern const char *const yyrule[];
|
||||
#endif
|
||||
|
||||
@ -263,9 +267,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -327,7 +331,7 @@ static short *yylexp = 0;
|
||||
|
||||
static short *yylexemes = 0;
|
||||
#endif /* YYBTYACC */
|
||||
#line 68 "code_calc.y"
|
||||
#line 70 "code_calc.y"
|
||||
/* start of programs */
|
||||
|
||||
#ifdef YYBYACC
|
||||
@ -373,7 +377,7 @@ yylex(void)
|
||||
}
|
||||
return( c );
|
||||
}
|
||||
#line 377 "code_calc.code.c"
|
||||
#line 381 "code_calc.code.c"
|
||||
|
||||
/* For use in generated program */
|
||||
#define yydepth (int)(yystack.s_mark - yystack.s_base)
|
||||
@ -382,18 +386,18 @@ yylex(void)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -407,7 +411,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -471,7 +475,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -531,6 +535,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -604,11 +610,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -667,7 +672,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -748,7 +753,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -794,9 +799,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -821,7 +835,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -837,7 +851,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -872,7 +886,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -894,7 +908,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -963,7 +977,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1031,66 +1045,66 @@ yyreduce:
|
||||
switch (yyn)
|
||||
{
|
||||
case 3:
|
||||
#line 30 "code_calc.y"
|
||||
#line 32 "code_calc.y"
|
||||
{ yyerrok ; }
|
||||
break;
|
||||
case 4:
|
||||
#line 34 "code_calc.y"
|
||||
#line 36 "code_calc.y"
|
||||
{ printf("%d\n",yystack.l_mark[0]);}
|
||||
break;
|
||||
case 5:
|
||||
#line 36 "code_calc.y"
|
||||
#line 38 "code_calc.y"
|
||||
{ regs[yystack.l_mark[-2]] = yystack.l_mark[0]; }
|
||||
break;
|
||||
case 6:
|
||||
#line 40 "code_calc.y"
|
||||
#line 42 "code_calc.y"
|
||||
{ yyval = yystack.l_mark[-1]; }
|
||||
break;
|
||||
case 7:
|
||||
#line 42 "code_calc.y"
|
||||
#line 44 "code_calc.y"
|
||||
{ yyval = yystack.l_mark[-2] + yystack.l_mark[0]; }
|
||||
break;
|
||||
case 8:
|
||||
#line 44 "code_calc.y"
|
||||
#line 46 "code_calc.y"
|
||||
{ yyval = yystack.l_mark[-2] - yystack.l_mark[0]; }
|
||||
break;
|
||||
case 9:
|
||||
#line 46 "code_calc.y"
|
||||
#line 48 "code_calc.y"
|
||||
{ yyval = yystack.l_mark[-2] * yystack.l_mark[0]; }
|
||||
break;
|
||||
case 10:
|
||||
#line 48 "code_calc.y"
|
||||
#line 50 "code_calc.y"
|
||||
{ yyval = yystack.l_mark[-2] / yystack.l_mark[0]; }
|
||||
break;
|
||||
case 11:
|
||||
#line 50 "code_calc.y"
|
||||
#line 52 "code_calc.y"
|
||||
{ yyval = yystack.l_mark[-2] % yystack.l_mark[0]; }
|
||||
break;
|
||||
case 12:
|
||||
#line 52 "code_calc.y"
|
||||
#line 54 "code_calc.y"
|
||||
{ yyval = yystack.l_mark[-2] & yystack.l_mark[0]; }
|
||||
break;
|
||||
case 13:
|
||||
#line 54 "code_calc.y"
|
||||
#line 56 "code_calc.y"
|
||||
{ yyval = yystack.l_mark[-2] | yystack.l_mark[0]; }
|
||||
break;
|
||||
case 14:
|
||||
#line 56 "code_calc.y"
|
||||
#line 58 "code_calc.y"
|
||||
{ yyval = - yystack.l_mark[0]; }
|
||||
break;
|
||||
case 15:
|
||||
#line 58 "code_calc.y"
|
||||
#line 60 "code_calc.y"
|
||||
{ yyval = regs[yystack.l_mark[0]]; }
|
||||
break;
|
||||
case 17:
|
||||
#line 63 "code_calc.y"
|
||||
#line 65 "code_calc.y"
|
||||
{ yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; }
|
||||
break;
|
||||
case 18:
|
||||
#line 65 "code_calc.y"
|
||||
#line 67 "code_calc.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1094 "code_calc.code.c"
|
||||
#line 1108 "code_calc.code.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1178,12 +1192,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1210,7 +1223,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1245,7 +1258,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -125,7 +125,6 @@ const YYINT calc_ctable[] = { -1,
|
||||
#ifndef YYDEBUG
|
||||
#define YYDEBUG 0
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
const char *const calc_name[] = {
|
||||
|
||||
"$end",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
@ -138,6 +137,7 @@ const char *const calc_name[] = {
|
||||
0,0,"error","DIGIT","LETTER","UMINUS","$accept","list","stat","expr","number",
|
||||
"illegal-symbol",
|
||||
};
|
||||
#if YYDEBUG
|
||||
const char *const calc_rule[] = {
|
||||
"$accept : list",
|
||||
"list :",
|
||||
|
@ -4,5 +4,7 @@
|
||||
#define DIGIT 257
|
||||
#define LETTER 258
|
||||
#define UMINUS 259
|
||||
#undef yytname
|
||||
#define yytname yyname
|
||||
|
||||
#endif /* _calc__defines_h_ */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -190,8 +190,10 @@ extern const YYINT yycheck[];
|
||||
extern const YYINT yyctable[];
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#if YYDEBUG || defined(yytname)
|
||||
extern const char *const yyname[];
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern const char *const yyrule[];
|
||||
#endif
|
||||
|
||||
@ -255,9 +257,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -345,7 +347,7 @@ yyerror(const char* s)
|
||||
{
|
||||
printf("%s\n", s);
|
||||
}
|
||||
#line 349 "code_error.code.c"
|
||||
#line 351 "code_error.code.c"
|
||||
|
||||
/* For use in generated program */
|
||||
#define yydepth (int)(yystack.s_mark - yystack.s_base)
|
||||
@ -354,18 +356,18 @@ yyerror(const char* s)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -379,7 +381,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -443,7 +445,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -503,6 +505,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -576,11 +580,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -639,7 +642,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -720,7 +723,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -766,9 +769,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -793,7 +805,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -809,7 +821,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -844,7 +856,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -866,7 +878,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -935,7 +947,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1089,12 +1101,11 @@ yyreduce:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1121,7 +1132,7 @@ yyreduce:
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1156,7 +1167,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -287,9 +287,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -373,18 +373,18 @@ YYERROR_DECL() {
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -398,7 +398,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -462,7 +462,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -522,6 +522,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -595,11 +597,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -658,7 +659,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -739,7 +740,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -785,9 +786,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -812,7 +822,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -828,7 +838,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -863,7 +873,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -885,7 +895,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -954,7 +964,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1108,12 +1118,11 @@ yyreduce:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1140,7 +1149,7 @@ yyreduce:
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1175,7 +1184,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -5,25 +5,22 @@
|
||||
2 $$2 :
|
||||
|
||||
3 declaration : class type $$1 $$2 namelist
|
||||
4 | type locnamelist
|
||||
|
||||
4 $$3 :
|
||||
5 class : GLOBAL
|
||||
6 | LOCAL
|
||||
|
||||
5 declaration : type $$3 locnamelist
|
||||
7 type : REAL
|
||||
8 | INTEGER
|
||||
|
||||
6 class : GLOBAL
|
||||
7 | LOCAL
|
||||
9 $$3 :
|
||||
|
||||
8 type : REAL
|
||||
9 | INTEGER
|
||||
10 namelist : $$3 namelist NAME
|
||||
11 | NAME
|
||||
|
||||
10 $$4 :
|
||||
12 $$4 :
|
||||
|
||||
11 namelist : $$4 namelist NAME
|
||||
12 | NAME
|
||||
|
||||
13 $$5 :
|
||||
|
||||
14 locnamelist : $$5 $$2 namelist
|
||||
13 locnamelist : $$4 $$2 namelist
|
||||
|
||||
state 0
|
||||
$accept : . declaration $end (0)
|
||||
@ -40,29 +37,29 @@ state 0
|
||||
|
||||
|
||||
state 1
|
||||
class : GLOBAL . (6)
|
||||
class : GLOBAL . (5)
|
||||
|
||||
. reduce 5
|
||||
|
||||
|
||||
state 2
|
||||
class : LOCAL . (6)
|
||||
|
||||
. reduce 6
|
||||
|
||||
|
||||
state 2
|
||||
class : LOCAL . (7)
|
||||
state 3
|
||||
type : REAL . (7)
|
||||
|
||||
. reduce 7
|
||||
|
||||
|
||||
state 3
|
||||
type : REAL . (8)
|
||||
state 4
|
||||
type : INTEGER . (8)
|
||||
|
||||
. reduce 8
|
||||
|
||||
|
||||
state 4
|
||||
type : INTEGER . (9)
|
||||
|
||||
. reduce 9
|
||||
|
||||
|
||||
state 5
|
||||
$accept : declaration . $end (0)
|
||||
|
||||
@ -80,12 +77,13 @@ state 6
|
||||
|
||||
|
||||
state 7
|
||||
declaration : type . $$3 locnamelist (5)
|
||||
$$3 : . (4)
|
||||
declaration : type . locnamelist (4)
|
||||
$$4 : . (12)
|
||||
|
||||
. reduce 4
|
||||
. reduce 12
|
||||
|
||||
$$3 goto 9
|
||||
locnamelist goto 9
|
||||
$$4 goto 10
|
||||
|
||||
|
||||
state 8
|
||||
@ -94,20 +92,25 @@ state 8
|
||||
|
||||
. reduce 1
|
||||
|
||||
$$1 goto 10
|
||||
$$1 goto 11
|
||||
|
||||
|
||||
state 9
|
||||
declaration : type $$3 . locnamelist (5)
|
||||
$$5 : . (13)
|
||||
declaration : type locnamelist . (4)
|
||||
|
||||
. reduce 13
|
||||
|
||||
locnamelist goto 11
|
||||
$$5 goto 12
|
||||
. reduce 4
|
||||
|
||||
|
||||
state 10
|
||||
locnamelist : $$4 . $$2 namelist (13)
|
||||
$$2 : . (2)
|
||||
|
||||
. reduce 2
|
||||
|
||||
$$2 goto 12
|
||||
|
||||
|
||||
state 11
|
||||
declaration : class type $$1 . $$2 namelist (3)
|
||||
$$2 : . (2)
|
||||
|
||||
@ -116,96 +119,81 @@ state 10
|
||||
$$2 goto 13
|
||||
|
||||
|
||||
state 11
|
||||
declaration : type $$3 locnamelist . (5)
|
||||
|
||||
. reduce 5
|
||||
|
||||
|
||||
12: shift/reduce conflict (shift 14, reduce 9) on NAME
|
||||
state 12
|
||||
locnamelist : $$5 . $$2 namelist (14)
|
||||
$$2 : . (2)
|
||||
locnamelist : $$4 $$2 . namelist (13)
|
||||
$$3 : . (9)
|
||||
|
||||
. reduce 2
|
||||
NAME shift 14
|
||||
|
||||
$$2 goto 14
|
||||
namelist goto 15
|
||||
$$3 goto 16
|
||||
|
||||
|
||||
13: shift/reduce conflict (shift 15, reduce 10) on NAME
|
||||
13: shift/reduce conflict (shift 14, reduce 9) on NAME
|
||||
state 13
|
||||
declaration : class type $$1 $$2 . namelist (3)
|
||||
$$4 : . (10)
|
||||
$$3 : . (9)
|
||||
|
||||
NAME shift 15
|
||||
NAME shift 14
|
||||
|
||||
namelist goto 16
|
||||
$$4 goto 17
|
||||
namelist goto 17
|
||||
$$3 goto 16
|
||||
|
||||
|
||||
14: shift/reduce conflict (shift 15, reduce 10) on NAME
|
||||
state 14
|
||||
locnamelist : $$5 $$2 . namelist (14)
|
||||
$$4 : . (10)
|
||||
namelist : NAME . (11)
|
||||
|
||||
NAME shift 15
|
||||
|
||||
namelist goto 18
|
||||
$$4 goto 17
|
||||
. reduce 11
|
||||
|
||||
|
||||
state 15
|
||||
namelist : NAME . (12)
|
||||
locnamelist : $$4 $$2 namelist . (13)
|
||||
|
||||
. reduce 12
|
||||
. reduce 13
|
||||
|
||||
|
||||
16: shift/reduce conflict (shift 14, reduce 9) on NAME
|
||||
state 16
|
||||
namelist : $$3 . namelist NAME (10)
|
||||
$$3 : . (9)
|
||||
|
||||
NAME shift 14
|
||||
|
||||
namelist goto 18
|
||||
$$3 goto 16
|
||||
|
||||
|
||||
state 17
|
||||
declaration : class type $$1 $$2 namelist . (3)
|
||||
|
||||
. reduce 3
|
||||
|
||||
|
||||
17: shift/reduce conflict (shift 15, reduce 10) on NAME
|
||||
state 17
|
||||
namelist : $$4 . namelist NAME (11)
|
||||
$$4 : . (10)
|
||||
|
||||
NAME shift 15
|
||||
|
||||
namelist goto 19
|
||||
$$4 goto 17
|
||||
|
||||
|
||||
state 18
|
||||
locnamelist : $$5 $$2 namelist . (14)
|
||||
namelist : $$3 namelist . NAME (10)
|
||||
|
||||
. reduce 14
|
||||
|
||||
|
||||
state 19
|
||||
namelist : $$4 namelist . NAME (11)
|
||||
|
||||
NAME shift 20
|
||||
NAME shift 19
|
||||
. error
|
||||
|
||||
|
||||
state 20
|
||||
namelist : $$4 namelist NAME . (11)
|
||||
state 19
|
||||
namelist : $$3 namelist NAME . (10)
|
||||
|
||||
. reduce 11
|
||||
. reduce 10
|
||||
|
||||
|
||||
Rules never reduced:
|
||||
$$4 : (10)
|
||||
$$3 : (9)
|
||||
|
||||
|
||||
State 12 contains 1 shift/reduce conflict.
|
||||
State 13 contains 1 shift/reduce conflict.
|
||||
State 14 contains 1 shift/reduce conflict.
|
||||
State 17 contains 1 shift/reduce conflict.
|
||||
State 16 contains 1 shift/reduce conflict.
|
||||
|
||||
|
||||
7 terminals, 11 nonterminals
|
||||
15 grammar rules, 21 states
|
||||
7 terminals, 10 nonterminals
|
||||
14 grammar rules, 20 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
@ -226,4 +214,3 @@ symbol# value# symbol
|
||||
14 269 $$2
|
||||
15 270 $$3
|
||||
16 271 $$4
|
||||
17 272 $$5
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -136,13 +136,13 @@ extern symbol *mksymbol(type t, class c, name id);
|
||||
#define YYLEX_DECL() yylex(void)
|
||||
#define YYERROR_DECL() yyerror(const char *s)
|
||||
#endif
|
||||
#line 39 "err_inherit3.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#line 39 "err_inherit3.y"
|
||||
typedef union
|
||||
{
|
||||
class cval;
|
||||
@ -199,53 +199,54 @@ extern int YYPARSE_DECL();
|
||||
#define YYERRCODE 256
|
||||
typedef short YYINT;
|
||||
static const YYINT err_inherit3_lhs[] = { -1,
|
||||
5, 6, 0, 7, 0, 3, 3, 4, 4, 8,
|
||||
1, 1, 9, 2,
|
||||
5, 6, 0, 0, 3, 3, 4, 4, 7, 1,
|
||||
1, 8, 2,
|
||||
};
|
||||
static const YYINT err_inherit3_len[] = { 2,
|
||||
0, 0, 5, 0, 3, 1, 1, 1, 1, 0,
|
||||
3, 1, 0, 3,
|
||||
0, 0, 5, 2, 1, 1, 1, 1, 0, 3,
|
||||
1, 0, 3,
|
||||
};
|
||||
static const YYINT err_inherit3_defred[] = { 0,
|
||||
6, 7, 8, 9, 0, 0, 4, 1, 13, 2,
|
||||
5, 2, 0, 0, 12, 3, 0, 14, 0, 11,
|
||||
5, 6, 7, 8, 0, 0, 12, 1, 4, 2,
|
||||
2, 0, 0, 11, 13, 0, 3, 0, 10,
|
||||
};
|
||||
static const YYINT err_inherit3_stos[] = { 0,
|
||||
257, 258, 259, 260, 263, 266, 267, 267, 270, 268,
|
||||
265, 272, 269, 269, 261, 264, 271, 264, 264, 261,
|
||||
257, 258, 259, 260, 263, 266, 267, 267, 265, 271,
|
||||
268, 269, 269, 261, 264, 270, 264, 264, 261,
|
||||
};
|
||||
static const YYINT err_inherit3_dgoto[] = { 5,
|
||||
16, 11, 6, 7, 10, 13, 9, 17, 12,
|
||||
15, 9, 6, 7, 11, 12, 16, 10,
|
||||
};
|
||||
static const YYINT err_inherit3_sindex[] = { -257,
|
||||
0, 0, 0, 0, 0, -254, 0, 0, 0, 0,
|
||||
0, 0, -253, -253, 0, 0, -253, 0, -252, 0,
|
||||
0, -253, -253, 0, 0, -253, 0, -252, 0,
|
||||
};
|
||||
static const YYINT err_inherit3_rindex[] = { 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
#if YYBTYACC
|
||||
static const YYINT err_inherit3_cindex[] = { 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
#endif
|
||||
static const YYINT err_inherit3_gindex[] = { 0,
|
||||
-10, 0, 0, 4, 0, -1, 0, 0, 0,
|
||||
-9, 0, 0, 4, 0, 1, 0, 0,
|
||||
};
|
||||
#define YYTABLESIZE 11
|
||||
#define YYTABLESIZE 12
|
||||
static const YYINT err_inherit3_table[] = { 1,
|
||||
2, 3, 4, 18, 3, 4, 19, 15, 20, 8,
|
||||
14,
|
||||
2, 3, 4, 17, 3, 4, 18, 14, 19, 8,
|
||||
0, 13,
|
||||
};
|
||||
static const YYINT err_inherit3_check[] = { 257,
|
||||
258, 259, 260, 14, 259, 260, 17, 261, 261, 6,
|
||||
12,
|
||||
258, 259, 260, 13, 259, 260, 16, 261, 261, 6,
|
||||
-1, 11,
|
||||
};
|
||||
#if YYBTYACC
|
||||
static const YYINT err_inherit3_ctable[] = { -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1,
|
||||
};
|
||||
#endif
|
||||
#define YYFINAL 5
|
||||
@ -253,7 +254,7 @@ static const YYINT err_inherit3_ctable[] = { -1,
|
||||
#define YYDEBUG 0
|
||||
#endif
|
||||
#define YYMAXTOKEN 261
|
||||
#define YYUNDFTOKEN 273
|
||||
#define YYUNDFTOKEN 272
|
||||
#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
|
||||
#if YYDEBUG
|
||||
static const char *const err_inherit3_name[] = {
|
||||
@ -266,24 +267,23 @@ static const char *const err_inherit3_name[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","GLOBAL","LOCAL","REAL","INTEGER",
|
||||
"NAME","$accept","declaration","namelist","locnamelist","class","type","$$1",
|
||||
"$$2","$$3","$$4","$$5","illegal-symbol",
|
||||
"$$2","$$3","$$4","illegal-symbol",
|
||||
};
|
||||
static const char *const err_inherit3_rule[] = {
|
||||
"$accept : declaration",
|
||||
"$$1 :",
|
||||
"$$2 :",
|
||||
"declaration : class type $$1 $$2 namelist",
|
||||
"$$3 :",
|
||||
"declaration : type $$3 locnamelist",
|
||||
"declaration : type locnamelist",
|
||||
"class : GLOBAL",
|
||||
"class : LOCAL",
|
||||
"type : REAL",
|
||||
"type : INTEGER",
|
||||
"$$4 :",
|
||||
"namelist : $$4 namelist NAME",
|
||||
"$$3 :",
|
||||
"namelist : $$3 namelist NAME",
|
||||
"namelist : NAME",
|
||||
"$$5 :",
|
||||
"locnamelist : $$5 $$2 namelist",
|
||||
"$$4 :",
|
||||
"locnamelist : $$4 $$2 namelist",
|
||||
|
||||
};
|
||||
#endif
|
||||
@ -348,9 +348,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -473,18 +473,18 @@ YYDESTRUCT_DECL()
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -498,7 +498,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -562,7 +562,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -622,6 +622,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -695,11 +697,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -758,7 +759,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -839,7 +840,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -885,9 +886,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -912,7 +922,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -928,7 +938,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -963,7 +973,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -985,7 +995,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1054,7 +1064,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1134,54 +1144,50 @@ case 3:
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; }
|
||||
break;
|
||||
case 4:
|
||||
#line 52 "err_inherit3.y"
|
||||
yyval.tval = yystack.l_mark[0].tval;
|
||||
break;
|
||||
case 5:
|
||||
#line 53 "err_inherit3.y"
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; }
|
||||
break;
|
||||
case 6:
|
||||
case 5:
|
||||
#line 56 "err_inherit3.y"
|
||||
{ yyval.cval = cGLOBAL; }
|
||||
break;
|
||||
case 7:
|
||||
case 6:
|
||||
#line 57 "err_inherit3.y"
|
||||
{ yyval.cval = cLOCAL; }
|
||||
break;
|
||||
case 8:
|
||||
case 7:
|
||||
#line 60 "err_inherit3.y"
|
||||
{ yyval.tval = tREAL; }
|
||||
break;
|
||||
case 9:
|
||||
case 8:
|
||||
#line 61 "err_inherit3.y"
|
||||
{ yyval.tval = tINTEGER; }
|
||||
break;
|
||||
case 10:
|
||||
case 9:
|
||||
#line 64 "err_inherit3.y"
|
||||
yyval.cval = yystack.l_mark[-2];
|
||||
break;
|
||||
case 11:
|
||||
case 10:
|
||||
#line 65 "err_inherit3.y"
|
||||
{ yyval.nlist->s = mksymbol(yystack.l_mark[-5].tval, yystack.l_mark[-5].cval, yystack.l_mark[0].id);
|
||||
yyval.nlist->next = yystack.l_mark[-1].nlist;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
case 11:
|
||||
#line 69 "err_inherit3.y"
|
||||
{ yyval.nlist->s = mksymbol(yystack.l_mark[-3], yystack.l_mark[-3], yystack.l_mark[0].id);
|
||||
yyval.nlist->next = NULL;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
case 12:
|
||||
#line 74 "err_inherit3.y"
|
||||
yyval.cval = cLOCAL;
|
||||
break;
|
||||
case 14:
|
||||
case 13:
|
||||
#line 75 "err_inherit3.y"
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; }
|
||||
break;
|
||||
#line 1185 "err_inherit3.tab.c"
|
||||
#line 1191 "err_inherit3.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1269,12 +1275,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1301,7 +1306,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1336,7 +1341,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -5,21 +5,18 @@
|
||||
2 $$2 :
|
||||
|
||||
3 declaration : class type $$1 $$2 namelist
|
||||
4 | type locnamelist
|
||||
|
||||
4 $$3 :
|
||||
5 class : GLOBAL
|
||||
6 | LOCAL
|
||||
|
||||
5 declaration : type $$3 locnamelist
|
||||
7 type : REAL
|
||||
8 | INTEGER
|
||||
|
||||
6 class : GLOBAL
|
||||
7 | LOCAL
|
||||
9 namelist : namelist NAME
|
||||
10 | NAME
|
||||
|
||||
8 type : REAL
|
||||
9 | INTEGER
|
||||
|
||||
10 namelist : namelist NAME
|
||||
11 | NAME
|
||||
|
||||
12 locnamelist : namelist
|
||||
11 locnamelist : namelist
|
||||
|
||||
state 0
|
||||
$accept : . declaration $end (0)
|
||||
@ -36,29 +33,29 @@ state 0
|
||||
|
||||
|
||||
state 1
|
||||
class : GLOBAL . (6)
|
||||
class : GLOBAL . (5)
|
||||
|
||||
. reduce 5
|
||||
|
||||
|
||||
state 2
|
||||
class : LOCAL . (6)
|
||||
|
||||
. reduce 6
|
||||
|
||||
|
||||
state 2
|
||||
class : LOCAL . (7)
|
||||
state 3
|
||||
type : REAL . (7)
|
||||
|
||||
. reduce 7
|
||||
|
||||
|
||||
state 3
|
||||
type : REAL . (8)
|
||||
state 4
|
||||
type : INTEGER . (8)
|
||||
|
||||
. reduce 8
|
||||
|
||||
|
||||
state 4
|
||||
type : INTEGER . (9)
|
||||
|
||||
. reduce 9
|
||||
|
||||
|
||||
state 5
|
||||
$accept : declaration . $end (0)
|
||||
|
||||
@ -76,12 +73,13 @@ state 6
|
||||
|
||||
|
||||
state 7
|
||||
declaration : type . $$3 locnamelist (5)
|
||||
$$3 : . (4)
|
||||
declaration : type . locnamelist (4)
|
||||
|
||||
. reduce 4
|
||||
NAME shift 9
|
||||
. error
|
||||
|
||||
$$3 goto 9
|
||||
namelist goto 10
|
||||
locnamelist goto 11
|
||||
|
||||
|
||||
state 8
|
||||
@ -90,20 +88,30 @@ state 8
|
||||
|
||||
. reduce 1
|
||||
|
||||
$$1 goto 10
|
||||
$$1 goto 12
|
||||
|
||||
|
||||
state 9
|
||||
declaration : type $$3 . locnamelist (5)
|
||||
namelist : NAME . (10)
|
||||
|
||||
NAME shift 11
|
||||
. error
|
||||
|
||||
namelist goto 12
|
||||
locnamelist goto 13
|
||||
. reduce 10
|
||||
|
||||
|
||||
state 10
|
||||
namelist : namelist . NAME (9)
|
||||
locnamelist : namelist . (11)
|
||||
|
||||
NAME shift 13
|
||||
$end reduce 11
|
||||
|
||||
|
||||
state 11
|
||||
declaration : type locnamelist . (4)
|
||||
|
||||
. reduce 4
|
||||
|
||||
|
||||
state 12
|
||||
declaration : class type $$1 . $$2 namelist (3)
|
||||
$$2 : . (2)
|
||||
|
||||
@ -112,51 +120,31 @@ state 10
|
||||
$$2 goto 14
|
||||
|
||||
|
||||
state 11
|
||||
namelist : NAME . (11)
|
||||
|
||||
. reduce 11
|
||||
|
||||
|
||||
state 12
|
||||
namelist : namelist . NAME (10)
|
||||
locnamelist : namelist . (12)
|
||||
|
||||
NAME shift 15
|
||||
$end reduce 12
|
||||
|
||||
|
||||
state 13
|
||||
declaration : type $$3 locnamelist . (5)
|
||||
namelist : namelist NAME . (9)
|
||||
|
||||
. reduce 5
|
||||
. reduce 9
|
||||
|
||||
|
||||
state 14
|
||||
declaration : class type $$1 $$2 . namelist (3)
|
||||
|
||||
NAME shift 11
|
||||
NAME shift 9
|
||||
. error
|
||||
|
||||
namelist goto 16
|
||||
namelist goto 15
|
||||
|
||||
|
||||
state 15
|
||||
namelist : namelist NAME . (10)
|
||||
|
||||
. reduce 10
|
||||
|
||||
|
||||
state 16
|
||||
declaration : class type $$1 $$2 namelist . (3)
|
||||
namelist : namelist . NAME (10)
|
||||
namelist : namelist . NAME (9)
|
||||
|
||||
NAME shift 15
|
||||
NAME shift 13
|
||||
$end reduce 3
|
||||
|
||||
|
||||
7 terminals, 9 nonterminals
|
||||
13 grammar rules, 17 states
|
||||
7 terminals, 8 nonterminals
|
||||
12 grammar rules, 16 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
@ -175,4 +163,3 @@ symbol# value# symbol
|
||||
12 267 type
|
||||
13 268 $$1
|
||||
14 269 $$2
|
||||
15 270 $$3
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -144,13 +144,13 @@ extern symbol *mksymbol(type t, class c, name id);
|
||||
#define YYLEX_DECL() yylex(void)
|
||||
#define YYERROR_DECL() yyerror(const char *s)
|
||||
#endif
|
||||
#line 41 "err_inherit4.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#line 41 "err_inherit4.y"
|
||||
typedef union
|
||||
{
|
||||
class cval;
|
||||
@ -219,44 +219,44 @@ extern int YYPARSE_DECL();
|
||||
#define YYERRCODE 256
|
||||
typedef short YYINT;
|
||||
static const YYINT err_inherit4_lhs[] = { -1,
|
||||
5, 6, 0, 7, 0, 3, 3, 4, 4, 1,
|
||||
1, 2,
|
||||
5, 6, 0, 0, 3, 3, 4, 4, 1, 1,
|
||||
2,
|
||||
};
|
||||
static const YYINT err_inherit4_len[] = { 2,
|
||||
0, 0, 5, 0, 3, 1, 1, 1, 1, 2,
|
||||
1, 1,
|
||||
0, 0, 5, 2, 1, 1, 1, 1, 2, 1,
|
||||
1,
|
||||
};
|
||||
static const YYINT err_inherit4_defred[] = { 0,
|
||||
6, 7, 8, 9, 0, 0, 4, 1, 0, 2,
|
||||
11, 0, 5, 0, 10, 0,
|
||||
5, 6, 7, 8, 0, 0, 0, 1, 10, 0,
|
||||
4, 2, 9, 0, 0,
|
||||
};
|
||||
static const YYINT err_inherit4_stos[] = { 0,
|
||||
257, 258, 259, 260, 263, 266, 267, 267, 270, 268,
|
||||
261, 264, 265, 269, 261, 264,
|
||||
257, 258, 259, 260, 263, 266, 267, 267, 261, 264,
|
||||
265, 268, 261, 269, 264,
|
||||
};
|
||||
static const YYINT err_inherit4_dgoto[] = { 5,
|
||||
12, 13, 6, 7, 10, 14, 9,
|
||||
10, 11, 6, 7, 12, 14,
|
||||
};
|
||||
static const YYINT err_inherit4_sindex[] = { -257,
|
||||
0, 0, 0, 0, 0, -255, 0, 0, -254, 0,
|
||||
0, -253, 0, -254, 0, -253,
|
||||
0, 0, 0, 0, 0, -255, -254, 0, 0, -253,
|
||||
0, 0, 0, -254, -253,
|
||||
};
|
||||
static const YYINT err_inherit4_rindex[] = { 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 6, 0, 0, 0, 9,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
|
||||
0, 0, 0, 0, 9,
|
||||
};
|
||||
#if YYBTYACC
|
||||
static const YYINT err_inherit4_cindex[] = { 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
};
|
||||
#endif
|
||||
static const YYINT err_inherit4_gindex[] = { 0,
|
||||
-4, 0, 0, 5, 0, 0, 0,
|
||||
-4, 0, 0, 5, 0, 0,
|
||||
};
|
||||
#define YYTABLESIZE 11
|
||||
static const YYINT err_inherit4_table[] = { 1,
|
||||
2, 3, 4, 3, 4, 12, 11, 15, 3, 16,
|
||||
2, 3, 4, 3, 4, 11, 9, 13, 3, 15,
|
||||
8,
|
||||
};
|
||||
static const YYINT err_inherit4_check[] = { 257,
|
||||
@ -273,7 +273,7 @@ static const YYINT err_inherit4_ctable[] = { -1,
|
||||
#define YYDEBUG 0
|
||||
#endif
|
||||
#define YYMAXTOKEN 261
|
||||
#define YYUNDFTOKEN 271
|
||||
#define YYUNDFTOKEN 270
|
||||
#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
|
||||
#if YYDEBUG
|
||||
static const char *const err_inherit4_name[] = {
|
||||
@ -286,15 +286,14 @@ static const char *const err_inherit4_name[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","GLOBAL","LOCAL","REAL","INTEGER",
|
||||
"NAME","$accept","declaration","namelist","locnamelist","class","type","$$1",
|
||||
"$$2","$$3","illegal-symbol",
|
||||
"$$2","illegal-symbol",
|
||||
};
|
||||
static const char *const err_inherit4_rule[] = {
|
||||
"$accept : declaration",
|
||||
"$$1 :",
|
||||
"$$2 :",
|
||||
"declaration : class type $$1 $$2 namelist",
|
||||
"$$3 :",
|
||||
"declaration : type $$3 locnamelist",
|
||||
"declaration : type locnamelist",
|
||||
"class : GLOBAL",
|
||||
"class : LOCAL",
|
||||
"type : REAL",
|
||||
@ -366,9 +365,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -434,7 +433,7 @@ static short *yylexemes = 0;
|
||||
|
||||
extern int YYLEX_DECL();
|
||||
extern void YYERROR_DECL();
|
||||
#line 438 "err_inherit4.tab.c"
|
||||
#line 437 "err_inherit4.tab.c"
|
||||
|
||||
/* Release memory associated with symbol. */
|
||||
#if ! defined YYDESTRUCT_IS_DECLARED
|
||||
@ -447,17 +446,17 @@ YYDESTRUCT_DECL()
|
||||
#line 28 "err_inherit4.y"
|
||||
{ }
|
||||
break;
|
||||
#line 451 "err_inherit4.tab.c"
|
||||
#line 450 "err_inherit4.tab.c"
|
||||
case 264:
|
||||
#line 28 "err_inherit4.y"
|
||||
{ }
|
||||
break;
|
||||
#line 456 "err_inherit4.tab.c"
|
||||
#line 455 "err_inherit4.tab.c"
|
||||
case 265:
|
||||
#line 28 "err_inherit4.y"
|
||||
{ }
|
||||
break;
|
||||
#line 461 "err_inherit4.tab.c"
|
||||
#line 460 "err_inherit4.tab.c"
|
||||
}
|
||||
}
|
||||
#define YYDESTRUCT_IS_DECLARED 1
|
||||
@ -470,18 +469,18 @@ YYDESTRUCT_DECL()
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -495,7 +494,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -559,7 +558,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -619,6 +618,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -692,11 +693,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -755,7 +755,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -836,7 +836,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -882,9 +882,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -909,7 +918,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -925,7 +934,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -960,7 +969,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -982,7 +991,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1051,7 +1060,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1128,49 +1137,45 @@ yyval.tval = yystack.l_mark[-1].tval;
|
||||
break;
|
||||
case 3:
|
||||
#line 53 "err_inherit4.y"
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; }
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; yyloc = yystack.p_mark[0]; }
|
||||
break;
|
||||
case 4:
|
||||
#line 54 "err_inherit4.y"
|
||||
yyval.tval = yystack.l_mark[0].tval;
|
||||
#line 55 "err_inherit4.y"
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; yyloc = yystack.p_mark[-3]; }
|
||||
break;
|
||||
case 5:
|
||||
#line 55 "err_inherit4.y"
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; }
|
||||
break;
|
||||
case 6:
|
||||
#line 58 "err_inherit4.y"
|
||||
{ yyval.cval = cGLOBAL; }
|
||||
break;
|
||||
case 7:
|
||||
case 6:
|
||||
#line 59 "err_inherit4.y"
|
||||
{ yyval.cval = cLOCAL; }
|
||||
break;
|
||||
case 8:
|
||||
case 7:
|
||||
#line 62 "err_inherit4.y"
|
||||
{ yyval.tval = tREAL; }
|
||||
break;
|
||||
case 9:
|
||||
case 8:
|
||||
#line 63 "err_inherit4.y"
|
||||
{ yyval.tval = tINTEGER; }
|
||||
break;
|
||||
case 10:
|
||||
case 9:
|
||||
#line 67 "err_inherit4.y"
|
||||
{ yyval.nlist->s = mksymbol(yystack.l_mark[-2].tval, yystack.l_mark[-3].cval, yystack.l_mark[0].id);
|
||||
yyval.nlist->next = yystack.l_mark[-1].nlist;
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
case 10:
|
||||
#line 71 "err_inherit4.y"
|
||||
{ yyval.nlist->s = mksymbol(yystack.l_mark[-1].tval, yystack.l_mark[-2].cval, yystack.l_mark[0].id);
|
||||
yyval.nlist->next = NULL;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
case 11:
|
||||
#line 77 "err_inherit4.y"
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; yyloc = yystack.p_mark[1]; }
|
||||
break;
|
||||
#line 1174 "err_inherit4.tab.c"
|
||||
#line 1179 "err_inherit4.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1258,12 +1263,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1290,7 +1294,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1325,7 +1329,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -277,9 +277,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -372,18 +372,18 @@ yyerror(const char* s)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -397,7 +397,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -461,7 +461,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -521,6 +521,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -594,11 +596,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -657,7 +658,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -738,7 +739,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -784,9 +785,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -811,7 +821,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -827,7 +837,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -862,7 +872,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -884,7 +894,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -953,7 +963,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1107,12 +1117,11 @@ yyreduce:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1139,7 +1148,7 @@ yyreduce:
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1174,7 +1183,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -283,9 +283,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -378,18 +378,18 @@ yyerror(const char* s)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -403,7 +403,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -467,7 +467,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -527,6 +527,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -600,11 +602,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -663,7 +664,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -744,7 +745,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -790,9 +791,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -817,7 +827,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -833,7 +843,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -868,7 +878,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -890,7 +900,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -959,7 +969,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1113,12 +1123,11 @@ yyreduce:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1145,7 +1154,7 @@ yyreduce:
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1180,7 +1189,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -289,9 +289,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -384,18 +384,18 @@ yyerror(const char* s)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -409,7 +409,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -473,7 +473,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -533,6 +533,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -606,11 +608,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -669,7 +670,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -750,7 +751,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -796,9 +797,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -823,7 +833,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -839,7 +849,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -874,7 +884,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -896,7 +906,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -965,7 +975,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1119,12 +1129,11 @@ yyreduce:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1151,7 +1160,7 @@ yyreduce:
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1186,7 +1195,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -286,9 +286,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -381,18 +381,18 @@ yyerror(const char* s)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -406,7 +406,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -470,7 +470,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -530,6 +530,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -603,11 +605,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -666,7 +667,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -747,7 +748,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -793,9 +794,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -820,7 +830,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -836,7 +846,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -871,7 +881,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -893,7 +903,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -962,7 +972,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1033,7 +1043,7 @@ case 1:
|
||||
#line 9 "err_syntax18.y"
|
||||
{ yyval = yystack.l_mark[1]; }
|
||||
break;
|
||||
#line 1037 "err_syntax18.tab.c"
|
||||
#line 1047 "err_syntax18.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1121,12 +1131,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1153,7 +1162,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1188,7 +1197,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -281,9 +281,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -376,18 +376,18 @@ yyerror(const char* s)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -401,7 +401,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -465,7 +465,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -525,6 +525,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -598,11 +600,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -661,7 +662,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -742,7 +743,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -788,9 +789,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -815,7 +825,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -831,7 +841,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -866,7 +876,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -888,7 +898,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -957,7 +967,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1028,7 +1038,7 @@ case 1:
|
||||
#line 12 "err_syntax20.y"
|
||||
{ yystack.l_mark[-1].rechk = 3; }
|
||||
break;
|
||||
#line 1032 "err_syntax20.tab.c"
|
||||
#line 1042 "err_syntax20.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1116,12 +1126,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1148,7 +1157,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1183,7 +1192,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,2 +1,2 @@
|
||||
YACC: w - line 21 of "./err_syntax24.y", the default action assigns an undefined value to $$
|
||||
YACC: w - line 21 of "./err_syntax24.y", the default action for expr assigns an undefined value to $$
|
||||
YACC: e - line 22 of "./err_syntax24.y", $$ is untyped
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -282,9 +282,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -377,18 +377,18 @@ yyerror(const char* s)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -402,7 +402,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -466,7 +466,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -526,6 +526,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -599,11 +601,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -662,7 +663,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -743,7 +744,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -789,9 +790,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -816,7 +826,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -832,7 +842,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -867,7 +877,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -889,7 +899,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -958,7 +968,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1112,12 +1122,11 @@ yyreduce:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1144,7 +1153,7 @@ yyreduce:
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1179,7 +1188,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -1106,9 +1106,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1350,18 +1350,18 @@ free_parser(void)
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -1375,7 +1375,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -1439,7 +1439,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -1499,6 +1499,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -1572,11 +1574,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -1635,7 +1636,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1716,7 +1717,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -1762,9 +1763,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -1789,7 +1799,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1805,7 +1815,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1840,7 +1850,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -1862,7 +1872,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1931,7 +1941,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -2672,7 +2682,7 @@ case 114:
|
||||
yyval.declarator->func_def = FUNC_ANSI;
|
||||
}
|
||||
break;
|
||||
#line 2676 "grammar.tab.c"
|
||||
#line 2686 "grammar.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2760,12 +2770,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -2792,7 +2801,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -2827,7 +2836,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -319,9 +319,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -396,18 +396,18 @@ extern void YYERROR_DECL();
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -421,7 +421,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -485,7 +485,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -545,6 +545,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -618,11 +620,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -681,7 +682,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -762,7 +763,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -808,9 +809,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -835,7 +845,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -851,7 +861,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -886,7 +896,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -908,7 +918,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -977,7 +987,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1088,7 +1098,7 @@ case 11:
|
||||
#line 43 "inherit0.y"
|
||||
{ yyval = yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1092 "inherit0.tab.c"
|
||||
#line 1102 "inherit0.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1176,12 +1186,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1208,7 +1217,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1243,7 +1252,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -138,13 +138,13 @@ extern symbol *mksymbol(type t, class c, name id);
|
||||
extern int YYLEX_DECL();
|
||||
extern void YYERROR_DECL();
|
||||
#endif
|
||||
#line 32 "inherit1.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#line 32 "inherit1.y"
|
||||
typedef union
|
||||
{
|
||||
class cval;
|
||||
@ -340,9 +340,9 @@ do \
|
||||
|
||||
typedef struct {
|
||||
unsigned stacksize;
|
||||
short *s_base;
|
||||
short *s_mark;
|
||||
short *s_last;
|
||||
YYINT *s_base;
|
||||
YYINT *s_mark;
|
||||
YYINT *s_last;
|
||||
YYSTYPE *l_base;
|
||||
YYSTYPE *l_mark;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -417,18 +417,18 @@ extern void YYERROR_DECL();
|
||||
#endif /* YYBTYACC */
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
#include <string.h> /* needed for memset */
|
||||
|
||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
||||
static int yygrowstack(YYSTACKDATA *data)
|
||||
{
|
||||
int i;
|
||||
unsigned newsize;
|
||||
short *newss;
|
||||
YYINT *newss;
|
||||
YYSTYPE *newvs;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
YYLTYPE *newps;
|
||||
@ -442,7 +442,7 @@ static int yygrowstack(YYSTACKDATA *data)
|
||||
newsize = YYMAXDEPTH;
|
||||
|
||||
i = (int) (data->s_mark - data->s_base);
|
||||
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
|
||||
if (newss == 0)
|
||||
return YYENOMEM;
|
||||
|
||||
@ -506,7 +506,7 @@ yyNewState(unsigned size)
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
p->yystack.s_base = (short *) malloc(size * sizeof(short));
|
||||
p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
|
||||
if (p->yystack.s_base == NULL) return NULL;
|
||||
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
|
||||
if (p->yystack.l_base == NULL) return NULL;
|
||||
@ -566,6 +566,8 @@ YYPARSE_DECL()
|
||||
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
|
||||
yyps->save = 0;
|
||||
#endif /* YYBTYACC */
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -639,11 +641,10 @@ yyloop:
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
#ifdef YYSTYPE_TOSTRING
|
||||
@ -702,7 +703,7 @@ yyloop:
|
||||
save->state = yystate;
|
||||
save->errflag = yyerrflag;
|
||||
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -783,7 +784,7 @@ yyloop:
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
goto yyoverflow;
|
||||
yystate = yyctable[ctry];
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yylloc;
|
||||
@ -829,9 +830,18 @@ yyloop:
|
||||
|
||||
yynewerrflag = 1;
|
||||
goto yyerrhandler;
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
|
||||
yyerrlab:
|
||||
/* explicit YYERROR from an action -- pop the rhs of the rule reduced
|
||||
* before looking for error recovery */
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
yystack.l_mark -= yym;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
yystack.p_mark -= yym;
|
||||
#endif
|
||||
|
||||
yynewerrflag = 0;
|
||||
yyerrhandler:
|
||||
while (yyps->save)
|
||||
@ -856,7 +866,7 @@ yyerrhandler:
|
||||
yyerrctx->state = yystate;
|
||||
yyerrctx->errflag = yyerrflag;
|
||||
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
|
||||
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -872,7 +882,7 @@ yyerrhandler:
|
||||
yylexp = yylexemes + save->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
|
||||
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -907,7 +917,7 @@ yyerrhandler:
|
||||
yylloc = yylpp[-1];
|
||||
#endif
|
||||
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
|
||||
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
@ -929,7 +939,7 @@ yyerrhandler:
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -998,7 +1008,7 @@ yyinrecovery:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, yystate, yychar, yys);
|
||||
}
|
||||
@ -1113,7 +1123,7 @@ case 11:
|
||||
#line 71 "inherit1.y"
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; }
|
||||
break;
|
||||
#line 1117 "inherit1.tab.c"
|
||||
#line 1127 "inherit1.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1201,12 +1211,11 @@ break;
|
||||
} while (0);
|
||||
#endif /* YYBTYACC */
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
/* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
|
||||
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
@ -1233,7 +1242,7 @@ break;
|
||||
}
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (short) yystate;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
*++yystack.p_mark = yyloc;
|
||||
@ -1268,7 +1277,7 @@ yyvalid:
|
||||
yylexp = yylexemes + yypath->lexeme;
|
||||
yychar = YYEMPTY;
|
||||
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
|
||||
memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
|
||||
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
|
||||
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user