mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Import byacc 20140409
This commit is contained in:
parent
e0ae66db63
commit
4ecea33a98
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/byacc/dist/; revision=264790 svn path=/vendor/byacc/20140409/; revision=264791; tag=vendor/byacc/20140409
721
CHANGES
721
CHANGES
@ -1,9 +1,648 @@
|
||||
2014-04-09 Rick.Spates
|
||||
|
||||
* main.c, defs.h: patch to allow DEBUG build with WIN32 system
|
||||
|
||||
2014-04-09 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* output.c, reader.c: gcc warnings
|
||||
|
||||
* reader.c: fix const-cast warnings
|
||||
|
||||
* test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, 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_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/code_error.tab.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/err_syntax12.tab.c, test/btyacc/error.tab.c, test/btyacc/rename_debug.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.tab.c, output.c:
|
||||
fix a few clang --analyze warnings; one was a case where output_ctable emitted
|
||||
an empty table (which should be an error).
|
||||
|
||||
* reader.c: appease clang --analyze
|
||||
|
||||
* defs.h: mark two functions as no-return.
|
||||
|
||||
* package/debian/changelog: reason for release
|
||||
|
||||
* VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
|
||||
bump
|
||||
|
||||
* makefile.in: use $LINT_OPTS from environment via configure script
|
||||
|
||||
* test/btyacc/ok_syntax1.output, test/btyacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.c, test/ok_syntax1.y, test/yacc/ok_syntax1.output:
|
||||
tweaks to make generated files from ok_syntax1.y compile with check_make rule
|
||||
|
||||
* test/btyacc/rename_debug.c, test/btyacc/rename_debug.error, test/btyacc/rename_debug.h, test/btyacc/rename_debug.i, test/btyacc/rename_debug.output, test/yacc/rename_debug.c:
|
||||
reference output for testing
|
||||
|
||||
* test/run_test.sh:
|
||||
retain the renaming done for code_debug.y so that check_make will work.
|
||||
|
||||
* test/yacc/rename_debug.error, test/yacc/rename_debug.h, test/yacc/rename_debug.i, test/yacc/rename_debug.output:
|
||||
reference output for testing
|
||||
|
||||
* test/btyacc/ok_syntax1.error: RCS_BASE
|
||||
|
||||
* test/yacc/quote_calc4-s.tab.c, test/yacc/varsyntax_calc1.tab.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/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/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.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, yaccpar.c:
|
||||
regen
|
||||
|
||||
* yacc.1:
|
||||
clarify relationship of btyacc features to default configuration.
|
||||
|
||||
2014-04-08 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/yacc/ok_syntax1.output, test/yacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.h, test/btyacc/ok_syntax1.output, test/btyacc/ok_syntax1.tab.c, test/btyacc/ok_syntax1.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/ok_syntax1.y: RCS_BASE
|
||||
|
||||
* test/yacc/ok_syntax1.error: reference output for testing
|
||||
|
||||
* test/yacc/big_b.error, test/yacc/big_b.output, test/yacc/big_l.error, test/yacc/big_l.output, test/btyacc/big_b.error, test/btyacc/big_b.output, test/btyacc/big_l.error, test/btyacc/big_l.output, test/run_test.sh:
|
||||
exercise -L/-B options
|
||||
|
||||
* test/yacc/code_debug.c, test/btyacc/code_debug.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax27.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.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-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/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_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.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.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.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/btyacc_demo.tab.c, 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.tab.c, 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/pure_calc.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/btyacc_calc1.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/run_test.sh, test/yacc/no_b_opt1.output:
|
||||
use a better renaming of the YYPATCH definition (none of the test-cases rely
|
||||
upon it, but redefinition in the "make check_make" rule is a problem).
|
||||
|
||||
* test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax2.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/varsyntax_calc1.tab.c:
|
||||
undid temporary reordering in reader() by Tom Shields to align with byacc outputs
|
||||
|
||||
* test/run_test.sh: remove a repeated test-case
|
||||
|
||||
* mstring.c: minor reformatting to make coverage analysis simpler
|
||||
|
||||
2014-04-07 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/run_test.sh: tidy
|
||||
|
||||
* test/yacc/help.error, test/yacc/help.output, test/yacc/no_b_opt.error, test/yacc/no_b_opt.output, test/yacc/no_b_opt1.error, test/yacc/no_b_opt1.output, test/yacc/no_code_c.error, test/yacc/no_code_c.output, test/yacc/no_defines.error, test/yacc/no_defines.output, test/yacc/no_graph.error, test/yacc/no_graph.output, test/yacc/no_include.error, test/yacc/no_include.output, test/yacc/no_opts.error, test/yacc/no_opts.output, test/yacc/no_output.error, test/yacc/no_output.output, test/yacc/no_output1.error, test/yacc/no_output1.output, test/yacc/no_output2.error, test/yacc/no_output2.output, test/yacc/no_p_opt.error, test/yacc/no_p_opt.output, test/yacc/no_p_opt1.error, test/yacc/no_p_opt1.output, test/yacc/no_verbose.error, test/yacc/no_verbose.output, test/yacc/nostdin.error, test/yacc/nostdin.output, test/yacc/test-no_b_opt1.output:
|
||||
reference output for testing
|
||||
|
||||
* test/run_test.sh:
|
||||
add special checks for flags which depend on writable/existing files
|
||||
|
||||
* test/btyacc/no_b_opt1.output, test/btyacc/no_p_opt1.output, test/btyacc/no_b_opt.error, test/btyacc/no_b_opt.output, test/btyacc/no_b_opt1.error, test/btyacc/no_code_c.output, test/btyacc/no_p_opt.error, test/btyacc/no_p_opt.output, test/btyacc/no_p_opt1.error, test/btyacc/no_output2.output, test/btyacc/no_code_c.error, test/btyacc/no_output2.error, test/btyacc/no_include.error, test/btyacc/no_include.output, test/btyacc/no_defines.output, test/btyacc/no_defines.error, test/btyacc/no_verbose.output, test/btyacc/no_graph.output, test/btyacc/no_graph.error, test/btyacc/no_opts.error, test/btyacc/no_opts.output, test/btyacc/no_verbose.error, test/btyacc/nostdin.error, test/btyacc/nostdin.output, test/btyacc/no_output.error, test/btyacc/no_output.output, test/btyacc/no_output1.error, test/btyacc/no_output1.output:
|
||||
reference output for testing
|
||||
|
||||
* main.c:
|
||||
change CREATE_FILE_NAMES() to use local function rather than inline code,
|
||||
to simplify coverage analysis.
|
||||
|
||||
* test/btyacc/err_syntax27.error, test/btyacc/err_syntax27.output, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax27.tab.h, test/btyacc/help.error, test/btyacc/help.output, test/yacc/err_syntax27.error, test/yacc/err_syntax27.output, test/yacc/err_syntax27.tab.c, test/yacc/err_syntax27.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax27.y: testcase for missing_brace()
|
||||
|
||||
* error.c: ifdef'd non-btyacc function
|
||||
|
||||
* lr0.c: ifdef'd debug-code
|
||||
|
||||
* yaccpar.skel: use YYINT's to replace short's as in btyaccpar.skel
|
||||
|
||||
* test/btyacc/code_debug.c, test/btyacc/err_syntax12.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_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.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.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/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.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_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.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-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/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_debug.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, output.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/run_test.sh:
|
||||
2010/11/26 simplification of output.c using putc_code() and putl_code()
|
||||
omitted an adjustment of the #line value used for code-file. Fix that.
|
||||
Also, amend 2005/05/04 change to run_test.sh to retain a dummy line for
|
||||
YYPATCH #define's to make test-outputs easier to compare #line's (report
|
||||
by Tom Shields)
|
||||
|
||||
2014-04-06 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* reader.c: fix for valgrind
|
||||
(the calloc's are intentional - valgrind reported use of uninitialized memory)
|
||||
|
||||
* lr0.c, output.c: fix for valgrind
|
||||
|
||||
* test/btyacc/code_debug.c, test/btyacc/code_debug.error, test/btyacc/code_debug.h, test/btyacc/code_debug.i, test/btyacc/code_debug.output:
|
||||
RCS_BASE
|
||||
|
||||
* test/yacc/code_debug.c, test/yacc/code_debug.h:
|
||||
exercise the -i option
|
||||
|
||||
* test/yacc/code_debug.i: reference output for testing
|
||||
|
||||
* test/run_test.sh: exercise the -i option
|
||||
|
||||
* test/yacc/code_debug.c: reference output for testing
|
||||
|
||||
* test/run_test.sh: exercise the "-o" option
|
||||
|
||||
* test/yacc/code_debug.error, test/yacc/code_debug.h, test/yacc/code_debug.output:
|
||||
reference output for testing
|
||||
|
||||
* output.c: don't call exit() without giving a chance to cleanup.
|
||||
|
||||
* mstring.c: ifdef'd functions not used in byacc
|
||||
|
||||
* btyaccpar.c: generated from btyaccpar.skel
|
||||
|
||||
* yaccpar.c: generated from yaccpar.skel
|
||||
|
||||
* skel2c:
|
||||
change the generated-by comment to show which version of this script (and
|
||||
which version of the given skeleton file) were used to produce the C-file.
|
||||
|
||||
* configure: regen
|
||||
|
||||
* makefile.in:
|
||||
add rules to generate byacc and btyacc parser skeleton files independently
|
||||
|
||||
* aclocal.m4: CF_PROG_AWK - add to byacc's configure script
|
||||
CF_INTEL_COMPILER
|
||||
cleanup the -no-gcc option which was leftover from testing - prcs does
|
||||
not build with this option.
|
||||
CF_MAKE_DOCS
|
||||
protect $2 from substitution, for luit's "$(manext)"
|
||||
CF_XOPEN_SOURCE
|
||||
for Solaris (tested with gcc/g++ 3.4.3 on Solaris 10 and gcc/g++ 4.5.2
|
||||
on Solaris 11), suppress the followup check for defining _XOPEN_SOURCE
|
||||
because it is not needed, as well as because g++ 4.7.3 (no package,
|
||||
used in Sage for Solaris 10) has some unspecified header breakage which
|
||||
is triggered by the duplicate definition.
|
||||
|
||||
* configure.in:
|
||||
modify so skeleton-source is determined by configure options rather than by
|
||||
having developer rename yaccpar.skel.old to yaccpar.skel
|
||||
|
||||
* descrip.mms: rename skeleton
|
||||
|
||||
* vmsbuild.com:
|
||||
fwiw, renamed the skeleton for consistency with makefile
|
||||
|
||||
* skel2c, skeleton.c: resync skeleton and its generating files
|
||||
|
||||
* yaccpar.skel:
|
||||
renamed yaccpar.skel.old to yaccpar.skel, to allow using makefile suffix rules
|
||||
|
||||
* yaccpar.skel.old: resync skeleton and its generating files
|
||||
|
||||
* test/run_make.sh: improve cleanup after error recovery
|
||||
|
||||
* 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/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.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-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, output.c, skeleton.c, defs.h:
|
||||
use improvement from Tom Shield's btyacc changes, getting rid of special cases for generating two yyerror calls in skeleton
|
||||
|
||||
* output.c: simplify output_yyerror_decl()
|
||||
|
||||
* test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.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/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.tab.c, test/yacc/code_error.tab.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/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, output.c:
|
||||
add second "const" to string-table declarations, from Tom Shield's btyacc changes
|
||||
|
||||
* 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/inherit2.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/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.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/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c:
|
||||
discard unnecessary call on write_code_lineno() from Tom Shield's changes
|
||||
|
||||
* test/yacc/error.tab.c, test/yacc/grammar.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-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/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_error.code.c, test/yacc/code_error.tab.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/err_syntax20.tab.c, output.c:
|
||||
use YYINT typedef from Tom Shield's btyacc changes to replace explicit "short"
|
||||
|
||||
* test/yacc/code_calc.code.c, test/yacc/code_error.code.c, output.c:
|
||||
use fix from Tom Shield's btyacc changes: remove redundant extern-declaration for YYPARSE_DECL()
|
||||
|
||||
* 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/inherit2.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/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.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/err_syntax12.tab.c:
|
||||
discard unnecessary call on write_code_lineno() from Tom Shield's changes
|
||||
|
||||
* output.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.tab.c:
|
||||
use fix from Tom Shield's btyacc changes: prefix-definitions went to the
|
||||
output (.tab.c) file in a case where they should have gone to the code
|
||||
(.code.c) file. Remove now-redundant call to output_prefix().
|
||||
|
||||
* main.c: do the same for help-message
|
||||
|
||||
* main.c: use OUTPUT_SUFFIX symbol in an overlooked case
|
||||
|
||||
* test/run_make.sh:
|
||||
modify to avoid use of VPATH, which has no standard implementation
|
||||
|
||||
2014-04-05 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.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/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.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/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c:
|
||||
discard a change which merged CountLines() with explicit comparisons against
|
||||
code_file because that adds extra to the #line values
|
||||
|
||||
* 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-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/calc.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_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/error.tab.c, output.c:
|
||||
add Tom Shield's change to allow definition of YYSTYPE_IS_DECLARED symbol to
|
||||
override fallback typedef for YYSTYPE when that symbol is undefined
|
||||
|
||||
* test/btyacc/error.tab.c, test/btyacc/inherit0.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/calc.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_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c:
|
||||
minor tweak to coding style - use parenthesis for "defined" operator's parameter
|
||||
|
||||
* test/btyacc/err_syntax11.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/inherit2.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/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.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:
|
||||
regen to make YYMAXTOKEN and YYUNDFTOKEN adjacent
|
||||
|
||||
* test/yacc/err_syntax20.tab.c, test/yacc/grammar.tab.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/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_error.code.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c:
|
||||
regen after adding the YYUNDFTOKEN symbol
|
||||
|
||||
* output.c:
|
||||
integrate Tom Shield's btyacc changes which introduce the YYUNDFTOKEN symbol
|
||||
(I changed order of output to keep this adjacent to YYMAXTOKEN)
|
||||
|
||||
* reader.c:
|
||||
merge all but one small change from Tom Shield's btyacc changes - that
|
||||
changes the order of code-file in the tests.
|
||||
|
||||
* test/btyacc/btyacc_demo.tab.c: regen
|
||||
|
||||
* test/btyacc_demo.y: fix prototypes
|
||||
|
||||
2014-04-04 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* reader.c, defs.h, main.c:
|
||||
more merging of Tom Shield's btyacc changes. In the merge, I moved the
|
||||
symbol_pval inside the btyacc ifdef's and added some more btyacc ifdefs
|
||||
|
||||
2014-04-03 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* reader.c:
|
||||
merge-in 3/4 of btyacc's changes, deferring those which change test-outputs.
|
||||
Tom Shield's changes split-out copy_string() and copy_comment() functions
|
||||
to simplify some logic, as well as adding btyacc-only chunks
|
||||
|
||||
* makefile.in: build mstring.o, needed for changes in reader.c
|
||||
|
||||
* output.c:
|
||||
merge-in all of btyacc's changes which do not change byacc's test-output.
|
||||
Some of the merge uses ifdef-changes which I applied to ongoing resync,
|
||||
e.g., the introduction of PER_STATE.
|
||||
|
||||
2014-04-02 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c: regen
|
||||
|
||||
* output.c: fix typo
|
||||
|
||||
* output.c, reader.c:
|
||||
merge in some chunks of reader and output files which do not affect byacc tests
|
||||
|
||||
* test/yacc/calc2.tab.c, test/yacc/calc3.tab.c: regen
|
||||
|
||||
* test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.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-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/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_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, skeleton.c:
|
||||
incorporate YYENOMEM and YYEOF symbols from btyacc
|
||||
|
||||
* output.c: merge chunk from btyacc changes for header-guards
|
||||
|
||||
* btyaccpar.skel: RCS_BASE
|
||||
|
||||
* yaccpar.skel: comment-out yysccsid[], for FreeBSD build-issues
|
||||
remove GCC_UNUSED to reduce name-pollution as well as being simpler
|
||||
|
||||
* main.c:
|
||||
move a btyacc symbol outside ifdef to work around current state of merge
|
||||
|
||||
* defs.h:
|
||||
add USE_HEADER_GUARDS to defer whether to modify byacc's header-output
|
||||
|
||||
* test/run_make.sh:
|
||||
do not try to compile files used for testing syntax-errors, since they are
|
||||
likely to be incomplete
|
||||
|
||||
2014-04-02 Tom.Shields
|
||||
|
||||
* main.c: changes for btyacc
|
||||
|
||||
2014-04-01 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* reader.c:
|
||||
integrate change by Tom Shields to use bsearch rather than successive
|
||||
calls to matchec()
|
||||
|
||||
* defs.h: typedef __compar_fn_t is unnecessary
|
||||
|
||||
* 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/inherit2.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/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.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/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c:
|
||||
omit the GCC_UNUSED, as noted by Tom Shields not really essential
|
||||
|
||||
2014-04-01 Tom.Shields
|
||||
|
||||
* verbose.c: changes for btyacc, ifdef'd
|
||||
|
||||
2014-04-01 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* mkpar.c: eliminate most of the ifdef's using macros
|
||||
|
||||
2014-04-01 Tom.Shields
|
||||
|
||||
* mkpar.c: merge btyacc changes (ifdef'd - no change to byacc)
|
||||
|
||||
* error.c:
|
||||
new functions used for reporting errors from the btyacc configuration
|
||||
(I reordered some, and ifdef'd the new ones -TD)
|
||||
|
||||
2014-03-31 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c:
|
||||
omit the GCC_UNUSED, as noted by Tom Shields not really essential
|
||||
|
||||
* test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.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_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.tab.c:
|
||||
regen
|
||||
|
||||
2014-03-29 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.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-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/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_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, skeleton.c:
|
||||
comment-out yysccsid in the banner because it produces unnecessary compiler
|
||||
warnings. The suggested alternative (using #pragma ident) in the preceding
|
||||
comment is also obsolete; remove that comment (request by Gleb Smirnoff).
|
||||
|
||||
* test/run_test.sh:
|
||||
for yacc, ignore the inherit testcases, since they are btyacc-specific
|
||||
|
||||
2014-03-28 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/yacc/varsyntax_calc1.error, test/yacc/varsyntax_calc1.output, test/yacc/varsyntax_calc1.tab.c, test/yacc/varsyntax_calc1.tab.h, test/yacc/err_inherit3.error, test/yacc/err_inherit3.output, test/yacc/err_inherit3.tab.c, test/yacc/err_inherit3.tab.h, test/yacc/err_inherit4.error, test/yacc/err_inherit4.output, test/yacc/err_inherit4.tab.c, test/yacc/err_inherit4.tab.h, test/yacc/err_inherit5.error, test/yacc/err_inherit5.output, test/yacc/err_inherit5.tab.c, test/yacc/err_inherit5.tab.h, test/yacc/inherit0.error, test/yacc/inherit0.output, test/yacc/inherit0.tab.c, test/yacc/inherit0.tab.h, test/yacc/inherit1.error, test/yacc/inherit1.output, test/yacc/inherit1.tab.c, test/yacc/inherit1.tab.h, test/yacc/inherit2.error, test/yacc/inherit2.output, test/yacc/inherit2.tab.c, test/yacc/inherit2.tab.h, test/yacc/empty.error, test/yacc/empty.output, test/yacc/empty.tab.c, test/yacc/empty.tab.h, test/yacc/err_inherit1.error, test/yacc/err_inherit1.output, test/yacc/err_inherit1.tab.c, test/yacc/err_inherit1.tab.h, test/yacc/err_inherit2.error, test/yacc/err_inherit2.output, test/yacc/err_inherit2.tab.c, test/yacc/err_inherit2.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/run_lint.sh, test/run_make.sh, test/run_test.sh:
|
||||
moving #define's out of makefile broke check for yacc vs btyacc (fix)
|
||||
|
||||
2014-03-28 Tom.Shields
|
||||
|
||||
* test/btyacc/btyacc_demo.tab.c, test/btyacc/err_inherit3.error, test/btyacc/err_inherit3.output, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit3.tab.h, test/btyacc/err_inherit2.error, test/btyacc/err_inherit2.output, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit2.tab.h, test/btyacc/err_inherit4.error, test/btyacc/err_inherit4.output, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit4.tab.h, test/btyacc/err_inherit5.error, test/btyacc/err_inherit5.output, test/btyacc/err_inherit5.tab.c, test/btyacc/err_inherit5.tab.h, test/btyacc/inherit0.error, test/btyacc/inherit0.output, test/btyacc/inherit0.tab.c, test/btyacc/inherit0.tab.h, test/btyacc/inherit1.error, test/btyacc/inherit1.output, test/btyacc/inherit1.tab.c, test/btyacc/inherit1.tab.h, test/btyacc/inherit2.error, test/btyacc/inherit2.output, test/btyacc/inherit2.tab.c, test/btyacc/inherit2.tab.h, test/btyacc/calc.error, test/btyacc/err_inherit1.error, test/btyacc/err_inherit1.output, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit1.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* defs.h: new functions/variables for btyacc
|
||||
(I reordered and ifdef'd -TD)
|
||||
|
||||
* test/inherit0.y, test/inherit1.y: testcase for btyacc
|
||||
|
||||
2014-03-27 Tom.Shields
|
||||
|
||||
* test/err_inherit5.y, test/err_inherit4.y, test/err_inherit3.y, test/err_inherit2.y, test/err_inherit1.y, test/inherit2.y:
|
||||
testcase for btyacc
|
||||
|
||||
2014-03-25 Tom.Shields
|
||||
|
||||
* symtab.c: extra initialization needed for btyacc
|
||||
(I ifdef'd -TD)
|
||||
|
||||
* yacc.1: document -L/-B features from btyacc
|
||||
|
||||
2014-03-25 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* yacc.1: typo
|
||||
|
||||
* configure: regen
|
||||
|
||||
* configure.in:
|
||||
modified new options to act like those in my other configure-scripts, e.g.,
|
||||
showing what option is being tested, and the resulting value. Put the
|
||||
definitions in config.h rather than in the makefile.
|
||||
|
||||
2014-03-25 Tom.Shields
|
||||
|
||||
* makefile.in: add/use LINTFLAGS variable
|
||||
make all of the objects (not just skeleton) rebuild if makefile changes
|
||||
modify check-rule to reflect updates to run_test.sh vs subdirectory
|
||||
|
||||
* mstring.c: byacc-btyacc-20140323
|
||||
|
||||
2014-03-25 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/btyacc/RCS, test/yacc/RCS: PERMIT FILE
|
||||
|
||||
* config_h.in: updated with autoheader-252
|
||||
|
||||
2014-03-25 Tom.Shields
|
||||
|
||||
* README.BTYACC: byacc-btyacc-20140323
|
||||
|
||||
2014-03-24 Tom.Shields
|
||||
|
||||
* test/btyacc/err_syntax1.output, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax1.tab.h, test/btyacc/err_syntax10.error, test/btyacc/err_syntax10.output, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax10.tab.h, test/btyacc/err_syntax11.error, test/btyacc/err_syntax11.output, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax11.tab.h, test/btyacc/err_syntax12.error, test/btyacc/err_syntax12.output, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax12.tab.h, test/btyacc/err_syntax13.error, test/btyacc/err_syntax13.output, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax13.tab.h, test/btyacc/err_syntax14.error, test/btyacc/err_syntax14.output, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax14.tab.h, test/btyacc/err_syntax15.error, test/btyacc/err_syntax15.output, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax15.tab.h, test/btyacc/err_syntax16.error, test/btyacc/err_syntax16.output, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax16.tab.h, test/btyacc/err_syntax17.error, test/btyacc/err_syntax17.output, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax17.tab.h, test/btyacc/err_syntax18.error, test/btyacc/err_syntax18.output, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax18.tab.h, test/btyacc/err_syntax19.error, test/btyacc/err_syntax19.output, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax19.tab.h, test/btyacc/err_syntax2.output, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax2.tab.h, test/btyacc/err_syntax20.error, test/btyacc/err_syntax20.output, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax20.tab.h, test/btyacc/err_syntax21.error, test/btyacc/err_syntax21.output, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax21.tab.h, test/btyacc/err_syntax22.error, test/btyacc/err_syntax22.output, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax22.tab.h, test/btyacc/err_syntax23.error, test/btyacc/err_syntax23.output, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax23.tab.h, test/btyacc/err_syntax24.error, test/btyacc/err_syntax24.output, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax24.tab.h, test/btyacc/err_syntax25.error, test/btyacc/err_syntax25.output, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax25.tab.h, test/btyacc/err_syntax26.error, test/btyacc/err_syntax26.output, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax26.tab.h, test/btyacc/err_syntax3.output, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax3.tab.h, test/btyacc/err_syntax4.output, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax4.tab.h, test/btyacc/err_syntax5.output, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax5.tab.h, test/btyacc/err_syntax6.output, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax6.tab.h, test/btyacc/err_syntax7.output, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7.tab.h, test/btyacc/err_syntax7a.output, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7a.tab.h, test/btyacc/err_syntax7b.output, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax7b.tab.h, test/btyacc/err_syntax8.output, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8.tab.h, test/btyacc/err_syntax8a.output, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax8a.tab.h, test/btyacc/err_syntax9.output, test/btyacc/err_syntax9.tab.c, test/btyacc/err_syntax9.tab.h:
|
||||
reference output for testing
|
||||
|
||||
2014-03-24 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* defs.h: fix compiler warnings due to mputc()
|
||||
|
||||
2014-03-23 Tom.Shields
|
||||
|
||||
* test/btyacc_demo.y: testcase for btyacc
|
||||
|
||||
* test/btyacc/varsyntax_calc1.error, test/btyacc/varsyntax_calc1.output, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/varsyntax_calc1.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/varsyntax_calc1.y, test/btyacc_calc1.y: testcase for btyacc
|
||||
|
||||
2014-03-23 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/err_syntax26.error, test/err_syntax26.output, test/err_syntax26.tab.c, test/err_syntax26.tab.h, test/yacc/err_syntax26.error, test/yacc/err_syntax26.output, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax26.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax26.y: testcase for missing_brace()
|
||||
|
||||
* test/err_syntax25.error, test/err_syntax25.output, test/err_syntax25.tab.c, test/err_syntax25.tab.h, test/yacc/err_syntax25.error, test/yacc/err_syntax25.output, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax25.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax25.y: testcase for over_unionized()
|
||||
|
||||
* test/err_syntax24.error, test/err_syntax24.output, test/err_syntax24.tab.c, test/err_syntax24.tab.h, test/yacc/err_syntax24.error, test/yacc/err_syntax24.output, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax24.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax24.y: testcase for default_action_warning()
|
||||
|
||||
2014-03-23 Tom.Shields
|
||||
|
||||
* test/btyacc/quote_calc3-s.error, test/btyacc/quote_calc4-s.error, test/btyacc/quote_calc4.error, test/btyacc/grammar.dot, test/btyacc/grammar.error, test/btyacc/pure_calc.error, test/btyacc/pure_error.error, test/btyacc/quote_calc-s.error, test/btyacc/quote_calc.error, test/btyacc/quote_calc2-s.error, test/btyacc/quote_calc2.error, test/btyacc/quote_calc3.error, test/btyacc/err_syntax2.error, test/btyacc/err_syntax3.error, test/btyacc/err_syntax4.error, test/btyacc/err_syntax5.error, test/btyacc/err_syntax6.error, test/btyacc/err_syntax7.error, test/btyacc/err_syntax7a.error, test/btyacc/err_syntax7b.error, test/btyacc/err_syntax8.error, test/btyacc/err_syntax8a.error, test/btyacc/err_syntax9.error, test/btyacc/error.error, test/btyacc/calc1.error, test/btyacc/calc2.error, test/btyacc/calc3.error, test/btyacc/code_calc.error, test/btyacc/code_error.error, test/btyacc/empty.error, test/btyacc/err_syntax1.error, test/btyacc/btyacc_calc1.error, test/btyacc/btyacc_demo.error:
|
||||
reference output for testing
|
||||
|
||||
2014-03-23 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/err_syntax23.error, test/err_syntax23.output, test/err_syntax23.tab.c, test/err_syntax23.tab.h, test/yacc/err_syntax23.error, test/yacc/err_syntax23.output, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax23.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax23.y: testcase for untyped_lhs()
|
||||
|
||||
2014-03-23 Tom.Shields
|
||||
|
||||
* test/run_test.sh:
|
||||
move test-outputs into subdirectories to keep btyacc/yacc results separate
|
||||
|
||||
2014-03-23 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/err_syntax22.error, test/err_syntax22.output, test/err_syntax22.tab.c, test/err_syntax22.tab.h, test/yacc/err_syntax22.error, test/yacc/err_syntax22.output, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax22.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax22.y: testcase for untyped_rhs()
|
||||
|
||||
* test/err_syntax21.error, test/err_syntax21.output, test/err_syntax21.tab.c, test/err_syntax21.tab.h, test/yacc/err_syntax21.error, test/yacc/err_syntax21.output, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax21.tab.h, test/err_syntax20.error, test/err_syntax20.output, test/err_syntax20.tab.c, test/err_syntax20.tab.h, test/yacc/err_syntax20.error, test/yacc/err_syntax20.output, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax20.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax20.y: testcase for undefined_symbol_warning()
|
||||
|
||||
* test/err_syntax21.y: testcase for unknown_rhs()
|
||||
|
||||
* test/err_syntax19.error, test/err_syntax19.output, test/err_syntax19.tab.c, test/err_syntax19.tab.h, test/yacc/err_syntax19.error, test/yacc/err_syntax19.output, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax19.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax19.y: testcase for dollar_error()
|
||||
|
||||
* test/err_syntax18.error, test/err_syntax18.output, test/err_syntax18.tab.c, test/err_syntax18.tab.h, test/yacc/err_syntax18.error, test/yacc/err_syntax18.output, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax18.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax18.y: testcase for dollar_warning()
|
||||
|
||||
* test/err_syntax17.error, test/err_syntax17.output, test/err_syntax17.tab.c, test/err_syntax17.tab.h, test/yacc/err_syntax17.error, test/yacc/err_syntax17.output, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax17.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax17.y: testcase for unterminated_action()
|
||||
|
||||
2014-03-22 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/err_syntax16.error, test/err_syntax16.output, test/err_syntax16.tab.c, test/err_syntax16.tab.h, test/yacc/err_syntax16.error, test/yacc/err_syntax16.output, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax16.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax16.y: testcase for terminal_lhs()
|
||||
|
||||
* test/err_syntax15.error, test/err_syntax15.output, test/err_syntax15.tab.c, test/err_syntax15.tab.h, test/yacc/err_syntax15.error, test/yacc/err_syntax15.output, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax15.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax15.y: testcase for no_grammar()
|
||||
|
||||
* test/err_syntax14.error, test/err_syntax14.output, test/err_syntax14.tab.c, test/err_syntax14.tab.h, test/yacc/err_syntax14.error, test/yacc/err_syntax14.output, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax14.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax14.y:
|
||||
testcase for restarted_warning() and undefined_goal()
|
||||
|
||||
* test/err_syntax13.error, test/err_syntax13.output, test/err_syntax13.tab.c, test/err_syntax13.tab.h, test/yacc/err_syntax13.error, test/yacc/err_syntax13.output, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax13.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax13.y: testcase for terminal_start()
|
||||
|
||||
* test/err_syntax12.error, test/err_syntax12.output, test/err_syntax12.tab.c, test/err_syntax12.tab.h, test/yacc/err_syntax12.error, test/yacc/err_syntax12.output, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax12.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax12.y: testcase for revalued_warning()
|
||||
|
||||
* test/err_syntax11.error, test/err_syntax11.output, test/err_syntax11.tab.c, test/err_syntax11.tab.h, test/yacc/err_syntax11.error, test/yacc/err_syntax11.output, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax11.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax11.y: testcase for reprec_warning()
|
||||
|
||||
* test/err_syntax10.error, test/err_syntax10.output, test/err_syntax10.tab.c, test/err_syntax10.tab.h, test/yacc/err_syntax10.error, test/yacc/err_syntax10.output, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax10.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax10.y: testcase for retyped_warning()
|
||||
|
||||
2014-03-21 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/err_syntax9.error, test/err_syntax9.output, test/err_syntax9.tab.c, test/err_syntax9.tab.h, test/yacc/err_syntax9.error, test/yacc/err_syntax9.output, test/yacc/err_syntax9.tab.c, test/yacc/err_syntax9.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax9.y: testcase for tokenized_start()
|
||||
|
||||
* test/err_syntax8.error, test/err_syntax8.output, test/err_syntax8.tab.c, test/err_syntax8.tab.h, test/err_syntax8a.error, test/err_syntax8a.output, test/err_syntax8a.tab.c, test/err_syntax8a.tab.h, test/yacc/err_syntax8.error, test/yacc/err_syntax8.output, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8.tab.h, test/yacc/err_syntax8a.error, test/yacc/err_syntax8a.output, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax8a.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax8a.y, test/err_syntax8.y: testcase for used_reserved()
|
||||
|
||||
* test/err_syntax7.error, test/err_syntax7.output, test/err_syntax7.tab.c, test/err_syntax7.tab.h, test/err_syntax7a.error, test/err_syntax7a.output, test/err_syntax7a.tab.c, test/err_syntax7a.tab.h, test/err_syntax7b.error, test/err_syntax7b.output, test/err_syntax7b.tab.c, test/err_syntax7b.tab.h, test/yacc/err_syntax7.error, test/yacc/err_syntax7.output, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7.tab.h, test/yacc/err_syntax7a.error, test/yacc/err_syntax7a.output, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7a.tab.h, test/yacc/err_syntax7b.error, test/yacc/err_syntax7b.output, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax7b.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax7b.y, test/err_syntax7a.y, test/err_syntax7.y:
|
||||
testcase for illegal_character()
|
||||
|
||||
* test/err_syntax6.error, test/err_syntax6.output, test/err_syntax6.tab.c, test/err_syntax6.tab.h, test/yacc/err_syntax6.error, test/yacc/err_syntax6.output, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax6.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax6.y: testcase for illegal_tag()
|
||||
|
||||
* test/err_syntax5.error, test/err_syntax5.output, test/err_syntax5.tab.c, test/err_syntax5.tab.h, test/yacc/err_syntax5.error, test/yacc/err_syntax5.output, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax5.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax5.y: testcase for unterminated_union()
|
||||
|
||||
* test/err_syntax4.error, test/err_syntax4.output, test/err_syntax4.tab.c, test/err_syntax4.tab.h, test/yacc/err_syntax4.error, test/yacc/err_syntax4.output, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax4.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax4.y: testcase for unterminated_text()
|
||||
|
||||
* test/err_syntax3.error, test/err_syntax3.output, test/err_syntax3.tab.c, test/err_syntax3.tab.h, test/yacc/err_syntax3.error, test/yacc/err_syntax3.output, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax3.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax3.y: testcase for unterminated_string()
|
||||
|
||||
* test/err_syntax2.error, test/err_syntax2.output, test/err_syntax2.tab.c, test/err_syntax2.tab.h, test/yacc/err_syntax2.error, test/yacc/err_syntax2.output, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax2.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax2.y: testcase for unterminated_comment()
|
||||
|
||||
* test/err_syntax1.error, test/yacc/err_syntax1.error:
|
||||
reference output for testing
|
||||
|
||||
* test/err_syntax1.y:
|
||||
test-case with syntax error (and nonprinting character)
|
||||
|
||||
* test/calc.error, test/calc1.error, test/calc2.error, test/calc3.error, test/code_calc.error, test/code_error.error, test/err_syntax1.error, test/error.error, test/grammar.error, test/pure_calc.error, test/pure_error.error, test/quote_calc-s.error, test/quote_calc.error, test/quote_calc2-s.error, test/quote_calc2.error, test/quote_calc3-s.error, test/quote_calc3.error, test/quote_calc4-s.error, test/quote_calc4.error, test/yacc/calc.error, test/yacc/calc1.error, test/yacc/calc2.error, test/yacc/calc3.error, test/yacc/code_calc.error, test/yacc/code_error.error, test/yacc/error.error, test/yacc/grammar.error, test/yacc/pure_calc.error, test/yacc/pure_error.error, test/yacc/quote_calc-s.error, test/yacc/quote_calc.error, test/yacc/quote_calc2-s.error, test/yacc/quote_calc2.error, test/yacc/quote_calc3-s.error, test/yacc/quote_calc3.error, test/yacc/quote_calc4-s.error, test/yacc/quote_calc4.error:
|
||||
reference output for testing
|
||||
|
||||
* test/run_test.sh:
|
||||
save stderr to reference files, to capture shift/reduce messages as well
|
||||
as syntax-error messages
|
||||
|
||||
* test/err_syntax1.output, test/err_syntax1.tab.c, test/err_syntax1.tab.h, test/yacc/err_syntax1.output, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax1.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/run_test.sh: generate a ".dot" file for the grammar file
|
||||
|
||||
* test/grammar.dot: RCS_BASE
|
||||
|
||||
* test/yacc/grammar.dot: reference output for testing
|
||||
|
||||
2014-03-19 Tom.Shields
|
||||
|
||||
* output.c: rename MAXSHORT to MAXYYINT
|
||||
|
||||
2014-03-18 Tom.Shields
|
||||
|
||||
* yaccpar.skel: skeleton with btyacc additions
|
||||
|
||||
* NOTES-btyacc-Changes: byacc-btyacc-20140323
|
||||
|
||||
* test/btyacc/btyacc_calc1.output, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_calc1.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/run_make.sh:
|
||||
move test-outputs into subdirectories to keep btyacc/yacc results separate
|
||||
|
||||
* test/btyacc/pure_calc.tab.c, test/btyacc/pure_calc.tab.h, test/btyacc/pure_error.output, test/btyacc/pure_error.tab.c, test/btyacc/pure_error.tab.h, test/btyacc/quote_calc-s.output, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc-s.tab.h, test/btyacc/quote_calc.output, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc.tab.h, test/btyacc/quote_calc2-s.output, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2-s.tab.h, test/btyacc/quote_calc2.output, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc2.tab.h, test/btyacc/quote_calc3-s.output, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3-s.tab.h, test/btyacc/quote_calc3.output, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc3.tab.h, test/btyacc/quote_calc4-s.output, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4-s.tab.h, test/btyacc/quote_calc4.output, test/btyacc/quote_calc4.tab.c, test/btyacc/quote_calc4.tab.h, test/btyacc/calc1.output, test/btyacc/calc1.tab.c, test/btyacc/calc1.tab.h, test/btyacc/calc2.output, test/btyacc/calc2.tab.c, test/btyacc/calc2.tab.h, test/btyacc/calc3.output, test/btyacc/calc3.tab.c, test/btyacc/calc3.tab.h, test/btyacc/code_calc.code.c, test/btyacc/code_calc.output, test/btyacc/code_calc.tab.c, test/btyacc/code_calc.tab.h, test/btyacc/code_error.code.c, test/btyacc/code_error.output, test/btyacc/code_error.tab.c, test/btyacc/code_error.tab.h, test/btyacc/empty.output, test/btyacc/empty.tab.c, test/btyacc/empty.tab.h, test/btyacc/error.output, test/btyacc/error.tab.c, test/btyacc/error.tab.h, test/btyacc/grammar.output, test/btyacc/grammar.tab.c, test/btyacc/grammar.tab.h, test/btyacc/pure_calc.output, test/btyacc/btyacc_demo.output, test/btyacc/btyacc_demo.tab.h, test/btyacc/calc.output, test/btyacc/calc.tab.c, test/btyacc/calc.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* defs.h:
|
||||
several changes to help decouple the use of 'short' as the type of value
|
||||
used in yacc parsers.
|
||||
|
||||
* NOTES-btyacc-Disposition: byacc-btyacc-20140323
|
||||
|
||||
2014-03-17 Tom.Shields
|
||||
|
||||
* skel2c, yaccpar.skel, yaccpar.skel.old: RCS_BASE
|
||||
|
||||
* test/run_lint.sh:
|
||||
move test-outputs into subdirectories to keep btyacc/yacc results separate
|
||||
|
||||
* configure.in: add --with-max-table-size and --enable-btyacc options
|
||||
|
||||
2014-03-16 Tom.Shields
|
||||
|
||||
* main.c: use Value_t rather than short
|
||||
|
||||
2014-03-11 Tom.Shields
|
||||
|
||||
* test/empty.y: testcase for btyacc
|
||||
|
||||
2014-03-10 Tom.Shields
|
||||
|
||||
* test/calc3.y, test/calc2.y: fix unused-variable warning
|
||||
|
||||
2014-02-18 Tom.Shields
|
||||
|
||||
* lr0.c, graph.c: use Value_t rather than short
|
||||
|
||||
* closure.c: use Value_t rather than short
|
||||
ifdef'd forward-reference prototypes to match ifdef'ing of the actual functions
|
||||
|
||||
* lalr.c: rename MAXSHORT to MAXYYINT
|
||||
|
||||
2014-01-01 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* yacc.1: document %token-table, improve presentation of double-quotes
|
||||
|
||||
* VERSION, package/byacc.spec, package/debian/changelog: bump
|
||||
|
||||
* 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_error.code.c, test/yacc/code_error.tab.c, test/yacc/error.tab.c, test/yacc/grammar.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-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:
|
||||
reference output for testing
|
||||
|
||||
* test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_calc.tab.c, test/code_error.code.c, test/code_error.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c:
|
||||
regen
|
||||
|
||||
@ -248,6 +887,8 @@
|
||||
|
||||
* VERSION, package/debian/changelog, package/byacc.spec: bump
|
||||
|
||||
* test/yacc/calc1.output: reference output for testing
|
||||
|
||||
* test/calc1.output, test/calc1.tab.c: regen
|
||||
|
||||
* test/calc1.y:
|
||||
@ -267,6 +908,8 @@
|
||||
* test/calc2.tab.c, test/calc3.tab.c, test/code_error.code.c, test/ftp.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c:
|
||||
regen
|
||||
|
||||
* test/code_debug.y: RCS_BASE
|
||||
|
||||
* test/calc2.y, test/calc3.y, test/code_error.y, test/ftp.y:
|
||||
byacc already declares yyerror
|
||||
|
||||
@ -359,6 +1002,9 @@
|
||||
* test/quote_calc-s.output, test/quote_calc-s.tab.c, test/quote_calc-s.tab.h, test/quote_calc2-s.output, test/quote_calc2-s.tab.c, test/quote_calc2-s.tab.h, test/quote_calc3-s.output, test/quote_calc3-s.tab.c, test/quote_calc3-s.tab.h, test/quote_calc4-s.output, test/quote_calc4-s.tab.c, test/quote_calc4-s.tab.h:
|
||||
RCS_BASE
|
||||
|
||||
* test/yacc/quote_calc-s.output, test/yacc/quote_calc-s.tab.h, test/yacc/quote_calc2-s.output, test/yacc/quote_calc2-s.tab.h, test/yacc/quote_calc3-s.output, test/yacc/quote_calc3-s.tab.h, test/yacc/quote_calc4-s.output, test/yacc/quote_calc4-s.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/run_test.sh: generate/test with "-s" option applied.
|
||||
|
||||
2012-01-13 Thomas E. Dickey <tom@invisible-island.net>
|
||||
@ -371,9 +1017,24 @@
|
||||
|
||||
* main.c: add -s option to usage message.
|
||||
|
||||
* test/quote_calc3.output, test/quote_calc3.tab.c, test/quote_calc4.output, test/quote_calc4.tab.c, test/quote_calc4.tab.h, test/quote_calc3.y, test/quote_calc.tab.h, test/quote_calc.output, test/quote_calc.tab.c, test/quote_calc2.output, test/quote_calc2.tab.c, test/quote_calc2.tab.h, test/quote_calc3.tab.h, test/quote_calc4.y, test/quote_calc.y, test/quote_calc2.y:
|
||||
* test/quote_calc3.output, test/quote_calc3.tab.c, test/quote_calc4.output, test/quote_calc4.tab.c, test/quote_calc4.tab.h:
|
||||
RCS_BASE
|
||||
|
||||
* test/yacc/quote_calc3.output, test/yacc/quote_calc4.output, test/yacc/quote_calc4.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/quote_calc3.y, test/quote_calc.tab.h: RCS_BASE
|
||||
|
||||
* test/yacc/quote_calc.tab.h: reference output for testing
|
||||
|
||||
* test/quote_calc.output, test/quote_calc.tab.c, test/quote_calc2.output, test/quote_calc2.tab.c, test/quote_calc2.tab.h, test/quote_calc3.tab.h:
|
||||
RCS_BASE
|
||||
|
||||
* test/yacc/quote_calc.output, test/yacc/quote_calc2.output, test/yacc/quote_calc2.tab.h, test/yacc/quote_calc3.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/quote_calc4.y, test/quote_calc.y, test/quote_calc2.y: RCS_BASE
|
||||
|
||||
* configure: regen
|
||||
|
||||
* aclocal.m4: resync with my-autoconf, i.e., fixes for CF_XOPEN_SOURCE
|
||||
@ -556,6 +1217,8 @@
|
||||
|
||||
* output.c: simplified a little, using putc_code() and putl_code()
|
||||
|
||||
* test/yacc/calc1.tab.h: reference output for testing
|
||||
|
||||
* test/calc1.tab.h: regen
|
||||
|
||||
* reader.c:
|
||||
@ -637,9 +1300,20 @@
|
||||
improve %lex-param / %parse-param implementation by allowing for arrays to
|
||||
be passed as parameters, e.g., "int regs[26]".
|
||||
|
||||
* test/calc3.tab.c, test/calc3.y, test/calc3.output, test/calc3.tab.h, test/calc2.tab.c, test/calc2.y, test/calc2.tab.h, test/calc2.output:
|
||||
* test/calc3.tab.c, test/calc3.y, test/calc3.output, test/calc3.tab.h:
|
||||
RCS_BASE
|
||||
|
||||
* test/yacc/calc3.output, test/yacc/calc3.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/calc2.tab.c, test/calc2.y, test/calc2.tab.h: RCS_BASE
|
||||
|
||||
* test/yacc/calc2.tab.h: reference output for testing
|
||||
|
||||
* test/calc2.output: RCS_BASE
|
||||
|
||||
* test/yacc/calc2.output: reference output for testing
|
||||
|
||||
* output.c:
|
||||
improve %lex-param / %parse-param implementation by allowing for arrays to
|
||||
be passed as parameters, e.g., "int regs[26]".
|
||||
@ -699,9 +1373,27 @@
|
||||
provide for testing -r and -P options by checking if the ".y" filename
|
||||
begins with "code_" or "pure_", respectively.
|
||||
|
||||
* test/code_error.code.c, test/code_error.tab.c, test/code_error.tab.h, test/code_calc.code.c, test/code_calc.tab.c, test/code_calc.tab.h, test/pure_calc.output, test/pure_calc.tab.h, test/pure_error.output, test/pure_error.tab.h, test/code_calc.output, test/code_error.output:
|
||||
* test/code_error.code.c, test/code_error.tab.c, test/code_error.tab.h:
|
||||
RCS_BASE
|
||||
|
||||
* test/yacc/code_error.tab.h: reference output for testing
|
||||
|
||||
* test/code_calc.code.c, test/code_calc.tab.c, test/code_calc.tab.h:
|
||||
RCS_BASE
|
||||
|
||||
* test/yacc/code_calc.tab.h: reference output for testing
|
||||
|
||||
* test/pure_calc.output, test/pure_calc.tab.h, test/pure_error.output, test/pure_error.tab.h:
|
||||
RCS_BASE
|
||||
|
||||
* test/yacc/pure_calc.output, test/yacc/pure_calc.tab.h, test/yacc/pure_error.output, test/yacc/pure_error.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* test/code_calc.output, test/code_error.output: RCS_BASE
|
||||
|
||||
* test/yacc/code_calc.output, test/yacc/code_error.output:
|
||||
reference output for testing
|
||||
|
||||
* test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: regen
|
||||
|
||||
* test/run_test.sh:
|
||||
@ -1250,9 +1942,18 @@
|
||||
|
||||
* test/grammar.output, test/grammar.tab.c, test/grammar.tab.h: RCS_BASE
|
||||
|
||||
* test/yacc/grammar.output, test/yacc/grammar.tab.h:
|
||||
reference output for testing
|
||||
|
||||
* makefile.in: turn on "make check" rule
|
||||
|
||||
* test/calc.output, test/run_test.sh, test/calc.tab.h: RCS_BASE
|
||||
* test/calc.output: RCS_BASE
|
||||
|
||||
* test/yacc/calc.output: reference output for testing
|
||||
|
||||
* test/run_test.sh, test/calc.tab.h: RCS_BASE
|
||||
|
||||
* test/yacc/calc.tab.h: reference output for testing
|
||||
|
||||
* test/ftp.tab.c: yyparse() is now yyparse(void)
|
||||
|
||||
@ -1338,8 +2039,16 @@
|
||||
|
||||
1993-02-22 unknown
|
||||
|
||||
* test/ftp.output, test/ftp.tab.c, test/ftp.tab.h, test/error.output, test/error.tab.c, test/error.tab.h:
|
||||
RCS_BASE
|
||||
* test/ftp.output, test/ftp.tab.c, test/ftp.tab.h: RCS_BASE
|
||||
|
||||
1993-02-22 Thomas E. Dickey <tom@invisible-island.net>
|
||||
|
||||
* test/yacc/error.output, test/yacc/error.tab.h:
|
||||
reference output for testing
|
||||
|
||||
1993-02-22 unknown
|
||||
|
||||
* test/error.output, test/error.tab.c, test/error.tab.h: RCS_BASE
|
||||
|
||||
* skeleton.c, warshall.c, main.c, output.c, reader.c, closure.c, NOTES:
|
||||
original version
|
||||
|
669
MANIFEST
Normal file
669
MANIFEST
Normal file
@ -0,0 +1,669 @@
|
||||
MANIFEST for byacc-20140409, version t20140409
|
||||
--------------------------------------------------------------------------------
|
||||
MANIFEST this file
|
||||
ACKNOWLEDGEMENTS original version of byacc - 1993
|
||||
AUTHORS nicknames for some contributors (see CHANGES for details)
|
||||
Makefile.old renamed from Makefile
|
||||
NEW_FEATURES original version of byacc - 1993
|
||||
NOTES original version of byacc - 1993
|
||||
NOTES-btyacc-Changes byacc-btyacc-20140323
|
||||
NOTES-btyacc-Disposition byacc-btyacc-20140323
|
||||
NO_WARRANTY original version of byacc - 1993
|
||||
README original version of byacc - 1993
|
||||
README.BTYACC byacc-btyacc-20140323
|
||||
VERSION patch-level
|
||||
aclocal.m4 macros for configure-script
|
||||
btyaccpar.c generated from btyaccpar.skel
|
||||
btyaccpar.skel bytacc's parser skeleton (renamed from yaccpar.skel)
|
||||
closure.c original version of byacc - 1993
|
||||
config.guess configure-script utility
|
||||
config.sub configure-script utility
|
||||
config_h.in template for config.h
|
||||
configure snapshot 2004/3/28
|
||||
configure.in template for configure-script
|
||||
defs.h original version of byacc - 1993
|
||||
descrip.mms build-script for VMS
|
||||
error.c original version of byacc - 1993
|
||||
graph.c write the file y.dot in graphviz format
|
||||
install-sh install-script
|
||||
lalr.c original version of byacc - 1993
|
||||
lr0.c original version of byacc - 1993
|
||||
main.c original version of byacc - 1993
|
||||
makefile.in template for makefile
|
||||
mkpar.c original version of byacc - 1993
|
||||
mstring.c string-utilities
|
||||
output.c original version of byacc - 1993
|
||||
reader.c original version of byacc - 1993
|
||||
skel2c awk script to transform yaccpar.skel into skeleton.c
|
||||
symtab.c original version of byacc - 1993
|
||||
verbose.c original version of byacc - 1993
|
||||
vmsbuild.com build-script for VMS
|
||||
warshall.c original version of byacc - 1993
|
||||
yacc.1 original version of byacc - 1993
|
||||
yaccpar.c generated from yaccpar.skel
|
||||
yaccpar.skel data which can be transformed into skeleton.c
|
||||
package subdirectory
|
||||
package/byacc.spec RPM file for byacc
|
||||
package/debian subdirectory
|
||||
package/debian/changelog scripts from Debian package
|
||||
package/debian/compat scripts from Debian package
|
||||
package/debian/control scripts from Debian package
|
||||
package/debian/copyright scripts from Debian package
|
||||
package/debian/docs scripts from Debian package
|
||||
package/debian/postinst scripts from Debian package
|
||||
package/debian/prerm scripts from Debian package
|
||||
package/debian/rules scripts from Debian package
|
||||
package/debian/source subdirectory
|
||||
package/debian/source/format scripts from Debian package
|
||||
package/debian subdirectory
|
||||
package/debian/watch scripts from Debian package
|
||||
package subdirectory
|
||||
package/mingw-byacc.spec mingw spec-file, for cross-compiles
|
||||
package/pkgsrc subdirectory
|
||||
package/pkgsrc/DESCR scripts from NetBSD pkgsrc, for test-builds
|
||||
package/pkgsrc/Makefile scripts from NetBSD pkgsrc, for test-builds
|
||||
package/pkgsrc/PLIST scripts from NetBSD pkgsrc, for test-builds
|
||||
package/pkgsrc/distinfo scripts from NetBSD pkgsrc, for test-builds
|
||||
test subdirectory
|
||||
test/README describe contents of "test" subdirectory
|
||||
test/btyacc subdirectory
|
||||
test/btyacc/big_b.error exercise -L/-B options
|
||||
test/btyacc/big_b.output exercise -L/-B options
|
||||
test/btyacc/big_l.error exercise -L/-B options
|
||||
test/btyacc/big_l.output exercise -L/-B options
|
||||
test/btyacc/btyacc_calc1.error reference output for testing
|
||||
test/btyacc/btyacc_calc1.output reference output for testing
|
||||
test/btyacc/btyacc_calc1.tab.c reference output for testing
|
||||
test/btyacc/btyacc_calc1.tab.h reference output for testing
|
||||
test/btyacc/btyacc_demo.error reference output for testing
|
||||
test/btyacc/btyacc_demo.output reference output for testing
|
||||
test/btyacc/btyacc_demo.tab.c reference output for testing
|
||||
test/btyacc/btyacc_demo.tab.h reference output for testing
|
||||
test/btyacc/calc.error reference output for testing
|
||||
test/btyacc/calc.output reference output for testing
|
||||
test/btyacc/calc.tab.c reference output for testing
|
||||
test/btyacc/calc.tab.h reference output for testing
|
||||
test/btyacc/calc1.error reference output for testing
|
||||
test/btyacc/calc1.output reference output for testing
|
||||
test/btyacc/calc1.tab.c reference output for testing
|
||||
test/btyacc/calc1.tab.h reference output for testing
|
||||
test/btyacc/calc2.error reference output for testing
|
||||
test/btyacc/calc2.output reference output for testing
|
||||
test/btyacc/calc2.tab.c reference output for testing
|
||||
test/btyacc/calc2.tab.h reference output for testing
|
||||
test/btyacc/calc3.error reference output for testing
|
||||
test/btyacc/calc3.output reference output for testing
|
||||
test/btyacc/calc3.tab.c reference output for testing
|
||||
test/btyacc/calc3.tab.h reference output for testing
|
||||
test/btyacc/code_calc.code.c reference output for testing
|
||||
test/btyacc/code_calc.error reference output for testing
|
||||
test/btyacc/code_calc.output reference output for testing
|
||||
test/btyacc/code_calc.tab.c reference output for testing
|
||||
test/btyacc/code_calc.tab.h reference output for testing
|
||||
test/btyacc/code_debug.c reference for test-output
|
||||
test/btyacc/code_debug.error reference for test-output
|
||||
test/btyacc/code_debug.h reference for test-output
|
||||
test/btyacc/code_debug.i reference for test-output
|
||||
test/btyacc/code_debug.output reference for test-output
|
||||
test/btyacc/code_error.code.c reference output for testing
|
||||
test/btyacc/code_error.error reference output for testing
|
||||
test/btyacc/code_error.output reference output for testing
|
||||
test/btyacc/code_error.tab.c reference output for testing
|
||||
test/btyacc/code_error.tab.h reference output for testing
|
||||
test/btyacc/empty.error reference output for testing
|
||||
test/btyacc/empty.output reference output for testing
|
||||
test/btyacc/empty.tab.c reference output for testing
|
||||
test/btyacc/empty.tab.h reference output for testing
|
||||
test/btyacc/err_inherit1.error reference output for testing
|
||||
test/btyacc/err_inherit1.output reference output for testing
|
||||
test/btyacc/err_inherit1.tab.c reference output for testing
|
||||
test/btyacc/err_inherit1.tab.h reference output for testing
|
||||
test/btyacc/err_inherit2.error reference output for testing
|
||||
test/btyacc/err_inherit2.output reference output for testing
|
||||
test/btyacc/err_inherit2.tab.c reference output for testing
|
||||
test/btyacc/err_inherit2.tab.h reference output for testing
|
||||
test/btyacc/err_inherit3.error reference output for testing
|
||||
test/btyacc/err_inherit3.output reference output for testing
|
||||
test/btyacc/err_inherit3.tab.c reference output for testing
|
||||
test/btyacc/err_inherit3.tab.h reference output for testing
|
||||
test/btyacc/err_inherit4.error reference output for testing
|
||||
test/btyacc/err_inherit4.output reference output for testing
|
||||
test/btyacc/err_inherit4.tab.c reference output for testing
|
||||
test/btyacc/err_inherit4.tab.h reference output for testing
|
||||
test/btyacc/err_inherit5.error reference output for testing
|
||||
test/btyacc/err_inherit5.output reference output for testing
|
||||
test/btyacc/err_inherit5.tab.c reference output for testing
|
||||
test/btyacc/err_inherit5.tab.h reference output for testing
|
||||
test/btyacc/err_syntax1.error reference output for testing
|
||||
test/btyacc/err_syntax1.output reference output for testing
|
||||
test/btyacc/err_syntax1.tab.c reference output for testing
|
||||
test/btyacc/err_syntax1.tab.h reference output for testing
|
||||
test/btyacc/err_syntax10.error reference output for testing
|
||||
test/btyacc/err_syntax10.output reference output for testing
|
||||
test/btyacc/err_syntax10.tab.c reference output for testing
|
||||
test/btyacc/err_syntax10.tab.h reference output for testing
|
||||
test/btyacc/err_syntax11.error reference output for testing
|
||||
test/btyacc/err_syntax11.output reference output for testing
|
||||
test/btyacc/err_syntax11.tab.c reference output for testing
|
||||
test/btyacc/err_syntax11.tab.h reference output for testing
|
||||
test/btyacc/err_syntax12.error reference output for testing
|
||||
test/btyacc/err_syntax12.output reference output for testing
|
||||
test/btyacc/err_syntax12.tab.c reference output for testing
|
||||
test/btyacc/err_syntax12.tab.h reference output for testing
|
||||
test/btyacc/err_syntax13.error reference output for testing
|
||||
test/btyacc/err_syntax13.output reference output for testing
|
||||
test/btyacc/err_syntax13.tab.c reference output for testing
|
||||
test/btyacc/err_syntax13.tab.h reference output for testing
|
||||
test/btyacc/err_syntax14.error reference output for testing
|
||||
test/btyacc/err_syntax14.output reference output for testing
|
||||
test/btyacc/err_syntax14.tab.c reference output for testing
|
||||
test/btyacc/err_syntax14.tab.h reference output for testing
|
||||
test/btyacc/err_syntax15.error reference output for testing
|
||||
test/btyacc/err_syntax15.output reference output for testing
|
||||
test/btyacc/err_syntax15.tab.c reference output for testing
|
||||
test/btyacc/err_syntax15.tab.h reference output for testing
|
||||
test/btyacc/err_syntax16.error reference output for testing
|
||||
test/btyacc/err_syntax16.output reference output for testing
|
||||
test/btyacc/err_syntax16.tab.c reference output for testing
|
||||
test/btyacc/err_syntax16.tab.h reference output for testing
|
||||
test/btyacc/err_syntax17.error reference output for testing
|
||||
test/btyacc/err_syntax17.output reference output for testing
|
||||
test/btyacc/err_syntax17.tab.c reference output for testing
|
||||
test/btyacc/err_syntax17.tab.h reference output for testing
|
||||
test/btyacc/err_syntax18.error reference output for testing
|
||||
test/btyacc/err_syntax18.output reference output for testing
|
||||
test/btyacc/err_syntax18.tab.c reference output for testing
|
||||
test/btyacc/err_syntax18.tab.h reference output for testing
|
||||
test/btyacc/err_syntax19.error reference output for testing
|
||||
test/btyacc/err_syntax19.output reference output for testing
|
||||
test/btyacc/err_syntax19.tab.c reference output for testing
|
||||
test/btyacc/err_syntax19.tab.h reference output for testing
|
||||
test/btyacc/err_syntax2.error reference output for testing
|
||||
test/btyacc/err_syntax2.output reference output for testing
|
||||
test/btyacc/err_syntax2.tab.c reference output for testing
|
||||
test/btyacc/err_syntax2.tab.h reference output for testing
|
||||
test/btyacc/err_syntax20.error reference output for testing
|
||||
test/btyacc/err_syntax20.output reference output for testing
|
||||
test/btyacc/err_syntax20.tab.c reference output for testing
|
||||
test/btyacc/err_syntax20.tab.h reference output for testing
|
||||
test/btyacc/err_syntax21.error reference output for testing
|
||||
test/btyacc/err_syntax21.output reference output for testing
|
||||
test/btyacc/err_syntax21.tab.c reference output for testing
|
||||
test/btyacc/err_syntax21.tab.h reference output for testing
|
||||
test/btyacc/err_syntax22.error reference output for testing
|
||||
test/btyacc/err_syntax22.output reference output for testing
|
||||
test/btyacc/err_syntax22.tab.c reference output for testing
|
||||
test/btyacc/err_syntax22.tab.h reference output for testing
|
||||
test/btyacc/err_syntax23.error reference output for testing
|
||||
test/btyacc/err_syntax23.output reference output for testing
|
||||
test/btyacc/err_syntax23.tab.c reference output for testing
|
||||
test/btyacc/err_syntax23.tab.h reference output for testing
|
||||
test/btyacc/err_syntax24.error reference output for testing
|
||||
test/btyacc/err_syntax24.output reference output for testing
|
||||
test/btyacc/err_syntax24.tab.c reference output for testing
|
||||
test/btyacc/err_syntax24.tab.h reference output for testing
|
||||
test/btyacc/err_syntax25.error reference output for testing
|
||||
test/btyacc/err_syntax25.output reference output for testing
|
||||
test/btyacc/err_syntax25.tab.c reference output for testing
|
||||
test/btyacc/err_syntax25.tab.h reference output for testing
|
||||
test/btyacc/err_syntax26.error reference output for testing
|
||||
test/btyacc/err_syntax26.output reference output for testing
|
||||
test/btyacc/err_syntax26.tab.c reference output for testing
|
||||
test/btyacc/err_syntax26.tab.h reference output for testing
|
||||
test/btyacc/err_syntax27.error reference output for testing
|
||||
test/btyacc/err_syntax27.output reference output for testing
|
||||
test/btyacc/err_syntax27.tab.c reference output for testing
|
||||
test/btyacc/err_syntax27.tab.h reference output for testing
|
||||
test/btyacc/err_syntax3.error reference output for testing
|
||||
test/btyacc/err_syntax3.output reference output for testing
|
||||
test/btyacc/err_syntax3.tab.c reference output for testing
|
||||
test/btyacc/err_syntax3.tab.h reference output for testing
|
||||
test/btyacc/err_syntax4.error reference output for testing
|
||||
test/btyacc/err_syntax4.output reference output for testing
|
||||
test/btyacc/err_syntax4.tab.c reference output for testing
|
||||
test/btyacc/err_syntax4.tab.h reference output for testing
|
||||
test/btyacc/err_syntax5.error reference output for testing
|
||||
test/btyacc/err_syntax5.output reference output for testing
|
||||
test/btyacc/err_syntax5.tab.c reference output for testing
|
||||
test/btyacc/err_syntax5.tab.h reference output for testing
|
||||
test/btyacc/err_syntax6.error reference output for testing
|
||||
test/btyacc/err_syntax6.output reference output for testing
|
||||
test/btyacc/err_syntax6.tab.c reference output for testing
|
||||
test/btyacc/err_syntax6.tab.h reference output for testing
|
||||
test/btyacc/err_syntax7.error reference output for testing
|
||||
test/btyacc/err_syntax7.output reference output for testing
|
||||
test/btyacc/err_syntax7.tab.c reference output for testing
|
||||
test/btyacc/err_syntax7.tab.h reference output for testing
|
||||
test/btyacc/err_syntax7a.error reference output for testing
|
||||
test/btyacc/err_syntax7a.output reference output for testing
|
||||
test/btyacc/err_syntax7a.tab.c reference output for testing
|
||||
test/btyacc/err_syntax7a.tab.h reference output for testing
|
||||
test/btyacc/err_syntax7b.error reference output for testing
|
||||
test/btyacc/err_syntax7b.output reference output for testing
|
||||
test/btyacc/err_syntax7b.tab.c reference output for testing
|
||||
test/btyacc/err_syntax7b.tab.h reference output for testing
|
||||
test/btyacc/err_syntax8.error reference output for testing
|
||||
test/btyacc/err_syntax8.output reference output for testing
|
||||
test/btyacc/err_syntax8.tab.c reference output for testing
|
||||
test/btyacc/err_syntax8.tab.h reference output for testing
|
||||
test/btyacc/err_syntax8a.error reference output for testing
|
||||
test/btyacc/err_syntax8a.output reference output for testing
|
||||
test/btyacc/err_syntax8a.tab.c reference output for testing
|
||||
test/btyacc/err_syntax8a.tab.h reference output for testing
|
||||
test/btyacc/err_syntax9.error reference output for testing
|
||||
test/btyacc/err_syntax9.output reference output for testing
|
||||
test/btyacc/err_syntax9.tab.c reference output for testing
|
||||
test/btyacc/err_syntax9.tab.h reference output for testing
|
||||
test/btyacc/error.error reference output for testing
|
||||
test/btyacc/error.output reference output for testing
|
||||
test/btyacc/error.tab.c reference output for testing
|
||||
test/btyacc/error.tab.h reference output for testing
|
||||
test/btyacc/grammar.dot reference output for testing
|
||||
test/btyacc/grammar.error reference output for testing
|
||||
test/btyacc/grammar.output reference output for testing
|
||||
test/btyacc/grammar.tab.c reference output for testing
|
||||
test/btyacc/grammar.tab.h reference output for testing
|
||||
test/btyacc/help.error reference output for testing
|
||||
test/btyacc/help.output reference output for testing
|
||||
test/btyacc/inherit0.error reference output for testing
|
||||
test/btyacc/inherit0.output reference output for testing
|
||||
test/btyacc/inherit0.tab.c reference output for testing
|
||||
test/btyacc/inherit0.tab.h reference output for testing
|
||||
test/btyacc/inherit1.error reference output for testing
|
||||
test/btyacc/inherit1.output reference output for testing
|
||||
test/btyacc/inherit1.tab.c reference output for testing
|
||||
test/btyacc/inherit1.tab.h reference output for testing
|
||||
test/btyacc/inherit2.error reference output for testing
|
||||
test/btyacc/inherit2.output reference output for testing
|
||||
test/btyacc/inherit2.tab.c reference output for testing
|
||||
test/btyacc/inherit2.tab.h reference output for testing
|
||||
test/btyacc/no_b_opt.error reference output for testing
|
||||
test/btyacc/no_b_opt.output reference output for testing
|
||||
test/btyacc/no_b_opt1.error reference output for testing
|
||||
test/btyacc/no_b_opt1.output reference output for testing
|
||||
test/btyacc/no_code_c.error reference output for testing
|
||||
test/btyacc/no_code_c.output reference output for testing
|
||||
test/btyacc/no_defines.error reference output for testing
|
||||
test/btyacc/no_defines.output reference output for testing
|
||||
test/btyacc/no_graph.error reference output for testing
|
||||
test/btyacc/no_graph.output reference output for testing
|
||||
test/btyacc/no_include.error reference output for testing
|
||||
test/btyacc/no_include.output reference output for testing
|
||||
test/btyacc/no_opts.error reference output for testing
|
||||
test/btyacc/no_opts.output reference output for testing
|
||||
test/btyacc/no_output.error reference output for testing
|
||||
test/btyacc/no_output.output reference output for testing
|
||||
test/btyacc/no_output1.error reference output for testing
|
||||
test/btyacc/no_output1.output reference output for testing
|
||||
test/btyacc/no_output2.error reference output for testing
|
||||
test/btyacc/no_output2.output reference output for testing
|
||||
test/btyacc/no_p_opt.error reference output for testing
|
||||
test/btyacc/no_p_opt.output reference output for testing
|
||||
test/btyacc/no_p_opt1.error reference output for testing
|
||||
test/btyacc/no_p_opt1.output reference output for testing
|
||||
test/btyacc/no_verbose.error reference output for testing
|
||||
test/btyacc/no_verbose.output reference output for testing
|
||||
test/btyacc/nostdin.error reference output for testing
|
||||
test/btyacc/nostdin.output reference output for testing
|
||||
test/btyacc/ok_syntax1.error reference output for testing
|
||||
test/btyacc/ok_syntax1.output reference output for testing
|
||||
test/btyacc/ok_syntax1.tab.c reference output for testing
|
||||
test/btyacc/ok_syntax1.tab.h reference output for testing
|
||||
test/btyacc/pure_calc.error reference output for testing
|
||||
test/btyacc/pure_calc.output reference output for testing
|
||||
test/btyacc/pure_calc.tab.c reference output for testing
|
||||
test/btyacc/pure_calc.tab.h reference output for testing
|
||||
test/btyacc/pure_error.error reference output for testing
|
||||
test/btyacc/pure_error.output reference output for testing
|
||||
test/btyacc/pure_error.tab.c reference output for testing
|
||||
test/btyacc/pure_error.tab.h reference output for testing
|
||||
test/btyacc/quote_calc-s.error reference output for testing
|
||||
test/btyacc/quote_calc-s.output reference output for testing
|
||||
test/btyacc/quote_calc-s.tab.c reference output for testing
|
||||
test/btyacc/quote_calc-s.tab.h reference output for testing
|
||||
test/btyacc/quote_calc.error reference output for testing
|
||||
test/btyacc/quote_calc.output reference output for testing
|
||||
test/btyacc/quote_calc.tab.c reference output for testing
|
||||
test/btyacc/quote_calc.tab.h reference output for testing
|
||||
test/btyacc/quote_calc2-s.error reference output for testing
|
||||
test/btyacc/quote_calc2-s.output reference output for testing
|
||||
test/btyacc/quote_calc2-s.tab.c reference output for testing
|
||||
test/btyacc/quote_calc2-s.tab.h reference output for testing
|
||||
test/btyacc/quote_calc2.error reference output for testing
|
||||
test/btyacc/quote_calc2.output reference output for testing
|
||||
test/btyacc/quote_calc2.tab.c reference output for testing
|
||||
test/btyacc/quote_calc2.tab.h reference output for testing
|
||||
test/btyacc/quote_calc3-s.error reference output for testing
|
||||
test/btyacc/quote_calc3-s.output reference output for testing
|
||||
test/btyacc/quote_calc3-s.tab.c reference output for testing
|
||||
test/btyacc/quote_calc3-s.tab.h reference output for testing
|
||||
test/btyacc/quote_calc3.error reference output for testing
|
||||
test/btyacc/quote_calc3.output reference output for testing
|
||||
test/btyacc/quote_calc3.tab.c reference output for testing
|
||||
test/btyacc/quote_calc3.tab.h reference output for testing
|
||||
test/btyacc/quote_calc4-s.error reference output for testing
|
||||
test/btyacc/quote_calc4-s.output reference output for testing
|
||||
test/btyacc/quote_calc4-s.tab.c reference output for testing
|
||||
test/btyacc/quote_calc4-s.tab.h reference output for testing
|
||||
test/btyacc/quote_calc4.error reference output for testing
|
||||
test/btyacc/quote_calc4.output reference output for testing
|
||||
test/btyacc/quote_calc4.tab.c reference output for testing
|
||||
test/btyacc/quote_calc4.tab.h reference output for testing
|
||||
test/btyacc/rename_debug.c reference output for testing
|
||||
test/btyacc/rename_debug.error reference output for testing
|
||||
test/btyacc/rename_debug.h reference output for testing
|
||||
test/btyacc/rename_debug.i reference output for testing
|
||||
test/btyacc/rename_debug.output reference output for testing
|
||||
test/btyacc/varsyntax_calc1.error reference output for testing
|
||||
test/btyacc/varsyntax_calc1.output reference output for testing
|
||||
test/btyacc/varsyntax_calc1.tab.c reference output for testing
|
||||
test/btyacc/varsyntax_calc1.tab.h reference output for testing
|
||||
test subdirectory
|
||||
test/btyacc_calc1.y testcase for btyacc
|
||||
test/btyacc_demo.y testcase for btyacc
|
||||
test/calc.y example from VMS freeware version of byacc
|
||||
test/calc1.y advanced example from Steve Johnson's paper.
|
||||
test/calc2.y test-cases and reference files for %lex-param / %parse-param
|
||||
test/calc3.y test-cases and reference files for %lex-param / %parse-param
|
||||
test/code_calc.y reference input for testing
|
||||
test/code_debug.y test-input, for -i, -o, -d options
|
||||
test/code_error.y reference input for testing
|
||||
test/empty.y testcase for btyacc
|
||||
test/err_inherit1.y testcase for btyacc
|
||||
test/err_inherit2.y testcase for btyacc
|
||||
test/err_inherit3.y testcase for btyacc
|
||||
test/err_inherit4.y testcase for btyacc
|
||||
test/err_inherit5.y testcase for btyacc
|
||||
test/err_syntax1.y test-case with syntax error (and nonprinting character)
|
||||
test/err_syntax10.y testcase for retyped_warning()
|
||||
test/err_syntax11.y testcase for reprec_warning()
|
||||
test/err_syntax12.y testcase for revalued_warning()
|
||||
test/err_syntax13.y testcase for terminal_start()
|
||||
test/err_syntax14.y testcase for restarted_warning() and undefined_goal()
|
||||
test/err_syntax15.y testcase for no_grammar()
|
||||
test/err_syntax16.y testcase for terminal_lhs()
|
||||
test/err_syntax17.y testcase for unterminated_action()
|
||||
test/err_syntax18.y testcase for dollar_warning()
|
||||
test/err_syntax19.y testcase for dollar_error()
|
||||
test/err_syntax2.y testcase for unterminated_comment()
|
||||
test/err_syntax20.y testcase for undefined_symbol_warning()
|
||||
test/err_syntax21.y testcase for unknown_rhs()
|
||||
test/err_syntax22.y testcase for untyped_rhs()
|
||||
test/err_syntax23.y testcase for untyped_lhs()
|
||||
test/err_syntax24.y testcase for default_action_warning()
|
||||
test/err_syntax25.y testcase for over_unionized()
|
||||
test/err_syntax26.y testcase for unexpected_EOF()
|
||||
test/err_syntax27.y testcase for missing_brace()
|
||||
test/err_syntax3.y testcase for unterminated_string()
|
||||
test/err_syntax4.y testcase for unterminated_text()
|
||||
test/err_syntax5.y testcase for unterminated_union()
|
||||
test/err_syntax6.y testcase for illegal_tag()
|
||||
test/err_syntax7.y testcase for illegal_character()
|
||||
test/err_syntax7a.y testcase for illegal_character()
|
||||
test/err_syntax7b.y testcase for illegal_character()
|
||||
test/err_syntax8.y testcase for used_reserved()
|
||||
test/err_syntax8a.y testcase for used_reserved()
|
||||
test/err_syntax9.y testcase for tokenized_start()
|
||||
test/error.y original version of byacc - 1993
|
||||
test/grammar.y grammar from cproto
|
||||
test/inherit0.y testcase for btyacc
|
||||
test/inherit1.y testcase for btyacc
|
||||
test/inherit2.y testcase for btyacc
|
||||
test/ok_syntax1.y testcase for valid literal syntax
|
||||
test/pure_calc.y reference input for testing
|
||||
test/pure_error.y reference input for testing
|
||||
test/quote_calc.y test-case for %token using quoted name
|
||||
test/quote_calc2.y test-case for %token using quoted name
|
||||
test/quote_calc3.y test-case for %token using quoted name
|
||||
test/quote_calc4.y test-case for %token using quoted name
|
||||
test/run_lint.sh run lint, using the build-directory's makefile, on each ".c" file in test-directory
|
||||
test/run_make.sh do a test-compile of each ".c" file in the test-directory
|
||||
test/run_test.sh test-script for byacc
|
||||
test/varsyntax_calc1.y testcase for btyacc
|
||||
test/yacc subdirectory
|
||||
test/yacc/big_b.error exercise -L/-B options
|
||||
test/yacc/big_b.output exercise -L/-B options
|
||||
test/yacc/big_l.error exercise -L/-B options
|
||||
test/yacc/big_l.output exercise -L/-B options
|
||||
test/yacc/calc.error reference output for testing
|
||||
test/yacc/calc.output reference output for testing
|
||||
test/yacc/calc.tab.c reference output for testing
|
||||
test/yacc/calc.tab.h reference output for testing
|
||||
test/yacc/calc1.error reference output for testing
|
||||
test/yacc/calc1.output reference output for testing
|
||||
test/yacc/calc1.tab.c reference output for testing
|
||||
test/yacc/calc1.tab.h reference output for testing
|
||||
test/yacc/calc2.error reference output for testing
|
||||
test/yacc/calc2.output reference output for testing
|
||||
test/yacc/calc2.tab.c reference output for testing
|
||||
test/yacc/calc2.tab.h reference output for testing
|
||||
test/yacc/calc3.error reference output for testing
|
||||
test/yacc/calc3.output reference output for testing
|
||||
test/yacc/calc3.tab.c reference output for testing
|
||||
test/yacc/calc3.tab.h reference output for testing
|
||||
test/yacc/code_calc.code.c reference output for testing
|
||||
test/yacc/code_calc.error reference output for testing
|
||||
test/yacc/code_calc.output reference output for testing
|
||||
test/yacc/code_calc.tab.c reference output for testing
|
||||
test/yacc/code_calc.tab.h reference output for testing
|
||||
test/yacc/code_error.code.c reference output for testing
|
||||
test/yacc/code_error.error reference output for testing
|
||||
test/yacc/code_error.output reference output for testing
|
||||
test/yacc/code_error.tab.c reference output for testing
|
||||
test/yacc/code_error.tab.h reference output for testing
|
||||
test/yacc/empty.error reference output for testing
|
||||
test/yacc/empty.output reference output for testing
|
||||
test/yacc/empty.tab.c reference output for testing
|
||||
test/yacc/empty.tab.h reference output for testing
|
||||
test/yacc/err_syntax1.error reference output for testing
|
||||
test/yacc/err_syntax1.output reference output for testing
|
||||
test/yacc/err_syntax1.tab.c reference output for testing
|
||||
test/yacc/err_syntax1.tab.h reference output for testing
|
||||
test/yacc/err_syntax10.error reference output for testing
|
||||
test/yacc/err_syntax10.output reference output for testing
|
||||
test/yacc/err_syntax10.tab.c reference output for testing
|
||||
test/yacc/err_syntax10.tab.h reference output for testing
|
||||
test/yacc/err_syntax11.error reference output for testing
|
||||
test/yacc/err_syntax11.output reference output for testing
|
||||
test/yacc/err_syntax11.tab.c reference output for testing
|
||||
test/yacc/err_syntax11.tab.h reference output for testing
|
||||
test/yacc/err_syntax12.error reference output for testing
|
||||
test/yacc/err_syntax12.output reference output for testing
|
||||
test/yacc/err_syntax12.tab.c reference output for testing
|
||||
test/yacc/err_syntax12.tab.h reference output for testing
|
||||
test/yacc/err_syntax13.error reference output for testing
|
||||
test/yacc/err_syntax13.output reference output for testing
|
||||
test/yacc/err_syntax13.tab.c reference output for testing
|
||||
test/yacc/err_syntax13.tab.h reference output for testing
|
||||
test/yacc/err_syntax14.error reference output for testing
|
||||
test/yacc/err_syntax14.output reference output for testing
|
||||
test/yacc/err_syntax14.tab.c reference output for testing
|
||||
test/yacc/err_syntax14.tab.h reference output for testing
|
||||
test/yacc/err_syntax15.error reference output for testing
|
||||
test/yacc/err_syntax15.output reference output for testing
|
||||
test/yacc/err_syntax15.tab.c reference output for testing
|
||||
test/yacc/err_syntax15.tab.h reference output for testing
|
||||
test/yacc/err_syntax16.error reference output for testing
|
||||
test/yacc/err_syntax16.output reference output for testing
|
||||
test/yacc/err_syntax16.tab.c reference output for testing
|
||||
test/yacc/err_syntax16.tab.h reference output for testing
|
||||
test/yacc/err_syntax17.error reference output for testing
|
||||
test/yacc/err_syntax17.output reference output for testing
|
||||
test/yacc/err_syntax17.tab.c reference output for testing
|
||||
test/yacc/err_syntax17.tab.h reference output for testing
|
||||
test/yacc/err_syntax18.error reference output for testing
|
||||
test/yacc/err_syntax18.output reference output for testing
|
||||
test/yacc/err_syntax18.tab.c reference output for testing
|
||||
test/yacc/err_syntax18.tab.h reference output for testing
|
||||
test/yacc/err_syntax19.error reference output for testing
|
||||
test/yacc/err_syntax19.output reference output for testing
|
||||
test/yacc/err_syntax19.tab.c reference output for testing
|
||||
test/yacc/err_syntax19.tab.h reference output for testing
|
||||
test/yacc/err_syntax2.error reference output for testing
|
||||
test/yacc/err_syntax2.output reference output for testing
|
||||
test/yacc/err_syntax2.tab.c reference output for testing
|
||||
test/yacc/err_syntax2.tab.h reference output for testing
|
||||
test/yacc/err_syntax20.error reference output for testing
|
||||
test/yacc/err_syntax20.output reference output for testing
|
||||
test/yacc/err_syntax20.tab.c reference output for testing
|
||||
test/yacc/err_syntax20.tab.h reference output for testing
|
||||
test/yacc/err_syntax21.error reference output for testing
|
||||
test/yacc/err_syntax21.output reference output for testing
|
||||
test/yacc/err_syntax21.tab.c reference output for testing
|
||||
test/yacc/err_syntax21.tab.h reference output for testing
|
||||
test/yacc/err_syntax22.error reference output for testing
|
||||
test/yacc/err_syntax22.output reference output for testing
|
||||
test/yacc/err_syntax22.tab.c reference output for testing
|
||||
test/yacc/err_syntax22.tab.h reference output for testing
|
||||
test/yacc/err_syntax23.error reference output for testing
|
||||
test/yacc/err_syntax23.output reference output for testing
|
||||
test/yacc/err_syntax23.tab.c reference output for testing
|
||||
test/yacc/err_syntax23.tab.h reference output for testing
|
||||
test/yacc/err_syntax24.error reference output for testing
|
||||
test/yacc/err_syntax24.output reference output for testing
|
||||
test/yacc/err_syntax24.tab.c reference output for testing
|
||||
test/yacc/err_syntax24.tab.h reference output for testing
|
||||
test/yacc/err_syntax25.error reference output for testing
|
||||
test/yacc/err_syntax25.output reference output for testing
|
||||
test/yacc/err_syntax25.tab.c reference output for testing
|
||||
test/yacc/err_syntax25.tab.h reference output for testing
|
||||
test/yacc/err_syntax26.error reference output for testing
|
||||
test/yacc/err_syntax26.output reference output for testing
|
||||
test/yacc/err_syntax26.tab.c reference output for testing
|
||||
test/yacc/err_syntax26.tab.h reference output for testing
|
||||
test/yacc/err_syntax27.error reference output for testing
|
||||
test/yacc/err_syntax27.output reference output for testing
|
||||
test/yacc/err_syntax27.tab.c reference output for testing
|
||||
test/yacc/err_syntax27.tab.h reference output for testing
|
||||
test/yacc/err_syntax3.error reference output for testing
|
||||
test/yacc/err_syntax3.output reference output for testing
|
||||
test/yacc/err_syntax3.tab.c reference output for testing
|
||||
test/yacc/err_syntax3.tab.h reference output for testing
|
||||
test/yacc/err_syntax4.error reference output for testing
|
||||
test/yacc/err_syntax4.output reference output for testing
|
||||
test/yacc/err_syntax4.tab.c reference output for testing
|
||||
test/yacc/err_syntax4.tab.h reference output for testing
|
||||
test/yacc/err_syntax5.error reference output for testing
|
||||
test/yacc/err_syntax5.output reference output for testing
|
||||
test/yacc/err_syntax5.tab.c reference output for testing
|
||||
test/yacc/err_syntax5.tab.h reference output for testing
|
||||
test/yacc/err_syntax6.error reference output for testing
|
||||
test/yacc/err_syntax6.output reference output for testing
|
||||
test/yacc/err_syntax6.tab.c reference output for testing
|
||||
test/yacc/err_syntax6.tab.h reference output for testing
|
||||
test/yacc/err_syntax7.error reference output for testing
|
||||
test/yacc/err_syntax7.output reference output for testing
|
||||
test/yacc/err_syntax7.tab.c reference output for testing
|
||||
test/yacc/err_syntax7.tab.h reference output for testing
|
||||
test/yacc/err_syntax7a.error reference output for testing
|
||||
test/yacc/err_syntax7a.output reference output for testing
|
||||
test/yacc/err_syntax7a.tab.c reference output for testing
|
||||
test/yacc/err_syntax7a.tab.h reference output for testing
|
||||
test/yacc/err_syntax7b.error reference output for testing
|
||||
test/yacc/err_syntax7b.output reference output for testing
|
||||
test/yacc/err_syntax7b.tab.c reference output for testing
|
||||
test/yacc/err_syntax7b.tab.h reference output for testing
|
||||
test/yacc/err_syntax8.error reference output for testing
|
||||
test/yacc/err_syntax8.output reference output for testing
|
||||
test/yacc/err_syntax8.tab.c reference output for testing
|
||||
test/yacc/err_syntax8.tab.h reference output for testing
|
||||
test/yacc/err_syntax8a.error reference output for testing
|
||||
test/yacc/err_syntax8a.output reference output for testing
|
||||
test/yacc/err_syntax8a.tab.c reference output for testing
|
||||
test/yacc/err_syntax8a.tab.h reference output for testing
|
||||
test/yacc/err_syntax9.error reference output for testing
|
||||
test/yacc/err_syntax9.output reference output for testing
|
||||
test/yacc/err_syntax9.tab.c reference output for testing
|
||||
test/yacc/err_syntax9.tab.h reference output for testing
|
||||
test/yacc/error.error reference output for testing
|
||||
test/yacc/error.output reference output for testing
|
||||
test/yacc/error.tab.c reference output for testing
|
||||
test/yacc/error.tab.h reference output for testing
|
||||
test/yacc/grammar.dot reference output for testing
|
||||
test/yacc/grammar.error reference output for testing
|
||||
test/yacc/grammar.output reference output for testing
|
||||
test/yacc/grammar.tab.c reference output for testing
|
||||
test/yacc/grammar.tab.h reference output for testing
|
||||
test/yacc/help.error reference output for testing
|
||||
test/yacc/help.output reference output for testing
|
||||
test/yacc/no_b_opt.error reference output for testing
|
||||
test/yacc/no_b_opt.output reference output for testing
|
||||
test/yacc/no_b_opt1.error reference output for testing
|
||||
test/yacc/no_b_opt1.output reference output for testing
|
||||
test/yacc/no_code_c.error reference output for testing
|
||||
test/yacc/no_code_c.output reference output for testing
|
||||
test/yacc/no_defines.error reference output for testing
|
||||
test/yacc/no_defines.output reference output for testing
|
||||
test/yacc/no_graph.error reference output for testing
|
||||
test/yacc/no_graph.output reference output for testing
|
||||
test/yacc/no_include.error reference output for testing
|
||||
test/yacc/no_include.output reference output for testing
|
||||
test/yacc/no_opts.error reference output for testing
|
||||
test/yacc/no_opts.output reference output for testing
|
||||
test/yacc/no_output.error reference output for testing
|
||||
test/yacc/no_output.output reference output for testing
|
||||
test/yacc/no_output1.error reference output for testing
|
||||
test/yacc/no_output1.output reference output for testing
|
||||
test/yacc/no_output2.error reference output for testing
|
||||
test/yacc/no_output2.output reference output for testing
|
||||
test/yacc/no_p_opt.error reference output for testing
|
||||
test/yacc/no_p_opt.output reference output for testing
|
||||
test/yacc/no_p_opt1.error reference output for testing
|
||||
test/yacc/no_p_opt1.output reference output for testing
|
||||
test/yacc/no_verbose.error reference output for testing
|
||||
test/yacc/no_verbose.output reference output for testing
|
||||
test/yacc/nostdin.error reference output for testing
|
||||
test/yacc/nostdin.output reference output for testing
|
||||
test/yacc/ok_syntax1.error reference output for testing
|
||||
test/yacc/ok_syntax1.output reference output for testing
|
||||
test/yacc/ok_syntax1.tab.c reference output for testing
|
||||
test/yacc/ok_syntax1.tab.h reference output for testing
|
||||
test/yacc/pure_calc.error reference output for testing
|
||||
test/yacc/pure_calc.output reference output for testing
|
||||
test/yacc/pure_calc.tab.c reference output for testing
|
||||
test/yacc/pure_calc.tab.h reference output for testing
|
||||
test/yacc/pure_error.error reference output for testing
|
||||
test/yacc/pure_error.output reference output for testing
|
||||
test/yacc/pure_error.tab.c reference output for testing
|
||||
test/yacc/pure_error.tab.h reference output for testing
|
||||
test/yacc/quote_calc-s.error reference output for testing
|
||||
test/yacc/quote_calc-s.output reference output for testing
|
||||
test/yacc/quote_calc-s.tab.c reference output for testing
|
||||
test/yacc/quote_calc-s.tab.h reference output for testing
|
||||
test/yacc/quote_calc.error reference output for testing
|
||||
test/yacc/quote_calc.output reference output for testing
|
||||
test/yacc/quote_calc.tab.c reference output for testing
|
||||
test/yacc/quote_calc.tab.h reference output for testing
|
||||
test/yacc/quote_calc2-s.error reference output for testing
|
||||
test/yacc/quote_calc2-s.output reference output for testing
|
||||
test/yacc/quote_calc2-s.tab.c reference output for testing
|
||||
test/yacc/quote_calc2-s.tab.h reference output for testing
|
||||
test/yacc/quote_calc2.error reference output for testing
|
||||
test/yacc/quote_calc2.output reference output for testing
|
||||
test/yacc/quote_calc2.tab.c reference output for testing
|
||||
test/yacc/quote_calc2.tab.h reference output for testing
|
||||
test/yacc/quote_calc3-s.error reference output for testing
|
||||
test/yacc/quote_calc3-s.output reference output for testing
|
||||
test/yacc/quote_calc3-s.tab.c reference output for testing
|
||||
test/yacc/quote_calc3-s.tab.h reference output for testing
|
||||
test/yacc/quote_calc3.error reference output for testing
|
||||
test/yacc/quote_calc3.output reference output for testing
|
||||
test/yacc/quote_calc3.tab.c reference output for testing
|
||||
test/yacc/quote_calc3.tab.h reference output for testing
|
||||
test/yacc/quote_calc4-s.error reference output for testing
|
||||
test/yacc/quote_calc4-s.output reference output for testing
|
||||
test/yacc/quote_calc4-s.tab.c reference output for testing
|
||||
test/yacc/quote_calc4-s.tab.h reference output for testing
|
||||
test/yacc/quote_calc4.error reference output for testing
|
||||
test/yacc/quote_calc4.output reference output for testing
|
||||
test/yacc/quote_calc4.tab.c reference output for testing
|
||||
test/yacc/quote_calc4.tab.h reference output for testing
|
||||
test/yacc/rename_debug.c reference output for testing
|
||||
test/yacc/rename_debug.error reference output for testing
|
||||
test/yacc/rename_debug.h reference output for testing
|
||||
test/yacc/rename_debug.i reference output for testing
|
||||
test/yacc/rename_debug.output reference output for testing
|
||||
test/yacc/varsyntax_calc1.error reference output for testing
|
||||
test/yacc/varsyntax_calc1.output reference output for testing
|
||||
test/yacc/varsyntax_calc1.tab.c reference output for testing
|
||||
test/yacc/varsyntax_calc1.tab.h reference output for testing
|
385
NOTES-btyacc-Changes
Normal file
385
NOTES-btyacc-Changes
Normal file
@ -0,0 +1,385 @@
|
||||
Tom Shields, March 17, 2014
|
||||
|
||||
PARKING LOT ISSUES:
|
||||
-------------------
|
||||
- verify debian packaging still works?
|
||||
|
||||
- there are no #line directives in y.tab.i, other than those that come
|
||||
from the input file and the skeleton file; to fix this, would need to
|
||||
count output lines in externs_file and add 'write_externs_lineno()'
|
||||
similar to 'write_code_lineno()'
|
||||
- if there are no defined symbols, the .tab.h file isn't empty (weird case,
|
||||
may not be worth fixing)
|
||||
- consider: treat []-actions identical to {}-actions if not processing a
|
||||
backtracking parser (avoids test case error)?
|
||||
|
||||
|
||||
BTYACC CHANGES CURRENTLY DEFERRED, BY FILE:
|
||||
-------------------------------------------
|
||||
|
||||
push.skel
|
||||
- skeleton for a 'push' parser
|
||||
- needs to be upgraded match the structure of yaccpar.skel
|
||||
|
||||
defs.h
|
||||
- adopt '%include' changes
|
||||
- adopt '%define'/'%ifdef'/'%endif'
|
||||
- adopt -E flag to print preprocessed grammar to stdout
|
||||
|
||||
error.c
|
||||
- adopt '%include' changes
|
||||
- NOTE: there is a btyacc change that might be worth adopting in byacc
|
||||
[FileError() refactoring to eliminate duplicated code in most of the
|
||||
error message functions]
|
||||
|
||||
main.c
|
||||
- adopt '%define' changes
|
||||
- adopt '-DNAME' command line option to define preprocessor variable NAME
|
||||
- adopt -E flag to print preprocessed grammar to stdout
|
||||
- adopt '-S skeleton_file' command line option to select an alternate parser
|
||||
skeleton file
|
||||
- the skeleton file named by the -S flag is used as provided to open the
|
||||
file; consider a change to this behavior to check whether the named file
|
||||
has a path prefix, and if not, look in 'installation' directory if the
|
||||
file is not found in the working directory
|
||||
|
||||
output.c
|
||||
- adopt '%include' changes
|
||||
|
||||
reader.c
|
||||
- adopt '%include' changes
|
||||
- adopt '%define'/'%ifdef'/'%endif' changes
|
||||
- adopt -E flag to print preprocessed grammar to stdout
|
||||
- NOTE: there is a btyacc change that might be worth adopting in byacc
|
||||
[copy_string() & copy_comment() refactoring to eliminate duplicated
|
||||
code in copy_text() and copy_union()]
|
||||
|
||||
warshall.c
|
||||
- NOTE: there is a btyacc change that might be worth adopting in byacc
|
||||
[shifting 'mask' incrementally rather than literal '1' by a variable
|
||||
amount each time thru the loop]
|
||||
|
||||
|
||||
================================================================================
|
||||
|
||||
|
||||
new files:
|
||||
----------
|
||||
|
||||
skel2c
|
||||
- modified from btyacc distribution: don't generate #include defs.h
|
||||
- extended syntax recognized to include '%% insert VERSION here', generating
|
||||
the defines for YYMAJOR, YYMINOR and YYPATCH at that point
|
||||
- made generated tables type 'const char *const' to match skelton.c from
|
||||
byacc-20130925 baseline
|
||||
- added code to append text for write_section() to end of generated skeleton.c
|
||||
- remove conversion of tab to \t in generated skeleton.c
|
||||
- extended syntax recognized to include '%%ifdef', '%%ifndef', '%%else' and
|
||||
'%%endif'; used in yaccpar.skel to bracket code that is specific to
|
||||
backtracking
|
||||
|
||||
yaccpar.skel.old
|
||||
- created from skeleton.c in byacc-20140101 baseline; use of this skeleton
|
||||
will create a version of skeleton.c that is close to that in the
|
||||
byacc-20140101 baseline
|
||||
- eliminated 'body_3' and 'trailer_2' skeleton segments - no need to generate
|
||||
yyerror() invocation dynamically; YYERROR_CALL() is already generated
|
||||
earlier, and so can be used in the skeleton to simplify
|
||||
- added 'const' to types in '%% tables' section to match what skel2c,
|
||||
start_int_table() and state_str_table() generate
|
||||
- added a few cosmetic changes (e.g., added some additional comments,
|
||||
reworded debugging output to match yaccpar.skel, changed yygrowstack()
|
||||
to return YYENOMEM for 'out of memory' error, rather than -1, to match
|
||||
yaccpar.skel; changed yyparse() return value from 1 to 2 for the
|
||||
'out of memory' error to match yaccpar.skel)
|
||||
- added '#ifndef'/'#endif' around '#define YYINITSTACKSIZE 200' to allow
|
||||
the value to be changed at compile time
|
||||
- changed 'printf(' to 'fprintf(stderr, '; added stack depth (yydepth) to
|
||||
debugging output from yaccpar.skel
|
||||
- use 'YYINT' rather than 'short' for integer table types
|
||||
|
||||
yaccpar.skel
|
||||
- renamed from btyaccpa.ske, merged with btyacc-c.ske
|
||||
- modified from btyacc distribution to match the latest byacc-20140101
|
||||
skeleton structure & data structures
|
||||
- make local functions static
|
||||
- change "virtual memory exceeded" to "memory exhausted" for bison
|
||||
compatibility
|
||||
- change debug output generation from printf/puts/putc onto stdout to use
|
||||
fprintf/fputs/fputc onto stderr; include
|
||||
stack depth and whether or not in trial parsing
|
||||
- changed types of generated string tables to be 'const pointer to const char'
|
||||
- check all malloc()/realloc() return values, ensure return value of
|
||||
yyparse() = 2 if parsing failed due to memory exhaustion
|
||||
- change YYDBPR() macro to YYSTYPE_TOSTRING(); define semantics as delivering
|
||||
a char* value representing a semantic value (e.g., yylval or yyval, or the
|
||||
contents of an entry on the semantic stack); additional parameter passed:
|
||||
grammar symbol # (to assist interpretation of semantic value)
|
||||
- change YYPOSN to YYLTYPE and yyposn to yylloc (position corresponding to
|
||||
yylval) for bison compatibility; add yyloc (corresponding to yyval)
|
||||
- move default definition of YYLTYPE into output.c, generating a typedef
|
||||
- add '#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)'/'#endif' around
|
||||
all lines specific to position processing
|
||||
- add '#if defined(YYDESTRUCT_CALL)'/'#endif' around all lines specific to
|
||||
semantic & position stack processing to reclaim memory associated with
|
||||
discarded symbols
|
||||
- add '%%ifdef YYBTYACC'/'%%endif' around all lines specific to backtrack
|
||||
parsing; converted by skel2c into '#if defined(YYBTYACC)'/'#endif'
|
||||
- distinguish between "yacc stack overflow" and "memory exhausted" situations
|
||||
- consolidated termination cleanup code; introduced yyreturn, set to 2 after
|
||||
labels yyoverflow/yyenomem, set to 1 after label yyabort, set to 0 after
|
||||
label yyaccept; all termination cases jump to label yyreturn, which does
|
||||
any cleanup then returns yyreturn value
|
||||
- replaced YYDELETEVAL & YYDELETEPOSN user-supplied macro capability by
|
||||
implementation of byacc-generated yydestruct() as defined by bison
|
||||
compatible %destructor mechanism
|
||||
- moved invocation of 'YYREDUCEPOSNFUNC' macro to immediately prior to, rather
|
||||
than after, execution of final rule action (so that, at some future
|
||||
date, implementation extensions can be added to enable custom calculation
|
||||
of locations associated with non-terminals within rule actions); deleted
|
||||
unnecessary flag 'reduce_posn'; deleted 'YYCALLREDUCEPOSN' macro; deleted
|
||||
C++ variant of 'YYREDUCEPOSNFUNC' invocation
|
||||
- adopt approach similar to bison for default computation of yyloc; change
|
||||
macro 'YYREDUCEPOSNFUNC' name to 'YYLLOC_DEFAULT' for bison compatibility;
|
||||
added 'yyerror_loc_range[2]' to hold start & end locations for error
|
||||
situations that pop the stack
|
||||
- use 'YYINT' rather than 'short' for integer table types, and for indexing
|
||||
parser tables
|
||||
|
||||
readskel.c
|
||||
http://www.verisign.com/index.html- replaced error() with fprintf()
|
||||
|
||||
mstring.h
|
||||
- moved contents of mstring.h to defs.h - mstring.h is obsolete
|
||||
|
||||
mstring.c
|
||||
- replaced include of mstring.h with defs.h
|
||||
- changed 'START' to 'HEAD' to remove conflict with 'START' used for
|
||||
the start symbol defined in defs.h
|
||||
|
||||
modified byacc files:
|
||||
---------------------
|
||||
|
||||
skeleton.c
|
||||
- skeleton.c is now generated from the appropriate skeleton file by 'skel2c'
|
||||
|
||||
configure.in
|
||||
- added configuration for --enable-btyacc option; if 'yes' add '-DYYBTYACC'
|
||||
to DEFINES in makefile.in; --enable-btyacc defaults to 'no'
|
||||
- added configuration for --with-max-table-size option; if present,
|
||||
overrides the value of MAXTABLE defined in defs.h
|
||||
- regenerate configure using autoconf
|
||||
|
||||
makefile.in
|
||||
- added mstring.c to C_FILES
|
||||
- added mstring$o to OBJS
|
||||
- added @DEFINES@ as value of DEFINES make variable
|
||||
- added new make variable SKELETON with value 'yaccpar.skel'
|
||||
- added rule to generate skeleton.c from $(SKELETON), depending on skel2c
|
||||
and makefile
|
||||
- added rm -f skeleton.c distclean rule
|
||||
- moved dependency on makefile from only main$o & skeleton$o to $(OBJS),
|
||||
since if ./configure is run changing, for example, from --enable-btyacc
|
||||
to --disable-btyacc, all files must be recompiled to ensure a clean
|
||||
executable
|
||||
- add @MAXTABLE@ for optional '-DMAXTABLE=nnn' if configured using
|
||||
--with-max-table-size=nnn
|
||||
- changed 'cd test && rn 0f test-*'to 'rm -f $(testdir)/test-*'
|
||||
|
||||
test/run_test.sh
|
||||
- ???
|
||||
|
||||
test/run_make.sh
|
||||
- ???
|
||||
|
||||
defs.h
|
||||
- moved contents of mstring.h to defs.h - mstring.h is obsolete
|
||||
- added <limits.h> to get the various system defined machine limits;
|
||||
changed definitions of MAXCHAR, MAXSHORT, MINSHORT & BITS_PER_WORD to use
|
||||
defines from <limits.h>; changed definitions of BIT and SETBIT to use
|
||||
value of BITS_PER_WORD
|
||||
- added typedef for __compar_fn_t, conditioned on _COMPAR_FN_T being
|
||||
undefined (at least for Mac OSX environment)
|
||||
- adopt new symbol class values ACTION and ARGUMENT
|
||||
- adopt changes/additions used by inherited attribute processing
|
||||
- clean up locations of extern function definitions to match where they
|
||||
actually live in source files
|
||||
- adopt error functions from inherited attribute processing; added new error
|
||||
functions
|
||||
- added keyword code LOCATIONS for %locations
|
||||
- added keyword code DESTRUCTOR for %destructor
|
||||
- added extern decl for 'int locations'; true if %locations present
|
||||
- added extern decl for 'int backtrack'; initialized to 0 (= false), set to
|
||||
1 (= true) if -B flag is present
|
||||
- added extern decl for 'int destructor'; true if at least one %destructor
|
||||
present in grammar spec file
|
||||
- define 'YYINT' as the smallest C type that can be used to address a
|
||||
table of size 'MAXTABLE'; define 'YYINT' based on the value of
|
||||
'MAXTABLE' using the standard system type size definitions from <limits.h>;
|
||||
define 'MAXYYINT' and 'MINYYINT' accordingly
|
||||
- change 'Value_t' and 'Index_t' to 'YYINT' from 'short'
|
||||
- allow 'MAXTABLE' to be defined by '-DMAXTABLE=nnn' at compile-time
|
||||
|
||||
closure.c
|
||||
- changed print_closure(), print_EFF() and print_first_derives() to 'static';
|
||||
added fwd declarations
|
||||
- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already
|
||||
used for variables/parameters that were related to variables/parameters
|
||||
declared as 'short'
|
||||
|
||||
error.c
|
||||
- adopt error functions from inherited attribute processing; added a few
|
||||
additional inherited attribute error functions
|
||||
|
||||
graph.c
|
||||
- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already
|
||||
used for variables/parameters that were related to variables/parameters
|
||||
declared as 'short'
|
||||
|
||||
lalr.c
|
||||
- changed MAXSHORT to MAXYYINT
|
||||
|
||||
lr0.c
|
||||
- changed MAXSHORT to MAXYYINT
|
||||
- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already
|
||||
used for variables/parameters that were related to variables/parameters
|
||||
declared as 'short'
|
||||
|
||||
main.c
|
||||
- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already
|
||||
used for variables/parameters that were related to variables/parameters
|
||||
declared as 'short'
|
||||
|
||||
mkpar.c
|
||||
- backtracking attempts to resolve shift/reduce and reduce/reduce conflicts
|
||||
|
||||
output.c
|
||||
- generate prefix & YYPREFIX defines into externs file (-i, .tab.i) and
|
||||
code file (-r, .code.c); generate into output file (.tab.c) only if not
|
||||
using -r option; eliminates doubled output of prefix aliases if -r with
|
||||
no -i in y.tab.c and y.code.c or if -r & -i in y.tab.i and y.code.c
|
||||
- changed types of generated string tables to be 'const pointer to const char'
|
||||
- adopt backtracking as an alternative in cases where otherwise we have a
|
||||
conflict in the parsing actions (3, rather than 2, choices)
|
||||
- wrap defines file with (where "yy" is value of 'symbol_prefix')
|
||||
#ifndef __yy_defines_h_
|
||||
#define _yy_defines_h_
|
||||
|
||||
<defines>
|
||||
|
||||
#endif
|
||||
- avoid writing %%xdecls skeleton section twice if -r used
|
||||
- eliminated 'body_3' and 'trailer_2' skeleton segments - no need to generate
|
||||
yyerror() invocation dynamically; YYERROR_CALL() is already generated
|
||||
earlier, and can be used in the pareser skeleton
|
||||
- if -P flag (pure_parser), add yylloc as 2nd parameter to yylex()
|
||||
(declaration & call)
|
||||
- change YYPOSN to YYLTYPE and yyposn to yylloc (position corresponding to
|
||||
yylval) for bison compatibility; add yyloc (corresponding to yyval)
|
||||
- generate yylloc parameters for yylex & yyerror if %locations present
|
||||
- add location as 1st parameter to declaraion & invocation of yyerror() if
|
||||
%locations present
|
||||
- output backtrack parsing tables if -B flag is present
|
||||
- added generation of yystos[] with output_accessing_symbols() to allow
|
||||
translation from a parser internal state number to the corresponding
|
||||
grammar symbol number [0 .. nsyms) of the accessing symbol of that parser
|
||||
state; used in the generated code for YYDESTRUCT_CALL() &
|
||||
YYSTYPE_TOSTRING() to enable the correct semantic value union tag to be
|
||||
determined when executing the implementation of YYDESTRUCT_CALL() or
|
||||
YYSTYPE_TOSTRING() (similar to yystos[] in bison)
|
||||
- added to output_prefix(): yystos; yycindex & yyctable if compiling
|
||||
backtracking; yyloc & yylloc if %locations used
|
||||
- extended yyname[] to include all grammar symbols, not just the terminal
|
||||
symbols: '$end', 'error', '$accept', all non-terminals, including internally
|
||||
generated non-terminals for embedded actions in rules, and 'illegal-symbol'
|
||||
(which bison spells '$undefined'); '$end' already defined as a symbol 0,
|
||||
rathern than adding 'end-of-file' as the name of symbol 0; added
|
||||
'illegal-symbol' from byacc-20140101 (NOTE: the comment in the code that
|
||||
says byacc does not predefine '$end' and '$error' is incorrect; however,
|
||||
both bison and byacc spell '$error' as 'error')
|
||||
- added generation of #define YYTRANSLATE() from byacc-20140101, but changed
|
||||
the definition for the undefined symbol case because it is no longer in
|
||||
yyname[YYMAXTOKEN+1] but rather occurs after the last non-terminal symbol;
|
||||
added #define YYUNDFTOKEN to contain the index in yyname of 'illegal-symbol'
|
||||
- generate YYLTYPE in output_ltype() as a struct like for bison rather than
|
||||
using #define in yaccpar.skel
|
||||
- added 'write_code_lineno' invocation at start of 'output_prefix'
|
||||
- added 'write_code_lineno' invocation at start of 'output_pure_parser'
|
||||
- added 'write_code_lineno' invocation prior to generation of #include
|
||||
for externs file
|
||||
- added 'write_code_lineno' invocation after 1st 'write_section(fp, xdecls)'
|
||||
- added '++outline;' prior to output of '#define YYTRANSLATE' - this was
|
||||
actually causing almost all of the invocations of 'write_code_lineno' to
|
||||
put out the correct #line directive
|
||||
- corrected 'write_code_lineno' - the line number in a #line directive is
|
||||
the number of the next line, not the number of the #line line
|
||||
- changed MAXSHORT to MAXYYINT; changed 'high' local static from 'int' to
|
||||
'long' so that it can get higher than 'MAXYYINT' without machine-dependent
|
||||
behavior; changed related formats from '%d' to '%ld'
|
||||
- generate 'YYINT' rather than 'short' for integer table types
|
||||
- generate YYDESTRUCT_DECL & YYDESTRUCT_CALL macros, similar to YYERROR_DECL
|
||||
and YYERROR_CALL macros, that can be redefined by user, if desired, to add
|
||||
additional parameters to yydestruct() (and even change the 'yydestruct'
|
||||
function name)
|
||||
- if at least one %destructor present, generate yydestruct(); 1st parameter
|
||||
is a string indicating the context in which yydestruct() is invoked
|
||||
(e.g., discarding input token, discarding state on stack, cleanup when
|
||||
aborting); 2nd parameter is the internal grammar symbol number [0..nsyms)
|
||||
of the accessing symbol of the parser state on the top of the stack; 3rd
|
||||
parameter is a pointer to the semantic value to be reclaimed associated
|
||||
with the grammar symbol in the 2nd parameter; if %locations is defined,
|
||||
the 4th parameter is a pointer to the position value to be reclaimed
|
||||
associated with the grammar symbol in the 2nd parameter
|
||||
|
||||
reader.c
|
||||
- adopt []-actions, similar to {}-actions; {}-actions are only executed when
|
||||
not in trial mode, but []-actions are executed regardless of mode
|
||||
- adopt new symbol class values ACTION and ARGUMENT
|
||||
- adopt inherited attributes (syntax resembles arguments to non-terminal
|
||||
symbols)
|
||||
- adopt keyword table lookup from btyacc, modified to handle equivalence
|
||||
of '-' and '_' in spelling of keywords
|
||||
- adopt refactoring of tag table creation into cache_tag() for use in
|
||||
multiple locations
|
||||
- added new error functions in place of btyacc's generic error() function
|
||||
- changed '0' to 'NULL' for pointer initialization
|
||||
- reworked for-loop at end of get_line (part of DEFERRED '%ifdef/%endif' change)
|
||||
- added %locations directive for bison compatibility to enable position
|
||||
processing
|
||||
- added decl for 'int locations'; true if %locations present
|
||||
- added decl 'int backtrack'; initialized to 0 (= false), set to
|
||||
1 (= true) if -B flag is present
|
||||
- process %locations if present, set location = 1
|
||||
- only process []-actions and only generate 'if (!yytrial)' prefix for
|
||||
{}-actions if backtracking is enabled
|
||||
- add decl for 'int destructor'; true if at least one %destructor is present
|
||||
- add %destructor directive to enable semantic & position stack processing to
|
||||
reclaim memory associated with discarded symbols
|
||||
- process bison compatible %destructor (set destructor = 1); support @$ in
|
||||
%destructor code to reference the position value if %locations is defined
|
||||
- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already
|
||||
used for variables/parameters that were related to variables/parameters
|
||||
declared as 'short'
|
||||
- if %locations present, support @N and @$ syntax as for bison to reference
|
||||
the locations associated with the N-th rhs symbol and the lhs symbol,
|
||||
respectively
|
||||
|
||||
symtab.c
|
||||
- initialize fields added to 'struct bucket' for non-terminal symbol
|
||||
inherited attributes
|
||||
|
||||
verbose.c
|
||||
- for parse states with conflicts, the contents of the y.output file include
|
||||
the trial shift and/or trial reduce actions
|
||||
- added output to the end of the verbose report showing the correspondance
|
||||
between grammar symbol #, internal parser symbol #, and grammar symbol name
|
||||
- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already
|
||||
used for variables/parameters that were related to variables/parameters
|
||||
declared as 'short'
|
||||
|
||||
yacc.1
|
||||
- added options 'P', 'V', 'y' and '-o output_file' to the yacc command
|
||||
synopsis (already covered in the description section)
|
||||
- added options 'B', 'D' and 'L' to the yacc command synopsis; added text in
|
||||
the description section
|
||||
- added %locations description to the extensions section
|
80
NOTES-btyacc-Disposition
Normal file
80
NOTES-btyacc-Disposition
Normal file
@ -0,0 +1,80 @@
|
||||
Tom Shields, March 17, 2014
|
||||
|
||||
NOTE: README.BTYACC needs to be re-written (or another README file created)
|
||||
to explain how the extensions were adopted into the byacc-20140101 baseline.
|
||||
|
||||
bytacc changes adopted; see README.BTYACC for details.
|
||||
------------------------------------------------------
|
||||
|
||||
Changes to the skeleton to send debugging output to stderr.
|
||||
|
||||
Changes to the types of the grammar tables from 'short' to 'int' if
|
||||
MAXTABLE is defined to be > MAXSHORT for generation of large grammar tables
|
||||
for large grammars. This can be set with the invocation of configure
|
||||
using the --with-max-table-size=N option
|
||||
|
||||
Changes to add syntactic sugaring for definition and semantic processing
|
||||
of inherited attributes associated with non-terminal symbols on the rhs of
|
||||
rules. Inherited attributes are implemented as {}-actions, and as such may
|
||||
introduce reduce/reduce conflicts. The advantage over manual {}-actions is
|
||||
that checking is performed on the number and types of inherited attributes,
|
||||
and the positions on the semantic stack are automatically calculated.
|
||||
Identical actions produced by the inherited attribute syntax are collapsed
|
||||
into a single action, reducing reduce/reduce conflicts.
|
||||
|
||||
The %type specification is extended to define the types of inherited
|
||||
attributes associated with non-terminal symbols on the lhs of rules, in
|
||||
addition to its original purpose in yacc for specifying the type of the
|
||||
symbol itself on the parser's value stack. In order to permit the two
|
||||
aspects to be used independently, the <type> specification following
|
||||
%type is optional.
|
||||
|
||||
Added a mechanism to the parser skeleton for computing and propagating
|
||||
the text position of grammar symbols if %locations directive is present in
|
||||
the grammar specificaion, or if yacc is invoked with the -L flag. Includes
|
||||
support for "@$" and "@N" (for N an integer) in actions to refer to symbol
|
||||
locations.
|
||||
|
||||
Added a bison compatible %destructor directive to define a memory
|
||||
management mechanism to the parser skeleton that enables cleanup of semantic
|
||||
values and text positions associated with the parsing stack that are
|
||||
automatically discarded during error processing.
|
||||
|
||||
The following is only available if configure is invoked with the
|
||||
--enable-btyacc=yes:
|
||||
|
||||
Changes to enable backtracking with semantic disambiguation, if yacc is
|
||||
invoked with the -B flag. A yacc parser disambiguates shift/reduce conflicts
|
||||
by choosing to shift, and reduce/reduce conflicts by reducing using the
|
||||
earliest grammar rule (in the grammar specification). A btyacc parser handles
|
||||
a conflict by remembering the current parse point and entering into trial parse
|
||||
mode. In trial parse mode, the parser tries each of the conflicting options
|
||||
until the first successs or until all options are exhausted. If the parser
|
||||
runs into an error while in trial parse mode, it backtracks to the most recent
|
||||
conflict point and tries the next alternative. If the parser finds a
|
||||
successful parse, it backtracks to the point where it first entered trial parse
|
||||
mode and continues with normal parsing, using the action at the start of the
|
||||
successful trial path. Success in trial parse mode is achieved either by
|
||||
successfully reducing the start symbol at the end of input or by invocation of
|
||||
YYVALID (or YYVALID_NESTED). Semantic disambiguation is supported within
|
||||
[]-actions, which are always executed, with invocation of YYERROR to terminate
|
||||
a trial path or YYVALID (and YYVALID_NESTED). Yacc {}-actions are only
|
||||
executed during normal parsing.
|
||||
|
||||
|
||||
btyacc changes deferred:
|
||||
------------------------
|
||||
|
||||
The -S command line flag to enable use of an alternate parser skeleton,
|
||||
read from an external file.
|
||||
|
||||
Preprocessor statements: %define, %ifdef/%endif, %include.
|
||||
|
||||
|
||||
btyacc changes rejected:
|
||||
------------------------
|
||||
|
||||
The yyerror_detailed() option for error messages is replaced by the
|
||||
byacc feature for specifying options paramters to yyerror().
|
||||
|
||||
C++-specific features in the parser skeleton.
|
603
README.BTYACC
Normal file
603
README.BTYACC
Normal file
@ -0,0 +1,603 @@
|
||||
-- $Id: README.BTYACC,v 1.1 2014/03/25 19:21:31 Tom.Shields Exp $
|
||||
|
||||
The original README from btyacc is below.
|
||||
|
||||
The backtracking enhancements to byacc have been merged into Thomas Dickey's
|
||||
byacc baseline.
|
||||
|
||||
The %include and %define/%ifdef enhancements described below are not currently
|
||||
incorporated.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
BTYACC -- backtracking yacc
|
||||
===========================
|
||||
|
||||
BTYACC was created by Chris Dodd using ideas from many
|
||||
places and lots of code from the Berkeley Yacc
|
||||
distribution, which is a public domain yacc clone put
|
||||
together by the good folks at Berkeley. This code is
|
||||
distributed with NO WARRANTY and is public domain.
|
||||
It is certain to contain bugs, which you should
|
||||
report to: chrisd@collins.com.
|
||||
|
||||
Vadim Maslov of Siber Systems <vadik@siber.com>
|
||||
considerably modified BTYACC to make it suitable
|
||||
for production environment.
|
||||
|
||||
Several people have suggested bug fixes that
|
||||
were incorporated into BtYacc.
|
||||
|
||||
See the README.BYACC files for more about
|
||||
Berkeley Yacc and other sources of info.
|
||||
|
||||
http://www.siber.com/btyacc/ is the current home of BtYacc.
|
||||
It is provided courtesy of Siber Systems http://www.siber.com/.
|
||||
|
||||
|
||||
Version 3.0 changes
|
||||
-------------------
|
||||
by Vadim Maslov
|
||||
|
||||
Changes mostly occurred in btyaccpa.ske file that
|
||||
contains the parsing shift/reduce/backtrack algorithm.
|
||||
|
||||
Version 3.0 innovations focus on:
|
||||
- text position computation and propagation,
|
||||
- industrial-strength error processing and recovery.
|
||||
|
||||
|
||||
** Added mechanism for computing and propagating
|
||||
text position of tokens and non-terminals.
|
||||
|
||||
Compilers often need to build AST trees such that every node
|
||||
in a tree can relate to the parsed program source it came from.
|
||||
The following applications are very likely to need this:
|
||||
- debuggers that show actual source of the debugged program,
|
||||
- source-to-source translators that want
|
||||
unchanged parts of the tree to generate the unchanged code.
|
||||
|
||||
The new YYPOSN mechanism added in this version of BtYacc
|
||||
helps you in automating the text position computation
|
||||
and in assigning the computed text positions to the AST.
|
||||
This mechanism is successfully used in commercial
|
||||
parsers and source-to-source translators.
|
||||
|
||||
In standard Yaccs every token and every non-terminal
|
||||
has an YYSTYPE semantic value attached to it.
|
||||
In this new version every token and every non-terminal
|
||||
also has an YYPOSN text position attached to it.
|
||||
YYPOSN is a user-defined type that can be anything and
|
||||
that has a meaning of text position attached to
|
||||
token or non-terminal.
|
||||
|
||||
In addition to semantic value stack BtYacc now maintains
|
||||
text position stack. Behavior of the text position stack
|
||||
is similar to the behavior of the semantic value stack.
|
||||
|
||||
If using text position mechanism,
|
||||
you need to define the following:
|
||||
|
||||
YYPOSN Preprocessor variable that contains C/C++ type of
|
||||
the text position attached to
|
||||
every token and non-terminal.
|
||||
|
||||
yyposn Global variable of type YYPOSN.
|
||||
The lexer must assign text position of
|
||||
the returned token to yyposn, just like it assigns
|
||||
semantic value of the returned token to yylval.
|
||||
|
||||
YYREDUCEPOSNFUNC
|
||||
Preprocessor variable that points to function that
|
||||
is called after the grammar rule reduction
|
||||
to reduce text positions located on the stack.
|
||||
|
||||
This function is called by BtYacc to reduce text
|
||||
positions. The function is called immediately after
|
||||
the regular rule reduction occurs.
|
||||
|
||||
The function has the following prototype:
|
||||
void ReducePosn(YYPOSN &ret,
|
||||
YYPOSN *terms,
|
||||
YYSTYPE *term_vals,
|
||||
int term_no,
|
||||
int stk_pos,
|
||||
int yychar,
|
||||
YYPOSN &yyposn,
|
||||
UserType extra);
|
||||
|
||||
The function arguments are:
|
||||
- ret
|
||||
Reference to the text position returned by
|
||||
the rule. The function must write the computed
|
||||
text position returned by the rule to ret.
|
||||
This is analogue of the $$ semantic value.
|
||||
|
||||
- term_posns
|
||||
Array of the right-hand side rule components
|
||||
YYPOSN text positions. These are analogues of
|
||||
$1, $2, ..., $N in the text position world.
|
||||
|
||||
- term_vals
|
||||
Array of the right-hand side (RHS) rule components
|
||||
YYSTYPE values. These are the $1,...,$N themselves.
|
||||
|
||||
- term_no
|
||||
Number of the components in RHS of the reduced rule.
|
||||
Equal to size of arrays term_posns and term_vals.
|
||||
Also equal to N in $1,...,$N in the reduced rule.
|
||||
|
||||
- stk_pos
|
||||
YYSTYPE/YYPOSN stack position before the reduction.
|
||||
|
||||
- yychar
|
||||
Lookahead token that immediately follows
|
||||
the reduced RHS components.
|
||||
|
||||
- yyposn
|
||||
YYPOSN of the token that immediately follows
|
||||
the reduced RHS components.
|
||||
|
||||
- extra
|
||||
User-defined extra argument passed to ReducePosn.
|
||||
|
||||
Typically this function extracts text positions from
|
||||
the right-hand side rule components and either
|
||||
assigns them to the returned $$ structure/tree or
|
||||
if no $$ value is returned, puts them into
|
||||
the ret text position from where
|
||||
it will be picked up by the later reduced rules.
|
||||
|
||||
YYREDUCEPOSNFUNCARG
|
||||
Extra user-defined argument passed to
|
||||
the ReducePosn function. This argument can use
|
||||
any variables defined in btyaccpa.ske.
|
||||
|
||||
|
||||
** Added code to btyaccpa.ske that automatically cleans up
|
||||
semantic semantic values and text positions of tokens
|
||||
and non-terminals that are discarded and deleted as
|
||||
a result of error processing.
|
||||
|
||||
In the previous versions the discarded token and non-terminal
|
||||
semantic values were not cleaned that caused quite severe
|
||||
leaks. The only way to fix it was to add garbage collection
|
||||
to YYSTYPE class.
|
||||
|
||||
Now BtYacc skeleton calls delete functions for semantic
|
||||
values and positions of the discarded tokens and
|
||||
non-terminals.
|
||||
|
||||
You need to define the following functions that BtYacc
|
||||
calls when it needs to delete semantic value or text position.
|
||||
|
||||
YYDELETEVAL
|
||||
User-defined function that is called by BtYacc
|
||||
to delete semantic value of the token or non-terminal.
|
||||
|
||||
The user-defined function must have the prototype:
|
||||
void DeleteYYval(YYSTYPE v, int type);
|
||||
v is semantic value to delete,
|
||||
type is one of the following:
|
||||
0 discarding token
|
||||
1 discarding state
|
||||
2 cleaning up stack when aborting
|
||||
|
||||
YYDELETEPOSN
|
||||
User-defined function that is called by BtYacc
|
||||
to delete text position of the token or non-terminal.
|
||||
|
||||
The user-defined function must have the prototype:
|
||||
void DeleteYYposn(YYPOSN p, int type);
|
||||
v is semantic value to delete,
|
||||
type is one of the following:
|
||||
0 discarding token
|
||||
1 discarding state
|
||||
2 cleaning up stack when aborting
|
||||
|
||||
|
||||
** User can define "detailed" syntax error processing
|
||||
function that reports an *exact* position of
|
||||
the token that caused the error.
|
||||
|
||||
If you define preprocessor variable YYERROR_DETAILED in
|
||||
your grammar then you need define the following
|
||||
error processing function:
|
||||
|
||||
void yyerror_detailed(char *text,
|
||||
int errt,
|
||||
YYSTYPE &errt_value,
|
||||
YYPOSN &errt_posn);
|
||||
|
||||
It receives the following arguments:
|
||||
text Error message.
|
||||
errt Code of the token that caused the error.
|
||||
errt_value Value of the token that caused the error.
|
||||
errt_posn Text position of token that caused error.
|
||||
|
||||
|
||||
** Dropped compatibility with C.
|
||||
|
||||
Compatibility with C became increasingly difficult
|
||||
to maintain as new features were added to btyaccpa.ske.
|
||||
So we dropped it. If anybody wants to make the new version
|
||||
compatible with C, we would gladly accept the changes.
|
||||
|
||||
Meanwhile we expect that you use C++ to write grammar
|
||||
actions and everything else in grammar files.
|
||||
Since C is (in a sense) subset of C++, your C-based
|
||||
grammar may work if you use C++ compiler to compile it.
|
||||
|
||||
Version 3.0 bugs fixed
|
||||
----------------------
|
||||
|
||||
Matthias Meixner <meixner@mes.th-darmstadt.de> fixed a bug:
|
||||
BtYacc does not correctly handle typenames, if one typename
|
||||
is a prefix of another one and if this type is used after
|
||||
the longer one. In this case BTYacc produces invalid code.
|
||||
|
||||
|
||||
Version 2.1 changes
|
||||
-------------------
|
||||
by Vadim Maslov
|
||||
|
||||
** Added preprocessor statements to BtYacc that are similar
|
||||
in function and behavior to C/C++ preprocessor statements.
|
||||
|
||||
These statements are used to:
|
||||
|
||||
- Introduce modularity into a grammar by breaking it
|
||||
into several *.y files and assembling different
|
||||
grammars from the *.y modules using %include and %ifdef.
|
||||
|
||||
- Have several versions of the same grammar
|
||||
by using %ifdef and $endif.
|
||||
|
||||
- To include automatically generated grammar fragment.
|
||||
For instance, we use %include to include
|
||||
automatically generated list of tokens.
|
||||
|
||||
Preprocessor statements are:
|
||||
|
||||
%define <var-name>
|
||||
Define preprocessor variable named <var-name>.
|
||||
|
||||
%ifdef <var-name>
|
||||
If preprocessor variable named <var-name>
|
||||
is defined by %define, then process the text from
|
||||
this %ifdef to the closing %endif.
|
||||
|
||||
%endif
|
||||
Closing bracket for %ifdef preprocessor statement.
|
||||
Only one nesting level of %ifdef-%endif is allowed.
|
||||
|
||||
%include <file-name>
|
||||
Process contents of the file named <file-name>.
|
||||
If <file-name> is a relative name, it is looked up
|
||||
in a directory in which btyacc was started.
|
||||
Only one nesting level of %include is allowed.
|
||||
|
||||
|
||||
Version 2.0 changes
|
||||
-------------------
|
||||
by Vadim Maslov
|
||||
|
||||
|
||||
** Changed 16-bit short numbers to 32-bit int numbers in
|
||||
grammar tables, so that huge grammar tables (tables that
|
||||
are larger than 32768 elements) resulting from huge
|
||||
grammars (Cobol grammar, for instance) can work correctly.
|
||||
You need to have 32-bit integer to index table bigger than
|
||||
32768 elements, 16-bit integer is not enough.
|
||||
|
||||
The original BtYacc just generated non-working tables
|
||||
larger than 32768 elements without even notifying about
|
||||
the table overflow.
|
||||
|
||||
|
||||
** Make error recovery work correctly when error happens
|
||||
while processing nested conflicts. Original BtYacc could
|
||||
infinitely cycle in certain situations that involved error
|
||||
recovery while in nested conflict.
|
||||
|
||||
More detailed explanation: when we have nested conflicts
|
||||
(conflict that happens while trial-processing another
|
||||
conflict), it leads btyacc into NP-complete searching of
|
||||
conflict tree. The ultimate goal is YYVALID operator that
|
||||
selects a particular branch of that tree as a valid one.
|
||||
|
||||
If no YYVALID is found on the tree, then error recovery
|
||||
takes over. The problem with this is that error recovery
|
||||
is started in the same state context that exists on the
|
||||
last surveyed branch of the conflict tree. Sometimes this
|
||||
last branch may be of zero length and it results in
|
||||
recovering to exactly the same state as existed before
|
||||
entering the conflict. BtYacc cycles then.
|
||||
|
||||
We solved this problem by memorizing the longest path in
|
||||
the conflict tree while browsing it. If we ever get into
|
||||
error recovery, we restore state that existed on the
|
||||
longest path. Effectively we say: if we have an error,
|
||||
let us move forward as far as we possibly could while we
|
||||
were browsing the conflict tree.
|
||||
|
||||
|
||||
** Introduce YYVALID_NESTED operation in addition to
|
||||
simply YYVALID. When we have a nested conflict (conflict
|
||||
while processing in trial mode for another conflict), we
|
||||
want to relate YYVALID to a particular level of conflict
|
||||
being in trial.
|
||||
|
||||
Since we mostly anticipate only 2-level nested conflicts
|
||||
YYVALID_NESTED tells the parser to satisfy only the
|
||||
internal conflict. Therefore, in 1-level conflict
|
||||
situation YYVALID_NESTED acts like a regular YYVALID, but
|
||||
in 2-level conflict it is a no-op and the other YYVALID
|
||||
for outer conflict will be searched for.
|
||||
|
||||
|
||||
** Improved handling of situation where /tmp directory is
|
||||
missing. Original btyacc just died quietly when /tmp
|
||||
directory was missing. We added code that states the
|
||||
problem explicitly. While on UNIX /tmp directory is always
|
||||
present, it may be missing on WIN32 systems, therefore
|
||||
diagnosing this situation is important.
|
||||
|
||||
|
||||
Version 1.0 changes: BackTracking
|
||||
=================================
|
||||
by Chris Dodd
|
||||
|
||||
BTYACC is a modified version of yacc that supports
|
||||
automatic backtracking and semantic disambiguation to
|
||||
parse ambiguous grammars, as well as syntactic sugar for
|
||||
inherited attributes (which tend to introduce conflicts).
|
||||
Whenever a btyacc generated parser runs into a
|
||||
shift-reduce or reduce-reduce error in the parse table, it
|
||||
remembers the current parse point (yacc stack and input
|
||||
stream state), and goes into trial parse mode. It then
|
||||
continues parsing, ignoring most rule actions. If it runs
|
||||
into an error (either through the parse table or through
|
||||
an action calling YYERROR), it backtracks to the most
|
||||
recent conflict point and tries a different alternative.
|
||||
If it finds a successful parse (reaches the end of the
|
||||
input or an action calls YYVALID), it backtracks to the
|
||||
point where it first entered trial parse mode, and
|
||||
continues with a full parse (executing all actions),
|
||||
following the path of the successful trial.
|
||||
|
||||
Actions in btyacc come in two flavors -- {}-actions, which
|
||||
are only executed when not in trial mode, and []-actions
|
||||
which are executed regardless of mode. There are also
|
||||
inherited attributes, which look like arguments (they are
|
||||
enclosed in "()") and act like []-actions.
|
||||
|
||||
What this buys you:
|
||||
|
||||
* No more lexer feedback hack. In yacc grammars for C, a
|
||||
standard hack, know as the "lexer feedback hack" is used
|
||||
to find typedef names. The lexer uses semantic
|
||||
information to decide if any given identifier is a
|
||||
typedef-name or not and returns a special token. With
|
||||
btyacc, you no longer need to do this; the lexer should
|
||||
just always return an identifier. The btyacc grammar then
|
||||
needs a rule of the form:
|
||||
|
||||
typename: ID [ if (!IsTypeName(LookupId($1))) YYERROR; ]
|
||||
|
||||
While the hack works adequately well for parsing C, it
|
||||
becomes a nightmare when you try to parse something like
|
||||
C++, where treating an ID as a typedef becomes heavily
|
||||
dependent on context.
|
||||
|
||||
* Easy disambiguation via simple ordering. Btyacc runs
|
||||
its trials via the rule "try shifting first, then try
|
||||
reducing by the order that the conflicting rules appear in
|
||||
the input file". This means you can deal with semantic a
|
||||
disambiguation rule like:
|
||||
[1] If it looks like a declaration it is, otherwise
|
||||
[2] If it looks like an expression it is, otherwise
|
||||
[3] it is a syntax error
|
||||
[Ellis&Stroustrup, Annotated C++ Reference Manual, p93]
|
||||
|
||||
To deal with this, you need only put all the rules for
|
||||
declarations before the rules for expressions in the
|
||||
grammar file.
|
||||
|
||||
* No extra cost if you do not use it. Backtracking is
|
||||
only triggered when the parse hits a shift/reduce or
|
||||
reduce/reduce conflict in the table. If you have no
|
||||
conflicts in your grammar, there is no extra cost, other
|
||||
than some extra code which will never be invoked.
|
||||
|
||||
* C++ and ANSI C compatible parsers. The parsers produced
|
||||
by btyacc can be compiled with C++ correctly. If you
|
||||
"#define" YYSTYPE to be some C++ type with constructor and
|
||||
destructor, everything will work fine. My favorite is
|
||||
"#define YYSTYPE SmartPointer", where SmartPointer is a
|
||||
smart pointer type that does garbage collection on the
|
||||
pointed to objects.
|
||||
|
||||
BTYACC was originally written to make it easy to write a
|
||||
C++ parser (my goal was to be able to use the grammar out
|
||||
of the back of the ARM with as few modifications as
|
||||
possible). Anyone who has ever looked at Jim Roskind
|
||||
public domain C++ yacc grammar, or the yacc-based grammar
|
||||
used in g++ knows how difficult this is. BTYACC is very
|
||||
useful for parsing any ambiguous grammar, particularly
|
||||
ones that come from trying to merge two (or more) complete
|
||||
grammars.
|
||||
|
||||
Limitations of the backtracking: Currently, the generated
|
||||
parser does NO pruning of alternate parsing paths. To
|
||||
avoid an exponential explosion of possible paths (and
|
||||
parsing time), you need to manually tell the parser when
|
||||
it can throw away saved paths using YYVALID. In practice,
|
||||
this turns out to be fairly easy to do. A C++ parser (for
|
||||
example) can just put a [YYVALID;] after every complete
|
||||
declaration and statement rule, corresponding to pruning
|
||||
the backtracking state after seeing a ';' or '}' -- there
|
||||
will never be a situation in which it is useful to
|
||||
backtrack past either of these.
|
||||
|
||||
Inherited attributes in btyacc:
|
||||
|
||||
Inherited attributes look a lot like function arguments to
|
||||
non-terminals, which is what they end up being in a
|
||||
recursive descent parser, but NOT how they are implemented
|
||||
in btyacc. Basically they are just syntactic sugar for
|
||||
embedded semantic actions and $0, $-1, ... in normal yacc.
|
||||
btyacc gives you two big advantages besides just the
|
||||
syntax:
|
||||
1. it does type checking on the inherited attributes,
|
||||
so you do not have to specify $<type>0 and makes sure
|
||||
you give the correct number of arguments (inherited
|
||||
attributes) to every use of a non-terminal.
|
||||
2. It "collapses" identical actions from that are produced
|
||||
from inherited attributes. This eliminates many
|
||||
potential reduce-reduce conflicts arising from
|
||||
the inherited attributes.
|
||||
|
||||
You use inherited attributes by declaring the types of the
|
||||
attributes in the preamble with a type declaration and
|
||||
declaring names of the attributes on the lhs of the yacc
|
||||
rule. You can of course have more than one rule with the
|
||||
same lhs, and you can even give them different names in
|
||||
each, but the type and number must be the same.
|
||||
|
||||
Here is a small example:
|
||||
/* lhs takes 2 inherited attributes */
|
||||
%type <t1> lhs(<t1>, <t2>)
|
||||
stuff(<t1>, <t2>)
|
||||
%%
|
||||
lhs($i1, $i2) : { $$ = $i1 }
|
||||
| lhs($i1, $i2) stuff($1,$i2) { $$ = $2; }
|
||||
|
||||
This is roughly equivalent to the following yacc code:
|
||||
lhs :
|
||||
{ $$ = $<t1>-1; }
|
||||
| lhs [ $<t1>$ = $-1; ] [ $<t2>$ = $<t2>0; ] stuff
|
||||
{ $$ = $4; }
|
||||
;
|
||||
|
||||
See the file "test/t2.y" for a longer and more complete
|
||||
example. At the current time, the start symbol cannot
|
||||
have any arguments.
|
||||
|
||||
Variant parsers:
|
||||
|
||||
Btyacc supports the -S flag to use a different parser
|
||||
skeleton, changing the way that the parser is called and
|
||||
used. The skeleton "push.skel" is included to produce a
|
||||
"passive" parser that you feed tokens to (rather than
|
||||
having the parser call a separate yylex routine). With
|
||||
push.skel, yyparse is defined as follows:
|
||||
|
||||
int yyparse(int token, YYSTYPE yylval)
|
||||
|
||||
You should call yyparse repeatedly with successive tokens
|
||||
of input. It returns 0 if more input is needed, 1 for a
|
||||
successful parse, and -1 for an unrecoverable parse error.
|
||||
|
||||
|
||||
Miscellaneous Features in ver. 1.0
|
||||
----------------------------------
|
||||
by Chris Dodd
|
||||
|
||||
The -r option has been implemented. The -r option tells
|
||||
Yacc to put the read-only tables in y.tab.c and the code and
|
||||
variables in y.code.c. Keith Bostic asked for this option so
|
||||
that :yyfix could be eliminated.
|
||||
|
||||
The -l and -t options have been implemented. The -l
|
||||
option tells Yacc not to include #line directives in the code
|
||||
it produces. The -t option causes debugging code to be
|
||||
included in the compiled parser.
|
||||
|
||||
The code for error recovery has been changed to
|
||||
implement the same algorithm as AT&T Yacc. There will still
|
||||
be differences in the way error recovery works because AT&T
|
||||
Yacc uses more default reductions than Berkeley Yacc.
|
||||
|
||||
The environment variable TMPDIR determines the directory
|
||||
where temporary files will be created. If TMPDIR is defined,
|
||||
temporary files will be created in the directory whose
|
||||
pathname is the value of TMPDIR. By default, temporary files
|
||||
are created in /tmp.
|
||||
|
||||
The keywords are now case-insensitive. For example,
|
||||
%nonassoc, %NONASSOC, %NonAssoc, and %nOnAsSoC are
|
||||
all equivalent.
|
||||
|
||||
Commas and semicolons that are not part of C code are
|
||||
treated as commentary.
|
||||
|
||||
Line-end comments, as in BCPL, are permitted. Line-end
|
||||
comments begin with // and end at the next end-of-line.
|
||||
Line-end comments are permitted in C code; they are converted
|
||||
to C comments on output.
|
||||
|
||||
The form of y.output files has been changed to look more
|
||||
like those produced by AT&T Yacc.
|
||||
|
||||
A new kind of declaration has been added.
|
||||
The form of the declaration is
|
||||
|
||||
%ident string
|
||||
|
||||
where string is a sequence of characters beginning with a
|
||||
double quote and ending with either a double quote or the
|
||||
next end-of-line, whichever comes first. The declaration
|
||||
will cause a #ident directive to be written near the start
|
||||
of the output file.
|
||||
|
||||
If a parser has been compiled with debugging code, that
|
||||
code can be enabled by setting an environment variable.
|
||||
If the environment variable YYDEBUG is set to 0, debugging
|
||||
output is suppressed. If it is set to 1, debugging output
|
||||
is written to standard output.
|
||||
|
||||
|
||||
Building BtYacc
|
||||
---------------
|
||||
by Chris Dodd and Vadim Maslov
|
||||
|
||||
We used GCC and GNU make to compile BtYacc both on UNIX and
|
||||
WIN32 paltforms. You are welcome to try different
|
||||
combinations of makes and compilers. Most likely it will
|
||||
work, but it may require Makefile changes.
|
||||
|
||||
There is no config script.
|
||||
Just type "make" and it should compile.
|
||||
|
||||
AWK. If you want to change file btyaccpa.ske (backtracking
|
||||
parser skeleton), you will need awk to compile it into
|
||||
skeleton.c file. We used GNU AWK (gawk) version 3.0.
|
||||
|
||||
It is known that using older versions of gawk
|
||||
may create problems in compilation, because older awks
|
||||
have problems with backslashes at the end of a line.
|
||||
|
||||
For MSDOS, there a "makefile.dos" that should do the trick.
|
||||
Note: makefile.dos was not tested for a long time.
|
||||
|
||||
The result of compilation should be a single executable called
|
||||
"btyacc" which you can install anywhere you like;
|
||||
it does not require any other files in the distribution to run.
|
||||
|
||||
|
||||
Legal Stuff
|
||||
-----------
|
||||
by Chris Dodd and Vadim Maslov
|
||||
|
||||
In English: BtYacc is freeware. BtYacc is distributed with
|
||||
no warranty whatsoever. The author and any other contributors
|
||||
take no responsibility for any and all consequences of its use.
|
||||
|
||||
In Legalese: LIMITATION OF LIABILITY. NEITHER SIBER SYSTEMS
|
||||
NOR ANY OF ITS LICENSORS NOR ANY BTYACC CONTRIBUTOR SHALL BE
|
||||
LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL
|
||||
DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR
|
||||
DATA USE, CAUSED BY BTYACC AND INCURRED BY CUSTOMER OR ANY
|
||||
THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, EVEN
|
||||
IF SIBER SYSTEMS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
26
aclocal.m4
vendored
26
aclocal.m4
vendored
@ -1,4 +1,4 @@
|
||||
dnl $Id: aclocal.m4,v 1.33 2014/01/01 14:08:07 tom Exp $
|
||||
dnl $Id: aclocal.m4,v 1.34 2014/04/06 19:16:18 tom Exp $
|
||||
dnl Macros for byacc configure script (Thomas E. Dickey)
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Copyright 2004-2013,2014 Thomas E. Dickey
|
||||
@ -600,7 +600,7 @@ make an error
|
||||
test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_INTEL_COMPILER version: 5 updated: 2013/02/10 10:41:05
|
||||
dnl CF_INTEL_COMPILER version: 6 updated: 2014/03/17 13:13:07
|
||||
dnl -----------------
|
||||
dnl Check if the given compiler is really the Intel compiler for Linux. It
|
||||
dnl tries to imitate gcc, but does not return an error when it finds a mismatch
|
||||
@ -629,7 +629,7 @@ if test "$ifelse([$1],,[$1],GCC)" = yes ; then
|
||||
make an error
|
||||
#endif
|
||||
],[ifelse([$2],,INTEL_COMPILER,[$2])=yes
|
||||
cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
|
||||
cf_save_CFLAGS="$cf_save_CFLAGS -we147"
|
||||
],[])
|
||||
ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
|
||||
AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
|
||||
@ -638,7 +638,7 @@ cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
|
||||
fi
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_MAKE_DOCS version: 2 updated: 2013/01/02 20:04:08
|
||||
dnl CF_MAKE_DOCS version: 3 updated: 2014/01/05 13:21:25
|
||||
dnl ------------
|
||||
dnl $1 = name(s) to generate rules for
|
||||
dnl $2 = suffix of corresponding manpages used as input.
|
||||
@ -684,10 +684,10 @@ clean \\
|
||||
docs-clean ::
|
||||
rm -f $cf_name.html $cf_name.pdf $cf_name.ps $cf_name.txt
|
||||
|
||||
$cf_name.html : $cf_name.$2
|
||||
$cf_name.html : $cf_name.\$2
|
||||
$cf_name.pdf : $cf_name.ps
|
||||
$cf_name.ps : $cf_name.$2
|
||||
$cf_name.txt : $cf_name.$2
|
||||
$cf_name.ps : $cf_name.\$2
|
||||
$cf_name.txt : $cf_name.\$2
|
||||
CF_EOF
|
||||
done
|
||||
])dnl
|
||||
@ -919,6 +919,15 @@ if test "$cf_cv_posix_c_source" != no ; then
|
||||
CF_ADD_CFLAGS($cf_cv_posix_c_source)
|
||||
fi
|
||||
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59
|
||||
dnl -----------
|
||||
dnl Check for awk, ensure that the check found something.
|
||||
AC_DEFUN([CF_PROG_AWK],
|
||||
[
|
||||
AC_PROG_AWK
|
||||
test -z "$AWK" && AC_MSG_ERROR(No awk program found)
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_PROG_CC version: 3 updated: 2012/10/06 15:31:55
|
||||
@ -1076,7 +1085,7 @@ fi
|
||||
fi
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_XOPEN_SOURCE version: 45 updated: 2013/09/07 14:06:25
|
||||
dnl CF_XOPEN_SOURCE version: 46 updated: 2014/02/09 19:30:15
|
||||
dnl ---------------
|
||||
dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
|
||||
dnl or adapt to the vendor's definitions to get equivalent functionality,
|
||||
@ -1154,6 +1163,7 @@ sco*) #(vi
|
||||
;;
|
||||
solaris2.*) #(vi
|
||||
cf_xopen_source="-D__EXTENSIONS__"
|
||||
cf_cv_xopen_source=broken
|
||||
;;
|
||||
*)
|
||||
CF_TRY_XOPEN_SOURCE
|
||||
|
1246
btyaccpar.c
Normal file
1246
btyaccpar.c
Normal file
File diff suppressed because it is too large
Load Diff
1125
btyaccpar.skel
Normal file
1125
btyaccpar.skel
Normal file
File diff suppressed because it is too large
Load Diff
22
closure.c
22
closure.c
@ -1,4 +1,4 @@
|
||||
/* $Id: closure.c,v 1.9 2010/06/09 08:21:47 tom Exp $ */
|
||||
/* $Id: closure.c,v 1.10 2014/02/19 00:45:42 Tom.Shields Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -9,12 +9,18 @@ unsigned *ruleset;
|
||||
static unsigned *first_derives;
|
||||
static unsigned *EFF;
|
||||
|
||||
#ifdef DEBUG
|
||||
static void print_closure(int);
|
||||
static void print_EFF(void);
|
||||
static void print_first_derives(void);
|
||||
#endif
|
||||
|
||||
static void
|
||||
set_EFF(void)
|
||||
{
|
||||
unsigned *row;
|
||||
int symbol;
|
||||
short *sp;
|
||||
Value_t *sp;
|
||||
int rowsize;
|
||||
int i;
|
||||
int rule;
|
||||
@ -53,7 +59,7 @@ set_first_derives(void)
|
||||
int j;
|
||||
unsigned k;
|
||||
unsigned cword = 0;
|
||||
short *rp;
|
||||
Value_t *rp;
|
||||
|
||||
int rule;
|
||||
int i;
|
||||
@ -100,7 +106,7 @@ set_first_derives(void)
|
||||
}
|
||||
|
||||
void
|
||||
closure(short *nucleus, int n)
|
||||
closure(Value_t *nucleus, int n)
|
||||
{
|
||||
unsigned ruleno;
|
||||
unsigned word;
|
||||
@ -175,17 +181,17 @@ finalize_closure(void)
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
void
|
||||
static void
|
||||
print_closure(int n)
|
||||
{
|
||||
short *isp;
|
||||
Value_t *isp;
|
||||
|
||||
printf("\n\nn = %d\n\n", n);
|
||||
for (isp = itemset; isp < itemsetend; isp++)
|
||||
printf(" %d\n", *isp);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
print_EFF(void)
|
||||
{
|
||||
int i, j;
|
||||
@ -216,7 +222,7 @@ print_EFF(void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
print_first_derives(void)
|
||||
{
|
||||
int i;
|
||||
|
@ -30,6 +30,9 @@
|
||||
/* Define to 1 if mkstemp() is available and working. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* Define to maximum table size (default: 32500) */
|
||||
#undef MAXTABLE
|
||||
|
||||
/* Define to 1 if filesystem supports mixed-case filenames. */
|
||||
#undef MIXEDCASE_FILENAMES
|
||||
|
||||
@ -48,5 +51,8 @@
|
||||
/* "Define to 1 if you want to use valgrind for testing." */
|
||||
#undef USE_VALGRIND
|
||||
|
||||
/* Define to 1 to enable backtracking extension */
|
||||
#undef YYBTYACC
|
||||
|
||||
/* Define to 1 if you want to perform memory-leak testing. */
|
||||
#undef YY_NO_LEAKS
|
||||
|
35
configure.in
35
configure.in
@ -1,7 +1,7 @@
|
||||
dnl Process this file with 'autoconf' to produce a 'configure' script
|
||||
dnl $Id: configure.in,v 1.15 2014/01/01 14:07:34 tom Exp $
|
||||
dnl $Id: configure.in,v 1.18 2014/04/06 19:11:51 tom Exp $
|
||||
AC_PREREQ(2.52.20011201)
|
||||
AC_REVISION($Revision: 1.15 $)
|
||||
AC_REVISION($Revision: 1.18 $)
|
||||
AC_INIT(main.c)
|
||||
AC_CONFIG_HEADER(config.h:config_h.in)
|
||||
|
||||
@ -12,12 +12,43 @@ CF_PROG_CC
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_INSTALL
|
||||
CF_MAKE_TAGS
|
||||
CF_PROG_AWK
|
||||
CF_PROG_LINT
|
||||
|
||||
CF_XOPEN_SOURCE
|
||||
AC_CHECK_HEADERS(fcntl.h)
|
||||
CF_MKSTEMP
|
||||
|
||||
AC_MSG_CHECKING(for maximum table size)
|
||||
AC_ARG_WITH([max-table-size],
|
||||
[AC_HELP_STRING([--with-max-table-size=N],
|
||||
[set the maximum table size = N (no default)])])
|
||||
if test -n "$with_max_table_size"
|
||||
then
|
||||
AC_MSG_RESULT($with_max_table_size)
|
||||
check=`expr "$with_max_table_size" + 0`
|
||||
if test "x$check" != "x$with_max_table_size"
|
||||
then
|
||||
AC_MSG_ERROR([invalid value for --with-max-table-size: $with_max_table_size])
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(MAXTABLE,$with_max_table_size,[Define to maximum table size (default: 32500)])
|
||||
else
|
||||
AC_MSG_RESULT(default)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(if backtracking extension is wanted)
|
||||
AC_ARG_ENABLE([btyacc],
|
||||
[AC_HELP_STRING([--enable-btyacc],
|
||||
[turn on support for the btyacc backtracking extension (default: no)])])
|
||||
AC_MSG_RESULT($enable_btyacc)
|
||||
if test "$enable_btyacc" = "yes"; then
|
||||
AC_DEFINE(YYBTYACC,1,[Define to 1 to enable backtracking extension])
|
||||
SKELETON=btyaccpar
|
||||
else
|
||||
SKELETON=yaccpar
|
||||
fi
|
||||
AC_SUBST(SKELETON)
|
||||
|
||||
CF_WITH_WARNINGS(Wwrite-strings)
|
||||
CF_DISABLE_ECHO
|
||||
CF_DISABLE_LEAKS
|
||||
|
145
defs.h
145
defs.h
@ -1,9 +1,10 @@
|
||||
/* $Id: defs.h,v 1.38 2014/01/01 14:23:27 Christos.Zoulas Exp $ */
|
||||
/* $Id: defs.h,v 1.47 2014/04/09 21:23:45 Rick.Spates Exp $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
@ -30,14 +31,14 @@
|
||||
|
||||
#define VERSION VSTRING(YYMAJOR, YYMINOR)
|
||||
|
||||
/* machine-dependent definitions */
|
||||
/* the following definitions are for the Tahoe */
|
||||
/* they might have to be changed for other machines */
|
||||
/* machine-dependent definitions: */
|
||||
|
||||
/* MAXCHAR is the largest unsigned character value */
|
||||
/* MAXSHORT is the largest value of a C short */
|
||||
/* MINSHORT is the most negative value of a C short */
|
||||
/* MAXTABLE is the maximum table size */
|
||||
/* YYINT is the smallest C integer type that can be */
|
||||
/* used to address a table of size MAXTABLE */
|
||||
/* MAXYYINT is the largest value of a YYINT */
|
||||
/* MINYYINT is the most negative value of a YYINT */
|
||||
/* BITS_PER_WORD is the number of bits in a C unsigned */
|
||||
/* WORDSIZE computes the number of words needed to */
|
||||
/* store n bits */
|
||||
@ -45,14 +46,26 @@
|
||||
/* from r (0-indexed) */
|
||||
/* SETBIT sets the n-th bit starting from r */
|
||||
|
||||
#define MAXCHAR 255
|
||||
#define MAXSHORT 32767
|
||||
#define MINSHORT -32768
|
||||
#define MAXCHAR UCHAR_MAX
|
||||
#ifndef MAXTABLE
|
||||
#define MAXTABLE 32500
|
||||
#define BITS_PER_WORD 32
|
||||
#define WORDSIZE(n) (((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
|
||||
#define BIT(r, n) ((((r)[(n)>>5])>>((n)&31))&1)
|
||||
#define SETBIT(r, n) ((r)[(n)>>5]|=((unsigned)1<<((n)&31)))
|
||||
#endif
|
||||
#if MAXTABLE <= SHRT_MAX
|
||||
#define YYINT short
|
||||
#define MAXYYINT SHRT_MAX
|
||||
#define MINYYINT SHRT_MIN
|
||||
#elif MAXTABLE <= INT_MAX
|
||||
#define YYINT int
|
||||
#define MAXYYINT INT_MAX
|
||||
#define MINYYINT INT_MIN
|
||||
#else
|
||||
#error "MAXTABLE is too large for this machine architecture!"
|
||||
#endif
|
||||
|
||||
#define BITS_PER_WORD ((int) sizeof (unsigned) * CHAR_BIT)
|
||||
#define WORDSIZE(n) (((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
|
||||
#define BIT(r, n) ((((r)[(n)/BITS_PER_WORD])>>((n)&(BITS_PER_WORD-1)))&1)
|
||||
#define SETBIT(r, n) ((r)[(n)/BITS_PER_WORD]|=((unsigned)1<<((n)&(BITS_PER_WORD-1))))
|
||||
|
||||
/* character names */
|
||||
|
||||
@ -106,11 +119,18 @@
|
||||
#define POSIX_YACC 15
|
||||
#define TOKEN_TABLE 16
|
||||
|
||||
#if defined(YYBTYACC)
|
||||
#define LOCATIONS 17
|
||||
#define DESTRUCTOR 18
|
||||
#endif
|
||||
|
||||
/* symbol classes */
|
||||
|
||||
#define UNKNOWN 0
|
||||
#define TERM 1
|
||||
#define NONTERM 2
|
||||
#define ACTION 3
|
||||
#define ARGUMENT 4
|
||||
|
||||
/* the undefined value */
|
||||
|
||||
@ -150,10 +170,20 @@
|
||||
/* messages */
|
||||
#define PLURAL(n) ((n) > 1 ? "s" : "")
|
||||
|
||||
/*
|
||||
* Features which depend indirectly on the btyacc configuration, but are not
|
||||
* essential.
|
||||
*/
|
||||
#if defined(YYBTYACC)
|
||||
#define USE_HEADER_GUARDS 1
|
||||
#else
|
||||
#define USE_HEADER_GUARDS 0
|
||||
#endif
|
||||
|
||||
typedef char Assoc_t;
|
||||
typedef char Class_t;
|
||||
typedef short Index_t;
|
||||
typedef short Value_t;
|
||||
typedef YYINT Index_t;
|
||||
typedef YYINT Value_t;
|
||||
|
||||
/* the structure of a symbol table entry */
|
||||
|
||||
@ -164,6 +194,12 @@ struct bucket
|
||||
struct bucket *next;
|
||||
char *name;
|
||||
char *tag;
|
||||
#if defined(YYBTYACC)
|
||||
char **argnames;
|
||||
char **argtags;
|
||||
int args;
|
||||
char *destructor;
|
||||
#endif
|
||||
Value_t value;
|
||||
Index_t index;
|
||||
Value_t prec;
|
||||
@ -250,6 +286,11 @@ extern int outline;
|
||||
extern int exit_code;
|
||||
extern int pure_parser;
|
||||
extern int token_table;
|
||||
#if defined(YYBTYACC)
|
||||
extern int locations;
|
||||
extern int backtrack;
|
||||
extern int destructor;
|
||||
#endif
|
||||
|
||||
extern const char *const banner[];
|
||||
extern const char *const xdecls[];
|
||||
@ -261,9 +302,7 @@ extern const char *const hdr_vars[];
|
||||
extern const char *const body_1[];
|
||||
extern const char *const body_vars[];
|
||||
extern const char *const body_2[];
|
||||
extern const char *const body_3[];
|
||||
extern const char *const trailer[];
|
||||
extern const char *const trailer_2[];
|
||||
|
||||
extern char *code_file_name;
|
||||
extern char *input_file_name;
|
||||
@ -281,11 +320,11 @@ extern FILE *union_file;
|
||||
extern FILE *verbose_file;
|
||||
extern FILE *graph_file;
|
||||
|
||||
extern int nitems;
|
||||
extern int nrules;
|
||||
extern int nsyms;
|
||||
extern int ntokens;
|
||||
extern int nvars;
|
||||
extern Value_t nitems;
|
||||
extern Value_t nrules;
|
||||
extern Value_t nsyms;
|
||||
extern Value_t ntokens;
|
||||
extern Value_t nvars;
|
||||
extern int ntags;
|
||||
|
||||
extern char unionized;
|
||||
@ -298,6 +337,12 @@ extern Value_t *symbol_value;
|
||||
extern Value_t *symbol_prec;
|
||||
extern char *symbol_assoc;
|
||||
|
||||
#if defined(YYBTYACC)
|
||||
extern Value_t *symbol_pval;
|
||||
extern char **symbol_destructor;
|
||||
extern char **symbol_type_tag;
|
||||
#endif
|
||||
|
||||
extern Value_t *ritem;
|
||||
extern Value_t *rlhs;
|
||||
extern Value_t *rrhs;
|
||||
@ -346,9 +391,6 @@ extern param *parse_param;
|
||||
|
||||
/* global functions */
|
||||
|
||||
extern bucket *lookup(const char *);
|
||||
extern bucket *make_bucket(const char *);
|
||||
|
||||
#ifndef GCC_NORETURN
|
||||
#if defined(__dead2)
|
||||
#define GCC_NORETURN __dead2
|
||||
@ -373,7 +415,13 @@ extern void finalize_closure(void);
|
||||
extern void set_first_derives(void);
|
||||
|
||||
/* error.c */
|
||||
extern void arg_number_disagree_warning(int a_lineno, char *a_name);
|
||||
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 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);
|
||||
extern void fatal(const char *msg) GCC_NORETURN;
|
||||
@ -389,6 +437,7 @@ extern void reprec_warning(char *s);
|
||||
extern void restarted_warning(void);
|
||||
extern void retyped_warning(char *s);
|
||||
extern void revalued_warning(char *s);
|
||||
extern void start_requires_args(char *a_name);
|
||||
extern void syntax_error(int st_lineno, char *st_line, char *st_cptr) GCC_NORETURN;
|
||||
extern void terminal_lhs(int s_lineno) GCC_NORETURN;
|
||||
extern void terminal_start(char *s) GCC_NORETURN;
|
||||
@ -396,24 +445,25 @@ extern void tokenized_start(char *s) GCC_NORETURN;
|
||||
extern void undefined_goal(char *s) GCC_NORETURN;
|
||||
extern void undefined_symbol_warning(char *s);
|
||||
extern void unexpected_EOF(void) GCC_NORETURN;
|
||||
extern void unknown_arg_warning(int d_lineno, const char *dlr_opt, const char *d_arg, const char *d_line, const char *d_cptr);
|
||||
extern void unknown_rhs(int i) GCC_NORETURN;
|
||||
extern void unsupported_flag_warning(const char *flag, const char *details);
|
||||
extern void unterminated_action(int a_lineno, char *a_line, char *a_cptr) GCC_NORETURN;
|
||||
extern void unterminated_comment(int c_lineno, char *c_line, char *c_cptr) GCC_NORETURN;
|
||||
extern void unterminated_string(int s_lineno, char *s_line, char *s_cptr) GCC_NORETURN;
|
||||
extern void unterminated_text(int t_lineno, char *t_line, char *t_cptr) GCC_NORETURN;
|
||||
extern void unterminated_union(int u_lineno, char *u_line, char *u_cptr) GCC_NORETURN;
|
||||
extern void untyped_arg_warning(int a_lineno, const char *dlr_opt, const char *a_name);
|
||||
extern void untyped_lhs(void) GCC_NORETURN;
|
||||
extern void untyped_rhs(int i, char *s) GCC_NORETURN;
|
||||
extern void used_reserved(char *s) GCC_NORETURN;
|
||||
extern void unterminated_arglist(int a_lineno, char *a_line, char *a_cptr) GCC_NORETURN;
|
||||
extern void wrong_number_args_warning(const char *which, const char *a_name);
|
||||
extern void wrong_type_for_arg_warning(int i, char *a_name);
|
||||
|
||||
/* graph.c */
|
||||
extern void graph(void);
|
||||
|
||||
/* lalr.c */
|
||||
extern void create_symbol_table(void);
|
||||
extern void free_symbol_table(void);
|
||||
extern void free_symbols(void);
|
||||
|
||||
/* lalr.c */
|
||||
extern void lalr(void);
|
||||
|
||||
@ -432,21 +482,54 @@ extern void done(int k) GCC_NORETURN;
|
||||
extern void free_parser(void);
|
||||
extern void make_parser(void);
|
||||
|
||||
/* mstring.c */
|
||||
struct mstring
|
||||
{
|
||||
char *base, *ptr, *end;
|
||||
};
|
||||
|
||||
extern void msprintf(struct mstring *, const char *, ...);
|
||||
extern int mputchar(struct mstring *, int);
|
||||
extern struct mstring *msnew(void);
|
||||
extern char *msdone(struct mstring *);
|
||||
extern int strnscmp(const char *, const char *);
|
||||
extern unsigned int strnshash(const char *);
|
||||
|
||||
#define mputc(m, ch) (((m)->ptr == (m)->end) \
|
||||
? mputchar(m,ch) \
|
||||
: (*(m)->ptr++ = (char) (ch)))
|
||||
|
||||
/* output.c */
|
||||
extern void output(void);
|
||||
|
||||
/* reader.c */
|
||||
extern void reader(void);
|
||||
|
||||
/* skeleton.c */
|
||||
/* skeleton.c (generated by skel2c) */
|
||||
extern void write_section(FILE * fp, const char *const section[]);
|
||||
|
||||
/* symtab.c */
|
||||
extern bucket *make_bucket(const char *);
|
||||
extern bucket *lookup(const char *);
|
||||
extern void create_symbol_table(void);
|
||||
extern void free_symbol_table(void);
|
||||
extern void free_symbols(void);
|
||||
|
||||
/* verbose.c */
|
||||
extern void verbose(void);
|
||||
|
||||
/* warshall.c */
|
||||
extern void reflexive_transitive_closure(unsigned *R, int n);
|
||||
|
||||
#ifdef DEBUG
|
||||
/* closure.c */
|
||||
extern void print_closure(int n);
|
||||
extern void print_EFF(void);
|
||||
extern void print_first_derives(void);
|
||||
/* lr0.c */
|
||||
extern void print_derives(void);
|
||||
#endif
|
||||
|
||||
#ifdef NO_LEAKS
|
||||
extern void lr0_leaks(void);
|
||||
extern void lalr_leaks(void);
|
||||
|
@ -12,7 +12,7 @@ OBJS = closure.obj, \
|
||||
mkpar.obj, \
|
||||
output.obj, \
|
||||
reader.obj, \
|
||||
skeleton.obj, \
|
||||
yaccpar.obj, \
|
||||
symtab.obj, \
|
||||
verbose.obj, \
|
||||
warshall.obj
|
||||
|
120
error.c
120
error.c
@ -1,4 +1,4 @@
|
||||
/* $Id: error.c,v 1.9 2011/09/05 23:27:43 tom Exp $ */
|
||||
/* $Id: error.c,v 1.11 2014/04/07 22:22:49 tom Exp $ */
|
||||
|
||||
/* routines for printing error messages */
|
||||
|
||||
@ -42,9 +42,9 @@ unexpected_EOF(void)
|
||||
}
|
||||
|
||||
static void
|
||||
print_pos(char *st_line, char *st_cptr)
|
||||
print_pos(const char *st_line, const char *st_cptr)
|
||||
{
|
||||
char *s;
|
||||
const char *s;
|
||||
|
||||
if (st_line == 0)
|
||||
return;
|
||||
@ -286,3 +286,117 @@ undefined_symbol_warning(char *s)
|
||||
{
|
||||
fprintf(stderr, "%s: w - the symbol %s is undefined\n", myname, s);
|
||||
}
|
||||
|
||||
#if ! defined(YYBTYACC)
|
||||
void
|
||||
unsupported_flag_warning(const char *flag, const char *details)
|
||||
{
|
||||
fprintf(stderr, "%s: w - %s flag unsupported, %s\n",
|
||||
myname, flag, details);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(YYBTYACC)
|
||||
void
|
||||
at_warning(int a_lineno, int i)
|
||||
{
|
||||
fprintf(stderr, "%s: w - line %d of \"%s\", @%d references beyond the \
|
||||
end of the current rule\n", myname, a_lineno, input_file_name, i);
|
||||
}
|
||||
|
||||
void
|
||||
at_error(int a_lineno, char *a_line, char *a_cptr)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s: e - line %d of \"%s\", illegal @$ or @N reference\n",
|
||||
myname, a_lineno, input_file_name);
|
||||
print_pos(a_line, a_cptr);
|
||||
done(1);
|
||||
}
|
||||
|
||||
void
|
||||
unterminated_arglist(int a_lineno, char *a_line, char *a_cptr)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s: e - line %d of \"%s\", unterminated argument list\n",
|
||||
myname, a_lineno, input_file_name);
|
||||
print_pos(a_line, a_cptr);
|
||||
done(1);
|
||||
}
|
||||
|
||||
void
|
||||
arg_number_disagree_warning(int a_lineno, char *a_name)
|
||||
{
|
||||
fprintf(stderr, "%s: w - line %d of \"%s\", number of arguments of %s "
|
||||
"doesn't agree with previous declaration\n",
|
||||
myname, a_lineno, input_file_name, a_name);
|
||||
}
|
||||
|
||||
void
|
||||
bad_formals(void)
|
||||
{
|
||||
fprintf(stderr, "%s: e - line %d of \"%s\", bad formal argument list\n",
|
||||
myname, lineno, input_file_name);
|
||||
print_pos(line, cptr);
|
||||
done(1);
|
||||
}
|
||||
|
||||
void
|
||||
arg_type_disagree_warning(int a_lineno, int i, char *a_name)
|
||||
{
|
||||
fprintf(stderr, "%s: w - line %d of \"%s\", type of argument %d "
|
||||
"to %s doesn't agree with previous declaration\n",
|
||||
myname, a_lineno, input_file_name, i, a_name);
|
||||
}
|
||||
|
||||
void
|
||||
unknown_arg_warning(int d_lineno, const char *dlr_opt, const char *d_arg, const char
|
||||
*d_line, const char *d_cptr)
|
||||
{
|
||||
fprintf(stderr, "%s: w - line %d of \"%s\", unknown argument %s%s\n",
|
||||
myname, d_lineno, input_file_name, dlr_opt, d_arg);
|
||||
print_pos(d_line, d_cptr);
|
||||
}
|
||||
|
||||
void
|
||||
untyped_arg_warning(int a_lineno, const char *dlr_opt, const char *a_name)
|
||||
{
|
||||
fprintf(stderr, "%s: w - line %d of \"%s\", untyped argument %s%s\n",
|
||||
myname, a_lineno, input_file_name, dlr_opt, a_name);
|
||||
}
|
||||
|
||||
void
|
||||
wrong_number_args_warning(const char *which, const char *a_name)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s: w - line %d of \"%s\", wrong number of %sarguments for %s\n",
|
||||
myname, lineno, input_file_name, which, a_name);
|
||||
print_pos(line, cptr);
|
||||
}
|
||||
|
||||
void
|
||||
wrong_type_for_arg_warning(int i, char *a_name)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s: w - line %d of \"%s\", wrong type for default argument %d to %s\n",
|
||||
myname, lineno, input_file_name, i, a_name);
|
||||
print_pos(line, cptr);
|
||||
}
|
||||
|
||||
void
|
||||
start_requires_args(char *a_name)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s: w - line %d of \"%s\", start symbol %s requires arguments\n",
|
||||
myname, 0, input_file_name, a_name);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
destructor_redeclared_warning(int a_lineno, char *a_line, char *a_cptr)
|
||||
{
|
||||
fprintf(stderr, "%s: w - line %d of \"%s\", destructor redeclared\n",
|
||||
myname, a_lineno, input_file_name);
|
||||
print_pos(a_line, a_cptr);
|
||||
}
|
||||
#endif
|
||||
|
8
graph.c
8
graph.c
@ -1,4 +1,4 @@
|
||||
/* $Id: graph.c,v 1.7 2009/10/27 09:25:20 tom Exp $ */
|
||||
/* $Id: graph.c,v 1.8 2014/02/19 00:46:57 Tom.Shields Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -51,10 +51,10 @@ graph(void)
|
||||
static void
|
||||
graph_state(int stateno)
|
||||
{
|
||||
short *isp;
|
||||
Value_t *isp;
|
||||
int rule;
|
||||
short *sp;
|
||||
short *sp1;
|
||||
Value_t *sp;
|
||||
Value_t *sp1;
|
||||
|
||||
larno = (unsigned)lookaheads[stateno];
|
||||
fprintf(graph_file, "\n\tq%d [label=\"%d:\\l", stateno, stateno);
|
||||
|
4
lalr.c
4
lalr.c
@ -1,4 +1,4 @@
|
||||
/* $Id: lalr.c,v 1.9 2009/10/27 09:49:27 tom Exp $ */
|
||||
/* $Id: lalr.c,v 1.10 2014/02/19 00:35:17 Tom.Shields Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -196,7 +196,7 @@ set_goto_map(void)
|
||||
if (ISTOKEN(symbol))
|
||||
break;
|
||||
|
||||
if (ngotos == MAXSHORT)
|
||||
if (ngotos == MAXYYINT)
|
||||
fatal("too many gotos");
|
||||
|
||||
ngotos++;
|
||||
|
84
lr0.c
84
lr0.c
@ -1,4 +1,4 @@
|
||||
/* $Id: lr0.c,v 1.13 2012/05/26 00:40:47 tom Exp $ */
|
||||
/* $Id: lr0.c,v 1.16 2014/04/07 21:53:50 tom Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -28,7 +28,7 @@ static shifts *last_shift;
|
||||
static reductions *last_reduction;
|
||||
|
||||
static int nshifts;
|
||||
static short *shift_symbol;
|
||||
static Value_t *shift_symbol;
|
||||
|
||||
static Value_t *redset;
|
||||
static Value_t *shiftset;
|
||||
@ -40,16 +40,16 @@ static Value_t *kernel_items;
|
||||
static void
|
||||
allocate_itemsets(void)
|
||||
{
|
||||
short *itemp;
|
||||
short *item_end;
|
||||
Value_t *itemp;
|
||||
Value_t *item_end;
|
||||
int symbol;
|
||||
int i;
|
||||
int count;
|
||||
int max;
|
||||
short *symbol_count;
|
||||
Value_t *symbol_count;
|
||||
|
||||
count = 0;
|
||||
symbol_count = NEW2(nsyms, short);
|
||||
symbol_count = NEW2(nsyms, Value_t);
|
||||
|
||||
item_end = ritem + nitems;
|
||||
for (itemp = ritem; itemp < item_end; itemp++)
|
||||
@ -62,8 +62,8 @@ allocate_itemsets(void)
|
||||
}
|
||||
}
|
||||
|
||||
kernel_base = NEW2(nsyms, short *);
|
||||
kernel_items = NEW2(count, short);
|
||||
kernel_base = NEW2(nsyms, Value_t *);
|
||||
kernel_items = NEW2(count, Value_t);
|
||||
|
||||
count = 0;
|
||||
max = 0;
|
||||
@ -76,15 +76,15 @@ allocate_itemsets(void)
|
||||
}
|
||||
|
||||
shift_symbol = symbol_count;
|
||||
kernel_end = NEW2(nsyms, short *);
|
||||
kernel_end = NEW2(nsyms, Value_t *);
|
||||
}
|
||||
|
||||
static void
|
||||
allocate_storage(void)
|
||||
{
|
||||
allocate_itemsets();
|
||||
shiftset = NEW2(nsyms, short);
|
||||
redset = NEW2(nrules + 1, short);
|
||||
shiftset = NEW2(nsyms, Value_t);
|
||||
redset = NEW2(nrules + 1, Value_t);
|
||||
state_set = NEW2(nitems, core *);
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ static void
|
||||
generate_states(void)
|
||||
{
|
||||
allocate_storage();
|
||||
itemset = NEW2(nitems, short);
|
||||
itemset = NEW2(nitems, Value_t);
|
||||
ruleset = NEW2(WORDSIZE(nrules), unsigned);
|
||||
set_first_derives();
|
||||
initialize_states();
|
||||
@ -158,9 +158,9 @@ static Value_t
|
||||
get_state(int symbol)
|
||||
{
|
||||
int key;
|
||||
short *isp1;
|
||||
short *isp2;
|
||||
short *iend;
|
||||
Value_t *isp1;
|
||||
Value_t *isp2;
|
||||
Value_t *iend;
|
||||
core *sp;
|
||||
int found;
|
||||
int n;
|
||||
@ -220,14 +220,14 @@ static void
|
||||
initialize_states(void)
|
||||
{
|
||||
unsigned i;
|
||||
short *start_derives;
|
||||
Value_t *start_derives;
|
||||
core *p;
|
||||
|
||||
start_derives = derives[start_symbol];
|
||||
for (i = 0; start_derives[i] >= 0; ++i)
|
||||
continue;
|
||||
|
||||
p = (core *)MALLOC(sizeof(core) + i * sizeof(short));
|
||||
p = (core *)MALLOC(sizeof(core) + i * sizeof(Value_t));
|
||||
NO_SPACE(p);
|
||||
|
||||
p->next = 0;
|
||||
@ -248,8 +248,8 @@ new_itemsets(void)
|
||||
{
|
||||
Value_t i;
|
||||
int shiftcount;
|
||||
short *isp;
|
||||
short *ksp;
|
||||
Value_t *isp;
|
||||
Value_t *ksp;
|
||||
Value_t symbol;
|
||||
|
||||
for (i = 0; i < nsyms; i++)
|
||||
@ -283,22 +283,22 @@ new_state(int symbol)
|
||||
{
|
||||
unsigned n;
|
||||
core *p;
|
||||
short *isp1;
|
||||
short *isp2;
|
||||
short *iend;
|
||||
Value_t *isp1;
|
||||
Value_t *isp2;
|
||||
Value_t *iend;
|
||||
|
||||
#ifdef TRACE
|
||||
fprintf(stderr, "Entering new_state(%d)\n", symbol);
|
||||
#endif
|
||||
|
||||
if (nstates >= MAXSHORT)
|
||||
if (nstates >= MAXYYINT)
|
||||
fatal("too many states");
|
||||
|
||||
isp1 = kernel_base[symbol];
|
||||
iend = kernel_end[symbol];
|
||||
n = (unsigned)(iend - isp1);
|
||||
|
||||
p = (core *)allocate((sizeof(core) + (n - 1) * sizeof(short)));
|
||||
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;
|
||||
@ -316,7 +316,7 @@ new_state(int symbol)
|
||||
}
|
||||
|
||||
/* show_cores is used for debugging */
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
show_cores(void)
|
||||
{
|
||||
@ -393,17 +393,18 @@ show_shifts(void)
|
||||
printf("\t%d\n", p->shift[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
save_shifts(void)
|
||||
{
|
||||
shifts *p;
|
||||
short *sp1;
|
||||
short *sp2;
|
||||
short *send;
|
||||
Value_t *sp1;
|
||||
Value_t *sp2;
|
||||
Value_t *send;
|
||||
|
||||
p = (shifts *)allocate((sizeof(shifts) +
|
||||
(unsigned)(nshifts - 1) * sizeof(short)));
|
||||
(unsigned)(nshifts - 1) * sizeof(Value_t)));
|
||||
|
||||
p->number = this_state->number;
|
||||
p->nshifts = (Value_t) nshifts;
|
||||
@ -430,13 +431,13 @@ save_shifts(void)
|
||||
static void
|
||||
save_reductions(void)
|
||||
{
|
||||
short *isp;
|
||||
short *rp1;
|
||||
short *rp2;
|
||||
Value_t *isp;
|
||||
Value_t *rp1;
|
||||
Value_t *rp2;
|
||||
int item;
|
||||
Value_t count;
|
||||
reductions *p;
|
||||
short *rend;
|
||||
Value_t *rend;
|
||||
|
||||
count = 0;
|
||||
for (isp = itemset; isp < itemsetend; isp++)
|
||||
@ -452,7 +453,7 @@ save_reductions(void)
|
||||
{
|
||||
p = (reductions *)allocate((sizeof(reductions) +
|
||||
(unsigned)(count - 1) *
|
||||
sizeof(short)));
|
||||
sizeof(Value_t)));
|
||||
|
||||
p->number = this_state->number;
|
||||
p->nreds = count;
|
||||
@ -482,10 +483,10 @@ set_derives(void)
|
||||
{
|
||||
Value_t i, k;
|
||||
int lhs;
|
||||
short *rules;
|
||||
Value_t *rules;
|
||||
|
||||
derives = NEW2(nsyms, short *);
|
||||
rules = NEW2(nvars + nrules, short);
|
||||
derives = NEW2(nsyms, Value_t *);
|
||||
rules = NEW2(nvars + nrules, Value_t);
|
||||
|
||||
k = 0;
|
||||
for (lhs = start_symbol; lhs < nsyms; lhs++)
|
||||
@ -513,7 +514,7 @@ void
|
||||
print_derives(void)
|
||||
{
|
||||
int i;
|
||||
short *sp;
|
||||
Value_t *sp;
|
||||
|
||||
printf("\nDERIVES\n\n");
|
||||
|
||||
@ -592,8 +593,11 @@ lr0(void)
|
||||
void
|
||||
lr0_leaks(void)
|
||||
{
|
||||
DO_FREE(derives[start_symbol]);
|
||||
DO_FREE(derives);
|
||||
if (derives)
|
||||
{
|
||||
DO_FREE(derives[start_symbol]);
|
||||
DO_FREE(derives);
|
||||
}
|
||||
DO_FREE(nullable);
|
||||
}
|
||||
#endif
|
||||
|
75
main.c
75
main.c
@ -1,7 +1,11 @@
|
||||
/* $Id: main.c,v 1.41 2014/01/01 14:23:27 Christos.Zoulas Exp $ */
|
||||
/* $Id: main.c,v 1.49 2014/04/09 21:25:20 Rick.Spates Exp $ */
|
||||
|
||||
#include <signal.h>
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h> /* for _exit() */
|
||||
#else
|
||||
#include <stdlib.h> /* for _exit() */
|
||||
#endif
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -73,21 +77,30 @@ FILE *union_file; /* a temp file, used to save the union */
|
||||
FILE *verbose_file; /* y.output */
|
||||
FILE *graph_file; /* y.dot */
|
||||
|
||||
int nitems;
|
||||
int nrules;
|
||||
int nsyms;
|
||||
int ntokens;
|
||||
int nvars;
|
||||
Value_t nitems;
|
||||
Value_t nrules;
|
||||
Value_t nsyms;
|
||||
Value_t ntokens;
|
||||
Value_t nvars;
|
||||
|
||||
Value_t start_symbol;
|
||||
char **symbol_name;
|
||||
char **symbol_pname;
|
||||
Value_t *symbol_value;
|
||||
short *symbol_prec;
|
||||
Value_t *symbol_prec;
|
||||
char *symbol_assoc;
|
||||
|
||||
int pure_parser;
|
||||
int token_table;
|
||||
|
||||
#if defined(YYBTYACC)
|
||||
Value_t *symbol_pval;
|
||||
char **symbol_destructor;
|
||||
char **symbol_type_tag;
|
||||
int locations = 0; /* default to no position processing */
|
||||
int backtrack = 0; /* default is no backtracking */
|
||||
#endif
|
||||
|
||||
int exit_code;
|
||||
|
||||
Value_t *ritem;
|
||||
@ -116,6 +129,10 @@ done(int k)
|
||||
{
|
||||
DO_CLOSE(input_file);
|
||||
DO_CLOSE(output_file);
|
||||
if (iflag)
|
||||
DO_CLOSE(externs_file);
|
||||
if (rflag)
|
||||
DO_CLOSE(code_file);
|
||||
|
||||
DO_CLOSE(action_file);
|
||||
DO_CLOSE(defines_file);
|
||||
@ -153,9 +170,6 @@ done(int k)
|
||||
reader_leaks();
|
||||
#endif
|
||||
|
||||
if (rflag)
|
||||
DO_CLOSE(code_file);
|
||||
|
||||
exit(k);
|
||||
}
|
||||
|
||||
@ -191,11 +205,14 @@ usage(void)
|
||||
""
|
||||
,"Options:"
|
||||
," -b file_prefix set filename prefix (default \"y.\")"
|
||||
," -d write definitions (y.tab.h)"
|
||||
," -B create a backtracking parser"
|
||||
," -d write definitions (" DEFINES_SUFFIX ")"
|
||||
," -D enable value stack memory reclamation"
|
||||
," -i write interface (y.tab.i)"
|
||||
," -g write a graphical description"
|
||||
," -l suppress #line directives"
|
||||
," -o output_file (default \"y.tab.c\")"
|
||||
," -L enable position processing, e.g., \"%locations\""
|
||||
," -o output_file (default \"" OUTPUT_SUFFIX "\")"
|
||||
," -p symbol_prefix set symbol prefix (default \"yy\")"
|
||||
," -P create a reentrant parser, e.g., \"%pure-parser\""
|
||||
," -r produce separate code and table files (y.code.c)"
|
||||
@ -219,6 +236,14 @@ setflag(int ch)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case 'B':
|
||||
#if defined(YYBTYACC)
|
||||
backtrack = 1;
|
||||
#else
|
||||
unsupported_flag_warning("-B", "reconfigure with --enable-btyacc");
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
dflag = 1;
|
||||
break;
|
||||
@ -235,6 +260,14 @@ setflag(int ch)
|
||||
lflag = 1;
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
#if defined(YYBTYACC)
|
||||
locations = 1;
|
||||
#else
|
||||
unsupported_flag_warning("-B", "reconfigure with --enable-btyacc");
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'P':
|
||||
pure_parser = 1;
|
||||
break;
|
||||
@ -364,10 +397,18 @@ allocate(size_t n)
|
||||
}
|
||||
|
||||
#define CREATE_FILE_NAME(dest, suffix) \
|
||||
dest = TMALLOC(char, len + strlen(suffix) + 1); \
|
||||
NO_SPACE(dest); \
|
||||
strcpy(dest, file_prefix); \
|
||||
strcpy(dest + len, suffix)
|
||||
dest = alloc_file_name(len, suffix)
|
||||
|
||||
static char *
|
||||
alloc_file_name(size_t len, const char *suffix)
|
||||
{
|
||||
char *result = TMALLOC(char, len + strlen(suffix) + 1);
|
||||
if (result == 0)
|
||||
no_space();
|
||||
strcpy(result, file_prefix);
|
||||
strcpy(result + len, suffix);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
create_file_names(void)
|
||||
@ -384,7 +425,7 @@ create_file_names(void)
|
||||
/* compute the file_prefix from the user provided output_file_name */
|
||||
if (output_file_name != 0)
|
||||
{
|
||||
if (!(prefix = strstr(output_file_name, ".tab.c"))
|
||||
if (!(prefix = strstr(output_file_name, OUTPUT_SUFFIX))
|
||||
&& (prefix = strstr(output_file_name, ".c")))
|
||||
{
|
||||
defines_suffix = ".h";
|
||||
|
33
makefile.in
33
makefile.in
@ -1,4 +1,4 @@
|
||||
# $Id: makefile.in,v 1.19 2014/01/01 14:09:43 tom Exp $
|
||||
# $Id: makefile.in,v 1.23 2014/04/09 12:15:52 tom Exp $
|
||||
#
|
||||
# UNIX template-makefile for Berkeley Yacc
|
||||
|
||||
@ -24,9 +24,11 @@ CFLAGS = @CFLAGS@ $(CPPFLAGS) $(EXTRA_CFLAGS)
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
|
||||
AWK = @AWK@
|
||||
CTAGS = @CTAGS@
|
||||
ETAGS = @ETAGS@
|
||||
LINT = @LINT@
|
||||
LINTFLAGS = @LINT_OPTS@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
@ -38,6 +40,7 @@ manext = 1
|
||||
|
||||
testdir = $(srcdir)/test
|
||||
|
||||
SKELETON = @SKELETON@
|
||||
x = @EXEEXT@
|
||||
o = .@OBJEXT@
|
||||
|
||||
@ -57,9 +60,10 @@ C_FILES = \
|
||||
lr0.c \
|
||||
main.c \
|
||||
mkpar.c \
|
||||
mstring.c \
|
||||
output.c \
|
||||
reader.c \
|
||||
skeleton.c \
|
||||
$(SKELETON).c \
|
||||
symtab.c \
|
||||
verbose.c \
|
||||
warshall.c
|
||||
@ -72,13 +76,18 @@ OBJS = \
|
||||
lr0$o \
|
||||
main$o \
|
||||
mkpar$o \
|
||||
mstring$o \
|
||||
output$o \
|
||||
reader$o \
|
||||
skeleton$o \
|
||||
$(SKELETON)$o \
|
||||
symtab$o \
|
||||
verbose$o \
|
||||
warshall$o
|
||||
|
||||
YACCPAR = \
|
||||
btyaccpar.c \
|
||||
yaccpar.c
|
||||
|
||||
TRANSFORM_BIN = sed 's/$x$$//' |sed '$(transform)'|sed 's/$$/$x/'
|
||||
TRANSFORM_MAN = sed 's/$(manext)$$//'|sed '$(transform)'|sed 's/$$/$(manext)/'
|
||||
|
||||
@ -100,7 +109,7 @@ uninstall:
|
||||
- rm -f $(mandir)/$(actual_man)
|
||||
|
||||
################################################################################
|
||||
.SUFFIXES : $o .i
|
||||
.SUFFIXES : .c $o .i .skel
|
||||
|
||||
.c$o:
|
||||
@RULE_CC@
|
||||
@ -110,6 +119,9 @@ uninstall:
|
||||
@RULE_CC@
|
||||
@ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@
|
||||
|
||||
.skel.c :
|
||||
$(AWK) -f $(srcdir)/skel2c $*.skel > $@
|
||||
|
||||
################################################################################
|
||||
|
||||
$(THIS)$x : $(OBJS)
|
||||
@ -123,11 +135,16 @@ clean :: mostlyclean
|
||||
|
||||
distclean :: clean
|
||||
- rm -f config.log config.cache config.status config.h makefile
|
||||
- cd test && rm -f test-*
|
||||
- rm -f $(testdir)/yacc/test-* $(testdir)/btyacc/test-*
|
||||
|
||||
realclean :: distclean
|
||||
- rm -f tags TAGS
|
||||
|
||||
sources : $(YACCPAR)
|
||||
|
||||
maintainer-clean :: realclean
|
||||
rm -f $(YACCPAR)
|
||||
|
||||
################################################################################
|
||||
check: $(THIS)$x
|
||||
$(SHELL) $(testdir)/run_test.sh $(testdir)
|
||||
@ -142,7 +159,7 @@ tags: $(H_FILES) $(C_FILES)
|
||||
$(CTAGS) $(C_FILES) $(H_FILES)
|
||||
|
||||
lint: $(C_FILES)
|
||||
$(LINT) $(CPPFLAGS) $(C_FILES)
|
||||
$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(C_FILES)
|
||||
|
||||
@MAKE_UPPER_TAGS@TAGS: $(H_FILES) $(C_FILES)
|
||||
@MAKE_UPPER_TAGS@ $(ETAGS) $(C_FILES) $(H_FILES)
|
||||
@ -150,9 +167,9 @@ lint: $(C_FILES)
|
||||
depend:
|
||||
makedepend -- $(CPPFLAGS) -- $(C_FILES)
|
||||
|
||||
$(OBJS) : defs.h
|
||||
$(OBJS) : defs.h makefile
|
||||
|
||||
main$o \
|
||||
skeleton$o : makefile VERSION
|
||||
$(SKELETON)$o : VERSION
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
27
mkpar.c
27
mkpar.c
@ -1,7 +1,18 @@
|
||||
/* $Id: mkpar.c,v 1.12 2012/05/26 00:42:18 tom Exp $ */
|
||||
/* $Id: mkpar.c,v 1.14 2014/04/01 23:05:37 tom Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#define NotSuppressed(p) ((p)->suppressed == 0)
|
||||
|
||||
#if defined(YYBTYACC)
|
||||
#define MaySuppress(p) ((backtrack ? ((p)->suppressed <= 1) : (p)->suppressed == 0))
|
||||
/* suppress the preferred action => enable backtracking */
|
||||
#define StartBacktrack(p) if (backtrack && (p) != NULL && NotSuppressed(p)) (p)->suppressed = 1
|
||||
#else
|
||||
#define MaySuppress(p) ((p)->suppressed == 0)
|
||||
#define StartBacktrack(p) /*nothing */
|
||||
#endif
|
||||
|
||||
static action *add_reduce(action *actions, int ruleno, int symbol);
|
||||
static action *add_reductions(int stateno, action *actions);
|
||||
static action *get_shifts(int stateno);
|
||||
@ -190,7 +201,7 @@ unused_rules(void)
|
||||
{
|
||||
for (p = parser[i]; p; p = p->next)
|
||||
{
|
||||
if (p->action_code == REDUCE && p->suppressed == 0)
|
||||
if ((p->action_code == REDUCE) && MaySuppress(p))
|
||||
rules_used[p->number] = 1;
|
||||
}
|
||||
}
|
||||
@ -225,17 +236,23 @@ remove_conflicts(void)
|
||||
SRcount = 0;
|
||||
RRcount = 0;
|
||||
symbol = -1;
|
||||
#if defined(YYBTYACC)
|
||||
pref = NULL;
|
||||
#endif
|
||||
for (p = parser[i]; p; p = p->next)
|
||||
{
|
||||
if (p->symbol != symbol)
|
||||
{
|
||||
/* the first parse action for each symbol is the preferred action */
|
||||
pref = p;
|
||||
symbol = p->symbol;
|
||||
}
|
||||
/* following conditions handle multiple, i.e., conflicting, parse actions */
|
||||
else if (i == final_state && symbol == 0)
|
||||
{
|
||||
SRcount++;
|
||||
p->suppressed = 1;
|
||||
StartBacktrack(pref);
|
||||
}
|
||||
else if (pref != 0 && pref->action_code == SHIFT)
|
||||
{
|
||||
@ -269,12 +286,14 @@ remove_conflicts(void)
|
||||
{
|
||||
SRcount++;
|
||||
p->suppressed = 1;
|
||||
StartBacktrack(pref);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RRcount++;
|
||||
p->suppressed = 1;
|
||||
StartBacktrack(pref);
|
||||
}
|
||||
}
|
||||
SRtotal += SRcount;
|
||||
@ -329,9 +348,9 @@ sole_reduction(int stateno)
|
||||
ruleno = 0;
|
||||
for (p = parser[stateno]; p; p = p->next)
|
||||
{
|
||||
if (p->action_code == SHIFT && p->suppressed == 0)
|
||||
if (p->action_code == SHIFT && MaySuppress(p))
|
||||
return (0);
|
||||
else if (p->action_code == REDUCE && p->suppressed == 0)
|
||||
else if ((p->action_code == REDUCE) && MaySuppress(p))
|
||||
{
|
||||
if (ruleno > 0 && p->number != ruleno)
|
||||
return (0);
|
||||
|
152
mstring.c
Normal file
152
mstring.c
Normal file
@ -0,0 +1,152 @@
|
||||
/* $Id: mstring.c,v 1.3 2014/04/08 20:37:26 tom Exp $ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "defs.h"
|
||||
|
||||
/* parameters about string length. HEAD is the starting size and
|
||||
** HEAD+TAIL should be a power of two */
|
||||
#define HEAD 24
|
||||
#define TAIL 8
|
||||
|
||||
#if defined(YYBTYACC)
|
||||
void
|
||||
msprintf(struct mstring *s, const char *fmt,...)
|
||||
{
|
||||
static char buf[4096]; /* a big static buffer */
|
||||
va_list args;
|
||||
size_t len;
|
||||
|
||||
if (!s || !s->base)
|
||||
return;
|
||||
va_start(args, fmt);
|
||||
vsprintf(buf, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
len = strlen(buf);
|
||||
if (len > (size_t) (s->end - s->ptr))
|
||||
{
|
||||
size_t cp = (size_t) (s->ptr - s->base);
|
||||
size_t cl = (size_t) (s->end - s->base);
|
||||
size_t nl = cl;
|
||||
while (len > (nl - cp))
|
||||
nl = nl + nl + TAIL;
|
||||
if ((s->base = realloc(s->base, nl)))
|
||||
{
|
||||
s->ptr = s->base + cp;
|
||||
s->end = s->base + nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
s->ptr = s->end = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
memcpy(s->ptr, buf, len);
|
||||
s->ptr += len;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
mputchar(struct mstring *s, int ch)
|
||||
{
|
||||
if (!s || !s->base)
|
||||
return ch;
|
||||
if (s->ptr == s->end)
|
||||
{
|
||||
size_t len = (size_t) (s->end - s->base);
|
||||
if ((s->base = realloc(s->base, len + len + TAIL)))
|
||||
{
|
||||
s->ptr = s->base + len;
|
||||
s->end = s->base + len + len + TAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
s->ptr = s->end = 0;
|
||||
return ch;
|
||||
}
|
||||
}
|
||||
*s->ptr++ = (char)ch;
|
||||
return ch;
|
||||
}
|
||||
|
||||
struct mstring *
|
||||
msnew(void)
|
||||
{
|
||||
struct mstring *n = malloc(sizeof(struct mstring));
|
||||
|
||||
if (n)
|
||||
{
|
||||
if ((n->base = n->ptr = malloc(HEAD)) != 0)
|
||||
{
|
||||
n->end = n->base + HEAD;
|
||||
}
|
||||
else
|
||||
{
|
||||
free(n);
|
||||
n = 0;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
char *
|
||||
msdone(struct mstring *s)
|
||||
{
|
||||
char *r = 0;
|
||||
if (s)
|
||||
{
|
||||
mputc(s, 0);
|
||||
r = s->base;
|
||||
free(s);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
#if defined(YYBTYACC)
|
||||
/* compare two strings, ignoring whitespace, except between two letters or
|
||||
** digits (and treat all of these as equal) */
|
||||
int
|
||||
strnscmp(const char *a, const char *b)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
while (isspace(*a))
|
||||
a++;
|
||||
while (isspace(*b))
|
||||
b++;
|
||||
while (*a && *a == *b)
|
||||
a++, b++;
|
||||
if (isspace(*a))
|
||||
{
|
||||
if (isalnum(a[-1]) && isalnum(*b))
|
||||
break;
|
||||
}
|
||||
else if (isspace(*b))
|
||||
{
|
||||
if (isalnum(b[-1]) && isalnum(*a))
|
||||
break;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
return *a - *b;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
strnshash(const char *s)
|
||||
{
|
||||
unsigned int h = 0;
|
||||
|
||||
while (*s)
|
||||
{
|
||||
if (!isspace(*s))
|
||||
h = (h << 5) - h + (unsigned char)*s;
|
||||
s++;
|
||||
}
|
||||
return h;
|
||||
}
|
||||
#endif
|
@ -1,8 +1,8 @@
|
||||
Summary: byacc - public domain Berkeley LALR Yacc parser generator
|
||||
%define AppProgram byacc
|
||||
%define AppVersion 20140101
|
||||
%define AppVersion 20140409
|
||||
%define UseProgram yacc
|
||||
# $XTermId: byacc.spec,v 1.18 2014/01/01 17:26:25 tom Exp $
|
||||
# $XTermId: byacc.spec,v 1.19 2014/04/09 19:53:59 tom Exp $
|
||||
Name: %{AppProgram}
|
||||
Version: %{AppVersion}
|
||||
Release: 1
|
||||
|
@ -1,3 +1,10 @@
|
||||
byacc (20140409) unstable; urgency=low
|
||||
|
||||
* integrate Tom Shield's btyacc-related changes
|
||||
* add test-cases to fill in gaps reported by lcov
|
||||
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Wed, 09 Apr 2014 15:53:59 -0400
|
||||
|
||||
byacc (20140101) unstable; urgency=low
|
||||
|
||||
* yytname[] changes
|
||||
|
@ -1,8 +1,8 @@
|
||||
Summary: byacc - public domain Berkeley LALR Yacc parser generator
|
||||
%define AppProgram byacc
|
||||
%define AppVersion 20130925
|
||||
%define AppVersion 20140409
|
||||
%define UseProgram yacc
|
||||
# $XTermId: mingw-byacc.spec,v 1.1 2013/09/25 23:12:06 tom Exp $
|
||||
# $XTermId: mingw-byacc.spec,v 1.2 2014/04/09 19:53:59 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-20050813
|
||||
DISTNAME= byacc-20140409
|
||||
PKGREVISION= 1
|
||||
CATEGORIES= devel
|
||||
MASTER_SITES= ftp://invisible-island.net/byacc/
|
||||
|
112
skel2c
Normal file
112
skel2c
Normal file
@ -0,0 +1,112 @@
|
||||
# vile: awkmode
|
||||
function noident(given) {
|
||||
gsub(/\$/,"@", given);
|
||||
return given;
|
||||
}
|
||||
BEGIN { havesection = 0;
|
||||
version = "$Id: skel2c,v 1.3 2014/04/06 19:48:04 tom Exp $";
|
||||
nsec = 0;
|
||||
ifdef = "";
|
||||
printf "/* This file generated automatically using\n * %s\n */\n\n",
|
||||
noident(version);
|
||||
}
|
||||
/[$]Id[:][^$]*[$]/ {
|
||||
printf "%s\n", noident($0);
|
||||
next;
|
||||
}
|
||||
/^%% *insert *VERSION *here/ {
|
||||
printf " CONCAT1(\"#define YYMAJOR \", YYMAJOR),\n";
|
||||
printf " CONCAT1(\"#define YYMINOR \", YYMINOR),\n";
|
||||
printf "#ifdef YYPATCH\n";
|
||||
printf " CONCAT1(\"#define YYPATCH \", YYPATCH),\n";
|
||||
printf "#endif\n";
|
||||
next;
|
||||
}
|
||||
/^%%ifdef/ {
|
||||
if (NF >= 2) {
|
||||
printf "#if defined(%s)\n", $2;
|
||||
printf " \"#if %s\",\n", $2;
|
||||
} else {
|
||||
_abort_exit = 1;
|
||||
printf "skel2c: ill-formed %%ifdef in skeleton file on line %d\n", FNR > "/dev/stderr";
|
||||
exit 2;
|
||||
}
|
||||
if (ifdef != "") {
|
||||
printf "skel2c: nested %%ifdef in skeleton file on line %d\n", FNR > "/dev/stderr";
|
||||
exit 2;
|
||||
}
|
||||
ifdef = $2;
|
||||
next;
|
||||
}
|
||||
/^%%endif/ {
|
||||
if (ifdef != "") {
|
||||
if (NF >= 2) {
|
||||
printf " \"#endif /* %s */\",\n", $2;
|
||||
printf "#endif /* defined(%s) */\n", $2;
|
||||
} else {
|
||||
printf " \"#endif /* %s */\",\n", ifdef;
|
||||
printf "#endif /* defined(%s) */\n", ifdef;
|
||||
}
|
||||
ifdef = "";
|
||||
} else {
|
||||
printf " \"#endif\",\n";
|
||||
printf "#endif\n";
|
||||
printf "skel2c: unmatched %endif in skeleton file on line %d\n", FNR > "/dev/stderr";
|
||||
exit 2;
|
||||
}
|
||||
next;
|
||||
}
|
||||
/^%%/ { if (havesection) {
|
||||
printf " 0\n};\n\n";
|
||||
}
|
||||
if (NF >= 2) {
|
||||
havesection = 1;
|
||||
section = $2;
|
||||
seclist[nsec] = section;
|
||||
nsec = nsec + 1;
|
||||
printf "const char *const %s[] =\n{\n", $2;
|
||||
} else {
|
||||
havesection = 0;
|
||||
}
|
||||
next;
|
||||
}
|
||||
{ if (havesection) {
|
||||
# Could use 'gsub(/\\/, "\\\\")' instead of the following
|
||||
# two lines, but there's a bug in mawk and the original
|
||||
# awk (not in gawk) which is triggered by that.
|
||||
gsub(/\\/, "\\\1");
|
||||
gsub(/\1/, "\\");
|
||||
# gsub(/\t/, "\\t"); # change '\t' to "\\t"
|
||||
gsub(/\"/, "\\\"");
|
||||
printf " \"%s\",\n", $0;
|
||||
} else {
|
||||
print $0;
|
||||
}
|
||||
}
|
||||
END { if (_abort_exit)
|
||||
exit 2;
|
||||
if (havesection) {
|
||||
print " 0\n};\n";
|
||||
}
|
||||
if (nsec > 0) {
|
||||
print "void";
|
||||
print "write_section(FILE * fp, const char *const section[])";
|
||||
print "{";
|
||||
print " int i;";
|
||||
print " const char *s;\n";
|
||||
print " for (i = 0; (s = section[i]) != 0; ++i)";
|
||||
print " {";
|
||||
print "\tif (fp == code_file)";
|
||||
print "\t ++outline;";
|
||||
print "\tfprintf(fp, \"%s\\n\", s);";
|
||||
print " }";
|
||||
print "}";
|
||||
} else {
|
||||
print "skel2c: no sections defined in skeleton file" > "/dev/stderr";
|
||||
exit 2;
|
||||
}
|
||||
if (ifdef != "") {
|
||||
printf "skel2c: unmatched %%ifdef %s at end of skeleton file\n", $ifdef > "/dev/stderr";
|
||||
exit 2;
|
||||
}
|
||||
}
|
8
symtab.c
8
symtab.c
@ -1,4 +1,4 @@
|
||||
/* $Id: symtab.c,v 1.10 2012/05/26 15:16:12 tom Exp $ */
|
||||
/* $Id: symtab.c,v 1.11 2014/03/26 00:17:09 Tom.Shields Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -48,6 +48,12 @@ make_bucket(const char *name)
|
||||
bp->prec = 0;
|
||||
bp->class = UNKNOWN;
|
||||
bp->assoc = TOKEN;
|
||||
#if defined(YYBTYACC)
|
||||
bp->args = -1;
|
||||
bp->argnames = 0;
|
||||
bp->argtags = 0;
|
||||
bp->destructor = 0;
|
||||
#endif
|
||||
strcpy(bp->name, name);
|
||||
|
||||
return (bp);
|
||||
|
19
test/btyacc/big_b.output
Normal file
19
test/btyacc/big_b.output
Normal file
@ -0,0 +1,19 @@
|
||||
Usage: YACC [options] filename
|
||||
|
||||
Options:
|
||||
-b file_prefix set filename prefix (default "y.")
|
||||
-B create a backtracking parser
|
||||
-d write definitions (.tab.h)
|
||||
-D enable value stack memory reclamation
|
||||
-i write interface (y.tab.i)
|
||||
-g write a graphical description
|
||||
-l suppress #line directives
|
||||
-L enable position processing, e.g., "%locations"
|
||||
-o output_file (default ".tab.c")
|
||||
-p symbol_prefix set symbol prefix (default "yy")
|
||||
-P create a reentrant parser, e.g., "%pure-parser"
|
||||
-r produce separate code and table files (y.code.c)
|
||||
-s suppress #define's for quoted names in %token lines
|
||||
-t add debugging support
|
||||
-v write description (y.output)
|
||||
-V show version information and exit
|
19
test/btyacc/big_l.output
Normal file
19
test/btyacc/big_l.output
Normal file
@ -0,0 +1,19 @@
|
||||
Usage: YACC [options] filename
|
||||
|
||||
Options:
|
||||
-b file_prefix set filename prefix (default "y.")
|
||||
-B create a backtracking parser
|
||||
-d write definitions (.tab.h)
|
||||
-D enable value stack memory reclamation
|
||||
-i write interface (y.tab.i)
|
||||
-g write a graphical description
|
||||
-l suppress #line directives
|
||||
-L enable position processing, e.g., "%locations"
|
||||
-o output_file (default ".tab.c")
|
||||
-p symbol_prefix set symbol prefix (default "yy")
|
||||
-P create a reentrant parser, e.g., "%pure-parser"
|
||||
-r produce separate code and table files (y.code.c)
|
||||
-s suppress #define's for quoted names in %token lines
|
||||
-t add debugging support
|
||||
-v write description (y.output)
|
||||
-V show version information and exit
|
1
test/btyacc/btyacc_calc1.error
Normal file
1
test/btyacc/btyacc_calc1.error
Normal file
@ -0,0 +1 @@
|
||||
YACC: 17 shift/reduce conflicts, 27 reduce/reduce conflicts.
|
949
test/btyacc/btyacc_calc1.output
Normal file
949
test/btyacc/btyacc_calc1.output
Normal file
@ -0,0 +1,949 @@
|
||||
0 $accept : lines $end
|
||||
|
||||
1 lines :
|
||||
2 | lines line '\n'
|
||||
3 | lines error '\n'
|
||||
|
||||
4 line : dexp
|
||||
5 | vexp
|
||||
6 | DREG '=' dexp
|
||||
7 | VREG '=' vexp
|
||||
|
||||
8 dexp : CONST
|
||||
9 | DREG
|
||||
10 | dexp '+' dexp
|
||||
11 | dexp '-' dexp
|
||||
12 | dexp '*' dexp
|
||||
13 | dexp '/' dexp
|
||||
14 | '-' dexp
|
||||
15 | '(' dexp ')'
|
||||
|
||||
16 vexp : dexp
|
||||
17 | '(' dexp ',' dexp ')'
|
||||
18 | VREG
|
||||
19 | vexp '+' vexp
|
||||
20 | dexp '+' vexp
|
||||
21 | vexp '-' vexp
|
||||
22 | dexp '-' vexp
|
||||
23 | vexp '*' vexp
|
||||
24 | dexp '*' vexp
|
||||
25 | vexp '/' vexp
|
||||
26 | dexp '/' vexp
|
||||
27 | '-' vexp
|
||||
28 | '(' vexp ')'
|
||||
|
||||
state 0
|
||||
$accept : . lines $end (0)
|
||||
lines : . (1)
|
||||
|
||||
. reduce 1
|
||||
|
||||
lines goto 1
|
||||
|
||||
|
||||
state 1
|
||||
$accept : lines . $end (0)
|
||||
lines : lines . line '\n' (2)
|
||||
lines : lines . error '\n' (3)
|
||||
|
||||
$end accept
|
||||
error shift 2
|
||||
DREG shift 3
|
||||
VREG shift 4
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 8
|
||||
vexp goto 9
|
||||
line goto 10
|
||||
|
||||
|
||||
state 2
|
||||
lines : lines error . '\n' (3)
|
||||
|
||||
'\n' shift 11
|
||||
. error
|
||||
|
||||
|
||||
state 3
|
||||
line : DREG . '=' dexp (6)
|
||||
dexp : DREG . (9)
|
||||
|
||||
'=' shift 12
|
||||
'+' reduce 9
|
||||
'-' reduce 9
|
||||
'*' reduce 9
|
||||
'/' reduce 9
|
||||
'\n' reduce 9
|
||||
|
||||
|
||||
state 4
|
||||
line : VREG . '=' vexp (7)
|
||||
vexp : VREG . (18)
|
||||
|
||||
'=' shift 13
|
||||
'+' reduce 18
|
||||
'-' reduce 18
|
||||
'*' reduce 18
|
||||
'/' reduce 18
|
||||
'\n' reduce 18
|
||||
|
||||
|
||||
state 5
|
||||
dexp : CONST . (8)
|
||||
|
||||
. reduce 8
|
||||
|
||||
|
||||
state 6
|
||||
dexp : '-' . dexp (14)
|
||||
vexp : '-' . vexp (27)
|
||||
|
||||
DREG shift 14
|
||||
VREG shift 15
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 16
|
||||
vexp goto 17
|
||||
|
||||
|
||||
state 7
|
||||
dexp : '(' . dexp ')' (15)
|
||||
vexp : '(' . dexp ',' dexp ')' (17)
|
||||
vexp : '(' . vexp ')' (28)
|
||||
|
||||
DREG shift 14
|
||||
VREG shift 15
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 18
|
||||
vexp goto 19
|
||||
|
||||
|
||||
8: shift/reduce conflict (shift 20, reduce 16) on '+'
|
||||
8: shift/reduce conflict (shift 21, reduce 16) on '-'
|
||||
8: shift/reduce conflict (shift 22, reduce 16) on '*'
|
||||
8: shift/reduce conflict (shift 23, reduce 16) on '/'
|
||||
8: reduce/reduce conflict (reduce 4, reduce 16) on '\n'
|
||||
state 8
|
||||
line : dexp . (4)
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'+' [trial] shift 20
|
||||
'-' [trial] shift 21
|
||||
'*' [trial] shift 22
|
||||
'/' [trial] shift 23
|
||||
'+' [trial] reduce 16
|
||||
'-' [trial] reduce 16
|
||||
'*' [trial] reduce 16
|
||||
'/' [trial] reduce 16
|
||||
'\n' [trial] reduce 4
|
||||
'\n' [trial] reduce 16
|
||||
|
||||
|
||||
state 9
|
||||
line : vexp . (5)
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'+' shift 24
|
||||
'-' shift 25
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'\n' reduce 5
|
||||
|
||||
|
||||
state 10
|
||||
lines : lines line . '\n' (2)
|
||||
|
||||
'\n' shift 28
|
||||
. error
|
||||
|
||||
|
||||
state 11
|
||||
lines : lines error '\n' . (3)
|
||||
|
||||
. reduce 3
|
||||
|
||||
|
||||
state 12
|
||||
line : DREG '=' . dexp (6)
|
||||
|
||||
DREG shift 14
|
||||
CONST shift 5
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 31
|
||||
|
||||
|
||||
state 13
|
||||
line : VREG '=' . vexp (7)
|
||||
|
||||
DREG shift 14
|
||||
VREG shift 15
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 32
|
||||
vexp goto 33
|
||||
|
||||
|
||||
state 14
|
||||
dexp : DREG . (9)
|
||||
|
||||
. reduce 9
|
||||
|
||||
|
||||
state 15
|
||||
vexp : VREG . (18)
|
||||
|
||||
. reduce 18
|
||||
|
||||
|
||||
16: reduce/reduce conflict (reduce 14, reduce 16) on '+'
|
||||
16: reduce/reduce conflict (reduce 14, reduce 16) on '-'
|
||||
16: reduce/reduce conflict (reduce 14, reduce 16) on '*'
|
||||
16: reduce/reduce conflict (reduce 14, reduce 16) on '/'
|
||||
16: reduce/reduce conflict (reduce 14, reduce 16) on '\n'
|
||||
16: reduce/reduce conflict (reduce 14, reduce 16) on ')'
|
||||
state 16
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : '-' dexp . (14)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'+' [trial] reduce 14
|
||||
'+' [trial] reduce 16
|
||||
'-' [trial] reduce 14
|
||||
'-' [trial] reduce 16
|
||||
'*' [trial] reduce 14
|
||||
'*' [trial] reduce 16
|
||||
'/' [trial] reduce 14
|
||||
'/' [trial] reduce 16
|
||||
'\n' [trial] reduce 14
|
||||
'\n' [trial] reduce 16
|
||||
')' [trial] reduce 14
|
||||
')' [trial] reduce 16
|
||||
',' reduce 14
|
||||
|
||||
|
||||
state 17
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
vexp : '-' vexp . (27)
|
||||
|
||||
. reduce 27
|
||||
|
||||
|
||||
18: shift/reduce conflict (shift 20, reduce 16) on '+'
|
||||
18: shift/reduce conflict (shift 21, reduce 16) on '-'
|
||||
18: shift/reduce conflict (shift 22, reduce 16) on '*'
|
||||
18: shift/reduce conflict (shift 23, reduce 16) on '/'
|
||||
18: shift/reduce conflict (shift 34, reduce 16) on ')'
|
||||
state 18
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : '(' dexp . ')' (15)
|
||||
vexp : dexp . (16)
|
||||
vexp : '(' dexp . ',' dexp ')' (17)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'+' [trial] shift 20
|
||||
'-' [trial] shift 21
|
||||
'*' [trial] shift 22
|
||||
'/' [trial] shift 23
|
||||
')' [trial] shift 34
|
||||
',' shift 35
|
||||
'+' [trial] reduce 16
|
||||
'-' [trial] reduce 16
|
||||
'*' [trial] reduce 16
|
||||
'/' [trial] reduce 16
|
||||
')' [trial] reduce 16
|
||||
|
||||
|
||||
state 19
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
vexp : '(' vexp . ')' (28)
|
||||
|
||||
'+' shift 24
|
||||
'-' shift 25
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
')' shift 36
|
||||
. error
|
||||
|
||||
|
||||
state 20
|
||||
dexp : dexp '+' . dexp (10)
|
||||
vexp : dexp '+' . vexp (20)
|
||||
|
||||
DREG shift 14
|
||||
VREG shift 15
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 37
|
||||
vexp goto 38
|
||||
|
||||
|
||||
state 21
|
||||
dexp : dexp '-' . dexp (11)
|
||||
vexp : dexp '-' . vexp (22)
|
||||
|
||||
DREG shift 14
|
||||
VREG shift 15
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 39
|
||||
vexp goto 40
|
||||
|
||||
|
||||
state 22
|
||||
dexp : dexp '*' . dexp (12)
|
||||
vexp : dexp '*' . vexp (24)
|
||||
|
||||
DREG shift 14
|
||||
VREG shift 15
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 41
|
||||
vexp goto 42
|
||||
|
||||
|
||||
state 23
|
||||
dexp : dexp '/' . dexp (13)
|
||||
vexp : dexp '/' . vexp (26)
|
||||
|
||||
DREG shift 14
|
||||
VREG shift 15
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 43
|
||||
vexp goto 44
|
||||
|
||||
|
||||
state 24
|
||||
vexp : vexp '+' . vexp (19)
|
||||
|
||||
DREG shift 14
|
||||
VREG shift 15
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 32
|
||||
vexp goto 45
|
||||
|
||||
|
||||
state 25
|
||||
vexp : vexp '-' . vexp (21)
|
||||
|
||||
DREG shift 14
|
||||
VREG shift 15
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 32
|
||||
vexp goto 46
|
||||
|
||||
|
||||
state 26
|
||||
vexp : vexp '*' . vexp (23)
|
||||
|
||||
DREG shift 14
|
||||
VREG shift 15
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 32
|
||||
vexp goto 47
|
||||
|
||||
|
||||
state 27
|
||||
vexp : vexp '/' . vexp (25)
|
||||
|
||||
DREG shift 14
|
||||
VREG shift 15
|
||||
CONST shift 5
|
||||
'-' shift 6
|
||||
'(' shift 7
|
||||
. error
|
||||
|
||||
dexp goto 32
|
||||
vexp goto 48
|
||||
|
||||
|
||||
state 28
|
||||
lines : lines line '\n' . (2)
|
||||
|
||||
. reduce 2
|
||||
|
||||
|
||||
state 29
|
||||
dexp : '-' . dexp (14)
|
||||
|
||||
DREG shift 14
|
||||
CONST shift 5
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 49
|
||||
|
||||
|
||||
state 30
|
||||
dexp : '(' . dexp ')' (15)
|
||||
|
||||
DREG shift 14
|
||||
CONST shift 5
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 50
|
||||
|
||||
|
||||
state 31
|
||||
line : DREG '=' dexp . (6)
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
|
||||
'+' shift 51
|
||||
'-' shift 52
|
||||
'*' shift 53
|
||||
'/' shift 54
|
||||
'\n' reduce 6
|
||||
|
||||
|
||||
32: shift/reduce conflict (shift 20, reduce 16) on '+'
|
||||
32: shift/reduce conflict (shift 21, reduce 16) on '-'
|
||||
32: shift/reduce conflict (shift 22, reduce 16) on '*'
|
||||
32: shift/reduce conflict (shift 23, reduce 16) on '/'
|
||||
state 32
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'+' [trial] shift 20
|
||||
'-' [trial] shift 21
|
||||
'*' [trial] shift 22
|
||||
'/' [trial] shift 23
|
||||
'+' [trial] reduce 16
|
||||
'-' [trial] reduce 16
|
||||
'*' [trial] reduce 16
|
||||
'/' [trial] reduce 16
|
||||
'\n' reduce 16
|
||||
')' reduce 16
|
||||
|
||||
|
||||
state 33
|
||||
line : VREG '=' vexp . (7)
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'+' shift 24
|
||||
'-' shift 25
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'\n' reduce 7
|
||||
|
||||
|
||||
state 34
|
||||
dexp : '(' dexp ')' . (15)
|
||||
|
||||
. reduce 15
|
||||
|
||||
|
||||
state 35
|
||||
vexp : '(' dexp ',' . dexp ')' (17)
|
||||
|
||||
DREG shift 14
|
||||
CONST shift 5
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 55
|
||||
|
||||
|
||||
state 36
|
||||
vexp : '(' vexp ')' . (28)
|
||||
|
||||
. reduce 28
|
||||
|
||||
|
||||
37: reduce/reduce conflict (reduce 10, reduce 16) on '+'
|
||||
37: reduce/reduce conflict (reduce 10, reduce 16) on '-'
|
||||
37: shift/reduce conflict (shift 22, reduce 16) on '*'
|
||||
37: shift/reduce conflict (shift 23, reduce 16) on '/'
|
||||
37: reduce/reduce conflict (reduce 10, reduce 16) on '\n'
|
||||
37: reduce/reduce conflict (reduce 10, reduce 16) on ')'
|
||||
state 37
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp '+' dexp . (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'*' [trial] shift 22
|
||||
'/' [trial] shift 23
|
||||
'+' [trial] reduce 10
|
||||
'+' [trial] reduce 16
|
||||
'-' [trial] reduce 10
|
||||
'-' [trial] reduce 16
|
||||
'*' [trial] reduce 16
|
||||
'/' [trial] reduce 16
|
||||
'\n' [trial] reduce 10
|
||||
'\n' [trial] reduce 16
|
||||
')' [trial] reduce 10
|
||||
')' [trial] reduce 16
|
||||
',' reduce 10
|
||||
|
||||
|
||||
state 38
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : dexp '+' vexp . (20)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'+' reduce 20
|
||||
'-' reduce 20
|
||||
'\n' reduce 20
|
||||
')' reduce 20
|
||||
|
||||
|
||||
39: reduce/reduce conflict (reduce 11, reduce 16) on '+'
|
||||
39: reduce/reduce conflict (reduce 11, reduce 16) on '-'
|
||||
39: shift/reduce conflict (shift 22, reduce 16) on '*'
|
||||
39: shift/reduce conflict (shift 23, reduce 16) on '/'
|
||||
39: reduce/reduce conflict (reduce 11, reduce 16) on '\n'
|
||||
39: reduce/reduce conflict (reduce 11, reduce 16) on ')'
|
||||
state 39
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp '-' dexp . (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'*' [trial] shift 22
|
||||
'/' [trial] shift 23
|
||||
'+' [trial] reduce 11
|
||||
'+' [trial] reduce 16
|
||||
'-' [trial] reduce 11
|
||||
'-' [trial] reduce 16
|
||||
'*' [trial] reduce 16
|
||||
'/' [trial] reduce 16
|
||||
'\n' [trial] reduce 11
|
||||
'\n' [trial] reduce 16
|
||||
')' [trial] reduce 11
|
||||
')' [trial] reduce 16
|
||||
',' reduce 11
|
||||
|
||||
|
||||
state 40
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : dexp '-' vexp . (22)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'+' reduce 22
|
||||
'-' reduce 22
|
||||
'\n' reduce 22
|
||||
')' reduce 22
|
||||
|
||||
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on '+'
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on '-'
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on '*'
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on '/'
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on '\n'
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on ')'
|
||||
state 41
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp '*' dexp . (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'+' [trial] reduce 12
|
||||
'+' [trial] reduce 16
|
||||
'-' [trial] reduce 12
|
||||
'-' [trial] reduce 16
|
||||
'*' [trial] reduce 12
|
||||
'*' [trial] reduce 16
|
||||
'/' [trial] reduce 12
|
||||
'/' [trial] reduce 16
|
||||
'\n' [trial] reduce 12
|
||||
'\n' [trial] reduce 16
|
||||
')' [trial] reduce 12
|
||||
')' [trial] reduce 16
|
||||
',' reduce 12
|
||||
|
||||
|
||||
state 42
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : dexp '*' vexp . (24)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
. reduce 24
|
||||
|
||||
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on '+'
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on '-'
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on '*'
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on '/'
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on '\n'
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on ')'
|
||||
state 43
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : dexp '/' dexp . (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'+' [trial] reduce 13
|
||||
'+' [trial] reduce 16
|
||||
'-' [trial] reduce 13
|
||||
'-' [trial] reduce 16
|
||||
'*' [trial] reduce 13
|
||||
'*' [trial] reduce 16
|
||||
'/' [trial] reduce 13
|
||||
'/' [trial] reduce 16
|
||||
'\n' [trial] reduce 13
|
||||
'\n' [trial] reduce 16
|
||||
')' [trial] reduce 13
|
||||
')' [trial] reduce 16
|
||||
',' reduce 13
|
||||
|
||||
|
||||
state 44
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
vexp : dexp '/' vexp . (26)
|
||||
|
||||
. reduce 26
|
||||
|
||||
|
||||
state 45
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp '+' vexp . (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'+' reduce 19
|
||||
'-' reduce 19
|
||||
'\n' reduce 19
|
||||
')' reduce 19
|
||||
|
||||
|
||||
state 46
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp '-' vexp . (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'+' reduce 21
|
||||
'-' reduce 21
|
||||
'\n' reduce 21
|
||||
')' reduce 21
|
||||
|
||||
|
||||
state 47
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp '*' vexp . (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
. reduce 23
|
||||
|
||||
|
||||
state 48
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
vexp : vexp '/' vexp . (25)
|
||||
|
||||
. reduce 25
|
||||
|
||||
|
||||
state 49
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : '-' dexp . (14)
|
||||
|
||||
. reduce 14
|
||||
|
||||
|
||||
state 50
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : '(' dexp . ')' (15)
|
||||
|
||||
'+' shift 51
|
||||
'-' shift 52
|
||||
'*' shift 53
|
||||
'/' shift 54
|
||||
')' shift 34
|
||||
. error
|
||||
|
||||
|
||||
state 51
|
||||
dexp : dexp '+' . dexp (10)
|
||||
|
||||
DREG shift 14
|
||||
CONST shift 5
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 56
|
||||
|
||||
|
||||
state 52
|
||||
dexp : dexp '-' . dexp (11)
|
||||
|
||||
DREG shift 14
|
||||
CONST shift 5
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 57
|
||||
|
||||
|
||||
state 53
|
||||
dexp : dexp '*' . dexp (12)
|
||||
|
||||
DREG shift 14
|
||||
CONST shift 5
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 58
|
||||
|
||||
|
||||
state 54
|
||||
dexp : dexp '/' . dexp (13)
|
||||
|
||||
DREG shift 14
|
||||
CONST shift 5
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 59
|
||||
|
||||
|
||||
state 55
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : '(' dexp ',' dexp . ')' (17)
|
||||
|
||||
'+' shift 51
|
||||
'-' shift 52
|
||||
'*' shift 53
|
||||
'/' shift 54
|
||||
')' shift 60
|
||||
. error
|
||||
|
||||
|
||||
state 56
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp '+' dexp . (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
|
||||
'*' shift 53
|
||||
'/' shift 54
|
||||
'+' reduce 10
|
||||
'-' reduce 10
|
||||
'\n' reduce 10
|
||||
')' reduce 10
|
||||
|
||||
|
||||
state 57
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp '-' dexp . (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
|
||||
'*' shift 53
|
||||
'/' shift 54
|
||||
'+' reduce 11
|
||||
'-' reduce 11
|
||||
'\n' reduce 11
|
||||
')' reduce 11
|
||||
|
||||
|
||||
state 58
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp '*' dexp . (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
|
||||
. reduce 12
|
||||
|
||||
|
||||
state 59
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : dexp '/' dexp . (13)
|
||||
|
||||
. reduce 13
|
||||
|
||||
|
||||
state 60
|
||||
vexp : '(' dexp ',' dexp ')' . (17)
|
||||
|
||||
. reduce 17
|
||||
|
||||
|
||||
State 8 contains 4 shift/reduce conflicts, 1 reduce/reduce conflict.
|
||||
State 16 contains 6 reduce/reduce conflicts.
|
||||
State 18 contains 5 shift/reduce conflicts.
|
||||
State 32 contains 4 shift/reduce conflicts.
|
||||
State 37 contains 2 shift/reduce conflicts, 4 reduce/reduce conflicts.
|
||||
State 39 contains 2 shift/reduce conflicts, 4 reduce/reduce conflicts.
|
||||
State 41 contains 6 reduce/reduce conflicts.
|
||||
State 43 contains 6 reduce/reduce conflicts.
|
||||
|
||||
|
||||
15 terminals, 5 nonterminals
|
||||
29 grammar rules, 61 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
0 0 $end
|
||||
1 256 error
|
||||
2 257 DREG
|
||||
3 258 VREG
|
||||
4 259 CONST
|
||||
5 43 '+'
|
||||
6 45 '-'
|
||||
7 42 '*'
|
||||
8 47 '/'
|
||||
9 260 UMINUS
|
||||
10 10 '\n'
|
||||
11 61 '='
|
||||
12 40 '('
|
||||
13 41 ')'
|
||||
14 44 ','
|
||||
15 261 $accept
|
||||
16 262 lines
|
||||
17 263 dexp
|
||||
18 264 vexp
|
||||
19 265 line
|
1732
test/btyacc/btyacc_calc1.tab.c
Normal file
1732
test/btyacc/btyacc_calc1.tab.c
Normal file
File diff suppressed because it is too large
Load Diff
23
test/btyacc/btyacc_calc1.tab.h
Normal file
23
test/btyacc/btyacc_calc1.tab.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef _calc1__defines_h_
|
||||
#define _calc1__defines_h_
|
||||
|
||||
#define DREG 257
|
||||
#define VREG 258
|
||||
#define CONST 259
|
||||
#define UMINUS 260
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
typedef union
|
||||
{
|
||||
int ival;
|
||||
double dval;
|
||||
INTERVAL vval;
|
||||
} YYSTYPE;
|
||||
#endif /* !YYSTYPE_IS_DECLARED */
|
||||
extern YYSTYPE calc1_lval;
|
||||
|
||||
#endif /* _calc1__defines_h_ */
|
1
test/btyacc/btyacc_demo.error
Normal file
1
test/btyacc/btyacc_demo.error
Normal file
@ -0,0 +1 @@
|
||||
YACC: 7 shift/reduce conflicts, 5 reduce/reduce conflicts.
|
1360
test/btyacc/btyacc_demo.output
Normal file
1360
test/btyacc/btyacc_demo.output
Normal file
File diff suppressed because it is too large
Load Diff
2331
test/btyacc/btyacc_demo.tab.c
Normal file
2331
test/btyacc/btyacc_demo.tab.c
Normal file
File diff suppressed because it is too large
Load Diff
36
test/btyacc/btyacc_demo.tab.h
Normal file
36
test/btyacc/btyacc_demo.tab.h
Normal file
@ -0,0 +1,36 @@
|
||||
#ifndef _demo__defines_h_
|
||||
#define _demo__defines_h_
|
||||
|
||||
#define PREFIX 257
|
||||
#define POSTFIX 258
|
||||
#define ID 259
|
||||
#define CONSTANT 260
|
||||
#define EXTERN 261
|
||||
#define REGISTER 262
|
||||
#define STATIC 263
|
||||
#define CONST 264
|
||||
#define VOLATILE 265
|
||||
#define IF 266
|
||||
#define THEN 267
|
||||
#define ELSE 268
|
||||
#define CLCL 269
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
typedef union {
|
||||
Scope *scope;
|
||||
Expr *expr;
|
||||
Expr_List *elist;
|
||||
Type *type;
|
||||
Decl *decl;
|
||||
Decl_List *dlist;
|
||||
Code *code;
|
||||
char *id;
|
||||
} YYSTYPE;
|
||||
#endif /* !YYSTYPE_IS_DECLARED */
|
||||
extern YYSTYPE demo_lval;
|
||||
|
||||
#endif /* _demo__defines_h_ */
|
485
test/btyacc/calc.output
Normal file
485
test/btyacc/calc.output
Normal file
@ -0,0 +1,485 @@
|
||||
0 $accept : list $end
|
||||
|
||||
1 list :
|
||||
2 | list stat '\n'
|
||||
3 | list error '\n'
|
||||
|
||||
4 stat : expr
|
||||
5 | LETTER '=' expr
|
||||
|
||||
6 expr : '(' expr ')'
|
||||
7 | expr '+' expr
|
||||
8 | expr '-' expr
|
||||
9 | expr '*' expr
|
||||
10 | expr '/' expr
|
||||
11 | expr '%' expr
|
||||
12 | expr '&' expr
|
||||
13 | expr '|' expr
|
||||
14 | '-' expr
|
||||
15 | LETTER
|
||||
16 | number
|
||||
|
||||
17 number : DIGIT
|
||||
18 | number DIGIT
|
||||
|
||||
state 0
|
||||
$accept : . list $end (0)
|
||||
list : . (1)
|
||||
|
||||
. reduce 1
|
||||
|
||||
list goto 1
|
||||
|
||||
|
||||
state 1
|
||||
$accept : list . $end (0)
|
||||
list : list . stat '\n' (2)
|
||||
list : list . error '\n' (3)
|
||||
|
||||
$end accept
|
||||
error shift 2
|
||||
DIGIT shift 3
|
||||
LETTER shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
stat goto 7
|
||||
expr goto 8
|
||||
number goto 9
|
||||
|
||||
|
||||
state 2
|
||||
list : list error . '\n' (3)
|
||||
|
||||
'\n' shift 10
|
||||
. error
|
||||
|
||||
|
||||
state 3
|
||||
number : DIGIT . (17)
|
||||
|
||||
. reduce 17
|
||||
|
||||
|
||||
state 4
|
||||
stat : LETTER . '=' expr (5)
|
||||
expr : LETTER . (15)
|
||||
|
||||
'=' shift 11
|
||||
'|' reduce 15
|
||||
'&' reduce 15
|
||||
'+' reduce 15
|
||||
'-' reduce 15
|
||||
'*' reduce 15
|
||||
'/' reduce 15
|
||||
'%' reduce 15
|
||||
'\n' reduce 15
|
||||
|
||||
|
||||
state 5
|
||||
expr : '-' . expr (14)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 13
|
||||
number goto 9
|
||||
|
||||
|
||||
state 6
|
||||
expr : '(' . expr ')' (6)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 14
|
||||
number goto 9
|
||||
|
||||
|
||||
state 7
|
||||
list : list stat . '\n' (2)
|
||||
|
||||
'\n' shift 15
|
||||
. error
|
||||
|
||||
|
||||
state 8
|
||||
stat : expr . (4)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'\n' reduce 4
|
||||
|
||||
|
||||
state 9
|
||||
expr : number . (16)
|
||||
number : number . DIGIT (18)
|
||||
|
||||
DIGIT shift 23
|
||||
'|' reduce 16
|
||||
'&' reduce 16
|
||||
'+' reduce 16
|
||||
'-' reduce 16
|
||||
'*' reduce 16
|
||||
'/' reduce 16
|
||||
'%' reduce 16
|
||||
'\n' reduce 16
|
||||
')' reduce 16
|
||||
|
||||
|
||||
state 10
|
||||
list : list error '\n' . (3)
|
||||
|
||||
. reduce 3
|
||||
|
||||
|
||||
state 11
|
||||
stat : LETTER '=' . expr (5)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 24
|
||||
number goto 9
|
||||
|
||||
|
||||
state 12
|
||||
expr : LETTER . (15)
|
||||
|
||||
. reduce 15
|
||||
|
||||
|
||||
state 13
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
expr : '-' expr . (14)
|
||||
|
||||
. reduce 14
|
||||
|
||||
|
||||
state 14
|
||||
expr : '(' expr . ')' (6)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
')' shift 25
|
||||
. error
|
||||
|
||||
|
||||
state 15
|
||||
list : list stat '\n' . (2)
|
||||
|
||||
. reduce 2
|
||||
|
||||
|
||||
state 16
|
||||
expr : expr '|' . expr (13)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 26
|
||||
number goto 9
|
||||
|
||||
|
||||
state 17
|
||||
expr : expr '&' . expr (12)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 27
|
||||
number goto 9
|
||||
|
||||
|
||||
state 18
|
||||
expr : expr '+' . expr (7)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 28
|
||||
number goto 9
|
||||
|
||||
|
||||
state 19
|
||||
expr : expr '-' . expr (8)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 29
|
||||
number goto 9
|
||||
|
||||
|
||||
state 20
|
||||
expr : expr '*' . expr (9)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 30
|
||||
number goto 9
|
||||
|
||||
|
||||
state 21
|
||||
expr : expr '/' . expr (10)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 31
|
||||
number goto 9
|
||||
|
||||
|
||||
state 22
|
||||
expr : expr '%' . expr (11)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 32
|
||||
number goto 9
|
||||
|
||||
|
||||
state 23
|
||||
number : number DIGIT . (18)
|
||||
|
||||
. reduce 18
|
||||
|
||||
|
||||
state 24
|
||||
stat : LETTER '=' expr . (5)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'\n' reduce 5
|
||||
|
||||
|
||||
state 25
|
||||
expr : '(' expr ')' . (6)
|
||||
|
||||
. reduce 6
|
||||
|
||||
|
||||
state 26
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
expr : expr '|' expr . (13)
|
||||
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 13
|
||||
'\n' reduce 13
|
||||
')' reduce 13
|
||||
|
||||
|
||||
state 27
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr '&' expr . (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 12
|
||||
'&' reduce 12
|
||||
'\n' reduce 12
|
||||
')' reduce 12
|
||||
|
||||
|
||||
state 28
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr '+' expr . (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 7
|
||||
'&' reduce 7
|
||||
'+' reduce 7
|
||||
'-' reduce 7
|
||||
'\n' reduce 7
|
||||
')' reduce 7
|
||||
|
||||
|
||||
state 29
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr '-' expr . (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 8
|
||||
'&' reduce 8
|
||||
'+' reduce 8
|
||||
'-' reduce 8
|
||||
'\n' reduce 8
|
||||
')' reduce 8
|
||||
|
||||
|
||||
state 30
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr '*' expr . (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 9
|
||||
|
||||
|
||||
state 31
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr '/' expr . (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 10
|
||||
|
||||
|
||||
state 32
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr '%' expr . (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 11
|
||||
|
||||
|
||||
16 terminals, 5 nonterminals
|
||||
19 grammar rules, 33 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
0 0 $end
|
||||
1 256 error
|
||||
2 257 DIGIT
|
||||
3 258 LETTER
|
||||
4 124 '|'
|
||||
5 38 '&'
|
||||
6 43 '+'
|
||||
7 45 '-'
|
||||
8 42 '*'
|
||||
9 47 '/'
|
||||
10 37 '%'
|
||||
11 259 UMINUS
|
||||
12 10 '\n'
|
||||
13 61 '='
|
||||
14 40 '('
|
||||
15 41 ')'
|
||||
16 260 $accept
|
||||
17 261 list
|
||||
18 262 stat
|
||||
19 263 expr
|
||||
20 264 number
|
1431
test/btyacc/calc.tab.c
Normal file
1431
test/btyacc/calc.tab.c
Normal file
File diff suppressed because it is too large
Load Diff
8
test/btyacc/calc.tab.h
Normal file
8
test/btyacc/calc.tab.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef _calc__defines_h_
|
||||
#define _calc__defines_h_
|
||||
|
||||
#define DIGIT 257
|
||||
#define LETTER 258
|
||||
#define UMINUS 259
|
||||
|
||||
#endif /* _calc__defines_h_ */
|
2
test/btyacc/calc1.error
Normal file
2
test/btyacc/calc1.error
Normal file
@ -0,0 +1,2 @@
|
||||
YACC: 2 rules never reduced
|
||||
YACC: 18 shift/reduce conflicts, 26 reduce/reduce conflicts.
|
900
test/btyacc/calc1.output
Normal file
900
test/btyacc/calc1.output
Normal file
@ -0,0 +1,900 @@
|
||||
0 $accept : line $end
|
||||
|
||||
1 lines :
|
||||
2 | lines line
|
||||
|
||||
3 line : dexp '\n'
|
||||
4 | vexp '\n'
|
||||
5 | DREG '=' dexp '\n'
|
||||
6 | VREG '=' vexp '\n'
|
||||
7 | error '\n'
|
||||
|
||||
8 dexp : CONST
|
||||
9 | DREG
|
||||
10 | dexp '+' dexp
|
||||
11 | dexp '-' dexp
|
||||
12 | dexp '*' dexp
|
||||
13 | dexp '/' dexp
|
||||
14 | '-' dexp
|
||||
15 | '(' dexp ')'
|
||||
|
||||
16 vexp : dexp
|
||||
17 | '(' dexp ',' dexp ')'
|
||||
18 | VREG
|
||||
19 | vexp '+' vexp
|
||||
20 | dexp '+' vexp
|
||||
21 | vexp '-' vexp
|
||||
22 | dexp '-' vexp
|
||||
23 | vexp '*' vexp
|
||||
24 | dexp '*' vexp
|
||||
25 | vexp '/' vexp
|
||||
26 | dexp '/' vexp
|
||||
27 | '-' vexp
|
||||
28 | '(' vexp ')'
|
||||
|
||||
state 0
|
||||
$accept : . line $end (0)
|
||||
|
||||
error shift 1
|
||||
DREG shift 2
|
||||
VREG shift 3
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
line goto 7
|
||||
dexp goto 8
|
||||
vexp goto 9
|
||||
|
||||
|
||||
state 1
|
||||
line : error . '\n' (7)
|
||||
|
||||
'\n' shift 10
|
||||
. error
|
||||
|
||||
|
||||
state 2
|
||||
line : DREG . '=' dexp '\n' (5)
|
||||
dexp : DREG . (9)
|
||||
|
||||
'=' shift 11
|
||||
'+' reduce 9
|
||||
'-' reduce 9
|
||||
'*' reduce 9
|
||||
'/' reduce 9
|
||||
'\n' reduce 9
|
||||
|
||||
|
||||
state 3
|
||||
line : VREG . '=' vexp '\n' (6)
|
||||
vexp : VREG . (18)
|
||||
|
||||
'=' shift 12
|
||||
'+' reduce 18
|
||||
'-' reduce 18
|
||||
'*' reduce 18
|
||||
'/' reduce 18
|
||||
'\n' reduce 18
|
||||
|
||||
|
||||
state 4
|
||||
dexp : CONST . (8)
|
||||
|
||||
. reduce 8
|
||||
|
||||
|
||||
state 5
|
||||
dexp : '-' . dexp (14)
|
||||
vexp : '-' . vexp (27)
|
||||
|
||||
DREG shift 13
|
||||
VREG shift 14
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
dexp goto 15
|
||||
vexp goto 16
|
||||
|
||||
|
||||
state 6
|
||||
dexp : '(' . dexp ')' (15)
|
||||
vexp : '(' . dexp ',' dexp ')' (17)
|
||||
vexp : '(' . vexp ')' (28)
|
||||
|
||||
DREG shift 13
|
||||
VREG shift 14
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
dexp goto 17
|
||||
vexp goto 18
|
||||
|
||||
|
||||
state 7
|
||||
$accept : line . $end (0)
|
||||
|
||||
$end accept
|
||||
|
||||
|
||||
8: shift/reduce conflict (shift 19, reduce 16) on '+'
|
||||
8: shift/reduce conflict (shift 20, reduce 16) on '-'
|
||||
8: shift/reduce conflict (shift 21, reduce 16) on '*'
|
||||
8: shift/reduce conflict (shift 22, reduce 16) on '/'
|
||||
8: shift/reduce conflict (shift 23, reduce 16) on '\n'
|
||||
state 8
|
||||
line : dexp . '\n' (3)
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'+' shift 19
|
||||
'-' shift 20
|
||||
'*' shift 21
|
||||
'/' shift 22
|
||||
'\n' shift 23
|
||||
|
||||
|
||||
state 9
|
||||
line : vexp . '\n' (4)
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'+' shift 24
|
||||
'-' shift 25
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'\n' shift 28
|
||||
. error
|
||||
|
||||
|
||||
state 10
|
||||
line : error '\n' . (7)
|
||||
|
||||
. reduce 7
|
||||
|
||||
|
||||
state 11
|
||||
line : DREG '=' . dexp '\n' (5)
|
||||
|
||||
DREG shift 13
|
||||
CONST shift 4
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 31
|
||||
|
||||
|
||||
state 12
|
||||
line : VREG '=' . vexp '\n' (6)
|
||||
|
||||
DREG shift 13
|
||||
VREG shift 14
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
dexp goto 32
|
||||
vexp goto 33
|
||||
|
||||
|
||||
state 13
|
||||
dexp : DREG . (9)
|
||||
|
||||
. reduce 9
|
||||
|
||||
|
||||
state 14
|
||||
vexp : VREG . (18)
|
||||
|
||||
. reduce 18
|
||||
|
||||
|
||||
15: reduce/reduce conflict (reduce 14, reduce 16) on '+'
|
||||
15: reduce/reduce conflict (reduce 14, reduce 16) on '-'
|
||||
15: reduce/reduce conflict (reduce 14, reduce 16) on '*'
|
||||
15: reduce/reduce conflict (reduce 14, reduce 16) on '/'
|
||||
15: reduce/reduce conflict (reduce 14, reduce 16) on '\n'
|
||||
15: reduce/reduce conflict (reduce 14, reduce 16) on ')'
|
||||
state 15
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : '-' dexp . (14)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
. reduce 14
|
||||
|
||||
|
||||
state 16
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
vexp : '-' vexp . (27)
|
||||
|
||||
. reduce 27
|
||||
|
||||
|
||||
17: shift/reduce conflict (shift 19, reduce 16) on '+'
|
||||
17: shift/reduce conflict (shift 20, reduce 16) on '-'
|
||||
17: shift/reduce conflict (shift 21, reduce 16) on '*'
|
||||
17: shift/reduce conflict (shift 22, reduce 16) on '/'
|
||||
17: shift/reduce conflict (shift 34, reduce 16) on ')'
|
||||
state 17
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : '(' dexp . ')' (15)
|
||||
vexp : dexp . (16)
|
||||
vexp : '(' dexp . ',' dexp ')' (17)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'+' shift 19
|
||||
'-' shift 20
|
||||
'*' shift 21
|
||||
'/' shift 22
|
||||
')' shift 34
|
||||
',' shift 35
|
||||
|
||||
|
||||
state 18
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
vexp : '(' vexp . ')' (28)
|
||||
|
||||
'+' shift 24
|
||||
'-' shift 25
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
')' shift 36
|
||||
. error
|
||||
|
||||
|
||||
state 19
|
||||
dexp : dexp '+' . dexp (10)
|
||||
vexp : dexp '+' . vexp (20)
|
||||
|
||||
DREG shift 13
|
||||
VREG shift 14
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
dexp goto 37
|
||||
vexp goto 38
|
||||
|
||||
|
||||
state 20
|
||||
dexp : dexp '-' . dexp (11)
|
||||
vexp : dexp '-' . vexp (22)
|
||||
|
||||
DREG shift 13
|
||||
VREG shift 14
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
dexp goto 39
|
||||
vexp goto 40
|
||||
|
||||
|
||||
state 21
|
||||
dexp : dexp '*' . dexp (12)
|
||||
vexp : dexp '*' . vexp (24)
|
||||
|
||||
DREG shift 13
|
||||
VREG shift 14
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
dexp goto 41
|
||||
vexp goto 42
|
||||
|
||||
|
||||
state 22
|
||||
dexp : dexp '/' . dexp (13)
|
||||
vexp : dexp '/' . vexp (26)
|
||||
|
||||
DREG shift 13
|
||||
VREG shift 14
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
dexp goto 43
|
||||
vexp goto 44
|
||||
|
||||
|
||||
state 23
|
||||
line : dexp '\n' . (3)
|
||||
|
||||
. reduce 3
|
||||
|
||||
|
||||
state 24
|
||||
vexp : vexp '+' . vexp (19)
|
||||
|
||||
DREG shift 13
|
||||
VREG shift 14
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
dexp goto 32
|
||||
vexp goto 45
|
||||
|
||||
|
||||
state 25
|
||||
vexp : vexp '-' . vexp (21)
|
||||
|
||||
DREG shift 13
|
||||
VREG shift 14
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
dexp goto 32
|
||||
vexp goto 46
|
||||
|
||||
|
||||
state 26
|
||||
vexp : vexp '*' . vexp (23)
|
||||
|
||||
DREG shift 13
|
||||
VREG shift 14
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
dexp goto 32
|
||||
vexp goto 47
|
||||
|
||||
|
||||
state 27
|
||||
vexp : vexp '/' . vexp (25)
|
||||
|
||||
DREG shift 13
|
||||
VREG shift 14
|
||||
CONST shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
dexp goto 32
|
||||
vexp goto 48
|
||||
|
||||
|
||||
state 28
|
||||
line : vexp '\n' . (4)
|
||||
|
||||
. reduce 4
|
||||
|
||||
|
||||
state 29
|
||||
dexp : '-' . dexp (14)
|
||||
|
||||
DREG shift 13
|
||||
CONST shift 4
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 49
|
||||
|
||||
|
||||
state 30
|
||||
dexp : '(' . dexp ')' (15)
|
||||
|
||||
DREG shift 13
|
||||
CONST shift 4
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 50
|
||||
|
||||
|
||||
state 31
|
||||
line : DREG '=' dexp . '\n' (5)
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
|
||||
'+' shift 51
|
||||
'-' shift 52
|
||||
'*' shift 53
|
||||
'/' shift 54
|
||||
'\n' shift 55
|
||||
. error
|
||||
|
||||
|
||||
32: shift/reduce conflict (shift 19, reduce 16) on '+'
|
||||
32: shift/reduce conflict (shift 20, reduce 16) on '-'
|
||||
32: shift/reduce conflict (shift 21, reduce 16) on '*'
|
||||
32: shift/reduce conflict (shift 22, reduce 16) on '/'
|
||||
state 32
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'+' shift 19
|
||||
'-' shift 20
|
||||
'*' shift 21
|
||||
'/' shift 22
|
||||
'\n' reduce 16
|
||||
')' reduce 16
|
||||
|
||||
|
||||
state 33
|
||||
line : VREG '=' vexp . '\n' (6)
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'+' shift 24
|
||||
'-' shift 25
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'\n' shift 56
|
||||
. error
|
||||
|
||||
|
||||
state 34
|
||||
dexp : '(' dexp ')' . (15)
|
||||
|
||||
. reduce 15
|
||||
|
||||
|
||||
state 35
|
||||
vexp : '(' dexp ',' . dexp ')' (17)
|
||||
|
||||
DREG shift 13
|
||||
CONST shift 4
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 57
|
||||
|
||||
|
||||
state 36
|
||||
vexp : '(' vexp ')' . (28)
|
||||
|
||||
. reduce 28
|
||||
|
||||
|
||||
37: reduce/reduce conflict (reduce 10, reduce 16) on '+'
|
||||
37: reduce/reduce conflict (reduce 10, reduce 16) on '-'
|
||||
37: shift/reduce conflict (shift 21, reduce 16) on '*'
|
||||
37: shift/reduce conflict (shift 22, reduce 16) on '/'
|
||||
37: reduce/reduce conflict (reduce 10, reduce 16) on '\n'
|
||||
37: reduce/reduce conflict (reduce 10, reduce 16) on ')'
|
||||
state 37
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp '+' dexp . (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'*' shift 21
|
||||
'/' shift 22
|
||||
'+' reduce 10
|
||||
'-' reduce 10
|
||||
'\n' reduce 10
|
||||
')' reduce 10
|
||||
',' reduce 10
|
||||
|
||||
|
||||
state 38
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : dexp '+' vexp . (20)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'+' reduce 20
|
||||
'-' reduce 20
|
||||
'\n' reduce 20
|
||||
')' reduce 20
|
||||
|
||||
|
||||
39: reduce/reduce conflict (reduce 11, reduce 16) on '+'
|
||||
39: reduce/reduce conflict (reduce 11, reduce 16) on '-'
|
||||
39: shift/reduce conflict (shift 21, reduce 16) on '*'
|
||||
39: shift/reduce conflict (shift 22, reduce 16) on '/'
|
||||
39: reduce/reduce conflict (reduce 11, reduce 16) on '\n'
|
||||
39: reduce/reduce conflict (reduce 11, reduce 16) on ')'
|
||||
state 39
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp '-' dexp . (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
'*' shift 21
|
||||
'/' shift 22
|
||||
'+' reduce 11
|
||||
'-' reduce 11
|
||||
'\n' reduce 11
|
||||
')' reduce 11
|
||||
',' reduce 11
|
||||
|
||||
|
||||
state 40
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : dexp '-' vexp . (22)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'+' reduce 22
|
||||
'-' reduce 22
|
||||
'\n' reduce 22
|
||||
')' reduce 22
|
||||
|
||||
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on '+'
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on '-'
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on '*'
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on '/'
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on '\n'
|
||||
41: reduce/reduce conflict (reduce 12, reduce 16) on ')'
|
||||
state 41
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp '*' dexp . (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
. reduce 12
|
||||
|
||||
|
||||
state 42
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : dexp '*' vexp . (24)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
. reduce 24
|
||||
|
||||
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on '+'
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on '-'
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on '*'
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on '/'
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on '\n'
|
||||
43: reduce/reduce conflict (reduce 13, reduce 16) on ')'
|
||||
state 43
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : dexp '/' dexp . (13)
|
||||
vexp : dexp . (16)
|
||||
vexp : dexp . '+' vexp (20)
|
||||
vexp : dexp . '-' vexp (22)
|
||||
vexp : dexp . '*' vexp (24)
|
||||
vexp : dexp . '/' vexp (26)
|
||||
|
||||
. reduce 13
|
||||
|
||||
|
||||
state 44
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
vexp : dexp '/' vexp . (26)
|
||||
|
||||
. reduce 26
|
||||
|
||||
|
||||
state 45
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp '+' vexp . (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'+' reduce 19
|
||||
'-' reduce 19
|
||||
'\n' reduce 19
|
||||
')' reduce 19
|
||||
|
||||
|
||||
state 46
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp '-' vexp . (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
'*' shift 26
|
||||
'/' shift 27
|
||||
'+' reduce 21
|
||||
'-' reduce 21
|
||||
'\n' reduce 21
|
||||
')' reduce 21
|
||||
|
||||
|
||||
state 47
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp '*' vexp . (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
|
||||
. reduce 23
|
||||
|
||||
|
||||
state 48
|
||||
vexp : vexp . '+' vexp (19)
|
||||
vexp : vexp . '-' vexp (21)
|
||||
vexp : vexp . '*' vexp (23)
|
||||
vexp : vexp . '/' vexp (25)
|
||||
vexp : vexp '/' vexp . (25)
|
||||
|
||||
. reduce 25
|
||||
|
||||
|
||||
state 49
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : '-' dexp . (14)
|
||||
|
||||
. reduce 14
|
||||
|
||||
|
||||
state 50
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : '(' dexp . ')' (15)
|
||||
|
||||
'+' shift 51
|
||||
'-' shift 52
|
||||
'*' shift 53
|
||||
'/' shift 54
|
||||
')' shift 34
|
||||
. error
|
||||
|
||||
|
||||
state 51
|
||||
dexp : dexp '+' . dexp (10)
|
||||
|
||||
DREG shift 13
|
||||
CONST shift 4
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 58
|
||||
|
||||
|
||||
state 52
|
||||
dexp : dexp '-' . dexp (11)
|
||||
|
||||
DREG shift 13
|
||||
CONST shift 4
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 59
|
||||
|
||||
|
||||
state 53
|
||||
dexp : dexp '*' . dexp (12)
|
||||
|
||||
DREG shift 13
|
||||
CONST shift 4
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 60
|
||||
|
||||
|
||||
state 54
|
||||
dexp : dexp '/' . dexp (13)
|
||||
|
||||
DREG shift 13
|
||||
CONST shift 4
|
||||
'-' shift 29
|
||||
'(' shift 30
|
||||
. error
|
||||
|
||||
dexp goto 61
|
||||
|
||||
|
||||
state 55
|
||||
line : DREG '=' dexp '\n' . (5)
|
||||
|
||||
. reduce 5
|
||||
|
||||
|
||||
state 56
|
||||
line : VREG '=' vexp '\n' . (6)
|
||||
|
||||
. reduce 6
|
||||
|
||||
|
||||
state 57
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
vexp : '(' dexp ',' dexp . ')' (17)
|
||||
|
||||
'+' shift 51
|
||||
'-' shift 52
|
||||
'*' shift 53
|
||||
'/' shift 54
|
||||
')' shift 62
|
||||
. error
|
||||
|
||||
|
||||
state 58
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp '+' dexp . (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
|
||||
'*' shift 53
|
||||
'/' shift 54
|
||||
'+' reduce 10
|
||||
'-' reduce 10
|
||||
'\n' reduce 10
|
||||
')' reduce 10
|
||||
|
||||
|
||||
state 59
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp '-' dexp . (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
|
||||
'*' shift 53
|
||||
'/' shift 54
|
||||
'+' reduce 11
|
||||
'-' reduce 11
|
||||
'\n' reduce 11
|
||||
')' reduce 11
|
||||
|
||||
|
||||
state 60
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp '*' dexp . (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
|
||||
. reduce 12
|
||||
|
||||
|
||||
state 61
|
||||
dexp : dexp . '+' dexp (10)
|
||||
dexp : dexp . '-' dexp (11)
|
||||
dexp : dexp . '*' dexp (12)
|
||||
dexp : dexp . '/' dexp (13)
|
||||
dexp : dexp '/' dexp . (13)
|
||||
|
||||
. reduce 13
|
||||
|
||||
|
||||
state 62
|
||||
vexp : '(' dexp ',' dexp ')' . (17)
|
||||
|
||||
. reduce 17
|
||||
|
||||
|
||||
Rules never reduced:
|
||||
lines : (1)
|
||||
lines : lines line (2)
|
||||
|
||||
|
||||
State 8 contains 5 shift/reduce conflicts.
|
||||
State 15 contains 6 reduce/reduce conflicts.
|
||||
State 17 contains 5 shift/reduce conflicts.
|
||||
State 32 contains 4 shift/reduce conflicts.
|
||||
State 37 contains 2 shift/reduce conflicts, 4 reduce/reduce conflicts.
|
||||
State 39 contains 2 shift/reduce conflicts, 4 reduce/reduce conflicts.
|
||||
State 41 contains 6 reduce/reduce conflicts.
|
||||
State 43 contains 6 reduce/reduce conflicts.
|
||||
|
||||
|
||||
15 terminals, 5 nonterminals
|
||||
29 grammar rules, 63 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
0 0 $end
|
||||
1 256 error
|
||||
2 257 DREG
|
||||
3 258 VREG
|
||||
4 259 CONST
|
||||
5 43 '+'
|
||||
6 45 '-'
|
||||
7 42 '*'
|
||||
8 47 '/'
|
||||
9 260 UMINUS
|
||||
10 10 '\n'
|
||||
11 61 '='
|
||||
12 40 '('
|
||||
13 41 ')'
|
||||
14 44 ','
|
||||
15 261 $accept
|
||||
16 262 line
|
||||
17 263 dexp
|
||||
18 264 vexp
|
||||
19 265 lines
|
1677
test/btyacc/calc1.tab.c
Normal file
1677
test/btyacc/calc1.tab.c
Normal file
File diff suppressed because it is too large
Load Diff
23
test/btyacc/calc1.tab.h
Normal file
23
test/btyacc/calc1.tab.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef _calc1__defines_h_
|
||||
#define _calc1__defines_h_
|
||||
|
||||
#define DREG 257
|
||||
#define VREG 258
|
||||
#define CONST 259
|
||||
#define UMINUS 260
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
typedef union
|
||||
{
|
||||
int ival;
|
||||
double dval;
|
||||
INTERVAL vval;
|
||||
} YYSTYPE;
|
||||
#endif /* !YYSTYPE_IS_DECLARED */
|
||||
extern YYSTYPE calc1_lval;
|
||||
|
||||
#endif /* _calc1__defines_h_ */
|
0
test/btyacc/calc2.error
Normal file
0
test/btyacc/calc2.error
Normal file
485
test/btyacc/calc2.output
Normal file
485
test/btyacc/calc2.output
Normal file
@ -0,0 +1,485 @@
|
||||
0 $accept : list $end
|
||||
|
||||
1 list :
|
||||
2 | list stat '\n'
|
||||
3 | list error '\n'
|
||||
|
||||
4 stat : expr
|
||||
5 | LETTER '=' expr
|
||||
|
||||
6 expr : '(' expr ')'
|
||||
7 | expr '+' expr
|
||||
8 | expr '-' expr
|
||||
9 | expr '*' expr
|
||||
10 | expr '/' expr
|
||||
11 | expr '%' expr
|
||||
12 | expr '&' expr
|
||||
13 | expr '|' expr
|
||||
14 | '-' expr
|
||||
15 | LETTER
|
||||
16 | number
|
||||
|
||||
17 number : DIGIT
|
||||
18 | number DIGIT
|
||||
|
||||
state 0
|
||||
$accept : . list $end (0)
|
||||
list : . (1)
|
||||
|
||||
. reduce 1
|
||||
|
||||
list goto 1
|
||||
|
||||
|
||||
state 1
|
||||
$accept : list . $end (0)
|
||||
list : list . stat '\n' (2)
|
||||
list : list . error '\n' (3)
|
||||
|
||||
$end accept
|
||||
error shift 2
|
||||
DIGIT shift 3
|
||||
LETTER shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
stat goto 7
|
||||
expr goto 8
|
||||
number goto 9
|
||||
|
||||
|
||||
state 2
|
||||
list : list error . '\n' (3)
|
||||
|
||||
'\n' shift 10
|
||||
. error
|
||||
|
||||
|
||||
state 3
|
||||
number : DIGIT . (17)
|
||||
|
||||
. reduce 17
|
||||
|
||||
|
||||
state 4
|
||||
stat : LETTER . '=' expr (5)
|
||||
expr : LETTER . (15)
|
||||
|
||||
'=' shift 11
|
||||
'|' reduce 15
|
||||
'&' reduce 15
|
||||
'+' reduce 15
|
||||
'-' reduce 15
|
||||
'*' reduce 15
|
||||
'/' reduce 15
|
||||
'%' reduce 15
|
||||
'\n' reduce 15
|
||||
|
||||
|
||||
state 5
|
||||
expr : '-' . expr (14)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 13
|
||||
number goto 9
|
||||
|
||||
|
||||
state 6
|
||||
expr : '(' . expr ')' (6)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 14
|
||||
number goto 9
|
||||
|
||||
|
||||
state 7
|
||||
list : list stat . '\n' (2)
|
||||
|
||||
'\n' shift 15
|
||||
. error
|
||||
|
||||
|
||||
state 8
|
||||
stat : expr . (4)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'\n' reduce 4
|
||||
|
||||
|
||||
state 9
|
||||
expr : number . (16)
|
||||
number : number . DIGIT (18)
|
||||
|
||||
DIGIT shift 23
|
||||
'|' reduce 16
|
||||
'&' reduce 16
|
||||
'+' reduce 16
|
||||
'-' reduce 16
|
||||
'*' reduce 16
|
||||
'/' reduce 16
|
||||
'%' reduce 16
|
||||
'\n' reduce 16
|
||||
')' reduce 16
|
||||
|
||||
|
||||
state 10
|
||||
list : list error '\n' . (3)
|
||||
|
||||
. reduce 3
|
||||
|
||||
|
||||
state 11
|
||||
stat : LETTER '=' . expr (5)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 24
|
||||
number goto 9
|
||||
|
||||
|
||||
state 12
|
||||
expr : LETTER . (15)
|
||||
|
||||
. reduce 15
|
||||
|
||||
|
||||
state 13
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
expr : '-' expr . (14)
|
||||
|
||||
. reduce 14
|
||||
|
||||
|
||||
state 14
|
||||
expr : '(' expr . ')' (6)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
')' shift 25
|
||||
. error
|
||||
|
||||
|
||||
state 15
|
||||
list : list stat '\n' . (2)
|
||||
|
||||
. reduce 2
|
||||
|
||||
|
||||
state 16
|
||||
expr : expr '|' . expr (13)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 26
|
||||
number goto 9
|
||||
|
||||
|
||||
state 17
|
||||
expr : expr '&' . expr (12)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 27
|
||||
number goto 9
|
||||
|
||||
|
||||
state 18
|
||||
expr : expr '+' . expr (7)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 28
|
||||
number goto 9
|
||||
|
||||
|
||||
state 19
|
||||
expr : expr '-' . expr (8)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 29
|
||||
number goto 9
|
||||
|
||||
|
||||
state 20
|
||||
expr : expr '*' . expr (9)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 30
|
||||
number goto 9
|
||||
|
||||
|
||||
state 21
|
||||
expr : expr '/' . expr (10)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 31
|
||||
number goto 9
|
||||
|
||||
|
||||
state 22
|
||||
expr : expr '%' . expr (11)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 32
|
||||
number goto 9
|
||||
|
||||
|
||||
state 23
|
||||
number : number DIGIT . (18)
|
||||
|
||||
. reduce 18
|
||||
|
||||
|
||||
state 24
|
||||
stat : LETTER '=' expr . (5)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'\n' reduce 5
|
||||
|
||||
|
||||
state 25
|
||||
expr : '(' expr ')' . (6)
|
||||
|
||||
. reduce 6
|
||||
|
||||
|
||||
state 26
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
expr : expr '|' expr . (13)
|
||||
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 13
|
||||
'\n' reduce 13
|
||||
')' reduce 13
|
||||
|
||||
|
||||
state 27
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr '&' expr . (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 12
|
||||
'&' reduce 12
|
||||
'\n' reduce 12
|
||||
')' reduce 12
|
||||
|
||||
|
||||
state 28
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr '+' expr . (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 7
|
||||
'&' reduce 7
|
||||
'+' reduce 7
|
||||
'-' reduce 7
|
||||
'\n' reduce 7
|
||||
')' reduce 7
|
||||
|
||||
|
||||
state 29
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr '-' expr . (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 8
|
||||
'&' reduce 8
|
||||
'+' reduce 8
|
||||
'-' reduce 8
|
||||
'\n' reduce 8
|
||||
')' reduce 8
|
||||
|
||||
|
||||
state 30
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr '*' expr . (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 9
|
||||
|
||||
|
||||
state 31
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr '/' expr . (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 10
|
||||
|
||||
|
||||
state 32
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr '%' expr . (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 11
|
||||
|
||||
|
||||
16 terminals, 5 nonterminals
|
||||
19 grammar rules, 33 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
0 0 $end
|
||||
1 256 error
|
||||
2 257 DIGIT
|
||||
3 258 LETTER
|
||||
4 124 '|'
|
||||
5 38 '&'
|
||||
6 43 '+'
|
||||
7 45 '-'
|
||||
8 42 '*'
|
||||
9 47 '/'
|
||||
10 37 '%'
|
||||
11 259 UMINUS
|
||||
12 10 '\n'
|
||||
13 61 '='
|
||||
14 40 '('
|
||||
15 41 ')'
|
||||
16 260 $accept
|
||||
17 261 list
|
||||
18 262 stat
|
||||
19 263 expr
|
||||
20 264 number
|
1444
test/btyacc/calc2.tab.c
Normal file
1444
test/btyacc/calc2.tab.c
Normal file
File diff suppressed because it is too large
Load Diff
8
test/btyacc/calc2.tab.h
Normal file
8
test/btyacc/calc2.tab.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef _calc2__defines_h_
|
||||
#define _calc2__defines_h_
|
||||
|
||||
#define DIGIT 257
|
||||
#define LETTER 258
|
||||
#define UMINUS 259
|
||||
|
||||
#endif /* _calc2__defines_h_ */
|
0
test/btyacc/calc3.error
Normal file
0
test/btyacc/calc3.error
Normal file
485
test/btyacc/calc3.output
Normal file
485
test/btyacc/calc3.output
Normal file
@ -0,0 +1,485 @@
|
||||
0 $accept : list $end
|
||||
|
||||
1 list :
|
||||
2 | list stat '\n'
|
||||
3 | list error '\n'
|
||||
|
||||
4 stat : expr
|
||||
5 | LETTER '=' expr
|
||||
|
||||
6 expr : '(' expr ')'
|
||||
7 | expr '+' expr
|
||||
8 | expr '-' expr
|
||||
9 | expr '*' expr
|
||||
10 | expr '/' expr
|
||||
11 | expr '%' expr
|
||||
12 | expr '&' expr
|
||||
13 | expr '|' expr
|
||||
14 | '-' expr
|
||||
15 | LETTER
|
||||
16 | number
|
||||
|
||||
17 number : DIGIT
|
||||
18 | number DIGIT
|
||||
|
||||
state 0
|
||||
$accept : . list $end (0)
|
||||
list : . (1)
|
||||
|
||||
. reduce 1
|
||||
|
||||
list goto 1
|
||||
|
||||
|
||||
state 1
|
||||
$accept : list . $end (0)
|
||||
list : list . stat '\n' (2)
|
||||
list : list . error '\n' (3)
|
||||
|
||||
$end accept
|
||||
error shift 2
|
||||
DIGIT shift 3
|
||||
LETTER shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
stat goto 7
|
||||
expr goto 8
|
||||
number goto 9
|
||||
|
||||
|
||||
state 2
|
||||
list : list error . '\n' (3)
|
||||
|
||||
'\n' shift 10
|
||||
. error
|
||||
|
||||
|
||||
state 3
|
||||
number : DIGIT . (17)
|
||||
|
||||
. reduce 17
|
||||
|
||||
|
||||
state 4
|
||||
stat : LETTER . '=' expr (5)
|
||||
expr : LETTER . (15)
|
||||
|
||||
'=' shift 11
|
||||
'|' reduce 15
|
||||
'&' reduce 15
|
||||
'+' reduce 15
|
||||
'-' reduce 15
|
||||
'*' reduce 15
|
||||
'/' reduce 15
|
||||
'%' reduce 15
|
||||
'\n' reduce 15
|
||||
|
||||
|
||||
state 5
|
||||
expr : '-' . expr (14)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 13
|
||||
number goto 9
|
||||
|
||||
|
||||
state 6
|
||||
expr : '(' . expr ')' (6)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 14
|
||||
number goto 9
|
||||
|
||||
|
||||
state 7
|
||||
list : list stat . '\n' (2)
|
||||
|
||||
'\n' shift 15
|
||||
. error
|
||||
|
||||
|
||||
state 8
|
||||
stat : expr . (4)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'\n' reduce 4
|
||||
|
||||
|
||||
state 9
|
||||
expr : number . (16)
|
||||
number : number . DIGIT (18)
|
||||
|
||||
DIGIT shift 23
|
||||
'|' reduce 16
|
||||
'&' reduce 16
|
||||
'+' reduce 16
|
||||
'-' reduce 16
|
||||
'*' reduce 16
|
||||
'/' reduce 16
|
||||
'%' reduce 16
|
||||
'\n' reduce 16
|
||||
')' reduce 16
|
||||
|
||||
|
||||
state 10
|
||||
list : list error '\n' . (3)
|
||||
|
||||
. reduce 3
|
||||
|
||||
|
||||
state 11
|
||||
stat : LETTER '=' . expr (5)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 24
|
||||
number goto 9
|
||||
|
||||
|
||||
state 12
|
||||
expr : LETTER . (15)
|
||||
|
||||
. reduce 15
|
||||
|
||||
|
||||
state 13
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
expr : '-' expr . (14)
|
||||
|
||||
. reduce 14
|
||||
|
||||
|
||||
state 14
|
||||
expr : '(' expr . ')' (6)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
')' shift 25
|
||||
. error
|
||||
|
||||
|
||||
state 15
|
||||
list : list stat '\n' . (2)
|
||||
|
||||
. reduce 2
|
||||
|
||||
|
||||
state 16
|
||||
expr : expr '|' . expr (13)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 26
|
||||
number goto 9
|
||||
|
||||
|
||||
state 17
|
||||
expr : expr '&' . expr (12)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 27
|
||||
number goto 9
|
||||
|
||||
|
||||
state 18
|
||||
expr : expr '+' . expr (7)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 28
|
||||
number goto 9
|
||||
|
||||
|
||||
state 19
|
||||
expr : expr '-' . expr (8)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 29
|
||||
number goto 9
|
||||
|
||||
|
||||
state 20
|
||||
expr : expr '*' . expr (9)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 30
|
||||
number goto 9
|
||||
|
||||
|
||||
state 21
|
||||
expr : expr '/' . expr (10)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 31
|
||||
number goto 9
|
||||
|
||||
|
||||
state 22
|
||||
expr : expr '%' . expr (11)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 32
|
||||
number goto 9
|
||||
|
||||
|
||||
state 23
|
||||
number : number DIGIT . (18)
|
||||
|
||||
. reduce 18
|
||||
|
||||
|
||||
state 24
|
||||
stat : LETTER '=' expr . (5)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'\n' reduce 5
|
||||
|
||||
|
||||
state 25
|
||||
expr : '(' expr ')' . (6)
|
||||
|
||||
. reduce 6
|
||||
|
||||
|
||||
state 26
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
expr : expr '|' expr . (13)
|
||||
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 13
|
||||
'\n' reduce 13
|
||||
')' reduce 13
|
||||
|
||||
|
||||
state 27
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr '&' expr . (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 12
|
||||
'&' reduce 12
|
||||
'\n' reduce 12
|
||||
')' reduce 12
|
||||
|
||||
|
||||
state 28
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr '+' expr . (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 7
|
||||
'&' reduce 7
|
||||
'+' reduce 7
|
||||
'-' reduce 7
|
||||
'\n' reduce 7
|
||||
')' reduce 7
|
||||
|
||||
|
||||
state 29
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr '-' expr . (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 8
|
||||
'&' reduce 8
|
||||
'+' reduce 8
|
||||
'-' reduce 8
|
||||
'\n' reduce 8
|
||||
')' reduce 8
|
||||
|
||||
|
||||
state 30
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr '*' expr . (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 9
|
||||
|
||||
|
||||
state 31
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr '/' expr . (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 10
|
||||
|
||||
|
||||
state 32
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr '%' expr . (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 11
|
||||
|
||||
|
||||
16 terminals, 5 nonterminals
|
||||
19 grammar rules, 33 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
0 0 $end
|
||||
1 256 error
|
||||
2 257 DIGIT
|
||||
3 258 LETTER
|
||||
4 124 '|'
|
||||
5 38 '&'
|
||||
6 43 '+'
|
||||
7 45 '-'
|
||||
8 42 '*'
|
||||
9 47 '/'
|
||||
10 37 '%'
|
||||
11 259 UMINUS
|
||||
12 10 '\n'
|
||||
13 61 '='
|
||||
14 40 '('
|
||||
15 41 ')'
|
||||
16 260 $accept
|
||||
17 261 list
|
||||
18 262 stat
|
||||
19 263 expr
|
||||
20 264 number
|
1449
test/btyacc/calc3.tab.c
Normal file
1449
test/btyacc/calc3.tab.c
Normal file
File diff suppressed because it is too large
Load Diff
8
test/btyacc/calc3.tab.h
Normal file
8
test/btyacc/calc3.tab.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef _calc3__defines_h_
|
||||
#define _calc3__defines_h_
|
||||
|
||||
#define DIGIT 257
|
||||
#define LETTER 258
|
||||
#define UMINUS 259
|
||||
|
||||
#endif /* _calc3__defines_h_ */
|
1328
test/btyacc/code_calc.code.c
Normal file
1328
test/btyacc/code_calc.code.c
Normal file
File diff suppressed because it is too large
Load Diff
0
test/btyacc/code_calc.error
Normal file
0
test/btyacc/code_calc.error
Normal file
485
test/btyacc/code_calc.output
Normal file
485
test/btyacc/code_calc.output
Normal file
@ -0,0 +1,485 @@
|
||||
0 $accept : list $end
|
||||
|
||||
1 list :
|
||||
2 | list stat '\n'
|
||||
3 | list error '\n'
|
||||
|
||||
4 stat : expr
|
||||
5 | LETTER '=' expr
|
||||
|
||||
6 expr : '(' expr ')'
|
||||
7 | expr '+' expr
|
||||
8 | expr '-' expr
|
||||
9 | expr '*' expr
|
||||
10 | expr '/' expr
|
||||
11 | expr '%' expr
|
||||
12 | expr '&' expr
|
||||
13 | expr '|' expr
|
||||
14 | '-' expr
|
||||
15 | LETTER
|
||||
16 | number
|
||||
|
||||
17 number : DIGIT
|
||||
18 | number DIGIT
|
||||
|
||||
state 0
|
||||
$accept : . list $end (0)
|
||||
list : . (1)
|
||||
|
||||
. reduce 1
|
||||
|
||||
list goto 1
|
||||
|
||||
|
||||
state 1
|
||||
$accept : list . $end (0)
|
||||
list : list . stat '\n' (2)
|
||||
list : list . error '\n' (3)
|
||||
|
||||
$end accept
|
||||
error shift 2
|
||||
DIGIT shift 3
|
||||
LETTER shift 4
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
stat goto 7
|
||||
expr goto 8
|
||||
number goto 9
|
||||
|
||||
|
||||
state 2
|
||||
list : list error . '\n' (3)
|
||||
|
||||
'\n' shift 10
|
||||
. error
|
||||
|
||||
|
||||
state 3
|
||||
number : DIGIT . (17)
|
||||
|
||||
. reduce 17
|
||||
|
||||
|
||||
state 4
|
||||
stat : LETTER . '=' expr (5)
|
||||
expr : LETTER . (15)
|
||||
|
||||
'=' shift 11
|
||||
'|' reduce 15
|
||||
'&' reduce 15
|
||||
'+' reduce 15
|
||||
'-' reduce 15
|
||||
'*' reduce 15
|
||||
'/' reduce 15
|
||||
'%' reduce 15
|
||||
'\n' reduce 15
|
||||
|
||||
|
||||
state 5
|
||||
expr : '-' . expr (14)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 13
|
||||
number goto 9
|
||||
|
||||
|
||||
state 6
|
||||
expr : '(' . expr ')' (6)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 14
|
||||
number goto 9
|
||||
|
||||
|
||||
state 7
|
||||
list : list stat . '\n' (2)
|
||||
|
||||
'\n' shift 15
|
||||
. error
|
||||
|
||||
|
||||
state 8
|
||||
stat : expr . (4)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'\n' reduce 4
|
||||
|
||||
|
||||
state 9
|
||||
expr : number . (16)
|
||||
number : number . DIGIT (18)
|
||||
|
||||
DIGIT shift 23
|
||||
'|' reduce 16
|
||||
'&' reduce 16
|
||||
'+' reduce 16
|
||||
'-' reduce 16
|
||||
'*' reduce 16
|
||||
'/' reduce 16
|
||||
'%' reduce 16
|
||||
'\n' reduce 16
|
||||
')' reduce 16
|
||||
|
||||
|
||||
state 10
|
||||
list : list error '\n' . (3)
|
||||
|
||||
. reduce 3
|
||||
|
||||
|
||||
state 11
|
||||
stat : LETTER '=' . expr (5)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 24
|
||||
number goto 9
|
||||
|
||||
|
||||
state 12
|
||||
expr : LETTER . (15)
|
||||
|
||||
. reduce 15
|
||||
|
||||
|
||||
state 13
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
expr : '-' expr . (14)
|
||||
|
||||
. reduce 14
|
||||
|
||||
|
||||
state 14
|
||||
expr : '(' expr . ')' (6)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
')' shift 25
|
||||
. error
|
||||
|
||||
|
||||
state 15
|
||||
list : list stat '\n' . (2)
|
||||
|
||||
. reduce 2
|
||||
|
||||
|
||||
state 16
|
||||
expr : expr '|' . expr (13)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 26
|
||||
number goto 9
|
||||
|
||||
|
||||
state 17
|
||||
expr : expr '&' . expr (12)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 27
|
||||
number goto 9
|
||||
|
||||
|
||||
state 18
|
||||
expr : expr '+' . expr (7)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 28
|
||||
number goto 9
|
||||
|
||||
|
||||
state 19
|
||||
expr : expr '-' . expr (8)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 29
|
||||
number goto 9
|
||||
|
||||
|
||||
state 20
|
||||
expr : expr '*' . expr (9)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 30
|
||||
number goto 9
|
||||
|
||||
|
||||
state 21
|
||||
expr : expr '/' . expr (10)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 31
|
||||
number goto 9
|
||||
|
||||
|
||||
state 22
|
||||
expr : expr '%' . expr (11)
|
||||
|
||||
DIGIT shift 3
|
||||
LETTER shift 12
|
||||
'-' shift 5
|
||||
'(' shift 6
|
||||
. error
|
||||
|
||||
expr goto 32
|
||||
number goto 9
|
||||
|
||||
|
||||
state 23
|
||||
number : number DIGIT . (18)
|
||||
|
||||
. reduce 18
|
||||
|
||||
|
||||
state 24
|
||||
stat : LETTER '=' expr . (5)
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'|' shift 16
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'\n' reduce 5
|
||||
|
||||
|
||||
state 25
|
||||
expr : '(' expr ')' . (6)
|
||||
|
||||
. reduce 6
|
||||
|
||||
|
||||
state 26
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
expr : expr '|' expr . (13)
|
||||
|
||||
'&' shift 17
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 13
|
||||
'\n' reduce 13
|
||||
')' reduce 13
|
||||
|
||||
|
||||
state 27
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr '&' expr . (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'+' shift 18
|
||||
'-' shift 19
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 12
|
||||
'&' reduce 12
|
||||
'\n' reduce 12
|
||||
')' reduce 12
|
||||
|
||||
|
||||
state 28
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr '+' expr . (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 7
|
||||
'&' reduce 7
|
||||
'+' reduce 7
|
||||
'-' reduce 7
|
||||
'\n' reduce 7
|
||||
')' reduce 7
|
||||
|
||||
|
||||
state 29
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr '-' expr . (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
'*' shift 20
|
||||
'/' shift 21
|
||||
'%' shift 22
|
||||
'|' reduce 8
|
||||
'&' reduce 8
|
||||
'+' reduce 8
|
||||
'-' reduce 8
|
||||
'\n' reduce 8
|
||||
')' reduce 8
|
||||
|
||||
|
||||
state 30
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr '*' expr . (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 9
|
||||
|
||||
|
||||
state 31
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr '/' expr . (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 10
|
||||
|
||||
|
||||
state 32
|
||||
expr : expr . '+' expr (7)
|
||||
expr : expr . '-' expr (8)
|
||||
expr : expr . '*' expr (9)
|
||||
expr : expr . '/' expr (10)
|
||||
expr : expr . '%' expr (11)
|
||||
expr : expr '%' expr . (11)
|
||||
expr : expr . '&' expr (12)
|
||||
expr : expr . '|' expr (13)
|
||||
|
||||
. reduce 11
|
||||
|
||||
|
||||
16 terminals, 5 nonterminals
|
||||
19 grammar rules, 33 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
0 0 $end
|
||||
1 256 error
|
||||
2 257 DIGIT
|
||||
3 258 LETTER
|
||||
4 124 '|'
|
||||
5 38 '&'
|
||||
6 43 '+'
|
||||
7 45 '-'
|
||||
8 42 '*'
|
||||
9 47 '/'
|
||||
10 37 '%'
|
||||
11 259 UMINUS
|
||||
12 10 '\n'
|
||||
13 61 '='
|
||||
14 40 '('
|
||||
15 41 ')'
|
||||
16 260 $accept
|
||||
17 261 list
|
||||
18 262 stat
|
||||
19 263 expr
|
||||
20 264 number
|
137
test/btyacc/code_calc.tab.c
Normal file
137
test/btyacc/code_calc.tab.c
Normal file
@ -0,0 +1,137 @@
|
||||
#undef YYBTYACC
|
||||
#define YYBTYACC 0
|
||||
#define YYDEBUGSTR YYPREFIX "debug"
|
||||
typedef short YYINT;
|
||||
const YYINT calc_lhs[] = { -1,
|
||||
0, 0, 0, 1, 1, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 3, 3,
|
||||
};
|
||||
const YYINT calc_len[] = { 2,
|
||||
0, 3, 3, 1, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 2, 1, 1, 1, 2,
|
||||
};
|
||||
const YYINT calc_defred[] = { 1,
|
||||
0, 0, 17, 0, 0, 0, 0, 0, 0, 3,
|
||||
0, 15, 14, 0, 2, 0, 0, 0, 0, 0,
|
||||
0, 0, 18, 0, 6, 0, 0, 0, 0, 9,
|
||||
10, 11,
|
||||
};
|
||||
const YYINT calc_stos[] = { 0,
|
||||
261, 256, 257, 258, 45, 40, 262, 263, 264, 10,
|
||||
61, 258, 263, 263, 10, 124, 38, 43, 45, 42,
|
||||
47, 37, 257, 263, 41, 263, 263, 263, 263, 263,
|
||||
263, 263,
|
||||
};
|
||||
const YYINT calc_dgoto[] = { 1,
|
||||
7, 8, 9,
|
||||
};
|
||||
const YYINT calc_sindex[] = { 0,
|
||||
-40, -7, 0, -55, -38, -38, 1, -29, -247, 0,
|
||||
-38, 0, 0, 22, 0, -38, -38, -38, -38, -38,
|
||||
-38, -38, 0, -29, 0, 51, 60, -20, -20, 0,
|
||||
0, 0,
|
||||
};
|
||||
const YYINT calc_rindex[] = { 0,
|
||||
0, 0, 0, 2, 0, 0, 0, 9, -9, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 10, 0, -6, 14, 5, 13, 0,
|
||||
0, 0,
|
||||
};
|
||||
#if YYBTYACC
|
||||
const YYINT calc_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, 0,
|
||||
0, 0,
|
||||
};
|
||||
#endif
|
||||
const YYINT calc_gindex[] = { 0,
|
||||
0, 65, 0,
|
||||
};
|
||||
const YYINT calc_table[] = { 6,
|
||||
16, 6, 10, 13, 5, 11, 5, 22, 17, 23,
|
||||
15, 15, 20, 18, 7, 19, 22, 21, 4, 5,
|
||||
0, 20, 8, 12, 0, 0, 21, 16, 16, 0,
|
||||
0, 16, 16, 16, 13, 16, 0, 16, 15, 15,
|
||||
0, 0, 7, 15, 15, 7, 15, 7, 15, 7,
|
||||
8, 12, 0, 8, 12, 8, 0, 8, 22, 17,
|
||||
0, 0, 25, 20, 18, 0, 19, 0, 21, 13,
|
||||
14, 0, 0, 0, 0, 24, 0, 0, 0, 0,
|
||||
26, 27, 28, 29, 30, 31, 32, 22, 17, 0,
|
||||
0, 0, 20, 18, 16, 19, 22, 21, 0, 0,
|
||||
0, 20, 18, 0, 19, 0, 21, 0, 0, 0,
|
||||
0, 0, 0, 0, 16, 0, 0, 13, 0, 0,
|
||||
0, 0, 0, 0, 0, 15, 0, 0, 7, 0,
|
||||
0, 0, 0, 0, 0, 0, 8, 12, 0, 0,
|
||||
0, 0, 0, 0, 0, 16, 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, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 2, 3, 4, 3, 12,
|
||||
};
|
||||
const YYINT calc_check[] = { 40,
|
||||
10, 40, 10, 10, 45, 61, 45, 37, 38, 257,
|
||||
10, 10, 42, 43, 10, 45, 37, 47, 10, 10,
|
||||
-1, 42, 10, 10, -1, -1, 47, 37, 38, -1,
|
||||
-1, 41, 42, 43, 41, 45, -1, 47, 37, 38,
|
||||
-1, -1, 38, 42, 43, 41, 45, 43, 47, 45,
|
||||
38, 38, -1, 41, 41, 43, -1, 45, 37, 38,
|
||||
-1, -1, 41, 42, 43, -1, 45, -1, 47, 5,
|
||||
6, -1, -1, -1, -1, 11, -1, -1, -1, -1,
|
||||
16, 17, 18, 19, 20, 21, 22, 37, 38, -1,
|
||||
-1, -1, 42, 43, 124, 45, 37, 47, -1, -1,
|
||||
-1, 42, 43, -1, 45, -1, 47, -1, -1, -1,
|
||||
-1, -1, -1, -1, 124, -1, -1, 124, -1, -1,
|
||||
-1, -1, -1, -1, -1, 124, -1, -1, 124, -1,
|
||||
-1, -1, -1, -1, -1, -1, 124, 124, -1, -1,
|
||||
-1, -1, -1, -1, -1, 124, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, 256, 257, 258, 257, 258,
|
||||
};
|
||||
#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,
|
||||
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,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,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,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","DIGIT","LETTER","UMINUS","$accept","list","stat","expr","number",
|
||||
"illegal-symbol",
|
||||
};
|
||||
const char *const calc_rule[] = {
|
||||
"$accept : list",
|
||||
"list :",
|
||||
"list : list stat '\\n'",
|
||||
"list : list error '\\n'",
|
||||
"stat : expr",
|
||||
"stat : LETTER '=' expr",
|
||||
"expr : '(' expr ')'",
|
||||
"expr : expr '+' expr",
|
||||
"expr : expr '-' expr",
|
||||
"expr : expr '*' expr",
|
||||
"expr : expr '/' expr",
|
||||
"expr : expr '%' expr",
|
||||
"expr : expr '&' expr",
|
||||
"expr : expr '|' expr",
|
||||
"expr : '-' expr",
|
||||
"expr : LETTER",
|
||||
"expr : number",
|
||||
"number : DIGIT",
|
||||
"number : number DIGIT",
|
||||
|
||||
};
|
||||
#endif
|
8
test/btyacc/code_calc.tab.h
Normal file
8
test/btyacc/code_calc.tab.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef _calc__defines_h_
|
||||
#define _calc__defines_h_
|
||||
|
||||
#define DIGIT 257
|
||||
#define LETTER 258
|
||||
#define UMINUS 259
|
||||
|
||||
#endif /* _calc__defines_h_ */
|
1125
test/btyacc/code_debug.c
Normal file
1125
test/btyacc/code_debug.c
Normal file
File diff suppressed because it is too large
Load Diff
0
test/btyacc/code_debug.error
Normal file
0
test/btyacc/code_debug.error
Normal file
6
test/btyacc/code_debug.h
Normal file
6
test/btyacc/code_debug.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef _yy_defines_h_
|
||||
#define _yy_defines_h_
|
||||
|
||||
#define YYERRCODE 256
|
||||
|
||||
#endif /* _yy_defines_h_ */
|
60
test/btyacc/code_debug.i
Normal file
60
test/btyacc/code_debug.i
Normal file
@ -0,0 +1,60 @@
|
||||
#define YYPREFIX "yy"
|
||||
|
||||
#define YYPURE 0
|
||||
|
||||
#line 2 "code_debug.y"
|
||||
|
||||
#ifdef YYBISON
|
||||
int yylex(void);
|
||||
static void yyerror(const char *);
|
||||
#endif
|
||||
|
||||
|
||||
#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
|
||||
/* Default: YYSTYPE is the semantic value type. */
|
||||
typedef int YYSTYPE;
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
/* compatibility with bison */
|
||||
#ifdef YYPARSE_PARAM
|
||||
/* compatibility with FreeBSD */
|
||||
# ifdef YYPARSE_PARAM_TYPE
|
||||
# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
|
||||
# else
|
||||
# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
|
||||
# endif
|
||||
#else
|
||||
# define YYPARSE_DECL() yyparse(void)
|
||||
#endif
|
||||
|
||||
/* Parameters sent to lex. */
|
||||
#ifdef YYLEX_PARAM
|
||||
# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
|
||||
# define YYLEX yylex(YYLEX_PARAM)
|
||||
#else
|
||||
# define YYLEX_DECL() yylex(void)
|
||||
# define YYLEX yylex()
|
||||
#endif
|
||||
|
||||
/* Parameters sent to yyerror. */
|
||||
#ifndef YYERROR_DECL
|
||||
#define YYERROR_DECL() yyerror(const char *s)
|
||||
#endif
|
||||
#ifndef YYERROR_CALL
|
||||
#define YYERROR_CALL(msg) yyerror(msg)
|
||||
#endif
|
||||
|
||||
extern int YYPARSE_DECL();
|
||||
|
||||
extern int yydebug;
|
||||
extern int yynerrs;
|
||||
|
||||
extern int yyerrflag;
|
||||
extern int yychar;
|
||||
extern YYSTYPE yyval;
|
||||
extern YYSTYPE yylval;
|
||||
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
|
||||
extern YYLTYPE yyloc; /* position returned by actions */
|
||||
extern YYLTYPE yylloc; /* position from the lexer */
|
||||
#endif
|
34
test/btyacc/code_debug.output
Normal file
34
test/btyacc/code_debug.output
Normal file
@ -0,0 +1,34 @@
|
||||
0 $accept : S $end
|
||||
|
||||
1 S : error
|
||||
|
||||
state 0
|
||||
$accept : . S $end (0)
|
||||
|
||||
error shift 1
|
||||
. error
|
||||
|
||||
S goto 2
|
||||
|
||||
|
||||
state 1
|
||||
S : error . (1)
|
||||
|
||||
. reduce 1
|
||||
|
||||
|
||||
state 2
|
||||
$accept : S . $end (0)
|
||||
|
||||
$end accept
|
||||
|
||||
|
||||
2 terminals, 2 nonterminals
|
||||
2 grammar rules, 3 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
0 0 $end
|
||||
1 256 error
|
||||
2 257 $accept
|
||||
3 258 S
|
1239
test/btyacc/code_error.code.c
Normal file
1239
test/btyacc/code_error.code.c
Normal file
File diff suppressed because it is too large
Load Diff
0
test/btyacc/code_error.error
Normal file
0
test/btyacc/code_error.error
Normal file
34
test/btyacc/code_error.output
Normal file
34
test/btyacc/code_error.output
Normal file
@ -0,0 +1,34 @@
|
||||
0 $accept : S $end
|
||||
|
||||
1 S : error
|
||||
|
||||
state 0
|
||||
$accept : . S $end (0)
|
||||
|
||||
error shift 1
|
||||
. error
|
||||
|
||||
S goto 2
|
||||
|
||||
|
||||
state 1
|
||||
S : error . (1)
|
||||
|
||||
. reduce 1
|
||||
|
||||
|
||||
state 2
|
||||
$accept : S . $end (0)
|
||||
|
||||
$end accept
|
||||
|
||||
|
||||
2 terminals, 2 nonterminals
|
||||
2 grammar rules, 3 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
0 0 $end
|
||||
1 256 error
|
||||
2 257 $accept
|
||||
3 258 S
|
55
test/btyacc/code_error.tab.c
Normal file
55
test/btyacc/code_error.tab.c
Normal file
@ -0,0 +1,55 @@
|
||||
#undef YYBTYACC
|
||||
#define YYBTYACC 0
|
||||
#define YYDEBUGSTR YYPREFIX "debug"
|
||||
typedef short YYINT;
|
||||
const YYINT error_lhs[] = { -1,
|
||||
0,
|
||||
};
|
||||
const YYINT error_len[] = { 2,
|
||||
1,
|
||||
};
|
||||
const YYINT error_defred[] = { 0,
|
||||
1, 0,
|
||||
};
|
||||
const YYINT error_stos[] = { 0,
|
||||
256, 258,
|
||||
};
|
||||
const YYINT error_dgoto[] = { 2,
|
||||
};
|
||||
const YYINT error_sindex[] = { -256,
|
||||
0, 0,
|
||||
};
|
||||
const YYINT error_rindex[] = { 0,
|
||||
0, 0,
|
||||
};
|
||||
#if YYBTYACC
|
||||
const YYINT error_cindex[] = { 0,
|
||||
0, 0,
|
||||
};
|
||||
#endif
|
||||
const YYINT error_gindex[] = { 0,
|
||||
};
|
||||
const YYINT error_table[] = { 1,
|
||||
};
|
||||
const YYINT error_check[] = { 256,
|
||||
};
|
||||
#ifndef YYDEBUG
|
||||
#define YYDEBUG 0
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
const char *const error_name[] = {
|
||||
|
||||
"$end",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,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,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,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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","$accept","S","illegal-symbol",
|
||||
};
|
||||
const char *const error_rule[] = {
|
||||
"$accept : S",
|
||||
"S : error",
|
||||
|
||||
};
|
||||
#endif
|
5
test/btyacc/code_error.tab.h
Normal file
5
test/btyacc/code_error.tab.h
Normal file
@ -0,0 +1,5 @@
|
||||
#ifndef _error__defines_h_
|
||||
#define _error__defines_h_
|
||||
|
||||
|
||||
#endif /* _error__defines_h_ */
|
0
test/btyacc/empty.error
Normal file
0
test/btyacc/empty.error
Normal file
28
test/btyacc/empty.output
Normal file
28
test/btyacc/empty.output
Normal file
@ -0,0 +1,28 @@
|
||||
0 $accept : start $end
|
||||
|
||||
1 start :
|
||||
|
||||
state 0
|
||||
$accept : . start $end (0)
|
||||
start : . (1)
|
||||
|
||||
. reduce 1
|
||||
|
||||
start goto 1
|
||||
|
||||
|
||||
state 1
|
||||
$accept : start . $end (0)
|
||||
|
||||
$end accept
|
||||
|
||||
|
||||
2 terminals, 2 nonterminals
|
||||
2 grammar rules, 2 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
0 0 $end
|
||||
1 256 error
|
||||
2 257 $accept
|
||||
3 258 start
|
1254
test/btyacc/empty.tab.c
Normal file
1254
test/btyacc/empty.tab.c
Normal file
File diff suppressed because it is too large
Load Diff
5
test/btyacc/empty.tab.h
Normal file
5
test/btyacc/empty.tab.h
Normal file
@ -0,0 +1,5 @@
|
||||
#ifndef _empty__defines_h_
|
||||
#define _empty__defines_h_
|
||||
|
||||
|
||||
#endif /* _empty__defines_h_ */
|
3
test/btyacc/err_inherit1.error
Normal file
3
test/btyacc/err_inherit1.error
Normal file
@ -0,0 +1,3 @@
|
||||
YACC: e - line 64 of "./test/err_inherit1.y", unterminated argument list
|
||||
namelist($c, $t
|
||||
^
|
0
test/btyacc/err_inherit1.output
Normal file
0
test/btyacc/err_inherit1.output
Normal file
15
test/btyacc/err_inherit1.tab.c
Normal file
15
test/btyacc/err_inherit1.tab.c
Normal file
@ -0,0 +1,15 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
#define YYMINOR 9
|
||||
#define YYCHECK "yyyymmdd"
|
||||
|
||||
#define YYEMPTY (-1)
|
||||
#define yyclearin (yychar = YYEMPTY)
|
||||
#define yyerrok (yyerrflag = 0)
|
||||
#define YYRECOVERING() (yyerrflag != 0)
|
||||
#define YYENOMEM (-2)
|
||||
#define YYEOF 0
|
0
test/btyacc/err_inherit1.tab.h
Normal file
0
test/btyacc/err_inherit1.tab.h
Normal file
5
test/btyacc/err_inherit2.error
Normal file
5
test/btyacc/err_inherit2.error
Normal file
@ -0,0 +1,5 @@
|
||||
YACC: w - line 64 of "./test/err_inherit2.y", number of arguments of namelist doesn't agree with previous declaration
|
||||
YACC: w - line 64 of "./test/err_inherit2.y", type of argument 1 to namelist doesn't agree with previous declaration
|
||||
YACC: e - line 64 of "./test/err_inherit2.y", bad formal argument list
|
||||
namelist($<tval>c, $t, extra): namelist NAME
|
||||
^
|
0
test/btyacc/err_inherit2.output
Normal file
0
test/btyacc/err_inherit2.output
Normal file
15
test/btyacc/err_inherit2.tab.c
Normal file
15
test/btyacc/err_inherit2.tab.c
Normal file
@ -0,0 +1,15 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
#define YYMINOR 9
|
||||
#define YYCHECK "yyyymmdd"
|
||||
|
||||
#define YYEMPTY (-1)
|
||||
#define yyclearin (yychar = YYEMPTY)
|
||||
#define yyerrok (yyerrflag = 0)
|
||||
#define YYRECOVERING() (yyerrflag != 0)
|
||||
#define YYENOMEM (-2)
|
||||
#define YYEOF 0
|
0
test/btyacc/err_inherit2.tab.h
Normal file
0
test/btyacc/err_inherit2.tab.h
Normal file
23
test/btyacc/err_inherit3.error
Normal file
23
test/btyacc/err_inherit3.error
Normal file
@ -0,0 +1,23 @@
|
||||
YACC: w - line 64 of "./test/err_inherit3.y", number of arguments of namelist doesn't agree with previous declaration
|
||||
YACC: w - line 64 of "./test/err_inherit3.y", wrong number of arguments for namelist
|
||||
namelist: namelist($c) NAME
|
||||
^
|
||||
YACC: w - line 64 of "./test/err_inherit3.y", unknown argument $c
|
||||
YACC: w - line 64 of "./test/err_inherit3.y", untyped argument $c
|
||||
YACC: w - line 65 of "./test/err_inherit3.y", unknown argument $t
|
||||
{ $$->s = mksymbol($<tval>t, $<cval>c, $2);
|
||||
^
|
||||
YACC: w - line 65 of "./test/err_inherit3.y", unknown argument $c
|
||||
{ $$->s = mksymbol($<tval>t, $<cval>c, $2);
|
||||
^
|
||||
YACC: w - line 69 of "./test/err_inherit3.y", unknown argument $t
|
||||
{ $$->s = mksymbol($t, $c, $1);
|
||||
^
|
||||
YACC: w - line 69 of "./test/err_inherit3.y", untyped argument $t
|
||||
YACC: w - line 69 of "./test/err_inherit3.y", unknown argument $c
|
||||
{ $$->s = mksymbol($t, $c, $1);
|
||||
^
|
||||
YACC: w - line 69 of "./test/err_inherit3.y", untyped argument $c
|
||||
YACC: w - line 0 of "./test/err_inherit3.y", start symbol declaration requires arguments
|
||||
YACC: 1 rule never reduced
|
||||
YACC: 3 shift/reduce conflicts.
|
229
test/btyacc/err_inherit3.output
Normal file
229
test/btyacc/err_inherit3.output
Normal file
@ -0,0 +1,229 @@
|
||||
0 $accept : declaration $end
|
||||
|
||||
1 $$1 :
|
||||
|
||||
2 $$2 :
|
||||
|
||||
3 declaration : class type $$1 $$2 namelist
|
||||
|
||||
4 $$3 :
|
||||
|
||||
5 declaration : type $$3 locnamelist
|
||||
|
||||
6 class : GLOBAL
|
||||
7 | LOCAL
|
||||
|
||||
8 type : REAL
|
||||
9 | INTEGER
|
||||
|
||||
10 $$4 :
|
||||
|
||||
11 namelist : $$4 namelist NAME
|
||||
12 | NAME
|
||||
|
||||
13 $$5 :
|
||||
|
||||
14 locnamelist : $$5 $$2 namelist
|
||||
|
||||
state 0
|
||||
$accept : . declaration $end (0)
|
||||
|
||||
GLOBAL shift 1
|
||||
LOCAL shift 2
|
||||
REAL shift 3
|
||||
INTEGER shift 4
|
||||
. error
|
||||
|
||||
declaration goto 5
|
||||
class goto 6
|
||||
type goto 7
|
||||
|
||||
|
||||
state 1
|
||||
class : GLOBAL . (6)
|
||||
|
||||
. reduce 6
|
||||
|
||||
|
||||
state 2
|
||||
class : LOCAL . (7)
|
||||
|
||||
. reduce 7
|
||||
|
||||
|
||||
state 3
|
||||
type : REAL . (8)
|
||||
|
||||
. reduce 8
|
||||
|
||||
|
||||
state 4
|
||||
type : INTEGER . (9)
|
||||
|
||||
. reduce 9
|
||||
|
||||
|
||||
state 5
|
||||
$accept : declaration . $end (0)
|
||||
|
||||
$end accept
|
||||
|
||||
|
||||
state 6
|
||||
declaration : class . type $$1 $$2 namelist (3)
|
||||
|
||||
REAL shift 3
|
||||
INTEGER shift 4
|
||||
. error
|
||||
|
||||
type goto 8
|
||||
|
||||
|
||||
state 7
|
||||
declaration : type . $$3 locnamelist (5)
|
||||
$$3 : . (4)
|
||||
|
||||
. reduce 4
|
||||
|
||||
$$3 goto 9
|
||||
|
||||
|
||||
state 8
|
||||
declaration : class type . $$1 $$2 namelist (3)
|
||||
$$1 : . (1)
|
||||
|
||||
. reduce 1
|
||||
|
||||
$$1 goto 10
|
||||
|
||||
|
||||
state 9
|
||||
declaration : type $$3 . locnamelist (5)
|
||||
$$5 : . (13)
|
||||
|
||||
. reduce 13
|
||||
|
||||
locnamelist goto 11
|
||||
$$5 goto 12
|
||||
|
||||
|
||||
state 10
|
||||
declaration : class type $$1 . $$2 namelist (3)
|
||||
$$2 : . (2)
|
||||
|
||||
. reduce 2
|
||||
|
||||
$$2 goto 13
|
||||
|
||||
|
||||
state 11
|
||||
declaration : type $$3 locnamelist . (5)
|
||||
|
||||
. reduce 5
|
||||
|
||||
|
||||
state 12
|
||||
locnamelist : $$5 . $$2 namelist (14)
|
||||
$$2 : . (2)
|
||||
|
||||
. reduce 2
|
||||
|
||||
$$2 goto 14
|
||||
|
||||
|
||||
13: shift/reduce conflict (shift 15, reduce 10) on NAME
|
||||
state 13
|
||||
declaration : class type $$1 $$2 . namelist (3)
|
||||
$$4 : . (10)
|
||||
|
||||
NAME shift 15
|
||||
|
||||
namelist goto 16
|
||||
$$4 goto 17
|
||||
|
||||
|
||||
14: shift/reduce conflict (shift 15, reduce 10) on NAME
|
||||
state 14
|
||||
locnamelist : $$5 $$2 . namelist (14)
|
||||
$$4 : . (10)
|
||||
|
||||
NAME shift 15
|
||||
|
||||
namelist goto 18
|
||||
$$4 goto 17
|
||||
|
||||
|
||||
state 15
|
||||
namelist : NAME . (12)
|
||||
|
||||
. reduce 12
|
||||
|
||||
|
||||
state 16
|
||||
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)
|
||||
|
||||
. reduce 14
|
||||
|
||||
|
||||
state 19
|
||||
namelist : $$4 namelist . NAME (11)
|
||||
|
||||
NAME shift 20
|
||||
. error
|
||||
|
||||
|
||||
state 20
|
||||
namelist : $$4 namelist NAME . (11)
|
||||
|
||||
. reduce 11
|
||||
|
||||
|
||||
Rules never reduced:
|
||||
$$4 : (10)
|
||||
|
||||
|
||||
State 13 contains 1 shift/reduce conflict.
|
||||
State 14 contains 1 shift/reduce conflict.
|
||||
State 17 contains 1 shift/reduce conflict.
|
||||
|
||||
|
||||
7 terminals, 11 nonterminals
|
||||
15 grammar rules, 21 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
0 0 $end
|
||||
1 256 error
|
||||
2 257 GLOBAL
|
||||
3 258 LOCAL
|
||||
4 259 REAL
|
||||
5 260 INTEGER
|
||||
6 261 NAME
|
||||
7 262 $accept
|
||||
8 263 declaration
|
||||
9 264 namelist
|
||||
10 265 locnamelist
|
||||
11 266 class
|
||||
12 267 type
|
||||
13 268 $$1
|
||||
14 269 $$2
|
||||
15 270 $$3
|
||||
16 271 $$4
|
||||
17 272 $$5
|
1414
test/btyacc/err_inherit3.tab.c
Normal file
1414
test/btyacc/err_inherit3.tab.c
Normal file
File diff suppressed because it is too large
Load Diff
25
test/btyacc/err_inherit3.tab.h
Normal file
25
test/btyacc/err_inherit3.tab.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef _err_inherit3__defines_h_
|
||||
#define _err_inherit3__defines_h_
|
||||
|
||||
#define GLOBAL 257
|
||||
#define LOCAL 258
|
||||
#define REAL 259
|
||||
#define INTEGER 260
|
||||
#define NAME 261
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
typedef union
|
||||
{
|
||||
class cval;
|
||||
type tval;
|
||||
namelist * nlist;
|
||||
name id;
|
||||
} YYSTYPE;
|
||||
#endif /* !YYSTYPE_IS_DECLARED */
|
||||
extern YYSTYPE err_inherit3_lval;
|
||||
|
||||
#endif /* _err_inherit3__defines_h_ */
|
13
test/btyacc/err_inherit4.error
Normal file
13
test/btyacc/err_inherit4.error
Normal file
@ -0,0 +1,13 @@
|
||||
YACC: w - line 32 of "./test/err_inherit4.y", destructor redeclared
|
||||
%destructor {
|
||||
^
|
||||
YACC: w - line 77 of "./test/err_inherit4.y", wrong number of default arguments for namelist
|
||||
{ $$ = $1; @$ = @2; }
|
||||
^
|
||||
YACC: w - line 77 of "./test/err_inherit4.y", wrong type for default argument 2 to namelist
|
||||
{ $$ = $1; @$ = @2; }
|
||||
^
|
||||
YACC: w - line 77 of "./test/err_inherit4.y", wrong type for default argument 1 to namelist
|
||||
{ $$ = $1; @$ = @2; }
|
||||
^
|
||||
YACC: w - line 77 of "./test/err_inherit4.y", @2 references beyond the end of the current rule
|
178
test/btyacc/err_inherit4.output
Normal file
178
test/btyacc/err_inherit4.output
Normal file
@ -0,0 +1,178 @@
|
||||
0 $accept : declaration $end
|
||||
|
||||
1 $$1 :
|
||||
|
||||
2 $$2 :
|
||||
|
||||
3 declaration : class type $$1 $$2 namelist
|
||||
|
||||
4 $$3 :
|
||||
|
||||
5 declaration : type $$3 locnamelist
|
||||
|
||||
6 class : GLOBAL
|
||||
7 | LOCAL
|
||||
|
||||
8 type : REAL
|
||||
9 | INTEGER
|
||||
|
||||
10 namelist : namelist NAME
|
||||
11 | NAME
|
||||
|
||||
12 locnamelist : namelist
|
||||
|
||||
state 0
|
||||
$accept : . declaration $end (0)
|
||||
|
||||
GLOBAL shift 1
|
||||
LOCAL shift 2
|
||||
REAL shift 3
|
||||
INTEGER shift 4
|
||||
. error
|
||||
|
||||
declaration goto 5
|
||||
class goto 6
|
||||
type goto 7
|
||||
|
||||
|
||||
state 1
|
||||
class : GLOBAL . (6)
|
||||
|
||||
. reduce 6
|
||||
|
||||
|
||||
state 2
|
||||
class : LOCAL . (7)
|
||||
|
||||
. reduce 7
|
||||
|
||||
|
||||
state 3
|
||||
type : REAL . (8)
|
||||
|
||||
. reduce 8
|
||||
|
||||
|
||||
state 4
|
||||
type : INTEGER . (9)
|
||||
|
||||
. reduce 9
|
||||
|
||||
|
||||
state 5
|
||||
$accept : declaration . $end (0)
|
||||
|
||||
$end accept
|
||||
|
||||
|
||||
state 6
|
||||
declaration : class . type $$1 $$2 namelist (3)
|
||||
|
||||
REAL shift 3
|
||||
INTEGER shift 4
|
||||
. error
|
||||
|
||||
type goto 8
|
||||
|
||||
|
||||
state 7
|
||||
declaration : type . $$3 locnamelist (5)
|
||||
$$3 : . (4)
|
||||
|
||||
. reduce 4
|
||||
|
||||
$$3 goto 9
|
||||
|
||||
|
||||
state 8
|
||||
declaration : class type . $$1 $$2 namelist (3)
|
||||
$$1 : . (1)
|
||||
|
||||
. reduce 1
|
||||
|
||||
$$1 goto 10
|
||||
|
||||
|
||||
state 9
|
||||
declaration : type $$3 . locnamelist (5)
|
||||
|
||||
NAME shift 11
|
||||
. error
|
||||
|
||||
namelist goto 12
|
||||
locnamelist goto 13
|
||||
|
||||
|
||||
state 10
|
||||
declaration : class type $$1 . $$2 namelist (3)
|
||||
$$2 : . (2)
|
||||
|
||||
. reduce 2
|
||||
|
||||
$$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)
|
||||
|
||||
. reduce 5
|
||||
|
||||
|
||||
state 14
|
||||
declaration : class type $$1 $$2 . namelist (3)
|
||||
|
||||
NAME shift 11
|
||||
. error
|
||||
|
||||
namelist goto 16
|
||||
|
||||
|
||||
state 15
|
||||
namelist : namelist NAME . (10)
|
||||
|
||||
. reduce 10
|
||||
|
||||
|
||||
state 16
|
||||
declaration : class type $$1 $$2 namelist . (3)
|
||||
namelist : namelist . NAME (10)
|
||||
|
||||
NAME shift 15
|
||||
$end reduce 3
|
||||
|
||||
|
||||
7 terminals, 9 nonterminals
|
||||
13 grammar rules, 17 states
|
||||
|
||||
grammar parser grammar
|
||||
symbol# value# symbol
|
||||
0 0 $end
|
||||
1 256 error
|
||||
2 257 GLOBAL
|
||||
3 258 LOCAL
|
||||
4 259 REAL
|
||||
5 260 INTEGER
|
||||
6 261 NAME
|
||||
7 262 $accept
|
||||
8 263 declaration
|
||||
9 264 namelist
|
||||
10 265 locnamelist
|
||||
11 266 class
|
||||
12 267 type
|
||||
13 268 $$1
|
||||
14 269 $$2
|
||||
15 270 $$3
|
1403
test/btyacc/err_inherit4.tab.c
Normal file
1403
test/btyacc/err_inherit4.tab.c
Normal file
File diff suppressed because it is too large
Load Diff
25
test/btyacc/err_inherit4.tab.h
Normal file
25
test/btyacc/err_inherit4.tab.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef _err_inherit4__defines_h_
|
||||
#define _err_inherit4__defines_h_
|
||||
|
||||
#define GLOBAL 257
|
||||
#define LOCAL 258
|
||||
#define REAL 259
|
||||
#define INTEGER 260
|
||||
#define NAME 261
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#ifndef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
typedef union
|
||||
{
|
||||
class cval;
|
||||
type tval;
|
||||
namelist * nlist;
|
||||
name id;
|
||||
} YYSTYPE;
|
||||
#endif /* !YYSTYPE_IS_DECLARED */
|
||||
extern YYSTYPE err_inherit4_lval;
|
||||
|
||||
#endif /* _err_inherit4__defines_h_ */
|
1
test/btyacc/err_inherit5.error
Normal file
1
test/btyacc/err_inherit5.error
Normal file
@ -0,0 +1 @@
|
||||
YACC: e - line 74 of "./test/err_inherit5.y", illegal @$ or @N reference
|
0
test/btyacc/err_inherit5.output
Normal file
0
test/btyacc/err_inherit5.output
Normal file
15
test/btyacc/err_inherit5.tab.c
Normal file
15
test/btyacc/err_inherit5.tab.c
Normal file
@ -0,0 +1,15 @@
|
||||
/* original parser id follows */
|
||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
|
||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
|
||||
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
#define YYMINOR 9
|
||||
#define YYCHECK "yyyymmdd"
|
||||
|
||||
#define YYEMPTY (-1)
|
||||
#define yyclearin (yychar = YYEMPTY)
|
||||
#define yyerrok (yyerrflag = 0)
|
||||
#define YYRECOVERING() (yyerrflag != 0)
|
||||
#define YYENOMEM (-2)
|
||||
#define YYEOF 0
|
0
test/btyacc/err_inherit5.tab.h
Normal file
0
test/btyacc/err_inherit5.tab.h
Normal file
3
test/btyacc/err_syntax1.error
Normal file
3
test/btyacc/err_syntax1.error
Normal file
@ -0,0 +1,3 @@
|
||||
YACC: e - line 1 of "./test/err_syntax1.y", syntax error
|
||||
?% {
|
||||
^
|
0
test/btyacc/err_syntax1.output
Normal file
0
test/btyacc/err_syntax1.output
Normal file
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user