Import byacc 20160606.
This commit is contained in:
parent
7118255f50
commit
710e7be2e2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/byacc/dist/; revision=306687 svn path=/vendor/byacc/20160606/; revision=306688; tag=vendor/byacc/20160606
79
CHANGES
79
CHANGES
@ -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
|
||||
|
2
MANIFEST
2
MANIFEST
@ -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
|
||||
|
19
aclocal.m4
vendored
19
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 ---------------------------------------------------------------------------
|
||||
|
65
btyaccpar.c
65
btyaccpar.c
@ -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;
|
||||
|
4
defs.h
4
defs.h
@ -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);
|
||||
|
9
error.c
9
error.c
@ -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
|
||||
|
30
lalr.c
30
lalr.c
@ -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;
|
||||
|
16
lr0.c
16
lr0.c
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
10
mkpar.c
10
mkpar.c
@ -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
|
||||
|
45
output.c
45
output.c
@ -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/
|
||||
|
230
reader.c
230
reader.c
@ -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,6 +389,7 @@ keyword(void)
|
||||
return (NONASSOC);
|
||||
}
|
||||
syntax_error(lineno, line, t_cptr);
|
||||
/*NOTREACHED */
|
||||
}
|
||||
|
||||
static void
|
||||
@ -446,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);
|
||||
}
|
||||
}
|
||||
@ -494,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);
|
||||
}
|
||||
}
|
||||
@ -515,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)
|
||||
@ -602,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;
|
||||
@ -621,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;
|
||||
|
||||
@ -857,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;
|
||||
@ -992,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;
|
||||
|
||||
@ -1186,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);
|
||||
}
|
||||
@ -1317,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;
|
||||
}
|
||||
|
||||
@ -1325,6 +1329,7 @@ declare_tokens(int assoc)
|
||||
if (c == EOF)
|
||||
unexpected_EOF();
|
||||
|
||||
value = UNDEFINED;
|
||||
if (isdigit(c))
|
||||
{
|
||||
value = get_number();
|
||||
@ -1429,7 +1434,7 @@ static void
|
||||
declare_types(void)
|
||||
{
|
||||
int c;
|
||||
bucket *bp;
|
||||
bucket *bp = NULL;
|
||||
char *tag = NULL;
|
||||
|
||||
c = nextc();
|
||||
@ -1749,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);
|
||||
@ -1831,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;
|
||||
|
||||
@ -1883,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)
|
||||
@ -1910,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
|
||||
{
|
||||
@ -1961,7 +2050,7 @@ clean_arg_cache(void)
|
||||
arg_cache[i] = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* defined(YYBTYACC) */
|
||||
|
||||
static void
|
||||
advance_to_start(void)
|
||||
@ -2060,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;
|
||||
@ -2093,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;
|
||||
@ -2124,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
|
||||
@ -2201,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);
|
||||
}
|
||||
@ -2223,7 +2333,6 @@ copy_action(void)
|
||||
int i, j, n;
|
||||
int depth;
|
||||
#if defined(YYBTYACC)
|
||||
int trialaction = 0;
|
||||
int haveyyval = 0;
|
||||
#endif
|
||||
char *tag;
|
||||
@ -2237,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)
|
||||
@ -2277,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2336,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;
|
||||
}
|
||||
@ -2450,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 == '$')
|
||||
@ -2510,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;
|
||||
@ -2553,7 +2670,7 @@ copy_action(void)
|
||||
}
|
||||
#endif
|
||||
fprintf(f, "\nbreak;\n");
|
||||
free(a_line);
|
||||
FREE(a_line);
|
||||
if (maxoffset > 0)
|
||||
FREE(offsets);
|
||||
return;
|
||||
@ -2896,6 +3013,7 @@ mark_symbol(void)
|
||||
else
|
||||
{
|
||||
syntax_error(lineno, line, cptr);
|
||||
/*NOTREACHED */
|
||||
}
|
||||
|
||||
if (rprec[nrules] != UNDEFINED && bp->prec != rprec[nrules])
|
||||
@ -3066,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);
|
||||
@ -3102,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)
|
||||
@ -3115,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)
|
||||
{
|
||||
@ -3126,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)
|
||||
{
|
||||
@ -3199,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)
|
||||
{
|
||||
@ -3209,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;
|
||||
@ -3296,7 +3414,7 @@ pack_grammar(void)
|
||||
}
|
||||
++j;
|
||||
}
|
||||
ritem[j] = (Value_t) - i;
|
||||
ritem[j] = (Value_t)-i;
|
||||
++j;
|
||||
if (rprec[i] == UNDEFINED)
|
||||
{
|
||||
@ -3454,7 +3572,7 @@ reader(void)
|
||||
|
||||
#ifdef NO_LEAKS
|
||||
static param *
|
||||
free_declarations(param * list)
|
||||
free_declarations(param *list)
|
||||
{
|
||||
while (list != 0)
|
||||
{
|
||||
|
6
skel2c
6
skel2c
@ -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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1253,7 +1263,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1097,7 +1107,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1097,7 +1107,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1097,7 +1107,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1092,7 +1102,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1236,7 +1246,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1105,7 +1115,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1110,7 +1120,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -963,7 +977,7 @@ YYPARSE_DECL()
|
||||
#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 @@ YYPARSE_DECL()
|
||||
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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -935,7 +947,7 @@ YYPARSE_DECL()
|
||||
#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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
}
|
||||
#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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -954,7 +964,7 @@ YYPARSE_DECL()
|
||||
#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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
}
|
||||
#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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1054,7 +1064,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1051,7 +1060,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -953,7 +963,7 @@ YYPARSE_DECL()
|
||||
#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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
}
|
||||
#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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -959,7 +969,7 @@ YYPARSE_DECL()
|
||||
#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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
}
|
||||
#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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -965,7 +975,7 @@ YYPARSE_DECL()
|
||||
#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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
}
|
||||
#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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -962,7 +972,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -957,7 +967,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -958,7 +968,7 @@ YYPARSE_DECL()
|
||||
#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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
}
|
||||
#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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1931,7 +1941,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -977,7 +987,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -998,7 +1008,7 @@ YYPARSE_DECL()
|
||||
#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 @@ break;
|
||||
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,23 +5,20 @@
|
||||
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
|
||||
11 $$3 :
|
||||
|
||||
10 namelist : namelist NAME
|
||||
11 | NAME
|
||||
|
||||
12 $$4 :
|
||||
|
||||
13 locnamelist : $$4 $$2 namelist
|
||||
12 locnamelist : $$3 $$2 namelist
|
||||
|
||||
state 0
|
||||
$accept : . declaration $end (0)
|
||||
@ -38,29 +35,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)
|
||||
|
||||
@ -78,12 +75,13 @@ state 6
|
||||
|
||||
|
||||
state 7
|
||||
declaration : type . $$3 locnamelist (5)
|
||||
$$3 : . (4)
|
||||
declaration : type . locnamelist (4)
|
||||
$$3 : . (11)
|
||||
|
||||
. reduce 4
|
||||
. reduce 11
|
||||
|
||||
$$3 goto 9
|
||||
locnamelist goto 9
|
||||
$$3 goto 10
|
||||
|
||||
|
||||
state 8
|
||||
@ -92,20 +90,25 @@ state 8
|
||||
|
||||
. reduce 1
|
||||
|
||||
$$1 goto 10
|
||||
$$1 goto 11
|
||||
|
||||
|
||||
state 9
|
||||
declaration : type $$3 . locnamelist (5)
|
||||
$$4 : . (12)
|
||||
declaration : type locnamelist . (4)
|
||||
|
||||
. reduce 12
|
||||
|
||||
locnamelist goto 11
|
||||
$$4 goto 12
|
||||
. reduce 4
|
||||
|
||||
|
||||
state 10
|
||||
locnamelist : $$3 . $$2 namelist (12)
|
||||
$$2 : . (2)
|
||||
|
||||
. reduce 2
|
||||
|
||||
$$2 goto 12
|
||||
|
||||
|
||||
state 11
|
||||
declaration : class type $$1 . $$2 namelist (3)
|
||||
$$2 : . (2)
|
||||
|
||||
@ -114,69 +117,54 @@ state 10
|
||||
$$2 goto 13
|
||||
|
||||
|
||||
state 11
|
||||
declaration : type $$3 locnamelist . (5)
|
||||
|
||||
. reduce 5
|
||||
|
||||
|
||||
state 12
|
||||
locnamelist : $$4 . $$2 namelist (13)
|
||||
$$2 : . (2)
|
||||
locnamelist : $$3 $$2 . namelist (12)
|
||||
|
||||
. reduce 2
|
||||
NAME shift 14
|
||||
. error
|
||||
|
||||
$$2 goto 14
|
||||
namelist goto 15
|
||||
|
||||
|
||||
state 13
|
||||
declaration : class type $$1 $$2 . namelist (3)
|
||||
|
||||
NAME shift 15
|
||||
NAME shift 14
|
||||
. error
|
||||
|
||||
namelist goto 16
|
||||
|
||||
|
||||
state 14
|
||||
locnamelist : $$4 $$2 . namelist (13)
|
||||
|
||||
NAME shift 15
|
||||
. error
|
||||
|
||||
namelist goto 17
|
||||
|
||||
|
||||
state 15
|
||||
namelist : NAME . (11)
|
||||
|
||||
. reduce 11
|
||||
|
||||
|
||||
state 16
|
||||
declaration : class type $$1 $$2 namelist . (3)
|
||||
namelist : namelist . NAME (10)
|
||||
|
||||
NAME shift 18
|
||||
$end reduce 3
|
||||
|
||||
|
||||
state 17
|
||||
namelist : namelist . NAME (10)
|
||||
locnamelist : $$4 $$2 namelist . (13)
|
||||
|
||||
NAME shift 18
|
||||
$end reduce 13
|
||||
|
||||
|
||||
state 18
|
||||
namelist : namelist NAME . (10)
|
||||
namelist : NAME . (10)
|
||||
|
||||
. reduce 10
|
||||
|
||||
|
||||
7 terminals, 10 nonterminals
|
||||
14 grammar rules, 19 states
|
||||
state 15
|
||||
namelist : namelist . NAME (9)
|
||||
locnamelist : $$3 $$2 namelist . (12)
|
||||
|
||||
NAME shift 17
|
||||
$end reduce 12
|
||||
|
||||
|
||||
state 16
|
||||
declaration : class type $$1 $$2 namelist . (3)
|
||||
namelist : namelist . NAME (9)
|
||||
|
||||
NAME shift 17
|
||||
$end reduce 3
|
||||
|
||||
|
||||
state 17
|
||||
namelist : namelist NAME . (9)
|
||||
|
||||
. reduce 9
|
||||
|
||||
|
||||
7 terminals, 9 nonterminals
|
||||
13 grammar rules, 18 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
@ -196,4 +184,3 @@ symbol# value# symbol
|
||||
13 268 $$1
|
||||
14 269 $$2
|
||||
15 270 $$3
|
||||
16 271 $$4
|
||||
|
@ -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 "inherit2.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#line 39 "inherit2.y"
|
||||
typedef union
|
||||
{
|
||||
class cval;
|
||||
@ -199,54 +199,54 @@ extern int YYPARSE_DECL();
|
||||
#define YYERRCODE 256
|
||||
typedef short YYINT;
|
||||
static const YYINT inherit2_lhs[] = { -1,
|
||||
5, 6, 0, 7, 0, 3, 3, 4, 4, 1,
|
||||
1, 8, 2,
|
||||
5, 6, 0, 0, 3, 3, 4, 4, 1, 1,
|
||||
7, 2,
|
||||
};
|
||||
static const YYINT inherit2_len[] = { 2,
|
||||
0, 0, 5, 0, 3, 1, 1, 1, 1, 2,
|
||||
1, 0, 3,
|
||||
0, 0, 5, 2, 1, 1, 1, 1, 2, 1,
|
||||
0, 3,
|
||||
};
|
||||
static const YYINT inherit2_defred[] = { 0,
|
||||
6, 7, 8, 9, 0, 0, 4, 1, 12, 2,
|
||||
5, 2, 0, 0, 11, 0, 0, 10,
|
||||
5, 6, 7, 8, 0, 0, 11, 1, 4, 2,
|
||||
2, 0, 0, 10, 0, 0, 9,
|
||||
};
|
||||
static const YYINT inherit2_stos[] = { 0,
|
||||
257, 258, 259, 260, 263, 266, 267, 267, 270, 268,
|
||||
265, 271, 269, 269, 261, 264, 264, 261,
|
||||
257, 258, 259, 260, 263, 266, 267, 267, 265, 270,
|
||||
268, 269, 269, 261, 264, 264, 261,
|
||||
};
|
||||
static const YYINT inherit2_dgoto[] = { 5,
|
||||
16, 11, 6, 7, 10, 13, 9, 12,
|
||||
15, 9, 6, 7, 11, 12, 10,
|
||||
};
|
||||
static const YYINT inherit2_sindex[] = { -257,
|
||||
0, 0, 0, 0, 0, -255, 0, 0, 0, 0,
|
||||
0, 0, -254, -254, 0, -253, -253, 0,
|
||||
0, -254, -254, 0, -253, -253, 0,
|
||||
};
|
||||
static const YYINT inherit2_rindex[] = { 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 6, 9, 0,
|
||||
0, 0, 0, 0, 6, 9, 0,
|
||||
};
|
||||
#if YYBTYACC
|
||||
static const YYINT inherit2_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,
|
||||
};
|
||||
#endif
|
||||
static const YYINT inherit2_gindex[] = { 0,
|
||||
-4, 0, 0, 5, 0, 1, 0, 0,
|
||||
-3, 0, 0, 5, 0, 1, 0,
|
||||
};
|
||||
#define YYTABLESIZE 13
|
||||
#define YYTABLESIZE 12
|
||||
static const YYINT inherit2_table[] = { 1,
|
||||
2, 3, 4, 3, 4, 3, 15, 18, 13, 17,
|
||||
8, 0, 14,
|
||||
2, 3, 4, 3, 4, 12, 14, 17, 3, 16,
|
||||
8, 13,
|
||||
};
|
||||
static const YYINT inherit2_check[] = { 257,
|
||||
258, 259, 260, 259, 260, 0, 261, 261, 0, 14,
|
||||
6, -1, 12,
|
||||
258, 259, 260, 259, 260, 0, 261, 261, 0, 13,
|
||||
6, 11,
|
||||
};
|
||||
#if YYBTYACC
|
||||
static const YYINT inherit2_ctable[] = { -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1,
|
||||
-1,
|
||||
};
|
||||
#endif
|
||||
#define YYFINAL 5
|
||||
@ -254,7 +254,7 @@ static const YYINT inherit2_ctable[] = { -1,
|
||||
#define YYDEBUG 0
|
||||
#endif
|
||||
#define YYMAXTOKEN 261
|
||||
#define YYUNDFTOKEN 272
|
||||
#define YYUNDFTOKEN 271
|
||||
#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
|
||||
#if YYDEBUG
|
||||
static const char *const inherit2_name[] = {
|
||||
@ -267,23 +267,22 @@ static const char *const inherit2_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","illegal-symbol",
|
||||
"$$2","$$3","illegal-symbol",
|
||||
};
|
||||
static const char *const inherit2_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",
|
||||
"namelist : namelist NAME",
|
||||
"namelist : NAME",
|
||||
"$$4 :",
|
||||
"locnamelist : $$4 $$2 namelist",
|
||||
"$$3 :",
|
||||
"locnamelist : $$3 $$2 namelist",
|
||||
|
||||
};
|
||||
#endif
|
||||
@ -348,9 +347,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)
|
||||
@ -416,7 +415,7 @@ static short *yylexemes = 0;
|
||||
|
||||
extern int YYLEX_DECL();
|
||||
extern void YYERROR_DECL();
|
||||
#line 420 "inherit2.tab.c"
|
||||
#line 419 "inherit2.tab.c"
|
||||
|
||||
/* Release memory associated with symbol. */
|
||||
#if ! defined YYDESTRUCT_IS_DECLARED
|
||||
@ -436,7 +435,7 @@ YYDESTRUCT_DECL()
|
||||
}
|
||||
}
|
||||
break;
|
||||
#line 440 "inherit2.tab.c"
|
||||
#line 439 "inherit2.tab.c"
|
||||
case 264:
|
||||
#line 30 "inherit2.y"
|
||||
{
|
||||
@ -448,7 +447,7 @@ YYDESTRUCT_DECL()
|
||||
}
|
||||
}
|
||||
break;
|
||||
#line 452 "inherit2.tab.c"
|
||||
#line 451 "inherit2.tab.c"
|
||||
case 265:
|
||||
#line 30 "inherit2.y"
|
||||
{
|
||||
@ -460,7 +459,7 @@ YYDESTRUCT_DECL()
|
||||
}
|
||||
}
|
||||
break;
|
||||
#line 464 "inherit2.tab.c"
|
||||
#line 463 "inherit2.tab.c"
|
||||
}
|
||||
}
|
||||
#define YYDESTRUCT_IS_DECLARED 1
|
||||
@ -473,18 +472,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 +497,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 +561,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 +621,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 +696,10 @@ YYPARSE_DECL()
|
||||
} 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 +758,7 @@ YYPARSE_DECL()
|
||||
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 +839,7 @@ YYPARSE_DECL()
|
||||
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 +885,18 @@ YYPARSE_DECL()
|
||||
|
||||
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 +921,7 @@ YYPARSE_DECL()
|
||||
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 +937,7 @@ YYPARSE_DECL()
|
||||
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 +972,7 @@ YYPARSE_DECL()
|
||||
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 +994,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1054,7 +1063,7 @@ YYPARSE_DECL()
|
||||
#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,50 +1143,46 @@ case 3:
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; }
|
||||
break;
|
||||
case 4:
|
||||
#line 52 "inherit2.y"
|
||||
yyval.tval = yystack.l_mark[0].tval;
|
||||
break;
|
||||
case 5:
|
||||
#line 53 "inherit2.y"
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; }
|
||||
break;
|
||||
case 6:
|
||||
case 5:
|
||||
#line 56 "inherit2.y"
|
||||
{ yyval.cval = cGLOBAL; }
|
||||
break;
|
||||
case 7:
|
||||
case 6:
|
||||
#line 57 "inherit2.y"
|
||||
{ yyval.cval = cLOCAL; }
|
||||
break;
|
||||
case 8:
|
||||
case 7:
|
||||
#line 60 "inherit2.y"
|
||||
{ yyval.tval = tREAL; }
|
||||
break;
|
||||
case 9:
|
||||
case 8:
|
||||
#line 61 "inherit2.y"
|
||||
{ yyval.tval = tINTEGER; }
|
||||
break;
|
||||
case 10:
|
||||
case 9:
|
||||
#line 65 "inherit2.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 69 "inherit2.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 74 "inherit2.y"
|
||||
yyval.cval = cLOCAL;
|
||||
break;
|
||||
case 13:
|
||||
case 12:
|
||||
#line 75 "inherit2.y"
|
||||
{ yyval.nlist = yystack.l_mark[0].nlist; }
|
||||
break;
|
||||
#line 1181 "inherit2.tab.c"
|
||||
#line 1186 "inherit2.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1265,12 +1270,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
|
||||
@ -1297,7 +1301,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;
|
||||
@ -1332,7 +1336,7 @@ break;
|
||||
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
|
||||
@ -130,13 +130,13 @@ int YYLEX_DECL();
|
||||
static void YYERROR_DECL();
|
||||
#endif
|
||||
|
||||
#line 43 "ok_syntax1.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#line 43 "ok_syntax1.y"
|
||||
typedef union
|
||||
{
|
||||
char * cval;
|
||||
@ -417,9 +417,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)
|
||||
@ -502,18 +502,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;
|
||||
@ -527,7 +527,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;
|
||||
|
||||
@ -591,7 +591,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;
|
||||
@ -701,6 +701,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;
|
||||
@ -774,11 +776,10 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -837,7 +838,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -918,7 +919,7 @@ YYPARSE_DECL()
|
||||
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;
|
||||
@ -964,9 +965,18 @@ YYPARSE_DECL()
|
||||
|
||||
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)
|
||||
@ -991,7 +1001,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1007,7 +1017,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1042,7 +1052,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1064,7 +1074,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1133,7 +1143,7 @@ YYPARSE_DECL()
|
||||
#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);
|
||||
}
|
||||
@ -1260,7 +1270,7 @@ case 18:
|
||||
#line 101 "ok_syntax1.y"
|
||||
{ yyval.ival = (*base) * yystack.l_mark[-1].ival + yystack.l_mark[0].ival; }
|
||||
break;
|
||||
#line 1264 "ok_syntax1.tab.c"
|
||||
#line 1274 "ok_syntax1.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1348,12 +1358,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
|
||||
@ -1380,7 +1389,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;
|
||||
@ -1415,7 +1424,7 @@ break;
|
||||
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
|
||||
@ -397,9 +397,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)
|
||||
@ -475,18 +475,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;
|
||||
@ -500,7 +500,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;
|
||||
|
||||
@ -564,7 +564,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;
|
||||
@ -674,6 +674,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;
|
||||
@ -747,11 +749,10 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -810,7 +811,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -891,7 +892,7 @@ YYPARSE_DECL()
|
||||
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;
|
||||
@ -937,9 +938,18 @@ YYPARSE_DECL()
|
||||
|
||||
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)
|
||||
@ -964,7 +974,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -980,7 +990,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1015,7 +1025,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1037,7 +1047,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1106,7 +1116,7 @@ YYPARSE_DECL()
|
||||
#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);
|
||||
}
|
||||
@ -1233,7 +1243,7 @@ case 18:
|
||||
#line 69 "pure_calc.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1237 "pure_calc.tab.c"
|
||||
#line 1247 "pure_calc.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1321,12 +1331,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
|
||||
@ -1353,7 +1362,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;
|
||||
@ -1388,7 +1397,7 @@ break;
|
||||
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
|
||||
@ -285,9 +285,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)
|
||||
@ -343,18 +343,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;
|
||||
@ -368,7 +368,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;
|
||||
|
||||
@ -432,7 +432,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;
|
||||
@ -542,6 +542,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;
|
||||
@ -615,11 +617,10 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -678,7 +679,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -759,7 +760,7 @@ YYPARSE_DECL()
|
||||
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;
|
||||
@ -805,9 +806,18 @@ YYPARSE_DECL()
|
||||
|
||||
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)
|
||||
@ -832,7 +842,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -848,7 +858,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -883,7 +893,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -905,7 +915,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -974,7 +984,7 @@ YYPARSE_DECL()
|
||||
#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,12 +1138,11 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -1160,7 +1169,7 @@ YYPARSE_DECL()
|
||||
}
|
||||
#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;
|
||||
@ -1195,7 +1204,7 @@ YYPARSE_DECL()
|
||||
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
|
||||
@ -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)
|
||||
@ -529,18 +529,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;
|
||||
@ -554,7 +554,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;
|
||||
|
||||
@ -618,7 +618,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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1110,7 +1120,7 @@ YYPARSE_DECL()
|
||||
#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 70 "quote_calc.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1241 "quote_calc-s.tab.c"
|
||||
#line 1251 "quote_calc-s.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 @@ break;
|
||||
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
|
||||
@ -421,9 +421,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)
|
||||
@ -535,18 +535,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;
|
||||
@ -560,7 +560,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;
|
||||
|
||||
@ -624,7 +624,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;
|
||||
@ -684,6 +684,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;
|
||||
@ -757,11 +759,10 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -820,7 +821,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -901,7 +902,7 @@ YYPARSE_DECL()
|
||||
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;
|
||||
@ -947,9 +948,18 @@ YYPARSE_DECL()
|
||||
|
||||
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)
|
||||
@ -974,7 +984,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -990,7 +1000,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1025,7 +1035,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1047,7 +1057,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1116,7 +1126,7 @@ YYPARSE_DECL()
|
||||
#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);
|
||||
}
|
||||
@ -1243,7 +1253,7 @@ case 18:
|
||||
#line 70 "quote_calc.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1247 "quote_calc.tab.c"
|
||||
#line 1257 "quote_calc.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1331,12 +1341,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
|
||||
@ -1363,7 +1372,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;
|
||||
@ -1398,7 +1407,7 @@ break;
|
||||
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
|
||||
@ -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)
|
||||
@ -529,18 +529,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;
|
||||
@ -554,7 +554,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;
|
||||
|
||||
@ -618,7 +618,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 @@ YYPARSE_DECL()
|
||||
} 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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
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 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1110,7 +1120,7 @@ YYPARSE_DECL()
|
||||
#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 70 "quote_calc2.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1241 "quote_calc2-s.tab.c"
|
||||
#line 1251 "quote_calc2-s.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 @@ break;
|
||||
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
|
||||
@ -421,9 +421,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)
|
||||
@ -535,18 +535,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;
|
||||
@ -560,7 +560,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;
|
||||
|
||||
@ -624,7 +624,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;
|
||||
@ -684,6 +684,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;
|
||||
@ -757,11 +759,10 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -820,7 +821,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -901,7 +902,7 @@ YYPARSE_DECL()
|
||||
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;
|
||||
@ -947,9 +948,18 @@ YYPARSE_DECL()
|
||||
|
||||
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)
|
||||
@ -974,7 +984,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -990,7 +1000,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1025,7 +1035,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1047,7 +1057,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1116,7 +1126,7 @@ YYPARSE_DECL()
|
||||
#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);
|
||||
}
|
||||
@ -1243,7 +1253,7 @@ case 18:
|
||||
#line 70 "quote_calc2.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1247 "quote_calc2.tab.c"
|
||||
#line 1257 "quote_calc2.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1331,12 +1341,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
|
||||
@ -1363,7 +1372,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;
|
||||
@ -1398,7 +1407,7 @@ break;
|
||||
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
|
||||
@ -416,9 +416,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)
|
||||
@ -530,18 +530,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;
|
||||
@ -555,7 +555,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;
|
||||
|
||||
@ -619,7 +619,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;
|
||||
@ -679,6 +679,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;
|
||||
@ -752,11 +754,10 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -815,7 +816,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -896,7 +897,7 @@ YYPARSE_DECL()
|
||||
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;
|
||||
@ -942,9 +943,18 @@ YYPARSE_DECL()
|
||||
|
||||
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)
|
||||
@ -969,7 +979,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -985,7 +995,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1020,7 +1030,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1042,7 +1052,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1111,7 +1121,7 @@ YYPARSE_DECL()
|
||||
#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);
|
||||
}
|
||||
@ -1238,7 +1248,7 @@ case 18:
|
||||
#line 70 "quote_calc3.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1242 "quote_calc3-s.tab.c"
|
||||
#line 1252 "quote_calc3-s.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1326,12 +1336,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
|
||||
@ -1358,7 +1367,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;
|
||||
@ -1393,7 +1402,7 @@ break;
|
||||
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
|
||||
@ -416,9 +416,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)
|
||||
@ -530,18 +530,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;
|
||||
@ -555,7 +555,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;
|
||||
|
||||
@ -619,7 +619,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;
|
||||
@ -679,6 +679,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;
|
||||
@ -752,11 +754,10 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -815,7 +816,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -896,7 +897,7 @@ YYPARSE_DECL()
|
||||
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;
|
||||
@ -942,9 +943,18 @@ YYPARSE_DECL()
|
||||
|
||||
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)
|
||||
@ -969,7 +979,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -985,7 +995,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1020,7 +1030,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1042,7 +1052,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1111,7 +1121,7 @@ YYPARSE_DECL()
|
||||
#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);
|
||||
}
|
||||
@ -1238,7 +1248,7 @@ case 18:
|
||||
#line 70 "quote_calc3.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1242 "quote_calc3.tab.c"
|
||||
#line 1252 "quote_calc3.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1326,12 +1336,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
|
||||
@ -1358,7 +1367,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;
|
||||
@ -1393,7 +1402,7 @@ break;
|
||||
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
|
||||
@ -416,9 +416,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)
|
||||
@ -530,18 +530,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;
|
||||
@ -555,7 +555,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;
|
||||
|
||||
@ -619,7 +619,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;
|
||||
@ -679,6 +679,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;
|
||||
@ -752,11 +754,10 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -815,7 +816,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -896,7 +897,7 @@ YYPARSE_DECL()
|
||||
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;
|
||||
@ -942,9 +943,18 @@ YYPARSE_DECL()
|
||||
|
||||
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)
|
||||
@ -969,7 +979,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -985,7 +995,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1020,7 +1030,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1042,7 +1052,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1111,7 +1121,7 @@ YYPARSE_DECL()
|
||||
#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);
|
||||
}
|
||||
@ -1238,7 +1248,7 @@ case 18:
|
||||
#line 70 "quote_calc4.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1242 "quote_calc4-s.tab.c"
|
||||
#line 1252 "quote_calc4-s.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1326,12 +1336,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
|
||||
@ -1358,7 +1367,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;
|
||||
@ -1393,7 +1402,7 @@ break;
|
||||
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
|
||||
@ -416,9 +416,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)
|
||||
@ -530,18 +530,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;
|
||||
@ -555,7 +555,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;
|
||||
|
||||
@ -619,7 +619,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;
|
||||
@ -679,6 +679,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;
|
||||
@ -752,11 +754,10 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -815,7 +816,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -896,7 +897,7 @@ YYPARSE_DECL()
|
||||
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;
|
||||
@ -942,9 +943,18 @@ YYPARSE_DECL()
|
||||
|
||||
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)
|
||||
@ -969,7 +979,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -985,7 +995,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1020,7 +1030,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1042,7 +1052,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1111,7 +1121,7 @@ YYPARSE_DECL()
|
||||
#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);
|
||||
}
|
||||
@ -1238,7 +1248,7 @@ case 18:
|
||||
#line 70 "quote_calc4.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 1242 "quote_calc4.tab.c"
|
||||
#line 1252 "quote_calc4.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1326,12 +1336,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
|
||||
@ -1358,7 +1367,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;
|
||||
@ -1393,7 +1402,7 @@ break;
|
||||
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,9 +141,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)
|
||||
@ -240,18 +240,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;
|
||||
@ -265,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;
|
||||
|
||||
@ -329,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;
|
||||
@ -389,6 +389,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;
|
||||
@ -462,11 +464,10 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -525,7 +526,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -606,7 +607,7 @@ YYPARSE_DECL()
|
||||
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;
|
||||
@ -652,9 +653,18 @@ YYPARSE_DECL()
|
||||
|
||||
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)
|
||||
@ -679,7 +689,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -695,7 +705,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -730,7 +740,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -752,7 +762,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -821,7 +831,7 @@ YYPARSE_DECL()
|
||||
#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);
|
||||
}
|
||||
@ -975,12 +985,11 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -1007,7 +1016,7 @@ YYPARSE_DECL()
|
||||
}
|
||||
#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,7 +1051,7 @@ YYPARSE_DECL()
|
||||
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
|
||||
@ -144,13 +144,13 @@ int dcheck(INTERVAL);
|
||||
double dreg[26];
|
||||
INTERVAL vreg[26];
|
||||
|
||||
#line 32 "varsyntax_calc1.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#line 32 "varsyntax_calc1.y"
|
||||
typedef union
|
||||
{
|
||||
int ival; /* dreg & vreg array index values*/
|
||||
@ -452,9 +452,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)
|
||||
@ -656,18 +656,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;
|
||||
@ -681,7 +681,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;
|
||||
|
||||
@ -745,7 +745,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;
|
||||
@ -805,6 +805,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;
|
||||
@ -878,11 +880,10 @@ YYPARSE_DECL()
|
||||
} 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
|
||||
@ -941,7 +942,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1022,7 +1023,7 @@ YYPARSE_DECL()
|
||||
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;
|
||||
@ -1068,9 +1069,18 @@ YYPARSE_DECL()
|
||||
|
||||
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)
|
||||
@ -1095,7 +1105,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1111,7 +1121,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1146,7 +1156,7 @@ YYPARSE_DECL()
|
||||
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)
|
||||
@ -1168,7 +1178,7 @@ YYPARSE_DECL()
|
||||
#endif
|
||||
|
||||
#if !YYBTYACC
|
||||
goto yyerrlab;
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
#endif
|
||||
++yynerrs;
|
||||
@ -1237,7 +1247,7 @@ YYPARSE_DECL()
|
||||
#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);
|
||||
}
|
||||
@ -1467,7 +1477,7 @@ case 28:
|
||||
yyval.vval = yystack.l_mark[-1].vval;
|
||||
}
|
||||
break;
|
||||
#line 1471 "varsyntax_calc1.tab.c"
|
||||
#line 1481 "varsyntax_calc1.tab.c"
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1555,12 +1565,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
|
||||
@ -1587,7 +1596,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;
|
||||
@ -1622,7 +1631,7 @@ break;
|
||||
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,3 +1,5 @@
|
||||
%token-table
|
||||
|
||||
%{
|
||||
# include <stdio.h>
|
||||
# include <ctype.h>
|
||||
|
@ -50,9 +50,9 @@ extern symbol *mksymbol(type t, class c, name id);
|
||||
|
||||
%%
|
||||
declaration: class type namelist($1, $2)
|
||||
{ $$ = $3; }
|
||||
{ $$ = $3; @$ = @3; }
|
||||
| type locnamelist($1)
|
||||
{ $$ = $2; }
|
||||
{ $$ = $2; @$ = @-1; }
|
||||
;
|
||||
|
||||
class : GLOBAL { $$ = cGLOBAL; }
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# $Id: run_make.sh,v 1.14 2014/04/06 17:50:57 tom Exp $
|
||||
# $Id: run_make.sh,v 1.15 2016/06/01 22:56:37 Tom.Shields Exp $
|
||||
# vi:ts=4 sw=4:
|
||||
|
||||
# do a test-compile on each of the ".c" files in the test-directory
|
||||
@ -43,7 +43,8 @@ echo "** test-files in $REF_DIR"
|
||||
for input in ${REF_DIR}/*.c
|
||||
do
|
||||
case $input in #(vi
|
||||
${REF_DIR}/err_*)
|
||||
${REF_DIR}/err_*|\
|
||||
${REF_DIR}/test-err_*)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
@ -72,11 +73,17 @@ then
|
||||
do
|
||||
test -f "$input" || continue
|
||||
case $input in
|
||||
${TEST_DIR}/err_*)
|
||||
${TEST_DIR}/err_*|\
|
||||
${TEST_DIR}/test-err_*)
|
||||
continue
|
||||
;;
|
||||
${TEST_DIR}/ok_syntax*|\
|
||||
${TEST_DIR}/varsyntax*)
|
||||
# Bison does not support all byacc legacy syntax
|
||||
continue
|
||||
;;
|
||||
${TEST_DIR}/btyacc_*)
|
||||
# Bison does not support the btyacc []-action extension.
|
||||
# Bison does not support the btyacc []-action & inherited attribute extensions.
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
@ -99,7 +106,7 @@ then
|
||||
|
||||
sed -e '/^%expect/s,%expect.*,,' $input >>run_make.y
|
||||
|
||||
bison -y run_make.y
|
||||
bison -Wno-other -Wno-conflicts-sr -Wconflicts-rr -y run_make.y
|
||||
if test -f "y.tab.c"
|
||||
then
|
||||
sed -e '/^#line/s,"run_make.y","'$input'",' y.tab.c >run_make.c
|
||||
|
@ -353,7 +353,7 @@ yylex(void)
|
||||
#line 354 "calc.tab.c"
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
@ -425,6 +425,8 @@ YYPARSE_DECL()
|
||||
}
|
||||
#endif
|
||||
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -444,28 +446,26 @@ YYPARSE_DECL()
|
||||
if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = YYLEX) < 0) yychar = YYEOF;
|
||||
yychar = YYLEX;
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, reading %d (%s)\n",
|
||||
YYPREFIX, yystate, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("%sdebug: state %d, shifting to state %d\n",
|
||||
YYPREFIX, yystate, yytable[yyn]);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
yystate = yytable[yyn];
|
||||
*++yystack.s_mark = yytable[yyn];
|
||||
*++yystack.l_mark = yylval;
|
||||
@ -473,18 +473,17 @@ YYPARSE_DECL()
|
||||
if (yyerrflag > 0) --yyerrflag;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
|
||||
{
|
||||
yyn = yytable[yyn];
|
||||
goto yyreduce;
|
||||
}
|
||||
if (yyerrflag) goto yyinrecovery;
|
||||
if (yyerrflag != 0) goto yyinrecovery;
|
||||
|
||||
YYERROR_CALL("syntax error");
|
||||
|
||||
goto yyerrlab;
|
||||
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
++yynerrs;
|
||||
|
||||
@ -494,18 +493,15 @@ YYPARSE_DECL()
|
||||
yyerrflag = 3;
|
||||
for (;;)
|
||||
{
|
||||
if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
|
||||
if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("%sdebug: state %d, error recovery shifting\
|
||||
to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
yystate = yytable[yyn];
|
||||
*++yystack.s_mark = yytable[yyn];
|
||||
*++yystack.l_mark = yylval;
|
||||
@ -530,7 +526,7 @@ YYPARSE_DECL()
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
|
||||
YYPREFIX, yystate, yychar, yys);
|
||||
}
|
||||
@ -546,10 +542,11 @@ YYPARSE_DECL()
|
||||
YYPREFIX, yystate, yyn, yyrule[yyn]);
|
||||
#endif
|
||||
yym = yylen[yyn];
|
||||
if (yym)
|
||||
if (yym > 0)
|
||||
yyval = yystack.l_mark[1-yym];
|
||||
else
|
||||
memset(&yyval, 0, sizeof yyval);
|
||||
|
||||
switch (yyn)
|
||||
{
|
||||
case 3:
|
||||
@ -612,7 +609,7 @@ case 18:
|
||||
#line 63 "calc.y"
|
||||
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 616 "calc.tab.c"
|
||||
#line 613 "calc.tab.c"
|
||||
}
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
@ -630,11 +627,12 @@ break;
|
||||
*++yystack.l_mark = yyval;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = YYLEX) < 0) yychar = YYEOF;
|
||||
yychar = YYLEX;
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, reading %d (%s)\n",
|
||||
YYPREFIX, YYFINAL, yychar, yys);
|
||||
}
|
||||
@ -643,8 +641,8 @@ break;
|
||||
if (yychar == YYEOF) goto yyaccept;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
|
||||
if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
|
||||
yystate = yytable[yyn];
|
||||
else
|
||||
yystate = yydgoto[yym];
|
||||
@ -653,10 +651,7 @@ break;
|
||||
printf("%sdebug: after reduction, shifting from state %d \
|
||||
to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
goto yyloop;
|
||||
|
@ -123,13 +123,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;
|
||||
@ -490,7 +490,7 @@ vdiv(double a, double b, INTERVAL v)
|
||||
#line 491 "calc1.tab.c"
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
@ -562,6 +562,8 @@ YYPARSE_DECL()
|
||||
}
|
||||
#endif
|
||||
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -581,28 +583,26 @@ YYPARSE_DECL()
|
||||
if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = YYLEX) < 0) yychar = YYEOF;
|
||||
yychar = YYLEX;
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, reading %d (%s)\n",
|
||||
YYPREFIX, yystate, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("%sdebug: state %d, shifting to state %d\n",
|
||||
YYPREFIX, yystate, yytable[yyn]);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
yystate = yytable[yyn];
|
||||
*++yystack.s_mark = yytable[yyn];
|
||||
*++yystack.l_mark = yylval;
|
||||
@ -610,18 +610,17 @@ YYPARSE_DECL()
|
||||
if (yyerrflag > 0) --yyerrflag;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
|
||||
{
|
||||
yyn = yytable[yyn];
|
||||
goto yyreduce;
|
||||
}
|
||||
if (yyerrflag) goto yyinrecovery;
|
||||
if (yyerrflag != 0) goto yyinrecovery;
|
||||
|
||||
YYERROR_CALL("syntax error");
|
||||
|
||||
goto yyerrlab;
|
||||
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
++yynerrs;
|
||||
|
||||
@ -631,18 +630,15 @@ YYPARSE_DECL()
|
||||
yyerrflag = 3;
|
||||
for (;;)
|
||||
{
|
||||
if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
|
||||
if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("%sdebug: state %d, error recovery shifting\
|
||||
to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
yystate = yytable[yyn];
|
||||
*++yystack.s_mark = yytable[yyn];
|
||||
*++yystack.l_mark = yylval;
|
||||
@ -667,7 +663,7 @@ YYPARSE_DECL()
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
|
||||
YYPREFIX, yystate, yychar, yys);
|
||||
}
|
||||
@ -683,10 +679,11 @@ YYPARSE_DECL()
|
||||
YYPREFIX, yystate, yyn, yyrule[yyn]);
|
||||
#endif
|
||||
yym = yylen[yyn];
|
||||
if (yym)
|
||||
if (yym > 0)
|
||||
yyval = yystack.l_mark[1-yym];
|
||||
else
|
||||
memset(&yyval, 0, sizeof yyval);
|
||||
|
||||
switch (yyn)
|
||||
{
|
||||
case 3:
|
||||
@ -852,7 +849,7 @@ case 28:
|
||||
yyval.vval = yystack.l_mark[-1].vval;
|
||||
}
|
||||
break;
|
||||
#line 856 "calc1.tab.c"
|
||||
#line 853 "calc1.tab.c"
|
||||
}
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
@ -870,11 +867,12 @@ break;
|
||||
*++yystack.l_mark = yyval;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = YYLEX) < 0) yychar = YYEOF;
|
||||
yychar = YYLEX;
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, reading %d (%s)\n",
|
||||
YYPREFIX, YYFINAL, yychar, yys);
|
||||
}
|
||||
@ -883,8 +881,8 @@ break;
|
||||
if (yychar == YYEOF) goto yyaccept;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
|
||||
if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
|
||||
yystate = yytable[yyn];
|
||||
else
|
||||
yystate = yydgoto[yym];
|
||||
@ -893,10 +891,7 @@ break;
|
||||
printf("%sdebug: after reduction, shifting from state %d \
|
||||
to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
goto yyloop;
|
||||
|
@ -366,7 +366,7 @@ YYLEX_DECL()
|
||||
#line 367 "calc2.tab.c"
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
@ -438,6 +438,8 @@ YYPARSE_DECL()
|
||||
}
|
||||
#endif
|
||||
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -457,28 +459,26 @@ YYPARSE_DECL()
|
||||
if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = YYLEX) < 0) yychar = YYEOF;
|
||||
yychar = YYLEX;
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, reading %d (%s)\n",
|
||||
YYPREFIX, yystate, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("%sdebug: state %d, shifting to state %d\n",
|
||||
YYPREFIX, yystate, yytable[yyn]);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
yystate = yytable[yyn];
|
||||
*++yystack.s_mark = yytable[yyn];
|
||||
*++yystack.l_mark = yylval;
|
||||
@ -486,18 +486,17 @@ YYPARSE_DECL()
|
||||
if (yyerrflag > 0) --yyerrflag;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
|
||||
{
|
||||
yyn = yytable[yyn];
|
||||
goto yyreduce;
|
||||
}
|
||||
if (yyerrflag) goto yyinrecovery;
|
||||
if (yyerrflag != 0) goto yyinrecovery;
|
||||
|
||||
YYERROR_CALL("syntax error");
|
||||
|
||||
goto yyerrlab;
|
||||
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
++yynerrs;
|
||||
|
||||
@ -507,18 +506,15 @@ YYPARSE_DECL()
|
||||
yyerrflag = 3;
|
||||
for (;;)
|
||||
{
|
||||
if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
|
||||
if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("%sdebug: state %d, error recovery shifting\
|
||||
to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
yystate = yytable[yyn];
|
||||
*++yystack.s_mark = yytable[yyn];
|
||||
*++yystack.l_mark = yylval;
|
||||
@ -543,7 +539,7 @@ YYPARSE_DECL()
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
|
||||
YYPREFIX, yystate, yychar, yys);
|
||||
}
|
||||
@ -559,10 +555,11 @@ YYPARSE_DECL()
|
||||
YYPREFIX, yystate, yyn, yyrule[yyn]);
|
||||
#endif
|
||||
yym = yylen[yyn];
|
||||
if (yym)
|
||||
if (yym > 0)
|
||||
yyval = yystack.l_mark[1-yym];
|
||||
else
|
||||
memset(&yyval, 0, sizeof yyval);
|
||||
|
||||
switch (yyn)
|
||||
{
|
||||
case 3:
|
||||
@ -625,7 +622,7 @@ case 18:
|
||||
#line 70 "calc2.y"
|
||||
{ yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 629 "calc2.tab.c"
|
||||
#line 626 "calc2.tab.c"
|
||||
}
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
@ -643,11 +640,12 @@ break;
|
||||
*++yystack.l_mark = yyval;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = YYLEX) < 0) yychar = YYEOF;
|
||||
yychar = YYLEX;
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, reading %d (%s)\n",
|
||||
YYPREFIX, YYFINAL, yychar, yys);
|
||||
}
|
||||
@ -656,8 +654,8 @@ break;
|
||||
if (yychar == YYEOF) goto yyaccept;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
|
||||
if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
|
||||
yystate = yytable[yyn];
|
||||
else
|
||||
yystate = yydgoto[yym];
|
||||
@ -666,10 +664,7 @@ break;
|
||||
printf("%sdebug: after reduction, shifting from state %d \
|
||||
to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
goto yyloop;
|
||||
|
@ -364,7 +364,7 @@ YYLEX_DECL()
|
||||
#line 365 "calc3.tab.c"
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
@ -443,6 +443,8 @@ YYPARSE_DECL()
|
||||
}
|
||||
#endif
|
||||
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -462,28 +464,26 @@ YYPARSE_DECL()
|
||||
if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = YYLEX) < 0) yychar = YYEOF;
|
||||
yychar = YYLEX;
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, reading %d (%s)\n",
|
||||
YYPREFIX, yystate, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("%sdebug: state %d, shifting to state %d\n",
|
||||
YYPREFIX, yystate, yytable[yyn]);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
yystate = yytable[yyn];
|
||||
*++yystack.s_mark = yytable[yyn];
|
||||
*++yystack.l_mark = yylval;
|
||||
@ -491,18 +491,17 @@ YYPARSE_DECL()
|
||||
if (yyerrflag > 0) --yyerrflag;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
|
||||
{
|
||||
yyn = yytable[yyn];
|
||||
goto yyreduce;
|
||||
}
|
||||
if (yyerrflag) goto yyinrecovery;
|
||||
if (yyerrflag != 0) goto yyinrecovery;
|
||||
|
||||
YYERROR_CALL("syntax error");
|
||||
|
||||
goto yyerrlab;
|
||||
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
++yynerrs;
|
||||
|
||||
@ -512,18 +511,15 @@ YYPARSE_DECL()
|
||||
yyerrflag = 3;
|
||||
for (;;)
|
||||
{
|
||||
if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
|
||||
if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("%sdebug: state %d, error recovery shifting\
|
||||
to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
yystate = yytable[yyn];
|
||||
*++yystack.s_mark = yytable[yyn];
|
||||
*++yystack.l_mark = yylval;
|
||||
@ -548,7 +544,7 @@ YYPARSE_DECL()
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
|
||||
YYPREFIX, yystate, yychar, yys);
|
||||
}
|
||||
@ -564,10 +560,11 @@ YYPARSE_DECL()
|
||||
YYPREFIX, yystate, yyn, yyrule[yyn]);
|
||||
#endif
|
||||
yym = yylen[yyn];
|
||||
if (yym)
|
||||
if (yym > 0)
|
||||
yyval = yystack.l_mark[1-yym];
|
||||
else
|
||||
memset(&yyval, 0, sizeof yyval);
|
||||
|
||||
switch (yyn)
|
||||
{
|
||||
case 3:
|
||||
@ -630,7 +627,7 @@ case 18:
|
||||
#line 73 "calc3.y"
|
||||
{ yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
|
||||
break;
|
||||
#line 634 "calc3.tab.c"
|
||||
#line 631 "calc3.tab.c"
|
||||
}
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
@ -648,11 +645,12 @@ break;
|
||||
*++yystack.l_mark = yyval;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = YYLEX) < 0) yychar = YYEOF;
|
||||
yychar = YYLEX;
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, reading %d (%s)\n",
|
||||
YYPREFIX, YYFINAL, yychar, yys);
|
||||
}
|
||||
@ -661,8 +659,8 @@ break;
|
||||
if (yychar == YYEOF) goto yyaccept;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
|
||||
if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
|
||||
yystate = yytable[yyn];
|
||||
else
|
||||
yystate = yydgoto[yym];
|
||||
@ -671,10 +669,7 @@ break;
|
||||
printf("%sdebug: after reduction, shifting from state %d \
|
||||
to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
goto yyloop;
|
||||
|
@ -97,7 +97,7 @@
|
||||
|
||||
#define YYPURE 0
|
||||
|
||||
#line 2 "code_calc.y"
|
||||
#line 4 "code_calc.y"
|
||||
# include <stdio.h>
|
||||
# include <ctype.h>
|
||||
|
||||
@ -150,6 +150,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
|
||||
@ -171,8 +173,10 @@ extern YYINT yygindex[];
|
||||
extern YYINT yytable[];
|
||||
extern YYINT yycheck[];
|
||||
|
||||
#if YYDEBUG
|
||||
#if YYDEBUG || defined(yytname)
|
||||
extern char *yyname[];
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern char *yyrule[];
|
||||
#endif
|
||||
|
||||
@ -209,7 +213,7 @@ typedef struct {
|
||||
} YYSTACKDATA;
|
||||
/* variables for the parser stack */
|
||||
static YYSTACKDATA yystack;
|
||||
#line 68 "code_calc.y"
|
||||
#line 70 "code_calc.y"
|
||||
/* start of programs */
|
||||
|
||||
#ifdef YYBYACC
|
||||
@ -255,10 +259,10 @@ yylex(void)
|
||||
}
|
||||
return( c );
|
||||
}
|
||||
#line 259 "code_calc.code.c"
|
||||
#line 263 "code_calc.code.c"
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#include <stdio.h> /* needed for printf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* needed for malloc, etc */
|
||||
@ -330,6 +334,8 @@ YYPARSE_DECL()
|
||||
}
|
||||
#endif
|
||||
|
||||
yym = 0;
|
||||
yyn = 0;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = YYEMPTY;
|
||||
@ -349,28 +355,26 @@ YYPARSE_DECL()
|
||||
if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = YYLEX) < 0) yychar = YYEOF;
|
||||
yychar = YYLEX;
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, reading %d (%s)\n",
|
||||
YYPREFIX, yystate, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("%sdebug: state %d, shifting to state %d\n",
|
||||
YYPREFIX, yystate, yytable[yyn]);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
yystate = yytable[yyn];
|
||||
*++yystack.s_mark = yytable[yyn];
|
||||
*++yystack.l_mark = yylval;
|
||||
@ -378,18 +382,17 @@ YYPARSE_DECL()
|
||||
if (yyerrflag > 0) --yyerrflag;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
|
||||
{
|
||||
yyn = yytable[yyn];
|
||||
goto yyreduce;
|
||||
}
|
||||
if (yyerrflag) goto yyinrecovery;
|
||||
if (yyerrflag != 0) goto yyinrecovery;
|
||||
|
||||
YYERROR_CALL("syntax error");
|
||||
|
||||
goto yyerrlab;
|
||||
|
||||
goto yyerrlab; /* redundant goto avoids 'unused label' warning */
|
||||
yyerrlab:
|
||||
++yynerrs;
|
||||
|
||||
@ -399,18 +402,15 @@ YYPARSE_DECL()
|
||||
yyerrflag = 3;
|
||||
for (;;)
|
||||
{
|
||||
if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
|
||||
if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("%sdebug: state %d, error recovery shifting\
|
||||
to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
yystate = yytable[yyn];
|
||||
*++yystack.s_mark = yytable[yyn];
|
||||
*++yystack.l_mark = yylval;
|
||||
@ -435,7 +435,7 @@ YYPARSE_DECL()
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
|
||||
YYPREFIX, yystate, yychar, yys);
|
||||
}
|
||||
@ -451,73 +451,74 @@ YYPARSE_DECL()
|
||||
YYPREFIX, yystate, yyn, yyrule[yyn]);
|
||||
#endif
|
||||
yym = yylen[yyn];
|
||||
if (yym)
|
||||
if (yym > 0)
|
||||
yyval = yystack.l_mark[1-yym];
|
||||
else
|
||||
memset(&yyval, 0, sizeof yyval);
|
||||
|
||||
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 521 "code_calc.code.c"
|
||||
#line 522 "code_calc.code.c"
|
||||
}
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
@ -535,11 +536,12 @@ break;
|
||||
*++yystack.l_mark = yyval;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = YYLEX) < 0) yychar = YYEOF;
|
||||
yychar = YYLEX;
|
||||
if (yychar < 0) yychar = YYEOF;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = yyname[YYTRANSLATE(yychar)];
|
||||
if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
|
||||
printf("%sdebug: state %d, reading %d (%s)\n",
|
||||
YYPREFIX, YYFINAL, yychar, yys);
|
||||
}
|
||||
@ -548,8 +550,8 @@ break;
|
||||
if (yychar == YYEOF) goto yyaccept;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
|
||||
if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
|
||||
yystate = yytable[yyn];
|
||||
else
|
||||
yystate = yydgoto[yym];
|
||||
@ -558,10 +560,7 @@ break;
|
||||
printf("%sdebug: after reduction, shifting from state %d \
|
||||
to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
|
||||
#endif
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
|
||||
*++yystack.s_mark = (YYINT) yystate;
|
||||
*++yystack.l_mark = yyval;
|
||||
goto yyloop;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user