├── ACKNOWLEDGEMENTS ├── AUTHORS ├── CHANGES ├── MANIFEST ├── Makefile.old ├── NEW_FEATURES ├── NOTES ├── NO_WARRANTY ├── README ├── README.BTYACC ├── VERSION ├── aclocal.m4 ├── btyaccpar.c ├── btyaccpar.skel ├── closure.c ├── config.guess ├── config.sub ├── config_h.in ├── configure ├── configure.in ├── defs.h ├── descrip.mms ├── error.c ├── graph.c ├── install-sh ├── lalr.c ├── lr0.c ├── main.c ├── makefile.in ├── mkpar.c ├── mstring.c ├── output.c ├── package ├── byacc.spec ├── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── docs │ ├── postinst │ ├── prerm │ ├── rules │ ├── source │ │ └── format │ └── watch ├── mingw-byacc.spec └── pkgsrc │ ├── DESCR │ ├── Makefile │ ├── PLIST │ └── distinfo ├── reader.c ├── skel2c ├── symtab.c ├── test ├── README ├── btyacc │ ├── big_b.error │ ├── big_b.output │ ├── big_l.error │ ├── big_l.output │ ├── btyacc_calc1.error │ ├── btyacc_calc1.output │ ├── btyacc_calc1.tab.c │ ├── btyacc_calc1.tab.h │ ├── btyacc_demo.error │ ├── btyacc_demo.output │ ├── btyacc_demo.tab.c │ ├── btyacc_demo.tab.h │ ├── btyacc_demo2.error │ ├── btyacc_demo2.output │ ├── btyacc_demo2.tab.c │ ├── btyacc_demo2.tab.h │ ├── btyacc_destroy1.error │ ├── btyacc_destroy1.output │ ├── btyacc_destroy1.tab.c │ ├── btyacc_destroy1.tab.h │ ├── btyacc_destroy2.error │ ├── btyacc_destroy2.output │ ├── btyacc_destroy2.tab.c │ ├── btyacc_destroy2.tab.h │ ├── btyacc_destroy3.error │ ├── btyacc_destroy3.output │ ├── btyacc_destroy3.tab.c │ ├── btyacc_destroy3.tab.h │ ├── calc.error │ ├── calc.output │ ├── calc.tab.c │ ├── calc.tab.h │ ├── calc1.error │ ├── calc1.output │ ├── calc1.tab.c │ ├── calc1.tab.h │ ├── calc2.error │ ├── calc2.output │ ├── calc2.tab.c │ ├── calc2.tab.h │ ├── calc3.error │ ├── calc3.output │ ├── calc3.tab.c │ ├── calc3.tab.h │ ├── code_calc.code.c │ ├── code_calc.error │ ├── code_calc.output │ ├── code_calc.tab.c │ ├── code_calc.tab.h │ ├── code_debug.c │ ├── code_debug.error │ ├── code_debug.h │ ├── code_debug.i │ ├── code_debug.output │ ├── code_error.code.c │ ├── code_error.error │ ├── code_error.output │ ├── code_error.tab.c │ ├── code_error.tab.h │ ├── empty.error │ ├── empty.output │ ├── empty.tab.c │ ├── empty.tab.h │ ├── err_inherit1.error │ ├── err_inherit1.output │ ├── err_inherit1.tab.c │ ├── err_inherit1.tab.h │ ├── err_inherit2.error │ ├── err_inherit2.output │ ├── err_inherit2.tab.c │ ├── err_inherit2.tab.h │ ├── err_inherit3.error │ ├── err_inherit3.output │ ├── err_inherit3.tab.c │ ├── err_inherit3.tab.h │ ├── err_inherit4.error │ ├── err_inherit4.output │ ├── err_inherit4.tab.c │ ├── err_inherit4.tab.h │ ├── err_inherit5.error │ ├── err_inherit5.output │ ├── err_inherit5.tab.c │ ├── err_inherit5.tab.h │ ├── err_syntax1.error │ ├── err_syntax1.output │ ├── err_syntax1.tab.c │ ├── err_syntax1.tab.h │ ├── err_syntax10.error │ ├── err_syntax10.output │ ├── err_syntax10.tab.c │ ├── err_syntax10.tab.h │ ├── err_syntax11.error │ ├── err_syntax11.output │ ├── err_syntax11.tab.c │ ├── err_syntax11.tab.h │ ├── err_syntax12.error │ ├── err_syntax12.output │ ├── err_syntax12.tab.c │ ├── err_syntax12.tab.h │ ├── err_syntax13.error │ ├── err_syntax13.output │ ├── err_syntax13.tab.c │ ├── err_syntax13.tab.h │ ├── err_syntax14.error │ ├── err_syntax14.output │ ├── err_syntax14.tab.c │ ├── err_syntax14.tab.h │ ├── err_syntax15.error │ ├── err_syntax15.output │ ├── err_syntax15.tab.c │ ├── err_syntax15.tab.h │ ├── err_syntax16.error │ ├── err_syntax16.output │ ├── err_syntax16.tab.c │ ├── err_syntax16.tab.h │ ├── err_syntax17.error │ ├── err_syntax17.output │ ├── err_syntax17.tab.c │ ├── err_syntax17.tab.h │ ├── err_syntax18.error │ ├── err_syntax18.output │ ├── err_syntax18.tab.c │ ├── err_syntax18.tab.h │ ├── err_syntax19.error │ ├── err_syntax19.output │ ├── err_syntax19.tab.c │ ├── err_syntax19.tab.h │ ├── err_syntax2.error │ ├── err_syntax2.output │ ├── err_syntax2.tab.c │ ├── err_syntax2.tab.h │ ├── err_syntax20.error │ ├── err_syntax20.output │ ├── err_syntax20.tab.c │ ├── err_syntax20.tab.h │ ├── err_syntax21.error │ ├── err_syntax21.output │ ├── err_syntax21.tab.c │ ├── err_syntax21.tab.h │ ├── err_syntax22.error │ ├── err_syntax22.output │ ├── err_syntax22.tab.c │ ├── err_syntax22.tab.h │ ├── err_syntax23.error │ ├── err_syntax23.output │ ├── err_syntax23.tab.c │ ├── err_syntax23.tab.h │ ├── err_syntax24.error │ ├── err_syntax24.output │ ├── err_syntax24.tab.c │ ├── err_syntax24.tab.h │ ├── err_syntax25.error │ ├── err_syntax25.output │ ├── err_syntax25.tab.c │ ├── err_syntax25.tab.h │ ├── err_syntax26.error │ ├── err_syntax26.output │ ├── err_syntax26.tab.c │ ├── err_syntax26.tab.h │ ├── err_syntax27.error │ ├── err_syntax27.output │ ├── err_syntax27.tab.c │ ├── err_syntax27.tab.h │ ├── err_syntax3.error │ ├── err_syntax3.output │ ├── err_syntax3.tab.c │ ├── err_syntax3.tab.h │ ├── err_syntax4.error │ ├── err_syntax4.output │ ├── err_syntax4.tab.c │ ├── err_syntax4.tab.h │ ├── err_syntax5.error │ ├── err_syntax5.output │ ├── err_syntax5.tab.c │ ├── err_syntax5.tab.h │ ├── err_syntax6.error │ ├── err_syntax6.output │ ├── err_syntax6.tab.c │ ├── err_syntax6.tab.h │ ├── err_syntax7.error │ ├── err_syntax7.output │ ├── err_syntax7.tab.c │ ├── err_syntax7.tab.h │ ├── err_syntax7a.error │ ├── err_syntax7a.output │ ├── err_syntax7a.tab.c │ ├── err_syntax7a.tab.h │ ├── err_syntax7b.error │ ├── err_syntax7b.output │ ├── err_syntax7b.tab.c │ ├── err_syntax7b.tab.h │ ├── err_syntax8.error │ ├── err_syntax8.output │ ├── err_syntax8.tab.c │ ├── err_syntax8.tab.h │ ├── err_syntax8a.error │ ├── err_syntax8a.output │ ├── err_syntax8a.tab.c │ ├── err_syntax8a.tab.h │ ├── err_syntax9.error │ ├── err_syntax9.output │ ├── err_syntax9.tab.c │ ├── err_syntax9.tab.h │ ├── error.error │ ├── error.output │ ├── error.tab.c │ ├── error.tab.h │ ├── grammar.dot │ ├── grammar.error │ ├── grammar.output │ ├── grammar.tab.c │ ├── grammar.tab.h │ ├── help.error │ ├── help.output │ ├── inherit0.error │ ├── inherit0.output │ ├── inherit0.tab.c │ ├── inherit0.tab.h │ ├── inherit1.error │ ├── inherit1.output │ ├── inherit1.tab.c │ ├── inherit1.tab.h │ ├── inherit2.error │ ├── inherit2.output │ ├── inherit2.tab.c │ ├── inherit2.tab.h │ ├── no_b_opt.error │ ├── no_b_opt.output │ ├── no_b_opt1.error │ ├── no_b_opt1.output │ ├── no_code_c.error │ ├── no_code_c.output │ ├── no_defines.error │ ├── no_defines.output │ ├── no_graph.error │ ├── no_graph.output │ ├── no_include.error │ ├── no_include.output │ ├── no_opts.error │ ├── no_opts.output │ ├── no_output.error │ ├── no_output.output │ ├── no_output1.error │ ├── no_output1.output │ ├── no_output2.error │ ├── no_output2.output │ ├── no_p_opt.error │ ├── no_p_opt.output │ ├── no_p_opt1.error │ ├── no_p_opt1.output │ ├── no_verbose.error │ ├── no_verbose.output │ ├── nostdin.error │ ├── nostdin.output │ ├── ok_syntax1.error │ ├── ok_syntax1.output │ ├── ok_syntax1.tab.c │ ├── ok_syntax1.tab.h │ ├── pure_calc.error │ ├── pure_calc.output │ ├── pure_calc.tab.c │ ├── pure_calc.tab.h │ ├── pure_error.error │ ├── pure_error.output │ ├── pure_error.tab.c │ ├── pure_error.tab.h │ ├── quote_calc-s.error │ ├── quote_calc-s.output │ ├── quote_calc-s.tab.c │ ├── quote_calc-s.tab.h │ ├── quote_calc.error │ ├── quote_calc.output │ ├── quote_calc.tab.c │ ├── quote_calc.tab.h │ ├── quote_calc2-s.error │ ├── quote_calc2-s.output │ ├── quote_calc2-s.tab.c │ ├── quote_calc2-s.tab.h │ ├── quote_calc2.error │ ├── quote_calc2.output │ ├── quote_calc2.tab.c │ ├── quote_calc2.tab.h │ ├── quote_calc3-s.error │ ├── quote_calc3-s.output │ ├── quote_calc3-s.tab.c │ ├── quote_calc3-s.tab.h │ ├── quote_calc3.error │ ├── quote_calc3.output │ ├── quote_calc3.tab.c │ ├── quote_calc3.tab.h │ ├── quote_calc4-s.error │ ├── quote_calc4-s.output │ ├── quote_calc4-s.tab.c │ ├── quote_calc4-s.tab.h │ ├── quote_calc4.error │ ├── quote_calc4.output │ ├── quote_calc4.tab.c │ ├── quote_calc4.tab.h │ ├── rename_debug.c │ ├── rename_debug.error │ ├── rename_debug.h │ ├── rename_debug.i │ ├── rename_debug.output │ ├── varsyntax_calc1.error │ ├── varsyntax_calc1.output │ ├── varsyntax_calc1.tab.c │ └── varsyntax_calc1.tab.h ├── btyacc_calc1.y ├── btyacc_demo.y ├── btyacc_destroy1.y ├── btyacc_destroy2.y ├── btyacc_destroy3.y ├── calc.y ├── calc1.y ├── calc2.y ├── calc3.y ├── code_calc.y ├── code_debug.y ├── code_error.y ├── empty.y ├── err_inherit1.y ├── err_inherit2.y ├── err_inherit3.y ├── err_inherit4.y ├── err_inherit5.y ├── err_syntax1.y ├── err_syntax10.y ├── err_syntax11.y ├── err_syntax12.y ├── err_syntax13.y ├── err_syntax14.y ├── err_syntax15.y ├── err_syntax16.y ├── err_syntax17.y ├── err_syntax18.y ├── err_syntax19.y ├── err_syntax2.y ├── err_syntax20.y ├── err_syntax21.y ├── err_syntax22.y ├── err_syntax23.y ├── err_syntax24.y ├── err_syntax25.y ├── err_syntax26.y ├── err_syntax27.y ├── err_syntax3.y ├── err_syntax4.y ├── err_syntax5.y ├── err_syntax6.y ├── err_syntax7.y ├── err_syntax7a.y ├── err_syntax7b.y ├── err_syntax8.y ├── err_syntax8a.y ├── err_syntax9.y ├── error.y ├── grammar.y ├── inherit0.y ├── inherit1.y ├── inherit2.y ├── ok_syntax1.y ├── pure_calc.y ├── pure_error.y ├── quote_calc.y ├── quote_calc2.y ├── quote_calc3.y ├── quote_calc4.y ├── run_lint.sh ├── run_make.sh ├── run_test.sh ├── varsyntax_calc1.y └── yacc │ ├── big_b.error │ ├── big_b.output │ ├── big_l.error │ ├── big_l.output │ ├── calc.error │ ├── calc.output │ ├── calc.tab.c │ ├── calc.tab.h │ ├── calc1.error │ ├── calc1.output │ ├── calc1.tab.c │ ├── calc1.tab.h │ ├── calc2.error │ ├── calc2.output │ ├── calc2.tab.c │ ├── calc2.tab.h │ ├── calc3.error │ ├── calc3.output │ ├── calc3.tab.c │ ├── calc3.tab.h │ ├── code_calc.code.c │ ├── code_calc.error │ ├── code_calc.output │ ├── code_calc.tab.c │ ├── code_calc.tab.h │ ├── code_error.code.c │ ├── code_error.error │ ├── code_error.output │ ├── code_error.tab.c │ ├── code_error.tab.h │ ├── empty.error │ ├── empty.output │ ├── empty.tab.c │ ├── empty.tab.h │ ├── err_syntax1.error │ ├── err_syntax1.output │ ├── err_syntax1.tab.c │ ├── err_syntax1.tab.h │ ├── err_syntax10.error │ ├── err_syntax10.output │ ├── err_syntax10.tab.c │ ├── err_syntax10.tab.h │ ├── err_syntax11.error │ ├── err_syntax11.output │ ├── err_syntax11.tab.c │ ├── err_syntax11.tab.h │ ├── err_syntax12.error │ ├── err_syntax12.output │ ├── err_syntax12.tab.c │ ├── err_syntax12.tab.h │ ├── err_syntax13.error │ ├── err_syntax13.output │ ├── err_syntax13.tab.c │ ├── err_syntax13.tab.h │ ├── err_syntax14.error │ ├── err_syntax14.output │ ├── err_syntax14.tab.c │ ├── err_syntax14.tab.h │ ├── err_syntax15.error │ ├── err_syntax15.output │ ├── err_syntax15.tab.c │ ├── err_syntax15.tab.h │ ├── err_syntax16.error │ ├── err_syntax16.output │ ├── err_syntax16.tab.c │ ├── err_syntax16.tab.h │ ├── err_syntax17.error │ ├── err_syntax17.output │ ├── err_syntax17.tab.c │ ├── err_syntax17.tab.h │ ├── err_syntax18.error │ ├── err_syntax18.output │ ├── err_syntax18.tab.c │ ├── err_syntax18.tab.h │ ├── err_syntax19.error │ ├── err_syntax19.output │ ├── err_syntax19.tab.c │ ├── err_syntax19.tab.h │ ├── err_syntax2.error │ ├── err_syntax2.output │ ├── err_syntax2.tab.c │ ├── err_syntax2.tab.h │ ├── err_syntax20.error │ ├── err_syntax20.output │ ├── err_syntax20.tab.c │ ├── err_syntax20.tab.h │ ├── err_syntax21.error │ ├── err_syntax21.output │ ├── err_syntax21.tab.c │ ├── err_syntax21.tab.h │ ├── err_syntax22.error │ ├── err_syntax22.output │ ├── err_syntax22.tab.c │ ├── err_syntax22.tab.h │ ├── err_syntax23.error │ ├── err_syntax23.output │ ├── err_syntax23.tab.c │ ├── err_syntax23.tab.h │ ├── err_syntax24.error │ ├── err_syntax24.output │ ├── err_syntax24.tab.c │ ├── err_syntax24.tab.h │ ├── err_syntax25.error │ ├── err_syntax25.output │ ├── err_syntax25.tab.c │ ├── err_syntax25.tab.h │ ├── err_syntax26.error │ ├── err_syntax26.output │ ├── err_syntax26.tab.c │ ├── err_syntax26.tab.h │ ├── err_syntax27.error │ ├── err_syntax27.output │ ├── err_syntax27.tab.c │ ├── err_syntax27.tab.h │ ├── err_syntax3.error │ ├── err_syntax3.output │ ├── err_syntax3.tab.c │ ├── err_syntax3.tab.h │ ├── err_syntax4.error │ ├── err_syntax4.output │ ├── err_syntax4.tab.c │ ├── err_syntax4.tab.h │ ├── err_syntax5.error │ ├── err_syntax5.output │ ├── err_syntax5.tab.c │ ├── err_syntax5.tab.h │ ├── err_syntax6.error │ ├── err_syntax6.output │ ├── err_syntax6.tab.c │ ├── err_syntax6.tab.h │ ├── err_syntax7.error │ ├── err_syntax7.output │ ├── err_syntax7.tab.c │ ├── err_syntax7.tab.h │ ├── err_syntax7a.error │ ├── err_syntax7a.output │ ├── err_syntax7a.tab.c │ ├── err_syntax7a.tab.h │ ├── err_syntax7b.error │ ├── err_syntax7b.output │ ├── err_syntax7b.tab.c │ ├── err_syntax7b.tab.h │ ├── err_syntax8.error │ ├── err_syntax8.output │ ├── err_syntax8.tab.c │ ├── err_syntax8.tab.h │ ├── err_syntax8a.error │ ├── err_syntax8a.output │ ├── err_syntax8a.tab.c │ ├── err_syntax8a.tab.h │ ├── err_syntax9.error │ ├── err_syntax9.output │ ├── err_syntax9.tab.c │ ├── err_syntax9.tab.h │ ├── error.error │ ├── error.output │ ├── error.tab.c │ ├── error.tab.h │ ├── grammar.dot │ ├── grammar.error │ ├── grammar.output │ ├── grammar.tab.c │ ├── grammar.tab.h │ ├── help.error │ ├── help.output │ ├── no_b_opt.error │ ├── no_b_opt.output │ ├── no_b_opt1.error │ ├── no_b_opt1.output │ ├── no_code_c.error │ ├── no_code_c.output │ ├── no_defines.error │ ├── no_defines.output │ ├── no_graph.error │ ├── no_graph.output │ ├── no_include.error │ ├── no_include.output │ ├── no_opts.error │ ├── no_opts.output │ ├── no_output.error │ ├── no_output.output │ ├── no_output1.error │ ├── no_output1.output │ ├── no_output2.error │ ├── no_output2.output │ ├── no_p_opt.error │ ├── no_p_opt.output │ ├── no_p_opt1.error │ ├── no_p_opt1.output │ ├── no_verbose.error │ ├── no_verbose.output │ ├── nostdin.error │ ├── nostdin.output │ ├── ok_syntax1.error │ ├── ok_syntax1.output │ ├── ok_syntax1.tab.c │ ├── ok_syntax1.tab.h │ ├── pure_calc.error │ ├── pure_calc.output │ ├── pure_calc.tab.c │ ├── pure_calc.tab.h │ ├── pure_error.error │ ├── pure_error.output │ ├── pure_error.tab.c │ ├── pure_error.tab.h │ ├── quote_calc-s.error │ ├── quote_calc-s.output │ ├── quote_calc-s.tab.c │ ├── quote_calc-s.tab.h │ ├── quote_calc.error │ ├── quote_calc.output │ ├── quote_calc.tab.c │ ├── quote_calc.tab.h │ ├── quote_calc2-s.error │ ├── quote_calc2-s.output │ ├── quote_calc2-s.tab.c │ ├── quote_calc2-s.tab.h │ ├── quote_calc2.error │ ├── quote_calc2.output │ ├── quote_calc2.tab.c │ ├── quote_calc2.tab.h │ ├── quote_calc3-s.error │ ├── quote_calc3-s.output │ ├── quote_calc3-s.tab.c │ ├── quote_calc3-s.tab.h │ ├── quote_calc3.error │ ├── quote_calc3.output │ ├── quote_calc3.tab.c │ ├── quote_calc3.tab.h │ ├── quote_calc4-s.error │ ├── quote_calc4-s.output │ ├── quote_calc4-s.tab.c │ ├── quote_calc4-s.tab.h │ ├── quote_calc4.error │ ├── quote_calc4.output │ ├── quote_calc4.tab.c │ ├── quote_calc4.tab.h │ ├── rename_debug.c │ ├── rename_debug.error │ ├── rename_debug.h │ ├── rename_debug.i │ ├── rename_debug.output │ ├── varsyntax_calc1.error │ ├── varsyntax_calc1.output │ ├── varsyntax_calc1.tab.c │ └── varsyntax_calc1.tab.h ├── verbose.c ├── vmsbuild.com ├── warshall.c ├── yacc.1 ├── yaccpar.c └── yaccpar.skel /ACKNOWLEDGEMENTS: -------------------------------------------------------------------------------- 1 | Berkeley Yacc owes much to the unflagging efforts of Keith Bostic. 2 | His badgering kept me working on it long after I was ready to quit. 3 | 4 | Berkeley Yacc is based on the excellent algorithm for computing LALR(1) 5 | lookaheads developed by Tom Pennello and Frank DeRemer. The algorithm is 6 | described in their almost impenetrable article in TOPLAS 4,4. 7 | 8 | Finally, much of the credit for the latest version must go to those 9 | who pointed out deficiencies of my earlier releases. Among the most 10 | prolific contributors were 11 | 12 | Benson I. Margulies 13 | Dave Gentzel 14 | Antoine Verheijen 15 | Peter S. Housel 16 | Dale Smith 17 | Ozan Yigit 18 | John Campbell 19 | Bill Sommerfeld 20 | Paul Hilfinger 21 | Gary Bridgewater 22 | Dave Bakken 23 | Dan Lanciani 24 | Richard Sargent 25 | Parag Patel 26 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | -- $Id: AUTHORS,v 1.1 2010/06/06 20:31:51 tom Exp $ 2 | -- vile:txtmode 3 | -- This file is used by a script that collects contributor information and 4 | -- resolves nicknames vs fullnames. 5 | dickey Thomas Dickey 6 | schmitz Sylvain Schmitz 7 | unknown Robert Corbett 8 | -------------------------------------------------------------------------------- /Makefile.old: -------------------------------------------------------------------------------- 1 | DEST = . 2 | 3 | HDRS = defs.h 4 | 5 | CFLAGS = -O -DNDEBUG 6 | 7 | LDFLAGS = 8 | 9 | LIBS = 10 | 11 | LINKER = cc 12 | 13 | MAKEFILE = Makefile 14 | 15 | OBJS = closure.o \ 16 | error.o \ 17 | lalr.o \ 18 | lr0.o \ 19 | main.o \ 20 | mkpar.o \ 21 | output.o \ 22 | reader.o \ 23 | skeleton.o \ 24 | symtab.o \ 25 | verbose.o \ 26 | warshall.o 27 | 28 | PRINT = pr -f -l88 29 | 30 | PROGRAM = yacc 31 | 32 | SRCS = closure.c \ 33 | error.c \ 34 | lalr.c \ 35 | lr0.c \ 36 | main.c \ 37 | mkpar.c \ 38 | output.c \ 39 | reader.c \ 40 | skeleton.c \ 41 | symtab.c \ 42 | verbose.c \ 43 | warshall.c 44 | 45 | all: $(PROGRAM) 46 | 47 | $(PROGRAM): $(OBJS) $(LIBS) 48 | @echo -n "Loading $(PROGRAM) ... " 49 | @$(LINKER) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS) 50 | @echo "done" 51 | 52 | clean:; @rm -f $(OBJS) 53 | 54 | clobber:; @rm -f $(OBJS) $(PROGRAM) 55 | 56 | depend:; @mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DEST=$(DEST) 57 | 58 | index:; @ctags -wx $(HDRS) $(SRCS) 59 | 60 | install: $(PROGRAM) 61 | @echo Installing $(PROGRAM) in $(DEST) 62 | @install -s $(PROGRAM) $(DEST) 63 | 64 | listing:; @$(PRINT) Makefile $(HDRS) $(SRCS) | lpr 65 | 66 | lint:; @lint $(SRCS) 67 | 68 | program: $(PROGRAM) 69 | 70 | tags: $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS) 71 | 72 | ### 73 | closure.o: defs.h 74 | error.o: defs.h 75 | lalr.o: defs.h 76 | lr0.o: defs.h 77 | main.o: defs.h 78 | mkpar.o: defs.h 79 | output.o: defs.h 80 | reader.o: defs.h 81 | skeleton.o: defs.h 82 | symtab.o: defs.h 83 | verbose.o: defs.h 84 | warshall.o: defs.h 85 | -------------------------------------------------------------------------------- /NOTES: -------------------------------------------------------------------------------- 1 | Berkeley Yacc reflects its origins. The reason so many routines 2 | use exactly six register variables is that Berkeley Yacc was 3 | developed on a VAX using PCC. PCC placed at most six variables 4 | in registers. I went to considerable effort to find which six 5 | variables most belonged in registers. Changes in machines and 6 | compilers make that effort worthless, perhaps even harmful. 7 | 8 | The code contains many instances where address calculations are 9 | performed in particular ways to optimize the code for the VAX. 10 | -------------------------------------------------------------------------------- /NO_WARRANTY: -------------------------------------------------------------------------------- 1 | Berkeley Yacc is distributed with no warranty whatever. The author 2 | and any other contributors take no responsibility for the consequences of 3 | its use. 4 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | -- $Id: README,v 1.2 2004/03/28 17:24:53 tom Exp $ 2 | 3 | The original README is below. I've updated this version of Berkeley Yacc 4 | to make it ANSI C compliant - Thomas Dickey 5 | 6 | ------------------------------------------------------------------------------- 7 | Berkeley Yacc is an LALR(1) parser generator. Berkeley Yacc has been made 8 | as compatible as possible with AT&T Yacc. Berkeley Yacc can accept any input 9 | specification that conforms to the AT&T Yacc documentation. Specifications 10 | that take advantage of undocumented features of AT&T Yacc will probably be 11 | rejected. 12 | 13 | Berkeley Yacc is distributed with no warranty whatever. The code is certain 14 | to contain errors. Neither the author nor any contributor takes responsibility 15 | for any consequences of its use. 16 | 17 | Berkeley Yacc is in the public domain. The data structures and algorithms 18 | used in Berkeley Yacc are all either taken from documents available to the 19 | general public or are inventions of the author. Anyone may freely distribute 20 | source or binary forms of Berkeley Yacc whether unchanged or modified. 21 | Distributers may charge whatever fees they can obtain for Berkeley Yacc. 22 | Programs generated by Berkeley Yacc may be distributed freely. 23 | 24 | Please report bugs to 25 | 26 | robert.corbett@eng.Sun.COM 27 | 28 | Include a small example if possible. Please include the banner string from 29 | skeleton.c with the bug report. Do not expect rapid responses. 30 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 20141128 2 | -------------------------------------------------------------------------------- /descrip.mms: -------------------------------------------------------------------------------- 1 | CFLAGS = /decc $(CC_OPTIONS)/Diagnostics /Define=(NDEBUG) /Object=$@ /Include=([]) 2 | 3 | LINKFLAGS = /map=$(MMS$TARGET_NAME)/cross_reference/exec=$(MMS$TARGET_NAME).exe 4 | 5 | LINKER = cc 6 | 7 | OBJS = closure.obj, \ 8 | error.obj,graph.obj, \ 9 | lalr.obj, \ 10 | lr0.obj, \ 11 | main.obj, \ 12 | mkpar.obj,mstring.obj, \ 13 | output.obj, \ 14 | reader.obj, \ 15 | yaccpar.obj, \ 16 | symtab.obj, \ 17 | verbose.obj, \ 18 | warshall.obj 19 | 20 | PROGRAM = yacc.exe 21 | 22 | all : $(PROGRAM) 23 | @ write sys$output "All done" 24 | 25 | $(PROGRAM) : $(OBJS) 26 | @ write sys$output "Loading $(PROGRAM) ... " 27 | @ $(LINK) $(LINKFLAGS) $(OBJS) 28 | @ write sys$output "done" 29 | 30 | clean : 31 | @- if f$search("*.obj") .nes. "" then delete *.obj;* 32 | @- if f$search("*.lis") .nes. "" then delete *.lis;* 33 | @- if f$search("*.log") .nes. "" then delete *.log;* 34 | 35 | clobber : clean 36 | @- if f$search("*.exe") .nes. "" then delete *.exe;* 37 | 38 | $(OBJS) : defs.h 39 | 40 | closure.obj : closure.c 41 | error.obj : error.c 42 | graph.obj : graph.c 43 | lalr.obj : lalr.c 44 | lr0.obj : lr0.c 45 | main.obj : main.c 46 | mkpar.obj : mkpar.c 47 | mstring.obj : mstring.c 48 | output.obj : output.c 49 | reader.obj : reader.c 50 | yaccpar.obj : yaccpar.c 51 | symtab.obj : symtab.c 52 | verbose.obj : verbose.c 53 | warshall.obj : warshall.c 54 | -------------------------------------------------------------------------------- /package/debian/compat: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /package/debian/control: -------------------------------------------------------------------------------- 1 | Source: byacc 2 | Maintainer: Dave Beckett 3 | Section: devel 4 | Priority: extra 5 | Standards-Version: 3.8.4 6 | Build-Depends: debhelper (>= 5) 7 | Homepage: http://invisible-island.net/byacc/ 8 | 9 | Package: byacc 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Description: public domain Berkeley LALR Yacc parser generator 13 | This package provides a parser generator utility that reads a grammar 14 | specification from a file and generates an LR(1) parser for it. The 15 | parsers consist of a set of LALR(1) parsing tables and a driver 16 | routine written in the C programming language. It has a public domain 17 | license which includes the generated C. 18 | -------------------------------------------------------------------------------- /package/debian/docs: -------------------------------------------------------------------------------- 1 | README 2 | ACKNOWLEDGEMENTS 3 | NEW_FEATURES 4 | NOTES 5 | -------------------------------------------------------------------------------- /package/debian/postinst: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # postinst script for byacc 3 | 4 | set -e 5 | 6 | if [ $1 != "upgrade" ] ; then 7 | update-alternatives \ 8 | --install /usr/bin/yacc yacc /usr/bin/byacc 80 \ 9 | --slave /usr/share/man/man1/yacc.1.gz yaccman \ 10 | /usr/share/man/man1/byacc.1.gz 11 | fi 12 | 13 | #DEBHELPER# 14 | 15 | exit 0 16 | -------------------------------------------------------------------------------- /package/debian/prerm: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # prerm script for byacc 3 | 4 | set -e 5 | 6 | if [ $1 != "upgrade" ]; then 7 | update-alternatives --remove yacc /usr/bin/byacc 8 | fi 9 | 10 | #DEBHELPER# 11 | 12 | exit 0 13 | -------------------------------------------------------------------------------- /package/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /package/debian/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | 3 | opts=passive ftp://invisible-island.net/byacc/byacc-(\d+)\.tgz \ 4 | debian uupdate 5 | -------------------------------------------------------------------------------- /package/pkgsrc/DESCR: -------------------------------------------------------------------------------- 1 | Berkeley Yacc (byacc) is a LALR(1) parser generator. Berkeley Yacc 2 | has been made as compatible as possible with AT&T Yacc. Berkeley 3 | Yacc can accept any input specification that conforms to the AT&T 4 | Yacc documentation. 5 | 6 | Some programs depend on a byacc (instead of bison). 7 | -------------------------------------------------------------------------------- /package/pkgsrc/Makefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $ 2 | # 3 | 4 | DISTNAME= byacc-20141128 5 | PKGREVISION= 1 6 | CATEGORIES= devel 7 | MASTER_SITES= ftp://invisible-island.net/byacc/ 8 | EXTRACT_SUFX= .tgz 9 | 10 | MAINTAINER= pkgsrc-users@NetBSD.org 11 | HOMEPAGE= http://dickey.his.com/byacc/byacc.html 12 | COMMENT= Berkeley Yacc 13 | 14 | PKG_DESTDIR_SUPPORT= user-destdir 15 | 16 | GNU_CONFIGURE= YES 17 | MAKE_FILE= makefile 18 | 19 | .include "../../mk/bsd.pkg.mk" 20 | -------------------------------------------------------------------------------- /package/pkgsrc/PLIST: -------------------------------------------------------------------------------- 1 | @comment $NetBSD: PLIST,v 1.2 2005/04/13 14:11:54 wiz Exp $ 2 | bin/yacc 3 | man/man1/yacc.1 4 | -------------------------------------------------------------------------------- /package/pkgsrc/distinfo: -------------------------------------------------------------------------------- 1 | $NetBSD: distinfo,v 1.4 2008/07/24 17:13:00 tonnerre Exp $ 2 | 3 | SHA1 (byacc-20050813.tgz) = 3258494f3422eb3150944c1823af1c9c2c386062 4 | RMD160 (byacc-20050813.tgz) = 3ee159857a79025a83e2b0807577925fe460f816 5 | Size (byacc-20050813.tgz) = 138684 bytes 6 | SHA1 (patch-aa) = decae78775a5e0f1e1f7aaaa258da53903aa1f7a 7 | -------------------------------------------------------------------------------- /test/README: -------------------------------------------------------------------------------- 1 | -- $Id: README,v 1.1 2004/03/28 19:10:48 tom Exp $ 2 | 3 | The files in this directory are input (.y) and output (.output, .tab.c, .tab.h) 4 | examples. 5 | -------------------------------------------------------------------------------- /test/btyacc/big_b.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/big_b.error -------------------------------------------------------------------------------- /test/btyacc/big_b.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/btyacc/big_l.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/big_l.error -------------------------------------------------------------------------------- /test/btyacc/big_l.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/btyacc/btyacc_calc1.error: -------------------------------------------------------------------------------- 1 | YACC: 17 shift/reduce conflicts, 27 reduce/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/btyacc/btyacc_calc1.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _calc1__defines_h_ 2 | #define _calc1__defines_h_ 3 | 4 | #define DREG 257 5 | #define VREG 258 6 | #define CONST 259 7 | #define UMINUS 260 8 | #ifdef YYSTYPE 9 | #undef YYSTYPE_IS_DECLARED 10 | #define YYSTYPE_IS_DECLARED 1 11 | #endif 12 | #ifndef YYSTYPE_IS_DECLARED 13 | #define YYSTYPE_IS_DECLARED 1 14 | typedef union 15 | { 16 | int ival; 17 | double dval; 18 | INTERVAL vval; 19 | } YYSTYPE; 20 | #endif /* !YYSTYPE_IS_DECLARED */ 21 | extern YYSTYPE calc1_lval; 22 | 23 | #endif /* _calc1__defines_h_ */ 24 | -------------------------------------------------------------------------------- /test/btyacc/btyacc_demo.error: -------------------------------------------------------------------------------- 1 | YACC: 7 shift/reduce conflicts, 5 reduce/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/btyacc/btyacc_demo.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _demo__defines_h_ 2 | #define _demo__defines_h_ 3 | 4 | #define PREFIX 257 5 | #define POSTFIX 258 6 | #define ID 259 7 | #define CONSTANT 260 8 | #define EXTERN 261 9 | #define REGISTER 262 10 | #define STATIC 263 11 | #define CONST 264 12 | #define VOLATILE 265 13 | #define IF 266 14 | #define THEN 267 15 | #define ELSE 268 16 | #define CLCL 269 17 | #ifdef YYSTYPE 18 | #undef YYSTYPE_IS_DECLARED 19 | #define YYSTYPE_IS_DECLARED 1 20 | #endif 21 | #ifndef YYSTYPE_IS_DECLARED 22 | #define YYSTYPE_IS_DECLARED 1 23 | typedef union { 24 | Scope *scope; 25 | Expr *expr; 26 | Expr_List *elist; 27 | Type *type; 28 | Decl *decl; 29 | Decl_List *dlist; 30 | Code *code; 31 | char *id; 32 | } YYSTYPE; 33 | #endif /* !YYSTYPE_IS_DECLARED */ 34 | extern YYSTYPE demo_lval; 35 | 36 | #endif /* _demo__defines_h_ */ 37 | -------------------------------------------------------------------------------- /test/btyacc/btyacc_demo2.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 82 of "./btyacc_demo2.y", $$ is untyped 2 | -------------------------------------------------------------------------------- /test/btyacc/btyacc_demo2.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/btyacc_demo2.output -------------------------------------------------------------------------------- /test/btyacc/btyacc_demo2.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/btyacc_demo2.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/btyacc_demo2.tab.h -------------------------------------------------------------------------------- /test/btyacc/btyacc_destroy1.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/btyacc_destroy1.error -------------------------------------------------------------------------------- /test/btyacc/btyacc_destroy1.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _destroy1__defines_h_ 2 | #define _destroy1__defines_h_ 3 | 4 | #define GLOBAL 257 5 | #define LOCAL 258 6 | #define REAL 259 7 | #define INTEGER 260 8 | #define NAME 261 9 | #ifdef YYSTYPE 10 | #undef YYSTYPE_IS_DECLARED 11 | #define YYSTYPE_IS_DECLARED 1 12 | #endif 13 | #ifndef YYSTYPE_IS_DECLARED 14 | #define YYSTYPE_IS_DECLARED 1 15 | typedef union 16 | { 17 | class cval; 18 | type tval; 19 | namelist * nlist; 20 | name id; 21 | } YYSTYPE; 22 | #endif /* !YYSTYPE_IS_DECLARED */ 23 | extern YYSTYPE destroy1_lval; 24 | 25 | #endif /* _destroy1__defines_h_ */ 26 | -------------------------------------------------------------------------------- /test/btyacc/btyacc_destroy2.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/btyacc_destroy2.error -------------------------------------------------------------------------------- /test/btyacc/btyacc_destroy2.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _destroy2__defines_h_ 2 | #define _destroy2__defines_h_ 3 | 4 | #define GLOBAL 257 5 | #define LOCAL 258 6 | #define REAL 259 7 | #define INTEGER 260 8 | #define NAME 261 9 | #ifdef YYSTYPE 10 | #undef YYSTYPE_IS_DECLARED 11 | #define YYSTYPE_IS_DECLARED 1 12 | #endif 13 | #ifndef YYSTYPE_IS_DECLARED 14 | #define YYSTYPE_IS_DECLARED 1 15 | typedef union 16 | { 17 | class cval; 18 | type tval; 19 | namelist * nlist; 20 | name id; 21 | } YYSTYPE; 22 | #endif /* !YYSTYPE_IS_DECLARED */ 23 | extern YYSTYPE destroy2_lval; 24 | 25 | #endif /* _destroy2__defines_h_ */ 26 | -------------------------------------------------------------------------------- /test/btyacc/btyacc_destroy3.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/btyacc_destroy3.error -------------------------------------------------------------------------------- /test/btyacc/btyacc_destroy3.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _destroy3__defines_h_ 2 | #define _destroy3__defines_h_ 3 | 4 | #define GLOBAL 257 5 | #define LOCAL 258 6 | #define REAL 259 7 | #define INTEGER 260 8 | #define NAME 261 9 | #ifdef YYSTYPE 10 | #undef YYSTYPE_IS_DECLARED 11 | #define YYSTYPE_IS_DECLARED 1 12 | #endif 13 | #ifndef YYSTYPE_IS_DECLARED 14 | #define YYSTYPE_IS_DECLARED 1 15 | typedef union 16 | { 17 | class cval; 18 | type tval; 19 | namelist * nlist; 20 | name id; 21 | } YYSTYPE; 22 | #endif /* !YYSTYPE_IS_DECLARED */ 23 | extern YYSTYPE destroy3_lval; 24 | 25 | #endif /* _destroy3__defines_h_ */ 26 | -------------------------------------------------------------------------------- /test/btyacc/calc.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/calc.error -------------------------------------------------------------------------------- /test/btyacc/calc.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _calc__defines_h_ 2 | #define _calc__defines_h_ 3 | 4 | #define DIGIT 257 5 | #define LETTER 258 6 | #define UMINUS 259 7 | 8 | #endif /* _calc__defines_h_ */ 9 | -------------------------------------------------------------------------------- /test/btyacc/calc1.error: -------------------------------------------------------------------------------- 1 | YACC: 2 rules never reduced 2 | YACC: 18 shift/reduce conflicts, 26 reduce/reduce conflicts. 3 | -------------------------------------------------------------------------------- /test/btyacc/calc1.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _calc1__defines_h_ 2 | #define _calc1__defines_h_ 3 | 4 | #define DREG 257 5 | #define VREG 258 6 | #define CONST 259 7 | #define UMINUS 260 8 | #ifdef YYSTYPE 9 | #undef YYSTYPE_IS_DECLARED 10 | #define YYSTYPE_IS_DECLARED 1 11 | #endif 12 | #ifndef YYSTYPE_IS_DECLARED 13 | #define YYSTYPE_IS_DECLARED 1 14 | typedef union 15 | { 16 | int ival; 17 | double dval; 18 | INTERVAL vval; 19 | } YYSTYPE; 20 | #endif /* !YYSTYPE_IS_DECLARED */ 21 | extern YYSTYPE calc1_lval; 22 | 23 | #endif /* _calc1__defines_h_ */ 24 | -------------------------------------------------------------------------------- /test/btyacc/calc2.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/calc2.error -------------------------------------------------------------------------------- /test/btyacc/calc2.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _calc2__defines_h_ 2 | #define _calc2__defines_h_ 3 | 4 | #define DIGIT 257 5 | #define LETTER 258 6 | #define UMINUS 259 7 | 8 | #endif /* _calc2__defines_h_ */ 9 | -------------------------------------------------------------------------------- /test/btyacc/calc3.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/calc3.error -------------------------------------------------------------------------------- /test/btyacc/calc3.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _calc3__defines_h_ 2 | #define _calc3__defines_h_ 3 | 4 | #define DIGIT 257 5 | #define LETTER 258 6 | #define UMINUS 259 7 | 8 | #endif /* _calc3__defines_h_ */ 9 | -------------------------------------------------------------------------------- /test/btyacc/code_calc.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/code_calc.error -------------------------------------------------------------------------------- /test/btyacc/code_calc.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _calc__defines_h_ 2 | #define _calc__defines_h_ 3 | 4 | #define DIGIT 257 5 | #define LETTER 258 6 | #define UMINUS 259 7 | 8 | #endif /* _calc__defines_h_ */ 9 | -------------------------------------------------------------------------------- /test/btyacc/code_debug.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/code_debug.error -------------------------------------------------------------------------------- /test/btyacc/code_debug.h: -------------------------------------------------------------------------------- 1 | #ifndef _yy_defines_h_ 2 | #define _yy_defines_h_ 3 | 4 | #define YYERRCODE 256 5 | 6 | #endif /* _yy_defines_h_ */ 7 | -------------------------------------------------------------------------------- /test/btyacc/code_debug.i: -------------------------------------------------------------------------------- 1 | #define YYPREFIX "yy" 2 | 3 | #define YYPURE 0 4 | 5 | #line 2 "code_debug.y" 6 | 7 | #ifdef YYBISON 8 | int yylex(void); 9 | static void yyerror(const char *); 10 | #endif 11 | 12 | 13 | #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED) 14 | /* Default: YYSTYPE is the semantic value type. */ 15 | typedef int YYSTYPE; 16 | # define YYSTYPE_IS_DECLARED 1 17 | #endif 18 | 19 | /* compatibility with bison */ 20 | #ifdef YYPARSE_PARAM 21 | /* compatibility with FreeBSD */ 22 | # ifdef YYPARSE_PARAM_TYPE 23 | # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 24 | # else 25 | # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 26 | # endif 27 | #else 28 | # define YYPARSE_DECL() yyparse(void) 29 | #endif 30 | 31 | /* Parameters sent to lex. */ 32 | #ifdef YYLEX_PARAM 33 | # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 34 | # define YYLEX yylex(YYLEX_PARAM) 35 | #else 36 | # define YYLEX_DECL() yylex(void) 37 | # define YYLEX yylex() 38 | #endif 39 | 40 | /* Parameters sent to yyerror. */ 41 | #ifndef YYERROR_DECL 42 | #define YYERROR_DECL() yyerror(const char *s) 43 | #endif 44 | #ifndef YYERROR_CALL 45 | #define YYERROR_CALL(msg) yyerror(msg) 46 | #endif 47 | 48 | extern int YYPARSE_DECL(); 49 | 50 | extern int yydebug; 51 | extern int yynerrs; 52 | 53 | extern int yyerrflag; 54 | extern int yychar; 55 | extern YYSTYPE yyval; 56 | extern YYSTYPE yylval; 57 | #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 58 | extern YYLTYPE yyloc; /* position returned by actions */ 59 | extern YYLTYPE yylloc; /* position from the lexer */ 60 | #endif 61 | -------------------------------------------------------------------------------- /test/btyacc/code_debug.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 2 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | 29 | grammar parser grammar 30 | symbol# value# symbol 31 | 0 0 $end 32 | 1 256 error 33 | 2 257 $accept 34 | 3 258 S 35 | -------------------------------------------------------------------------------- /test/btyacc/code_error.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/code_error.error -------------------------------------------------------------------------------- /test/btyacc/code_error.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 2 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | 29 | grammar parser grammar 30 | symbol# value# symbol 31 | 0 0 $end 32 | 1 256 error 33 | 2 257 $accept 34 | 3 258 S 35 | -------------------------------------------------------------------------------- /test/btyacc/code_error.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _error__defines_h_ 2 | #define _error__defines_h_ 3 | 4 | 5 | #endif /* _error__defines_h_ */ 6 | -------------------------------------------------------------------------------- /test/btyacc/empty.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/empty.error -------------------------------------------------------------------------------- /test/btyacc/empty.output: -------------------------------------------------------------------------------- 1 | 0 $accept : start $end 2 | 3 | 1 start : 4 | 5 | state 0 6 | $accept : . start $end (0) 7 | start : . (1) 8 | 9 | . reduce 1 10 | 11 | start goto 1 12 | 13 | 14 | state 1 15 | $accept : start . $end (0) 16 | 17 | $end accept 18 | 19 | 20 | 2 terminals, 2 nonterminals 21 | 2 grammar rules, 2 states 22 | 23 | grammar parser grammar 24 | symbol# value# symbol 25 | 0 0 $end 26 | 1 256 error 27 | 2 257 $accept 28 | 3 258 start 29 | -------------------------------------------------------------------------------- /test/btyacc/empty.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _empty__defines_h_ 2 | #define _empty__defines_h_ 3 | 4 | 5 | #endif /* _empty__defines_h_ */ 6 | -------------------------------------------------------------------------------- /test/btyacc/err_inherit1.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 64 of "./err_inherit1.y", unterminated argument list 2 | namelist($c, $t 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_inherit1.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_inherit1.output -------------------------------------------------------------------------------- /test/btyacc/err_inherit1.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_inherit1.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_inherit1.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_inherit2.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 64 of "./err_inherit2.y", number of arguments of namelist doesn't agree with previous declaration 2 | YACC: w - line 64 of "./err_inherit2.y", type of argument 1 to namelist doesn't agree with previous declaration 3 | YACC: e - line 64 of "./err_inherit2.y", bad formal argument list 4 | namelist($c, $t, extra): namelist NAME 5 | ^ 6 | -------------------------------------------------------------------------------- /test/btyacc/err_inherit2.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_inherit2.output -------------------------------------------------------------------------------- /test/btyacc/err_inherit2.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_inherit2.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_inherit2.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_inherit3.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 64 of "./err_inherit3.y", number of arguments of namelist doesn't agree with previous declaration 2 | YACC: w - line 64 of "./err_inherit3.y", wrong number of arguments for namelist 3 | namelist: namelist($c) NAME 4 | ^ 5 | YACC: w - line 64 of "./err_inherit3.y", unknown argument $c 6 | YACC: w - line 64 of "./err_inherit3.y", untyped argument $c 7 | YACC: w - line 65 of "./err_inherit3.y", unknown argument $t 8 | { $$->s = mksymbol($t, $c, $2); 9 | ^ 10 | YACC: w - line 65 of "./err_inherit3.y", unknown argument $c 11 | { $$->s = mksymbol($t, $c, $2); 12 | ^ 13 | YACC: w - line 69 of "./err_inherit3.y", unknown argument $t 14 | { $$->s = mksymbol($t, $c, $1); 15 | ^ 16 | YACC: w - line 69 of "./err_inherit3.y", untyped argument $t 17 | YACC: w - line 69 of "./err_inherit3.y", unknown argument $c 18 | { $$->s = mksymbol($t, $c, $1); 19 | ^ 20 | YACC: w - line 69 of "./err_inherit3.y", untyped argument $c 21 | YACC: w - line 0 of "./err_inherit3.y", start symbol declaration requires arguments 22 | YACC: 1 rule never reduced 23 | YACC: 3 shift/reduce conflicts. 24 | -------------------------------------------------------------------------------- /test/btyacc/err_inherit3.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _err_inherit3__defines_h_ 2 | #define _err_inherit3__defines_h_ 3 | 4 | #define GLOBAL 257 5 | #define LOCAL 258 6 | #define REAL 259 7 | #define INTEGER 260 8 | #define NAME 261 9 | #ifdef YYSTYPE 10 | #undef YYSTYPE_IS_DECLARED 11 | #define YYSTYPE_IS_DECLARED 1 12 | #endif 13 | #ifndef YYSTYPE_IS_DECLARED 14 | #define YYSTYPE_IS_DECLARED 1 15 | typedef union 16 | { 17 | class cval; 18 | type tval; 19 | namelist * nlist; 20 | name id; 21 | } YYSTYPE; 22 | #endif /* !YYSTYPE_IS_DECLARED */ 23 | extern YYSTYPE err_inherit3_lval; 24 | 25 | #endif /* _err_inherit3__defines_h_ */ 26 | -------------------------------------------------------------------------------- /test/btyacc/err_inherit4.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 32 of "./err_inherit4.y", destructor redeclared 2 | %destructor { 3 | ^ 4 | YACC: w - line 77 of "./err_inherit4.y", wrong number of default arguments for namelist 5 | { $$ = $1; @$ = @2; } 6 | ^ 7 | YACC: w - line 77 of "./err_inherit4.y", wrong type for default argument 2 to namelist 8 | { $$ = $1; @$ = @2; } 9 | ^ 10 | YACC: w - line 77 of "./err_inherit4.y", wrong type for default argument 1 to namelist 11 | { $$ = $1; @$ = @2; } 12 | ^ 13 | YACC: w - line 77 of "./err_inherit4.y", @2 references beyond the end of the current rule 14 | -------------------------------------------------------------------------------- /test/btyacc/err_inherit4.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _err_inherit4__defines_h_ 2 | #define _err_inherit4__defines_h_ 3 | 4 | #define GLOBAL 257 5 | #define LOCAL 258 6 | #define REAL 259 7 | #define INTEGER 260 8 | #define NAME 261 9 | #ifdef YYSTYPE 10 | #undef YYSTYPE_IS_DECLARED 11 | #define YYSTYPE_IS_DECLARED 1 12 | #endif 13 | #ifndef YYSTYPE_IS_DECLARED 14 | #define YYSTYPE_IS_DECLARED 1 15 | typedef union 16 | { 17 | class cval; 18 | type tval; 19 | namelist * nlist; 20 | name id; 21 | } YYSTYPE; 22 | #endif /* !YYSTYPE_IS_DECLARED */ 23 | extern YYSTYPE err_inherit4_lval; 24 | 25 | #endif /* _err_inherit4__defines_h_ */ 26 | -------------------------------------------------------------------------------- /test/btyacc/err_inherit5.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 74 of "./err_inherit5.y", illegal @$ or @N reference 2 | -------------------------------------------------------------------------------- /test/btyacc/err_inherit5.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_inherit5.output -------------------------------------------------------------------------------- /test/btyacc/err_inherit5.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_inherit5.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_inherit5.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax1.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 1 of "./err_syntax1.y", syntax error 2 | ?% { 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax1.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax1.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax1.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax1.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax1.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax10.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 7 of "./err_syntax10.y", the type of '(' has been redeclared 2 | YACC: w - line 7 of "./err_syntax10.y", the type of '*' has been redeclared 3 | YACC: w - line 7 of "./err_syntax10.y", the type of '&' has been redeclared 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax10.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 5 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | 29 | grammar parser grammar 30 | symbol# value# symbol 31 | 0 0 $end 32 | 1 256 error 33 | 2 40 '(' 34 | 3 42 '*' 35 | 4 38 '&' 36 | 5 257 $accept 37 | 6 258 S 38 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax10.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _err_syntax10__defines_h_ 2 | #define _err_syntax10__defines_h_ 3 | 4 | 5 | #endif /* _err_syntax10__defines_h_ */ 6 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax11.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 7 of "./err_syntax11.y", the precedence of '|' has been redeclared 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax11.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 3 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | 29 | grammar parser grammar 30 | symbol# value# symbol 31 | 0 0 $end 32 | 1 256 error 33 | 2 124 '|' 34 | 3 257 $accept 35 | 4 258 S 36 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax11.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _err_syntax11__defines_h_ 2 | #define _err_syntax11__defines_h_ 3 | 4 | 5 | #endif /* _err_syntax11__defines_h_ */ 6 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax12.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 7 of "./err_syntax12.y", the value of text has been redeclared 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax12.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 3 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | 29 | grammar parser grammar 30 | symbol# value# symbol 31 | 0 0 $end 32 | 1 256 error 33 | 2 456 text 34 | 3 457 $accept 35 | 4 458 S 36 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax12.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _err_syntax12__defines_h_ 2 | #define _err_syntax12__defines_h_ 3 | 4 | #define text 456 5 | 6 | #endif /* _err_syntax12__defines_h_ */ 7 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax13.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 7 of "./err_syntax13.y", the start symbol text is a token 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax13.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax13.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax13.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax13.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax13.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax14.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 7 of "./err_syntax14.y", the start symbol has been redeclared 2 | YACC: e - the start symbol text2 is undefined 3 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax14.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax14.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax14.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax14.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax14.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax15.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 9 of "./err_syntax15.y", no grammar has been specified 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax15.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax15.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax15.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax15.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax15.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax16.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 14 of "./err_syntax16.y", a token appears on the lhs of a production 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax16.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax16.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax16.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax16.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax16.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax17.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 8 of "./err_syntax17.y", unterminated action 2 | S: { error 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax17.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax17.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax17.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax17.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax17.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax18.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 9 of "./err_syntax18.y", $4 references beyond the end of the current rule 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax18.output: -------------------------------------------------------------------------------- 1 | 0 $accept : expr $end 2 | 3 | 1 expr : '(' expr ')' 4 | 5 | state 0 6 | $accept : . expr $end (0) 7 | 8 | '(' shift 1 9 | . error 10 | 11 | expr goto 2 12 | 13 | 14 | state 1 15 | expr : '(' . expr ')' (1) 16 | 17 | '(' shift 1 18 | . error 19 | 20 | expr goto 3 21 | 22 | 23 | state 2 24 | $accept : expr . $end (0) 25 | 26 | $end accept 27 | 28 | 29 | state 3 30 | expr : '(' expr . ')' (1) 31 | 32 | ')' shift 4 33 | . error 34 | 35 | 36 | state 4 37 | expr : '(' expr ')' . (1) 38 | 39 | . reduce 1 40 | 41 | 42 | 4 terminals, 2 nonterminals 43 | 2 grammar rules, 5 states 44 | 45 | grammar parser grammar 46 | symbol# value# symbol 47 | 0 0 $end 48 | 1 256 error 49 | 2 40 '(' 50 | 3 41 ')' 51 | 4 257 $accept 52 | 5 258 expr 53 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax18.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _err_syntax18__defines_h_ 2 | #define _err_syntax18__defines_h_ 3 | 4 | 5 | #endif /* _err_syntax18__defines_h_ */ 6 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax19.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 9 of "./err_syntax19.y", illegal $-name 2 | { $$ = $; } 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax19.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax19.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax19.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax19.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax19.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax2.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 1 of "./err_syntax2.y", unmatched /* 2 | %{ /* 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax2.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax2.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax2.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax2.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax2.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax20.error: -------------------------------------------------------------------------------- 1 | YACC: w - the symbol recur is undefined 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax20.output: -------------------------------------------------------------------------------- 1 | 0 $accept : expr $end 2 | 3 | 1 expr : '(' recur ')' 4 | 5 | state 0 6 | $accept : . expr $end (0) 7 | 8 | '(' shift 1 9 | . error 10 | 11 | expr goto 2 12 | 13 | 14 | state 1 15 | expr : '(' . recur ')' (1) 16 | 17 | recur shift 3 18 | . error 19 | 20 | 21 | state 2 22 | $accept : expr . $end (0) 23 | 24 | $end accept 25 | 26 | 27 | state 3 28 | expr : '(' recur . ')' (1) 29 | 30 | ')' shift 4 31 | . error 32 | 33 | 34 | state 4 35 | expr : '(' recur ')' . (1) 36 | 37 | . reduce 1 38 | 39 | 40 | 5 terminals, 2 nonterminals 41 | 2 grammar rules, 5 states 42 | 43 | grammar parser grammar 44 | symbol# value# symbol 45 | 0 0 $end 46 | 1 256 error 47 | 2 257 recur 48 | 3 40 '(' 49 | 4 41 ')' 50 | 5 258 $accept 51 | 6 259 expr 52 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax20.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _err_syntax20__defines_h_ 2 | #define _err_syntax20__defines_h_ 3 | 4 | #define recur 257 5 | 6 | #endif /* _err_syntax20__defines_h_ */ 7 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax21.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 12 of "./err_syntax21.y", $0 is untyped 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax21.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax21.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax21.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax21.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax21.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax22.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 17 of "./err_syntax22.y", $2 (recur) is untyped 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax22.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax22.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax22.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax22.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax22.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax23.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 18 of "./err_syntax23.y", $$ is untyped 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax23.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax23.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax23.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax23.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax23.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax24.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 21 of "./err_syntax24.y", the default action assigns an undefined value to $$ 2 | YACC: e - line 22 of "./err_syntax24.y", $$ is untyped 3 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax24.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax24.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax24.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax24.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax24.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax25.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 11 of "./err_syntax25.y", too many %union declarations 2 | %union { 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax25.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax25.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax25.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax25.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax25.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax26.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax26.y", unexpected end-of-file 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax26.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax26.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax26.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax26.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax26.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax27.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 3 of "./err_syntax27.y", missing '}' 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax27.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax27.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax27.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax27.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax27.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax3.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax3.y", unterminated string 2 | %token '(' '*' '& 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax3.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax3.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax3.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax3.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax3.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax4.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 1 of "./err_syntax4.y", unmatched %{ 2 | %{ 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax4.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax4.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax4.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax4.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax4.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax5.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax5.y", unterminated %union declaration 2 | %union { 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax5.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax5.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax5.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax5.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax5.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax6.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax6.y", illegal tag 2 | %token '\777' 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax7.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax7.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax7.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax7.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax7.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax7a.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax7a.y", illegal character 2 | %token '\xfff' 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax7a.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax7a.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax7a.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax7a.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax7a.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax7b.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax7b.y", illegal character 2 | %token '\x.' 3 | ^ 4 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax7b.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax7b.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax7b.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax7b.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax7b.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax8.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax8.y", illegal use of reserved symbol . 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax8.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax8.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax8.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax8.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax8.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax8a.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax8a.y", illegal use of reserved symbol $$123 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax8a.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax8a.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax8a.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax8a.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax8a.tab.h -------------------------------------------------------------------------------- /test/btyacc/err_syntax9.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 7 of "./err_syntax9.y", the start symbol text cannot be declared to be a token 2 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax9.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax9.output -------------------------------------------------------------------------------- /test/btyacc/err_syntax9.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/btyacc/err_syntax9.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/err_syntax9.tab.h -------------------------------------------------------------------------------- /test/btyacc/error.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/error.error -------------------------------------------------------------------------------- /test/btyacc/error.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 2 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | 29 | grammar parser grammar 30 | symbol# value# symbol 31 | 0 0 $end 32 | 1 256 error 33 | 2 257 $accept 34 | 3 258 S 35 | -------------------------------------------------------------------------------- /test/btyacc/error.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _error__defines_h_ 2 | #define _error__defines_h_ 3 | 4 | 5 | #endif /* _error__defines_h_ */ 6 | -------------------------------------------------------------------------------- /test/btyacc/grammar.error: -------------------------------------------------------------------------------- 1 | YACC: 1 shift/reduce conflict, 29 reduce/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/btyacc/grammar.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _grammar__defines_h_ 2 | #define _grammar__defines_h_ 3 | 4 | #define T_IDENTIFIER 257 5 | #define T_TYPEDEF_NAME 258 6 | #define T_DEFINE_NAME 259 7 | #define T_AUTO 260 8 | #define T_EXTERN 261 9 | #define T_REGISTER 262 10 | #define T_STATIC 263 11 | #define T_TYPEDEF 264 12 | #define T_INLINE 265 13 | #define T_EXTENSION 266 14 | #define T_CHAR 267 15 | #define T_DOUBLE 268 16 | #define T_FLOAT 269 17 | #define T_INT 270 18 | #define T_VOID 271 19 | #define T_LONG 272 20 | #define T_SHORT 273 21 | #define T_SIGNED 274 22 | #define T_UNSIGNED 275 23 | #define T_ENUM 276 24 | #define T_STRUCT 277 25 | #define T_UNION 278 26 | #define T_Bool 279 27 | #define T_Complex 280 28 | #define T_Imaginary 281 29 | #define T_TYPE_QUALIFIER 282 30 | #define T_BRACKETS 283 31 | #define T_LBRACE 284 32 | #define T_MATCHRBRACE 285 33 | #define T_ELLIPSIS 286 34 | #define T_INITIALIZER 287 35 | #define T_STRING_LITERAL 288 36 | #define T_ASM 289 37 | #define T_ASMARG 290 38 | #define T_VA_DCL 291 39 | 40 | #endif /* _grammar__defines_h_ */ 41 | -------------------------------------------------------------------------------- /test/btyacc/help.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/help.error -------------------------------------------------------------------------------- /test/btyacc/help.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/btyacc/inherit0.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/inherit0.error -------------------------------------------------------------------------------- /test/btyacc/inherit0.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _inherit0__defines_h_ 2 | #define _inherit0__defines_h_ 3 | 4 | #define GLOBAL 257 5 | #define LOCAL 258 6 | #define REAL 259 7 | #define INTEGER 260 8 | #define NAME 261 9 | 10 | #endif /* _inherit0__defines_h_ */ 11 | -------------------------------------------------------------------------------- /test/btyacc/inherit1.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/inherit1.error -------------------------------------------------------------------------------- /test/btyacc/inherit1.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _inherit1__defines_h_ 2 | #define _inherit1__defines_h_ 3 | 4 | #define GLOBAL 257 5 | #define LOCAL 258 6 | #define REAL 259 7 | #define INTEGER 260 8 | #define NAME 261 9 | #ifdef YYSTYPE 10 | #undef YYSTYPE_IS_DECLARED 11 | #define YYSTYPE_IS_DECLARED 1 12 | #endif 13 | #ifndef YYSTYPE_IS_DECLARED 14 | #define YYSTYPE_IS_DECLARED 1 15 | typedef union 16 | { 17 | class cval; 18 | type tval; 19 | namelist * nlist; 20 | name id; 21 | } YYSTYPE; 22 | #endif /* !YYSTYPE_IS_DECLARED */ 23 | extern YYSTYPE inherit1_lval; 24 | 25 | #endif /* _inherit1__defines_h_ */ 26 | -------------------------------------------------------------------------------- /test/btyacc/inherit2.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/inherit2.error -------------------------------------------------------------------------------- /test/btyacc/inherit2.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _inherit2__defines_h_ 2 | #define _inherit2__defines_h_ 3 | 4 | #define GLOBAL 257 5 | #define LOCAL 258 6 | #define REAL 259 7 | #define INTEGER 260 8 | #define NAME 261 9 | #ifdef YYSTYPE 10 | #undef YYSTYPE_IS_DECLARED 11 | #define YYSTYPE_IS_DECLARED 1 12 | #endif 13 | #ifndef YYSTYPE_IS_DECLARED 14 | #define YYSTYPE_IS_DECLARED 1 15 | typedef union 16 | { 17 | class cval; 18 | type tval; 19 | namelist * nlist; 20 | name id; 21 | } YYSTYPE; 22 | #endif /* !YYSTYPE_IS_DECLARED */ 23 | extern YYSTYPE inherit2_lval; 24 | 25 | #endif /* _inherit2__defines_h_ */ 26 | -------------------------------------------------------------------------------- /test/btyacc/no_b_opt.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_b_opt.error -------------------------------------------------------------------------------- /test/btyacc/no_b_opt.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/btyacc/no_b_opt1.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_b_opt1.error -------------------------------------------------------------------------------- /test/btyacc/no_b_opt1.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.c" 2 | -------------------------------------------------------------------------------- /test/btyacc/no_code_c.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_code_c.error -------------------------------------------------------------------------------- /test/btyacc/no_code_c.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.c" 2 | -------------------------------------------------------------------------------- /test/btyacc/no_defines.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_defines.error -------------------------------------------------------------------------------- /test/btyacc/no_defines.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.h" 2 | -------------------------------------------------------------------------------- /test/btyacc/no_graph.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_graph.error -------------------------------------------------------------------------------- /test/btyacc/no_graph.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.dot" 2 | -------------------------------------------------------------------------------- /test/btyacc/no_include.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_include.error -------------------------------------------------------------------------------- /test/btyacc/no_include.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.i" 2 | -------------------------------------------------------------------------------- /test/btyacc/no_opts.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_opts.error -------------------------------------------------------------------------------- /test/btyacc/no_opts.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.y" 2 | -------------------------------------------------------------------------------- /test/btyacc/no_output.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_output.error -------------------------------------------------------------------------------- /test/btyacc/no_output.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.output" 2 | -------------------------------------------------------------------------------- /test/btyacc/no_output1.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_output1.error -------------------------------------------------------------------------------- /test/btyacc/no_output1.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.output" 2 | -------------------------------------------------------------------------------- /test/btyacc/no_output2.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_output2.error -------------------------------------------------------------------------------- /test/btyacc/no_output2.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/btyacc/no_p_opt.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_p_opt.error -------------------------------------------------------------------------------- /test/btyacc/no_p_opt.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/btyacc/no_p_opt1.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_p_opt1.error -------------------------------------------------------------------------------- /test/btyacc/no_p_opt1.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.c" 2 | -------------------------------------------------------------------------------- /test/btyacc/no_verbose.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/no_verbose.error -------------------------------------------------------------------------------- /test/btyacc/no_verbose.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.output" 2 | -------------------------------------------------------------------------------- /test/btyacc/nostdin.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/nostdin.error -------------------------------------------------------------------------------- /test/btyacc/nostdin.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/btyacc/ok_syntax1.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/ok_syntax1.error -------------------------------------------------------------------------------- /test/btyacc/ok_syntax1.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _ok_syntax1__defines_h_ 2 | #define _ok_syntax1__defines_h_ 3 | 4 | #define DIGIT 257 5 | #define LETTER 258 6 | #define OCT1 259 7 | #define HEX1 260 8 | #define HEX2 261 9 | #define HEX3 262 10 | #define STR1 263 11 | #define STR2 265 12 | #define BELL 266 13 | #define BS 267 14 | #define NL 268 15 | #define LF 269 16 | #define CR 270 17 | #define TAB 271 18 | #define VT 272 19 | #define UMINUS 273 20 | #ifdef YYSTYPE 21 | #undef YYSTYPE_IS_DECLARED 22 | #define YYSTYPE_IS_DECLARED 1 23 | #endif 24 | #ifndef YYSTYPE_IS_DECLARED 25 | #define YYSTYPE_IS_DECLARED 1 26 | typedef union 27 | { 28 | char * cval; 29 | int ival; 30 | double dval; 31 | } YYSTYPE; 32 | #endif /* !YYSTYPE_IS_DECLARED */ 33 | extern YYSTYPE ok_syntax1_lval; 34 | 35 | #endif /* _ok_syntax1__defines_h_ */ 36 | -------------------------------------------------------------------------------- /test/btyacc/pure_calc.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/pure_calc.error -------------------------------------------------------------------------------- /test/btyacc/pure_calc.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _calc__defines_h_ 2 | #define _calc__defines_h_ 3 | 4 | #define DIGIT 257 5 | #define LETTER 258 6 | #define UMINUS 259 7 | 8 | #endif /* _calc__defines_h_ */ 9 | -------------------------------------------------------------------------------- /test/btyacc/pure_error.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/pure_error.error -------------------------------------------------------------------------------- /test/btyacc/pure_error.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 2 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | 29 | grammar parser grammar 30 | symbol# value# symbol 31 | 0 0 $end 32 | 1 256 error 33 | 2 257 $accept 34 | 3 258 S 35 | -------------------------------------------------------------------------------- /test/btyacc/pure_error.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _error__defines_h_ 2 | #define _error__defines_h_ 3 | 4 | 5 | #endif /* _error__defines_h_ */ 6 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc-s.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc-s.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _quote_calc__defines_h_ 2 | #define _quote_calc__defines_h_ 3 | 4 | #define OP_ADD 257 5 | #define OP_SUB 259 6 | #define OP_MUL 261 7 | #define OP_DIV 263 8 | #define OP_MOD 265 9 | #define OP_AND 267 10 | #define DIGIT 269 11 | #define LETTER 270 12 | #define UMINUS 271 13 | 14 | #endif /* _quote_calc__defines_h_ */ 15 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _quote_calc__defines_h_ 2 | #define _quote_calc__defines_h_ 3 | 4 | #define OP_ADD 257 5 | #define ADD 258 6 | #define OP_SUB 259 7 | #define SUB 260 8 | #define OP_MUL 261 9 | #define MUL 262 10 | #define OP_DIV 263 11 | #define DIV 264 12 | #define OP_MOD 265 13 | #define MOD 266 14 | #define OP_AND 267 15 | #define AND 268 16 | #define DIGIT 269 17 | #define LETTER 270 18 | #define UMINUS 271 19 | 20 | #endif /* _quote_calc__defines_h_ */ 21 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc2-s.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc2-s.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _quote_calc2__defines_h_ 2 | #define _quote_calc2__defines_h_ 3 | 4 | #define OP_ADD 257 5 | #define OP_SUB 259 6 | #define OP_MUL 261 7 | #define OP_DIV 263 8 | #define OP_MOD 265 9 | #define OP_AND 267 10 | #define DIGIT 269 11 | #define LETTER 270 12 | #define UMINUS 271 13 | 14 | #endif /* _quote_calc2__defines_h_ */ 15 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc2.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc2.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _quote_calc2__defines_h_ 2 | #define _quote_calc2__defines_h_ 3 | 4 | #define OP_ADD 257 5 | #define ADD 258 6 | #define OP_SUB 259 7 | #define SUB 260 8 | #define OP_MUL 261 9 | #define MUL 262 10 | #define OP_DIV 263 11 | #define DIV 264 12 | #define OP_MOD 265 13 | #define MOD 266 14 | #define OP_AND 267 15 | #define AND 268 16 | #define DIGIT 269 17 | #define LETTER 270 18 | #define UMINUS 271 19 | 20 | #endif /* _quote_calc2__defines_h_ */ 21 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc3-s.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc3-s.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _quote_calc3__defines_h_ 2 | #define _quote_calc3__defines_h_ 3 | 4 | #define OP_ADD 257 5 | #define OP_SUB 259 6 | #define OP_MUL 261 7 | #define OP_DIV 263 8 | #define OP_MOD 265 9 | #define OP_AND 267 10 | #define DIGIT 269 11 | #define LETTER 270 12 | #define UMINUS 271 13 | 14 | #endif /* _quote_calc3__defines_h_ */ 15 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc3.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc3.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _quote_calc3__defines_h_ 2 | #define _quote_calc3__defines_h_ 3 | 4 | #define OP_ADD 257 5 | #define OP_SUB 259 6 | #define OP_MUL 261 7 | #define OP_DIV 263 8 | #define OP_MOD 265 9 | #define OP_AND 267 10 | #define DIGIT 269 11 | #define LETTER 270 12 | #define UMINUS 271 13 | 14 | #endif /* _quote_calc3__defines_h_ */ 15 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc4-s.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc4-s.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _quote_calc4__defines_h_ 2 | #define _quote_calc4__defines_h_ 3 | 4 | #define OP_ADD 257 5 | #define OP_SUB 259 6 | #define OP_MUL 261 7 | #define OP_DIV 263 8 | #define OP_MOD 265 9 | #define OP_AND 267 10 | #define DIGIT 269 11 | #define LETTER 270 12 | #define UMINUS 271 13 | 14 | #endif /* _quote_calc4__defines_h_ */ 15 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc4.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/btyacc/quote_calc4.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _quote_calc4__defines_h_ 2 | #define _quote_calc4__defines_h_ 3 | 4 | #define OP_ADD 257 5 | #define OP_SUB 259 6 | #define OP_MUL 261 7 | #define OP_DIV 263 8 | #define OP_MOD 265 9 | #define OP_AND 267 10 | #define DIGIT 269 11 | #define LETTER 270 12 | #define UMINUS 271 13 | 14 | #endif /* _quote_calc4__defines_h_ */ 15 | -------------------------------------------------------------------------------- /test/btyacc/rename_debug.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/btyacc/rename_debug.error -------------------------------------------------------------------------------- /test/btyacc/rename_debug.h: -------------------------------------------------------------------------------- 1 | #ifndef _yy_defines_h_ 2 | #define _yy_defines_h_ 3 | 4 | #define YYERRCODE 256 5 | 6 | #endif /* _yy_defines_h_ */ 7 | -------------------------------------------------------------------------------- /test/btyacc/rename_debug.i: -------------------------------------------------------------------------------- 1 | #define YYPREFIX "yy" 2 | 3 | #define YYPURE 0 4 | 5 | #line 2 "code_debug.y" 6 | 7 | #ifdef YYBISON 8 | int yylex(void); 9 | static void yyerror(const char *); 10 | #endif 11 | 12 | 13 | #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED) 14 | /* Default: YYSTYPE is the semantic value type. */ 15 | typedef int YYSTYPE; 16 | # define YYSTYPE_IS_DECLARED 1 17 | #endif 18 | 19 | /* compatibility with bison */ 20 | #ifdef YYPARSE_PARAM 21 | /* compatibility with FreeBSD */ 22 | # ifdef YYPARSE_PARAM_TYPE 23 | # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 24 | # else 25 | # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 26 | # endif 27 | #else 28 | # define YYPARSE_DECL() yyparse(void) 29 | #endif 30 | 31 | /* Parameters sent to lex. */ 32 | #ifdef YYLEX_PARAM 33 | # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 34 | # define YYLEX yylex(YYLEX_PARAM) 35 | #else 36 | # define YYLEX_DECL() yylex(void) 37 | # define YYLEX yylex() 38 | #endif 39 | 40 | /* Parameters sent to yyerror. */ 41 | #ifndef YYERROR_DECL 42 | #define YYERROR_DECL() yyerror(const char *s) 43 | #endif 44 | #ifndef YYERROR_CALL 45 | #define YYERROR_CALL(msg) yyerror(msg) 46 | #endif 47 | 48 | extern int YYPARSE_DECL(); 49 | 50 | extern int yydebug; 51 | extern int yynerrs; 52 | 53 | extern int yyerrflag; 54 | extern int yychar; 55 | extern YYSTYPE yyval; 56 | extern YYSTYPE yylval; 57 | #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 58 | extern YYLTYPE yyloc; /* position returned by actions */ 59 | extern YYLTYPE yylloc; /* position from the lexer */ 60 | #endif 61 | -------------------------------------------------------------------------------- /test/btyacc/rename_debug.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 2 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | 29 | grammar parser grammar 30 | symbol# value# symbol 31 | 0 0 $end 32 | 1 256 error 33 | 2 257 $accept 34 | 3 258 S 35 | -------------------------------------------------------------------------------- /test/btyacc/varsyntax_calc1.error: -------------------------------------------------------------------------------- 1 | YACC: 2 rules never reduced 2 | YACC: 18 shift/reduce conflicts, 26 reduce/reduce conflicts. 3 | -------------------------------------------------------------------------------- /test/btyacc/varsyntax_calc1.tab.h: -------------------------------------------------------------------------------- 1 | #ifndef _varsyntax_calc1__defines_h_ 2 | #define _varsyntax_calc1__defines_h_ 3 | 4 | #define DREG 257 5 | #define VREG 258 6 | #define CONST 259 7 | #define UMINUS 260 8 | #ifdef YYSTYPE 9 | #undef YYSTYPE_IS_DECLARED 10 | #define YYSTYPE_IS_DECLARED 1 11 | #endif 12 | #ifndef YYSTYPE_IS_DECLARED 13 | #define YYSTYPE_IS_DECLARED 1 14 | typedef union 15 | { 16 | int ival; /* dreg & vreg array index values*/ 17 | double dval; /* floating point values*/ 18 | INTERVAL vval; /* interval values*/ 19 | } YYSTYPE; 20 | #endif /* !YYSTYPE_IS_DECLARED */ 21 | extern YYSTYPE varsyntax_calc1_lval; 22 | 23 | #endif /* _varsyntax_calc1__defines_h_ */ 24 | -------------------------------------------------------------------------------- /test/code_debug.y: -------------------------------------------------------------------------------- 1 | %{ 2 | 3 | #ifdef YYBISON 4 | int yylex(void); 5 | static void yyerror(const char *); 6 | #endif 7 | 8 | %} 9 | %% 10 | S: error 11 | %% 12 | 13 | #include 14 | 15 | #ifdef YYBYACC 16 | extern int YYLEX_DECL(); 17 | #endif 18 | 19 | int 20 | main(void) 21 | { 22 | printf("yyparse() = %d\n", yyparse()); 23 | return 0; 24 | } 25 | 26 | int 27 | yylex(void) 28 | { 29 | return -1; 30 | } 31 | 32 | static void 33 | yyerror(const char* s) 34 | { 35 | printf("%s\n", s); 36 | } 37 | -------------------------------------------------------------------------------- /test/code_error.y: -------------------------------------------------------------------------------- 1 | %{ 2 | 3 | #ifdef YYBISON 4 | int yylex(void); 5 | static void yyerror(const char *); 6 | #endif 7 | 8 | %} 9 | %% 10 | S: error 11 | %% 12 | 13 | #include 14 | 15 | #ifdef YYBYACC 16 | extern int YYLEX_DECL(); 17 | #endif 18 | 19 | int 20 | main(void) 21 | { 22 | printf("yyparse() = %d\n", yyparse()); 23 | return 0; 24 | } 25 | 26 | int 27 | yylex(void) 28 | { 29 | return -1; 30 | } 31 | 32 | static void 33 | yyerror(const char* s) 34 | { 35 | printf("%s\n", s); 36 | } 37 | -------------------------------------------------------------------------------- /test/empty.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #ifdef YYBISON 3 | #define YYLEX_DECL() yylex(void) 4 | #define YYERROR_DECL() yyerror(const char *s) 5 | static int YYLEX_DECL(); 6 | static void YYERROR_DECL(); 7 | #endif 8 | %} 9 | %% 10 | start: ; 11 | 12 | %% 13 | 14 | #include 15 | 16 | static int 17 | YYLEX_DECL() { 18 | return -1; 19 | } 20 | 21 | static void 22 | YYERROR_DECL() { 23 | printf("%s\n",s); 24 | } 25 | -------------------------------------------------------------------------------- /test/err_inherit1.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | 4 | typedef enum {cGLOBAL, cLOCAL} class; 5 | typedef enum {tREAL, tINTEGER} type; 6 | typedef char * name; 7 | 8 | struct symbol { class c; type t; name id; }; 9 | typedef struct symbol symbol; 10 | 11 | struct namelist { symbol *s; struct namelist *next; }; 12 | typedef struct namelist namelist; 13 | 14 | extern symbol *mksymbol(type t, class c, name id); 15 | 16 | #ifdef YYBISON 17 | #define YYLEX_DECL() yylex(void) 18 | #define YYERROR_DECL() yyerror(const char *s) 19 | #endif 20 | %} 21 | 22 | %token GLOBAL LOCAL 23 | %token REAL INTEGER 24 | %token NAME 25 | 26 | %type declaration namelist(, ) locnamelist() 27 | %type class 28 | %type type 29 | 30 | %destructor { 31 | namelist *p = $$; 32 | while (p != NULL) 33 | { namelist *pp = p; 34 | p = p->next; 35 | free(pp->s); free(pp); 36 | } 37 | } 38 | 39 | %union 40 | { 41 | class cval; 42 | type tval; 43 | namelist * nlist; 44 | name id; 45 | } 46 | 47 | %start declaration 48 | 49 | %% 50 | declaration: class type namelist($1, $2) 51 | { $$ = $3; } 52 | | type locnamelist($1) 53 | { $$ = $2; } 54 | ; 55 | 56 | class : GLOBAL { $$ = cGLOBAL; } 57 | | LOCAL { $$ = cLOCAL; } 58 | ; 59 | 60 | type : REAL { $$ = tREAL; } 61 | | INTEGER { $$ = tINTEGER; } 62 | ; 63 | 64 | namelist($c, $t 65 | -------------------------------------------------------------------------------- /test/err_inherit3.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | 4 | typedef enum {cGLOBAL, cLOCAL} class; 5 | typedef enum {tREAL, tINTEGER} type; 6 | typedef char * name; 7 | 8 | struct symbol { class c; type t; name id; }; 9 | typedef struct symbol symbol; 10 | 11 | struct namelist { symbol *s; struct namelist *next; }; 12 | typedef struct namelist namelist; 13 | 14 | extern symbol *mksymbol(type t, class c, name id); 15 | 16 | #ifdef YYBISON 17 | #define YYLEX_DECL() yylex(void) 18 | #define YYERROR_DECL() yyerror(const char *s) 19 | #endif 20 | %} 21 | 22 | %token GLOBAL LOCAL 23 | %token REAL INTEGER 24 | %token NAME 25 | 26 | %type declaration() namelist(, ) locnamelist() 27 | %type class 28 | %type type 29 | 30 | %destructor { 31 | namelist *p = $$; 32 | while (p != NULL) 33 | { namelist *pp = p; 34 | p = p->next; 35 | free(pp->s); free(pp); 36 | } 37 | } 38 | 39 | %union 40 | { 41 | class cval; 42 | type tval; 43 | namelist * nlist; 44 | name id; 45 | } 46 | 47 | %start declaration 48 | 49 | %% 50 | declaration($d): class type namelist($1, $2) 51 | { $$ = $3; } 52 | | type locnamelist($1) 53 | { $$ = $2; } 54 | ; 55 | 56 | class : GLOBAL { $$ = cGLOBAL; } 57 | | LOCAL { $$ = cLOCAL; } 58 | ; 59 | 60 | type : REAL { $$ = tREAL; } 61 | | INTEGER { $$ = tINTEGER; } 62 | ; 63 | 64 | namelist: namelist($c) NAME 65 | { $$->s = mksymbol($t, $c, $2); 66 | $$->next = $1; 67 | } 68 | | NAME 69 | { $$->s = mksymbol($t, $c, $1); 70 | $$->next = NULL; 71 | } 72 | ; 73 | 74 | locnamelist($t): namelist(cLOCAL, $t) 75 | { $$ = $1; } 76 | ; 77 | %% 78 | 79 | extern int YYLEX_DECL(); 80 | extern void YYERROR_DECL(); 81 | -------------------------------------------------------------------------------- /test/err_inherit5.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | 4 | typedef enum {cGLOBAL, cLOCAL} class; 5 | typedef enum {tREAL, tINTEGER} type; 6 | typedef char * name; 7 | 8 | struct symbol { class c; type t; name id; }; 9 | typedef struct symbol symbol; 10 | 11 | struct namelist { symbol *s; struct namelist *next; }; 12 | typedef struct namelist namelist; 13 | 14 | extern symbol *mksymbol(type t, class c, name id); 15 | 16 | #ifdef YYBISON 17 | #define YYLEX_DECL() yylex(void) 18 | #define YYERROR_DECL() yyerror(const char *s) 19 | #endif 20 | %} 21 | 22 | %token GLOBAL LOCAL 23 | %token REAL INTEGER 24 | %token NAME 25 | 26 | %type declaration namelist(, ) locnamelist() 27 | %type class 28 | %type type 29 | 30 | %destructor { 31 | namelist *p = $$; 32 | while (p != NULL) 33 | { namelist *pp = p; 34 | p = p->next; 35 | free(pp->s); free(pp); 36 | } 37 | } 38 | 39 | %union 40 | { 41 | class cval; 42 | type tval; 43 | namelist * nlist; 44 | name id; 45 | } 46 | 47 | %start declaration 48 | 49 | %% 50 | declaration: class type namelist($1, $2) 51 | { $$ = $3; } 52 | | type locnamelist($1) 53 | { $$ = $2; } 54 | ; 55 | 56 | class : GLOBAL { $$ = cGLOBAL; } 57 | | LOCAL { $$ = cLOCAL; } 58 | ; 59 | 60 | type : REAL { $$ = tREAL; } 61 | | INTEGER { $$ = tINTEGER; } 62 | ; 63 | 64 | namelist($c, $t): namelist NAME 65 | { $$->s = mksymbol($t, $c, $2); 66 | $$->next = $1; 67 | } 68 | | NAME 69 | { $$->s = mksymbol($t, $c, $1); 70 | $$->next = NULL; 71 | } 72 | ; 73 | 74 | locnamelist($t): namelist(@1, $t) 75 | { $$ = $1; } 76 | ; 77 | %% 78 | 79 | extern int YYLEX_DECL(); 80 | extern void YYERROR_DECL(); 81 | -------------------------------------------------------------------------------- /test/err_syntax1.y: -------------------------------------------------------------------------------- 1 | % { 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | %% 6 | S: error 7 | %% 8 | 9 | #include 10 | 11 | int 12 | main(void) 13 | { 14 | printf("yyparse() = %d\n", yyparse()); 15 | return 0; 16 | } 17 | 18 | int 19 | yylex(void) 20 | { 21 | return -1; 22 | } 23 | 24 | static void 25 | yyerror(const char* s) 26 | { 27 | printf("%s\n", s); 28 | } 29 | -------------------------------------------------------------------------------- /test/err_syntax10.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %token '(' '*' '&' 7 | %token '(' '*' '&' 8 | 9 | %% 10 | S: error 11 | %% 12 | 13 | #include 14 | 15 | int 16 | main(void) 17 | { 18 | printf("yyparse() = %d\n", yyparse()); 19 | return 0; 20 | } 21 | 22 | int 23 | yylex(void) 24 | { 25 | return -1; 26 | } 27 | 28 | static void 29 | yyerror(const char* s) 30 | { 31 | printf("%s\n", s); 32 | } 33 | -------------------------------------------------------------------------------- /test/err_syntax11.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %left '|' 7 | %right '|' 8 | 9 | %% 10 | S: error 11 | %% 12 | 13 | #include 14 | 15 | int 16 | main(void) 17 | { 18 | printf("yyparse() = %d\n", yyparse()); 19 | return 0; 20 | } 21 | 22 | int 23 | yylex(void) 24 | { 25 | return -1; 26 | } 27 | 28 | static void 29 | yyerror(const char* s) 30 | { 31 | printf("%s\n", s); 32 | } 33 | -------------------------------------------------------------------------------- /test/err_syntax12.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %token text 123 7 | %token text 456 8 | 9 | %% 10 | S: error 11 | %% 12 | 13 | #include 14 | 15 | int 16 | main(void) 17 | { 18 | printf("yyparse() = %d\n", yyparse()); 19 | return 0; 20 | } 21 | 22 | int 23 | yylex(void) 24 | { 25 | return -1; 26 | } 27 | 28 | static void 29 | yyerror(const char* s) 30 | { 31 | printf("%s\n", s); 32 | } 33 | -------------------------------------------------------------------------------- /test/err_syntax13.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %token text 123 7 | %start text 8 | 9 | %% 10 | S: error 11 | %% 12 | 13 | #include 14 | 15 | int 16 | main(void) 17 | { 18 | printf("yyparse() = %d\n", yyparse()); 19 | return 0; 20 | } 21 | 22 | int 23 | yylex(void) 24 | { 25 | return -1; 26 | } 27 | 28 | static void 29 | yyerror(const char* s) 30 | { 31 | printf("%s\n", s); 32 | } 33 | -------------------------------------------------------------------------------- /test/err_syntax14.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %start text 7 | %start text2 8 | 9 | %% 10 | S: error 11 | %% 12 | 13 | #include 14 | 15 | int 16 | main(void) 17 | { 18 | printf("yyparse() = %d\n", yyparse()); 19 | return 0; 20 | } 21 | 22 | int 23 | yylex(void) 24 | { 25 | return -1; 26 | } 27 | 28 | static void 29 | yyerror(const char* s) 30 | { 31 | printf("%s\n", s); 32 | } 33 | -------------------------------------------------------------------------------- /test/err_syntax15.y: -------------------------------------------------------------------------------- 1 | %% 2 | %{ 3 | int yylex(void); 4 | static void yyerror(const char *); 5 | %} 6 | 7 | %start text 8 | 9 | %% 10 | S: error 11 | %% 12 | 13 | #include 14 | 15 | int 16 | main(void) 17 | { 18 | printf("yyparse() = %d\n", yyparse()); 19 | return 0; 20 | } 21 | 22 | int 23 | yylex(void) 24 | { 25 | return -1; 26 | } 27 | 28 | static void 29 | yyerror(const char* s) 30 | { 31 | printf("%s\n", s); 32 | } 33 | -------------------------------------------------------------------------------- /test/err_syntax16.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %token second 7 | 8 | %% 9 | 10 | firstx 11 | : '(' secondx 12 | ; 13 | 14 | second : 15 | ')' 16 | ; 17 | 18 | S: error 19 | %% 20 | 21 | #include 22 | 23 | int 24 | main(void) 25 | { 26 | printf("yyparse() = %d\n", yyparse()); 27 | return 0; 28 | } 29 | 30 | int 31 | yylex(void) 32 | { 33 | return -1; 34 | } 35 | 36 | static void 37 | yyerror(const char* s) 38 | { 39 | printf("%s\n", s); 40 | } 41 | -------------------------------------------------------------------------------- /test/err_syntax17.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %% 7 | 8 | S: { error 9 | %% 10 | 11 | #include 12 | 13 | int 14 | main(void) 15 | { 16 | printf("yyparse() = %d\n", yyparse()); 17 | return 0; 18 | } 19 | 20 | int 21 | yylex(void) 22 | { 23 | return -1; 24 | } 25 | 26 | static void 27 | yyerror(const char* s) 28 | { 29 | printf("%s\n", s); 30 | } 31 | -------------------------------------------------------------------------------- /test/err_syntax18.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %% 7 | 8 | expr : '(' expr ')' 9 | { $$ = $4; } 10 | ; 11 | 12 | %% 13 | 14 | #include 15 | 16 | int 17 | main(void) 18 | { 19 | printf("yyparse() = %d\n", yyparse()); 20 | return 0; 21 | } 22 | 23 | int 24 | yylex(void) 25 | { 26 | return -1; 27 | } 28 | 29 | static void 30 | yyerror(const char* s) 31 | { 32 | printf("%s\n", s); 33 | } 34 | -------------------------------------------------------------------------------- /test/err_syntax19.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %% 7 | 8 | expr : '(' expr ')' 9 | { $$ = $; } 10 | ; 11 | 12 | %% 13 | 14 | #include 15 | 16 | int 17 | main(void) 18 | { 19 | printf("yyparse() = %d\n", yyparse()); 20 | return 0; 21 | } 22 | 23 | int 24 | yylex(void) 25 | { 26 | return -1; 27 | } 28 | 29 | static void 30 | yyerror(const char* s) 31 | { 32 | printf("%s\n", s); 33 | } 34 | -------------------------------------------------------------------------------- /test/err_syntax2.y: -------------------------------------------------------------------------------- 1 | %{ /* 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | %% 6 | S: error 7 | %% 8 | 9 | #include 10 | 11 | int 12 | main(void) 13 | { 14 | printf("yyparse() = %d\n", yyparse()); 15 | return 0; 16 | } 17 | 18 | int 19 | yylex(void) 20 | { 21 | return -1; 22 | } 23 | 24 | static void 25 | yyerror(const char* s) 26 | { 27 | printf("%s\n", s); 28 | } 29 | -------------------------------------------------------------------------------- /test/err_syntax20.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %type expr 7 | %type recur 8 | 9 | %% 10 | 11 | expr : '(' recur ')' 12 | { $2 = 3; } 13 | ; 14 | 15 | %% 16 | 17 | #include 18 | 19 | int 20 | main(void) 21 | { 22 | printf("yyparse() = %d\n", yyparse()); 23 | return 0; 24 | } 25 | 26 | int 27 | yylex(void) 28 | { 29 | return -1; 30 | } 31 | 32 | static void 33 | yyerror(const char* s) 34 | { 35 | printf("%s\n", s); 36 | } 37 | -------------------------------------------------------------------------------- /test/err_syntax21.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %type expr 7 | %type recur 8 | 9 | %% 10 | 11 | expr : '(' recur ')' 12 | { foo( $$ = $0 ); } 13 | ; 14 | 15 | %% 16 | 17 | #include 18 | 19 | int 20 | main(void) 21 | { 22 | printf("yyparse() = %d\n", yyparse()); 23 | return 0; 24 | } 25 | 26 | int 27 | yylex(void) 28 | { 29 | return -1; 30 | } 31 | 32 | static void 33 | yyerror(const char* s) 34 | { 35 | printf("%s\n", s); 36 | } 37 | -------------------------------------------------------------------------------- /test/err_syntax22.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %union { 7 | int ival; 8 | double dval; 9 | } 10 | 11 | %token NUMBER 12 | %type expr 13 | 14 | %% 15 | 16 | expr : '(' recur ')' 17 | { foo( $$ = $2 ); } 18 | ; 19 | 20 | recur : NUMBER 21 | ; 22 | 23 | %% 24 | 25 | #include 26 | 27 | int 28 | main(void) 29 | { 30 | printf("yyparse() = %d\n", yyparse()); 31 | return 0; 32 | } 33 | 34 | int 35 | yylex(void) 36 | { 37 | return -1; 38 | } 39 | 40 | static void 41 | yyerror(const char* s) 42 | { 43 | printf("%s\n", s); 44 | } 45 | -------------------------------------------------------------------------------- /test/err_syntax23.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %union { 7 | int ival; 8 | double dval; 9 | } 10 | 11 | %type recur 12 | 13 | %token NUMBER 14 | 15 | %% 16 | 17 | expr : '(' recur ')' 18 | { $$ = $2; } 19 | ; 20 | 21 | recur : NUMBER 22 | { $$ = 1; } 23 | ; 24 | 25 | %% 26 | 27 | #include 28 | 29 | int 30 | main(void) 31 | { 32 | printf("yyparse() = %d\n", yyparse()); 33 | return 0; 34 | } 35 | 36 | int 37 | yylex(void) 38 | { 39 | return -1; 40 | } 41 | 42 | static void 43 | yyerror(const char* s) 44 | { 45 | printf("%s\n", s); 46 | } 47 | -------------------------------------------------------------------------------- /test/err_syntax24.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %union { 7 | int ival; 8 | double dval; 9 | } 10 | 11 | %start expr 12 | %type expr 13 | 14 | %token NUMBER 15 | 16 | %% 17 | 18 | expr : '(' recur ')' 19 | ; 20 | 21 | recur : NUMBER 22 | { $$ = 1; } 23 | ; 24 | 25 | %% 26 | 27 | #include 28 | 29 | int 30 | main(void) 31 | { 32 | printf("yyparse() = %d\n", yyparse()); 33 | return 0; 34 | } 35 | 36 | int 37 | yylex(void) 38 | { 39 | return -1; 40 | } 41 | 42 | static void 43 | yyerror(const char* s) 44 | { 45 | printf("%s\n", s); 46 | } 47 | -------------------------------------------------------------------------------- /test/err_syntax25.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %union { 7 | int ival; 8 | double dval; 9 | } 10 | 11 | %union { 12 | int ival2; 13 | double dval2; 14 | } 15 | 16 | %start expr 17 | %type expr 18 | 19 | %token NUMBER 20 | 21 | %% 22 | 23 | expr : '(' recur ')' 24 | ; 25 | 26 | recur : NUMBER 27 | { $$ = 1; } 28 | ; 29 | 30 | %% 31 | 32 | #include 33 | 34 | int 35 | main(void) 36 | { 37 | printf("yyparse() = %d\n", yyparse()); 38 | return 0; 39 | } 40 | 41 | int 42 | yylex(void) 43 | { 44 | return -1; 45 | } 46 | 47 | static void 48 | yyerror(const char* s) 49 | { 50 | printf("%s\n", s); 51 | } 52 | -------------------------------------------------------------------------------- /test/err_syntax26.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %type '(' '*' '& 7 | 8 | %% 9 | S: error 10 | %% 11 | 12 | #include 13 | 14 | int 15 | main(void) 16 | { 17 | printf("yyparse() = %d\n", yyparse()); 18 | return 0; 19 | } 20 | 21 | int 22 | yylex(void) 23 | { 24 | return -1; 25 | } 26 | 27 | static void 28 | yyerror(const char* s) 29 | { 30 | printf("%s\n", s); 31 | } 32 | -------------------------------------------------------------------------------- /test/err_syntax4.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | } 5 | %% 6 | S: error 7 | %% 8 | 9 | #include 10 | 11 | int 12 | main(void) 13 | { 14 | printf("yyparse() = %d\n", yyparse()); 15 | return 0; 16 | } 17 | 18 | int 19 | yylex(void) 20 | { 21 | return -1; 22 | } 23 | 24 | static void 25 | yyerror(const char* s) 26 | { 27 | printf("%s\n", s); 28 | } 29 | -------------------------------------------------------------------------------- /test/err_syntax5.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %union { 7 | char *str; 8 | int num 9 | 10 | %% 11 | S: error 12 | %% 13 | 14 | #include 15 | 16 | int 17 | main(void) 18 | { 19 | printf("yyparse() = %d\n", yyparse()); 20 | return 0; 21 | } 22 | 23 | int 24 | yylex(void) 25 | { 26 | return -1; 27 | } 28 | 29 | static void 30 | yyerror(const char* s) 31 | { 32 | printf("%s\n", s); 33 | } 34 | -------------------------------------------------------------------------------- /test/err_syntax6.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %token 13 | 14 | int 15 | main(void) 16 | { 17 | printf("yyparse() = %d\n", yyparse()); 18 | return 0; 19 | } 20 | 21 | int 22 | yylex(void) 23 | { 24 | return -1; 25 | } 26 | 27 | static void 28 | yyerror(const char* s) 29 | { 30 | printf("%s\n", s); 31 | } 32 | -------------------------------------------------------------------------------- /test/err_syntax7.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %token '\777' 7 | 8 | %% 9 | S: error 10 | %% 11 | 12 | #include 13 | 14 | int 15 | main(void) 16 | { 17 | printf("yyparse() = %d\n", yyparse()); 18 | return 0; 19 | } 20 | 21 | int 22 | yylex(void) 23 | { 24 | return -1; 25 | } 26 | 27 | static void 28 | yyerror(const char* s) 29 | { 30 | printf("%s\n", s); 31 | } 32 | -------------------------------------------------------------------------------- /test/err_syntax7a.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %token '\xfff' 7 | 8 | %% 9 | S: error 10 | %% 11 | 12 | #include 13 | 14 | int 15 | main(void) 16 | { 17 | printf("yyparse() = %d\n", yyparse()); 18 | return 0; 19 | } 20 | 21 | int 22 | yylex(void) 23 | { 24 | return -1; 25 | } 26 | 27 | static void 28 | yyerror(const char* s) 29 | { 30 | printf("%s\n", s); 31 | } 32 | -------------------------------------------------------------------------------- /test/err_syntax7b.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %token '\x.' 7 | 8 | %% 9 | S: error 10 | %% 11 | 12 | #include 13 | 14 | int 15 | main(void) 16 | { 17 | printf("yyparse() = %d\n", yyparse()); 18 | return 0; 19 | } 20 | 21 | int 22 | yylex(void) 23 | { 24 | return -1; 25 | } 26 | 27 | static void 28 | yyerror(const char* s) 29 | { 30 | printf("%s\n", s); 31 | } 32 | -------------------------------------------------------------------------------- /test/err_syntax8.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %token . '\777' 7 | 8 | %% 9 | S: error 10 | %% 11 | 12 | #include 13 | 14 | int 15 | main(void) 16 | { 17 | printf("yyparse() = %d\n", yyparse()); 18 | return 0; 19 | } 20 | 21 | int 22 | yylex(void) 23 | { 24 | return -1; 25 | } 26 | 27 | static void 28 | yyerror(const char* s) 29 | { 30 | printf("%s\n", s); 31 | } 32 | -------------------------------------------------------------------------------- /test/err_syntax8a.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %token $$123 '\777' 7 | 8 | %% 9 | S: error 10 | %% 11 | 12 | #include 13 | 14 | int 15 | main(void) 16 | { 17 | printf("yyparse() = %d\n", yyparse()); 18 | return 0; 19 | } 20 | 21 | int 22 | yylex(void) 23 | { 24 | return -1; 25 | } 26 | 27 | static void 28 | yyerror(const char* s) 29 | { 30 | printf("%s\n", s); 31 | } 32 | -------------------------------------------------------------------------------- /test/err_syntax9.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | 6 | %start text 7 | %token text '(' '*' '&' 8 | 9 | %% 10 | S: error 11 | %% 12 | 13 | #include 14 | 15 | int 16 | main(void) 17 | { 18 | printf("yyparse() = %d\n", yyparse()); 19 | return 0; 20 | } 21 | 22 | int 23 | yylex(void) 24 | { 25 | return -1; 26 | } 27 | 28 | static void 29 | yyerror(const char* s) 30 | { 31 | printf("%s\n", s); 32 | } 33 | -------------------------------------------------------------------------------- /test/error.y: -------------------------------------------------------------------------------- 1 | %{ 2 | int yylex(void); 3 | static void yyerror(const char *); 4 | %} 5 | %% 6 | S: error 7 | %% 8 | 9 | #include 10 | 11 | int 12 | main(void) 13 | { 14 | printf("yyparse() = %d\n", yyparse()); 15 | return 0; 16 | } 17 | 18 | int 19 | yylex(void) 20 | { 21 | return -1; 22 | } 23 | 24 | static void 25 | yyerror(const char* s) 26 | { 27 | printf("%s\n", s); 28 | } 29 | -------------------------------------------------------------------------------- /test/inherit0.y: -------------------------------------------------------------------------------- 1 | %{ 2 | extern void mksymbol(int t, int c, int id); 3 | 4 | #ifdef YYBISON 5 | #define YYLEX_DECL() yylex(void) 6 | #define YYERROR_DECL() yyerror(const char *s) 7 | extern int YYLEX_DECL(); 8 | extern void YYERROR_DECL(); 9 | #endif 10 | %} 11 | 12 | %token GLOBAL LOCAL 13 | %token REAL INTEGER 14 | %token NAME 15 | 16 | %start declaration 17 | 18 | %% 19 | declaration: class type namelist 20 | { $$ = $3; } 21 | | type locnamelist 22 | { $$ = $2; } 23 | ; 24 | 25 | class : GLOBAL { $$ = 1; } 26 | | LOCAL { $$ = 2; } 27 | ; 28 | 29 | type : REAL { $$ = 1; } 30 | | INTEGER { $$ = 2; } 31 | ; 32 | 33 | namelist: namelist NAME 34 | { mksymbol($0, $-1, $2); } 35 | | NAME 36 | { mksymbol($0, $-1, $1); } 37 | ; 38 | 39 | locnamelist: 40 | { $$ = 2; } /* set up semantic stack for : LOCAL */ 41 | { $$ = $-1; } /* copy to where expects it */ 42 | namelist 43 | { $$ = $3; } 44 | ; 45 | %% 46 | 47 | extern int YYLEX_DECL(); 48 | extern void YYERROR_DECL(); 49 | -------------------------------------------------------------------------------- /test/inherit1.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | 4 | typedef enum {cGLOBAL, cLOCAL} class; 5 | typedef enum {tREAL, tINTEGER} type; 6 | typedef char * name; 7 | 8 | struct symbol { class c; type t; name id; }; 9 | typedef struct symbol symbol; 10 | 11 | struct namelist { symbol *s; struct namelist *next; }; 12 | typedef struct namelist namelist; 13 | 14 | extern symbol *mksymbol(type t, class c, name id); 15 | 16 | #ifdef YYBISON 17 | #define YYLEX_DECL() yylex(void) 18 | #define YYERROR_DECL() yyerror(const char *s) 19 | extern int YYLEX_DECL(); 20 | extern void YYERROR_DECL(); 21 | #endif 22 | %} 23 | 24 | %token GLOBAL LOCAL 25 | %token REAL INTEGER 26 | %token NAME 27 | 28 | %type declaration namelist locnamelist 29 | %type class 30 | %type type 31 | 32 | %union 33 | { 34 | class cval; 35 | type tval; 36 | namelist * nlist; 37 | name id; 38 | } 39 | 40 | %start declaration 41 | 42 | %% 43 | declaration: class type namelist 44 | { $$ = $3; } 45 | | type locnamelist 46 | { $$ = $2; } 47 | ; 48 | 49 | class : GLOBAL { $$ = cGLOBAL; } 50 | | LOCAL { $$ = cLOCAL; } 51 | ; 52 | 53 | type : REAL { $$ = tREAL; } 54 | | INTEGER { $$ = tINTEGER; } 55 | ; 56 | 57 | namelist: namelist NAME 58 | { $$->s = mksymbol($0, $-1, $2); 59 | $$->next = $1; 60 | } 61 | | NAME 62 | { $$->s = mksymbol($0, $-1, $1); 63 | $$->next = NULL; 64 | } 65 | ; 66 | 67 | locnamelist: 68 | { $$ = cLOCAL; } /* set up semantic stack for = LOCAL */ 69 | { $$ = $-1; } /* copy to where expects it */ 70 | namelist 71 | { $$ = $3; } 72 | ; 73 | %% 74 | 75 | extern int YYLEX_DECL(); 76 | extern void YYERROR_DECL(); 77 | -------------------------------------------------------------------------------- /test/inherit2.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | 4 | typedef enum {cGLOBAL, cLOCAL} class; 5 | typedef enum {tREAL, tINTEGER} type; 6 | typedef char * name; 7 | 8 | struct symbol { class c; type t; name id; }; 9 | typedef struct symbol symbol; 10 | 11 | struct namelist { symbol *s; struct namelist *next; }; 12 | typedef struct namelist namelist; 13 | 14 | extern symbol *mksymbol(type t, class c, name id); 15 | 16 | #ifdef YYBISON 17 | #define YYLEX_DECL() yylex(void) 18 | #define YYERROR_DECL() yyerror(const char *s) 19 | #endif 20 | %} 21 | 22 | %token GLOBAL LOCAL 23 | %token REAL INTEGER 24 | %token NAME 25 | 26 | %type declaration namelist(, ) locnamelist() 27 | %type class 28 | %type type 29 | 30 | %destructor { 31 | namelist *p = $$; 32 | while (p != NULL) 33 | { namelist *pp = p; 34 | p = p->next; 35 | free(pp->s); free(pp); 36 | } 37 | } 38 | 39 | %union 40 | { 41 | class cval; 42 | type tval; 43 | namelist * nlist; 44 | name id; 45 | } 46 | 47 | %start declaration 48 | 49 | %% 50 | declaration: class type namelist($1, $2) 51 | { $$ = $3; } 52 | | type locnamelist($1) 53 | { $$ = $2; } 54 | ; 55 | 56 | class : GLOBAL { $$ = cGLOBAL; } 57 | | LOCAL { $$ = cLOCAL; } 58 | ; 59 | 60 | type : REAL { $$ = tREAL; } 61 | | INTEGER { $$ = tINTEGER; } 62 | ; 63 | 64 | namelist($c, $t): namelist NAME 65 | { $$->s = mksymbol($t, $c, $2); 66 | $$->next = $1; 67 | } 68 | | NAME 69 | { $$->s = mksymbol($t, $c, $1); 70 | $$->next = NULL; 71 | } 72 | ; 73 | 74 | locnamelist($t): namelist(cLOCAL, $t) 75 | { $$ = $1; } 76 | ; 77 | %% 78 | 79 | extern int YYLEX_DECL(); 80 | extern void YYERROR_DECL(); 81 | -------------------------------------------------------------------------------- /test/pure_error.y: -------------------------------------------------------------------------------- 1 | %{ 2 | 3 | #ifdef YYBISON 4 | #define YYSTYPE int 5 | #define YYLEX_PARAM &yylval 6 | #define YYLEX_DECL() yylex(YYSTYPE *yylval) 7 | #define YYERROR_DECL() yyerror(const char *s) 8 | int YYLEX_DECL(); 9 | static void YYERROR_DECL(); 10 | #endif 11 | 12 | %} 13 | 14 | %% 15 | S: error 16 | %% 17 | 18 | #include 19 | 20 | #ifdef YYBYACC 21 | extern int YYLEX_DECL(); 22 | #endif 23 | 24 | int 25 | main(void) 26 | { 27 | printf("yyparse() = %d\n", yyparse()); 28 | return 0; 29 | } 30 | 31 | int 32 | yylex(YYSTYPE *value) 33 | { 34 | return value ? 0 : -1; 35 | } 36 | 37 | static void 38 | yyerror(const char* s) 39 | { 40 | printf("%s\n", s); 41 | } 42 | -------------------------------------------------------------------------------- /test/run_lint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $Id: run_lint.sh,v 1.3 2014/03/28 23:40:27 tom Exp $ 3 | # vi:ts=4 sw=4: 4 | 5 | # run lint on each of the ".c" files in the test directory 6 | 7 | if test $# = 1 8 | then 9 | PROG_DIR=`pwd` 10 | TEST_DIR=$1 11 | else 12 | PROG_DIR=.. 13 | TEST_DIR=. 14 | fi 15 | 16 | ifBTYACC=`fgrep -l 'define YYBTYACC' config.h > /dev/null; test $? != 0; echo $?` 17 | 18 | if test $ifBTYACC = 0; then 19 | REF_DIR=${TEST_DIR}/yacc 20 | else 21 | REF_DIR=${TEST_DIR}/btyacc 22 | fi 23 | 24 | echo '** '`date` 25 | for i in ${REF_DIR}/*.c 26 | do 27 | make -f $PROG_DIR/makefile lint C_FILES=$i srcdir=$PROG_DIR 28 | done 29 | -------------------------------------------------------------------------------- /test/yacc/big_b.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/big_b.error -------------------------------------------------------------------------------- /test/yacc/big_b.output: -------------------------------------------------------------------------------- 1 | YACC: w - -B flag unsupported, reconfigure with --enable-btyacc 2 | Usage: YACC [options] filename 3 | 4 | Options: 5 | -b file_prefix set filename prefix (default "y.") 6 | -B create a backtracking parser 7 | -d write definitions (.tab.h) 8 | -i write interface (y.tab.i) 9 | -g write a graphical description 10 | -l suppress #line directives 11 | -L enable position processing, e.g., "%locations" 12 | -o output_file (default ".tab.c") 13 | -p symbol_prefix set symbol prefix (default "yy") 14 | -P create a reentrant parser, e.g., "%pure-parser" 15 | -r produce separate code and table files (y.code.c) 16 | -s suppress #define's for quoted names in %token lines 17 | -t add debugging support 18 | -v write description (y.output) 19 | -V show version information and exit 20 | -------------------------------------------------------------------------------- /test/yacc/big_l.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/big_l.error -------------------------------------------------------------------------------- /test/yacc/big_l.output: -------------------------------------------------------------------------------- 1 | YACC: w - -B flag unsupported, reconfigure with --enable-btyacc 2 | Usage: YACC [options] filename 3 | 4 | Options: 5 | -b file_prefix set filename prefix (default "y.") 6 | -B create a backtracking parser 7 | -d write definitions (.tab.h) 8 | -i write interface (y.tab.i) 9 | -g write a graphical description 10 | -l suppress #line directives 11 | -L enable position processing, e.g., "%locations" 12 | -o output_file (default ".tab.c") 13 | -p symbol_prefix set symbol prefix (default "yy") 14 | -P create a reentrant parser, e.g., "%pure-parser" 15 | -r produce separate code and table files (y.code.c) 16 | -s suppress #define's for quoted names in %token lines 17 | -t add debugging support 18 | -v write description (y.output) 19 | -V show version information and exit 20 | -------------------------------------------------------------------------------- /test/yacc/calc.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/calc.error -------------------------------------------------------------------------------- /test/yacc/calc.tab.h: -------------------------------------------------------------------------------- 1 | #define DIGIT 257 2 | #define LETTER 258 3 | #define UMINUS 259 4 | -------------------------------------------------------------------------------- /test/yacc/calc1.error: -------------------------------------------------------------------------------- 1 | YACC: 2 rules never reduced 2 | YACC: 18 shift/reduce conflicts, 26 reduce/reduce conflicts. 3 | -------------------------------------------------------------------------------- /test/yacc/calc1.tab.h: -------------------------------------------------------------------------------- 1 | #define DREG 257 2 | #define VREG 258 3 | #define CONST 259 4 | #define UMINUS 260 5 | #ifdef YYSTYPE 6 | #undef YYSTYPE_IS_DECLARED 7 | #define YYSTYPE_IS_DECLARED 1 8 | #endif 9 | #ifndef YYSTYPE_IS_DECLARED 10 | #define YYSTYPE_IS_DECLARED 1 11 | typedef union 12 | { 13 | int ival; 14 | double dval; 15 | INTERVAL vval; 16 | } YYSTYPE; 17 | #endif /* !YYSTYPE_IS_DECLARED */ 18 | extern YYSTYPE calc1_lval; 19 | -------------------------------------------------------------------------------- /test/yacc/calc2.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/calc2.error -------------------------------------------------------------------------------- /test/yacc/calc2.tab.h: -------------------------------------------------------------------------------- 1 | #define DIGIT 257 2 | #define LETTER 258 3 | #define UMINUS 259 4 | -------------------------------------------------------------------------------- /test/yacc/calc3.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/calc3.error -------------------------------------------------------------------------------- /test/yacc/calc3.tab.h: -------------------------------------------------------------------------------- 1 | #define DIGIT 257 2 | #define LETTER 258 3 | #define UMINUS 259 4 | -------------------------------------------------------------------------------- /test/yacc/code_calc.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/code_calc.error -------------------------------------------------------------------------------- /test/yacc/code_calc.tab.h: -------------------------------------------------------------------------------- 1 | #define DIGIT 257 2 | #define LETTER 258 3 | #define UMINUS 259 4 | -------------------------------------------------------------------------------- /test/yacc/code_error.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/code_error.error -------------------------------------------------------------------------------- /test/yacc/code_error.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 2 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | -------------------------------------------------------------------------------- /test/yacc/code_error.tab.c: -------------------------------------------------------------------------------- 1 | typedef short YYINT; 2 | const YYINT error_lhs[] = { -1, 3 | 0, 4 | }; 5 | const YYINT error_len[] = { 2, 6 | 1, 7 | }; 8 | const YYINT error_defred[] = { 0, 9 | 1, 0, 10 | }; 11 | const YYINT error_dgoto[] = { 2, 12 | }; 13 | const YYINT error_sindex[] = { -256, 14 | 0, 0, 15 | }; 16 | const YYINT error_rindex[] = { 0, 17 | 0, 0, 18 | }; 19 | const YYINT error_gindex[] = { 0, 20 | }; 21 | const YYINT error_table[] = { 1, 22 | }; 23 | const YYINT error_check[] = { 256, 24 | }; 25 | #ifndef YYDEBUG 26 | #define YYDEBUG 0 27 | #endif 28 | #if YYDEBUG 29 | const char *const error_name[] = { 30 | 31 | "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 32 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 33 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 34 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 35 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 36 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 37 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol", 38 | }; 39 | const char *const error_rule[] = { 40 | "$accept : S", 41 | "S : error", 42 | 43 | }; 44 | #endif 45 | -------------------------------------------------------------------------------- /test/yacc/code_error.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/code_error.tab.h -------------------------------------------------------------------------------- /test/yacc/empty.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/empty.error -------------------------------------------------------------------------------- /test/yacc/empty.output: -------------------------------------------------------------------------------- 1 | 0 $accept : start $end 2 | 3 | 1 start : 4 | 5 | state 0 6 | $accept : . start $end (0) 7 | start : . (1) 8 | 9 | . reduce 1 10 | 11 | start goto 1 12 | 13 | 14 | state 1 15 | $accept : start . $end (0) 16 | 17 | $end accept 18 | 19 | 20 | 2 terminals, 2 nonterminals 21 | 2 grammar rules, 2 states 22 | -------------------------------------------------------------------------------- /test/yacc/empty.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/empty.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax1.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 1 of "./err_syntax1.y", syntax error 2 | ?% { 3 | ^ 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax1.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax1.output -------------------------------------------------------------------------------- /test/yacc/err_syntax1.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax1.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax1.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax10.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 7 of "./err_syntax10.y", the type of '(' has been redeclared 2 | YACC: w - line 7 of "./err_syntax10.y", the type of '*' has been redeclared 3 | YACC: w - line 7 of "./err_syntax10.y", the type of '&' has been redeclared 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax10.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 5 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | -------------------------------------------------------------------------------- /test/yacc/err_syntax10.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax10.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax11.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 7 of "./err_syntax11.y", the precedence of '|' has been redeclared 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax11.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 3 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | -------------------------------------------------------------------------------- /test/yacc/err_syntax11.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax11.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax12.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 7 of "./err_syntax12.y", the value of text has been redeclared 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax12.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 3 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | -------------------------------------------------------------------------------- /test/yacc/err_syntax12.tab.h: -------------------------------------------------------------------------------- 1 | #define text 456 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax13.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 7 of "./err_syntax13.y", the start symbol text is a token 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax13.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax13.output -------------------------------------------------------------------------------- /test/yacc/err_syntax13.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax13.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax13.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax14.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 7 of "./err_syntax14.y", the start symbol has been redeclared 2 | YACC: e - the start symbol text2 is undefined 3 | -------------------------------------------------------------------------------- /test/yacc/err_syntax14.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax14.output -------------------------------------------------------------------------------- /test/yacc/err_syntax14.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax14.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax14.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax15.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 9 of "./err_syntax15.y", no grammar has been specified 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax15.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax15.output -------------------------------------------------------------------------------- /test/yacc/err_syntax15.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax15.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax15.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax16.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 14 of "./err_syntax16.y", a token appears on the lhs of a production 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax16.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax16.output -------------------------------------------------------------------------------- /test/yacc/err_syntax16.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax16.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax16.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax17.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 8 of "./err_syntax17.y", unterminated action 2 | S: { error 3 | ^ 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax17.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax17.output -------------------------------------------------------------------------------- /test/yacc/err_syntax17.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax17.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax17.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax18.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 9 of "./err_syntax18.y", $4 references beyond the end of the current rule 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax18.output: -------------------------------------------------------------------------------- 1 | 0 $accept : expr $end 2 | 3 | 1 expr : '(' expr ')' 4 | 5 | state 0 6 | $accept : . expr $end (0) 7 | 8 | '(' shift 1 9 | . error 10 | 11 | expr goto 2 12 | 13 | 14 | state 1 15 | expr : '(' . expr ')' (1) 16 | 17 | '(' shift 1 18 | . error 19 | 20 | expr goto 3 21 | 22 | 23 | state 2 24 | $accept : expr . $end (0) 25 | 26 | $end accept 27 | 28 | 29 | state 3 30 | expr : '(' expr . ')' (1) 31 | 32 | ')' shift 4 33 | . error 34 | 35 | 36 | state 4 37 | expr : '(' expr ')' . (1) 38 | 39 | . reduce 1 40 | 41 | 42 | 4 terminals, 2 nonterminals 43 | 2 grammar rules, 5 states 44 | -------------------------------------------------------------------------------- /test/yacc/err_syntax18.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax18.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax19.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 9 of "./err_syntax19.y", illegal $-name 2 | { $$ = $; } 3 | ^ 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax19.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax19.output -------------------------------------------------------------------------------- /test/yacc/err_syntax19.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax19.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax19.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax2.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 1 of "./err_syntax2.y", unmatched /* 2 | %{ /* 3 | ^ 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax2.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax2.output -------------------------------------------------------------------------------- /test/yacc/err_syntax2.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax2.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax2.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax20.error: -------------------------------------------------------------------------------- 1 | YACC: w - the symbol recur is undefined 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax20.output: -------------------------------------------------------------------------------- 1 | 0 $accept : expr $end 2 | 3 | 1 expr : '(' recur ')' 4 | 5 | state 0 6 | $accept : . expr $end (0) 7 | 8 | '(' shift 1 9 | . error 10 | 11 | expr goto 2 12 | 13 | 14 | state 1 15 | expr : '(' . recur ')' (1) 16 | 17 | recur shift 3 18 | . error 19 | 20 | 21 | state 2 22 | $accept : expr . $end (0) 23 | 24 | $end accept 25 | 26 | 27 | state 3 28 | expr : '(' recur . ')' (1) 29 | 30 | ')' shift 4 31 | . error 32 | 33 | 34 | state 4 35 | expr : '(' recur ')' . (1) 36 | 37 | . reduce 1 38 | 39 | 40 | 5 terminals, 2 nonterminals 41 | 2 grammar rules, 5 states 42 | -------------------------------------------------------------------------------- /test/yacc/err_syntax20.tab.h: -------------------------------------------------------------------------------- 1 | #define recur 257 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax21.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 12 of "./err_syntax21.y", $0 is untyped 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax21.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax21.output -------------------------------------------------------------------------------- /test/yacc/err_syntax21.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax21.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax21.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax22.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 17 of "./err_syntax22.y", $2 (recur) is untyped 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax22.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax22.output -------------------------------------------------------------------------------- /test/yacc/err_syntax22.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax22.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax22.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax23.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 18 of "./err_syntax23.y", $$ is untyped 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax23.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax23.output -------------------------------------------------------------------------------- /test/yacc/err_syntax23.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax23.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax23.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax24.error: -------------------------------------------------------------------------------- 1 | YACC: w - line 21 of "./err_syntax24.y", the default action assigns an undefined value to $$ 2 | YACC: e - line 22 of "./err_syntax24.y", $$ is untyped 3 | -------------------------------------------------------------------------------- /test/yacc/err_syntax24.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax24.output -------------------------------------------------------------------------------- /test/yacc/err_syntax24.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax24.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax24.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax25.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 11 of "./err_syntax25.y", too many %union declarations 2 | %union { 3 | ^ 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax25.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax25.output -------------------------------------------------------------------------------- /test/yacc/err_syntax25.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax25.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax25.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax26.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax26.y", unexpected end-of-file 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax26.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax26.output -------------------------------------------------------------------------------- /test/yacc/err_syntax26.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax26.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax26.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax27.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 3 of "./err_syntax27.y", missing '}' 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax27.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax27.output -------------------------------------------------------------------------------- /test/yacc/err_syntax27.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax27.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax27.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax3.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax3.y", unterminated string 2 | %token '(' '*' '& 3 | ^ 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax3.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax3.output -------------------------------------------------------------------------------- /test/yacc/err_syntax3.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax3.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax3.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax4.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 1 of "./err_syntax4.y", unmatched %{ 2 | %{ 3 | ^ 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax4.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax4.output -------------------------------------------------------------------------------- /test/yacc/err_syntax4.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax4.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax4.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax5.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax5.y", unterminated %union declaration 2 | %union { 3 | ^ 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax5.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax5.output -------------------------------------------------------------------------------- /test/yacc/err_syntax5.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax5.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax5.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax6.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax6.y", illegal tag 2 | %token '\777' 3 | ^ 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax7.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax7.output -------------------------------------------------------------------------------- /test/yacc/err_syntax7.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax7.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax7.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax7a.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax7a.y", illegal character 2 | %token '\xfff' 3 | ^ 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax7a.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax7a.output -------------------------------------------------------------------------------- /test/yacc/err_syntax7a.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax7a.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax7a.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax7b.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax7b.y", illegal character 2 | %token '\x.' 3 | ^ 4 | -------------------------------------------------------------------------------- /test/yacc/err_syntax7b.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax7b.output -------------------------------------------------------------------------------- /test/yacc/err_syntax7b.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax7b.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax7b.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax8.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax8.y", illegal use of reserved symbol . 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax8.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax8.output -------------------------------------------------------------------------------- /test/yacc/err_syntax8.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax8.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax8.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax8a.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 6 of "./err_syntax8a.y", illegal use of reserved symbol $$123 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax8a.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax8a.output -------------------------------------------------------------------------------- /test/yacc/err_syntax8a.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax8a.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax8a.tab.h -------------------------------------------------------------------------------- /test/yacc/err_syntax9.error: -------------------------------------------------------------------------------- 1 | YACC: e - line 7 of "./err_syntax9.y", the start symbol text cannot be declared to be a token 2 | -------------------------------------------------------------------------------- /test/yacc/err_syntax9.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax9.output -------------------------------------------------------------------------------- /test/yacc/err_syntax9.tab.c: -------------------------------------------------------------------------------- 1 | /* original parser id follows */ 2 | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 | 5 | #define YYBYACC 1 6 | #define YYMAJOR 1 7 | #define YYMINOR 9 8 | #define YYCHECK "yyyymmdd" 9 | 10 | #define YYEMPTY (-1) 11 | #define yyclearin (yychar = YYEMPTY) 12 | #define yyerrok (yyerrflag = 0) 13 | #define YYRECOVERING() (yyerrflag != 0) 14 | #define YYENOMEM (-2) 15 | #define YYEOF 0 16 | -------------------------------------------------------------------------------- /test/yacc/err_syntax9.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/err_syntax9.tab.h -------------------------------------------------------------------------------- /test/yacc/error.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/error.error -------------------------------------------------------------------------------- /test/yacc/error.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 2 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | -------------------------------------------------------------------------------- /test/yacc/error.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/error.tab.h -------------------------------------------------------------------------------- /test/yacc/grammar.error: -------------------------------------------------------------------------------- 1 | YACC: 1 shift/reduce conflict, 29 reduce/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/yacc/grammar.tab.h: -------------------------------------------------------------------------------- 1 | #define T_IDENTIFIER 257 2 | #define T_TYPEDEF_NAME 258 3 | #define T_DEFINE_NAME 259 4 | #define T_AUTO 260 5 | #define T_EXTERN 261 6 | #define T_REGISTER 262 7 | #define T_STATIC 263 8 | #define T_TYPEDEF 264 9 | #define T_INLINE 265 10 | #define T_EXTENSION 266 11 | #define T_CHAR 267 12 | #define T_DOUBLE 268 13 | #define T_FLOAT 269 14 | #define T_INT 270 15 | #define T_VOID 271 16 | #define T_LONG 272 17 | #define T_SHORT 273 18 | #define T_SIGNED 274 19 | #define T_UNSIGNED 275 20 | #define T_ENUM 276 21 | #define T_STRUCT 277 22 | #define T_UNION 278 23 | #define T_Bool 279 24 | #define T_Complex 280 25 | #define T_Imaginary 281 26 | #define T_TYPE_QUALIFIER 282 27 | #define T_BRACKETS 283 28 | #define T_LBRACE 284 29 | #define T_MATCHRBRACE 285 30 | #define T_ELLIPSIS 286 31 | #define T_INITIALIZER 287 32 | #define T_STRING_LITERAL 288 33 | #define T_ASM 289 34 | #define T_ASMARG 290 35 | #define T_VA_DCL 291 36 | -------------------------------------------------------------------------------- /test/yacc/help.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/help.error -------------------------------------------------------------------------------- /test/yacc/help.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/yacc/no_b_opt.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_b_opt.error -------------------------------------------------------------------------------- /test/yacc/no_b_opt.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/yacc/no_b_opt1.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_b_opt1.error -------------------------------------------------------------------------------- /test/yacc/no_b_opt1.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.c" 2 | -------------------------------------------------------------------------------- /test/yacc/no_code_c.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_code_c.error -------------------------------------------------------------------------------- /test/yacc/no_code_c.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.c" 2 | -------------------------------------------------------------------------------- /test/yacc/no_defines.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_defines.error -------------------------------------------------------------------------------- /test/yacc/no_defines.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.h" 2 | -------------------------------------------------------------------------------- /test/yacc/no_graph.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_graph.error -------------------------------------------------------------------------------- /test/yacc/no_graph.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.dot" 2 | -------------------------------------------------------------------------------- /test/yacc/no_include.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_include.error -------------------------------------------------------------------------------- /test/yacc/no_include.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.i" 2 | -------------------------------------------------------------------------------- /test/yacc/no_opts.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_opts.error -------------------------------------------------------------------------------- /test/yacc/no_opts.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.y" 2 | -------------------------------------------------------------------------------- /test/yacc/no_output.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_output.error -------------------------------------------------------------------------------- /test/yacc/no_output.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.output" 2 | -------------------------------------------------------------------------------- /test/yacc/no_output1.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_output1.error -------------------------------------------------------------------------------- /test/yacc/no_output1.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.output" 2 | -------------------------------------------------------------------------------- /test/yacc/no_output2.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_output2.error -------------------------------------------------------------------------------- /test/yacc/no_output2.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/yacc/no_p_opt.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_p_opt.error -------------------------------------------------------------------------------- /test/yacc/no_p_opt.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/yacc/no_p_opt1.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_p_opt1.error -------------------------------------------------------------------------------- /test/yacc/no_p_opt1.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.c" 2 | -------------------------------------------------------------------------------- /test/yacc/no_verbose.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/no_verbose.error -------------------------------------------------------------------------------- /test/yacc/no_verbose.output: -------------------------------------------------------------------------------- 1 | YACC: f - cannot open "nosuchfile.output" 2 | -------------------------------------------------------------------------------- /test/yacc/nostdin.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/nostdin.error -------------------------------------------------------------------------------- /test/yacc/nostdin.output: -------------------------------------------------------------------------------- 1 | Usage: YACC [options] filename 2 | 3 | Options: 4 | -b file_prefix set filename prefix (default "y.") 5 | -B create a backtracking parser 6 | -d write definitions (.tab.h) 7 | -i write interface (y.tab.i) 8 | -g write a graphical description 9 | -l suppress #line directives 10 | -L enable position processing, e.g., "%locations" 11 | -o output_file (default ".tab.c") 12 | -p symbol_prefix set symbol prefix (default "yy") 13 | -P create a reentrant parser, e.g., "%pure-parser" 14 | -r produce separate code and table files (y.code.c) 15 | -s suppress #define's for quoted names in %token lines 16 | -t add debugging support 17 | -v write description (y.output) 18 | -V show version information and exit 19 | -------------------------------------------------------------------------------- /test/yacc/ok_syntax1.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/ok_syntax1.error -------------------------------------------------------------------------------- /test/yacc/ok_syntax1.tab.h: -------------------------------------------------------------------------------- 1 | #define DIGIT 257 2 | #define LETTER 258 3 | #define OCT1 259 4 | #define HEX1 260 5 | #define HEX2 261 6 | #define HEX3 262 7 | #define STR1 263 8 | #define STR2 265 9 | #define BELL 266 10 | #define BS 267 11 | #define NL 268 12 | #define LF 269 13 | #define CR 270 14 | #define TAB 271 15 | #define VT 272 16 | #define UMINUS 273 17 | #ifdef YYSTYPE 18 | #undef YYSTYPE_IS_DECLARED 19 | #define YYSTYPE_IS_DECLARED 1 20 | #endif 21 | #ifndef YYSTYPE_IS_DECLARED 22 | #define YYSTYPE_IS_DECLARED 1 23 | typedef union 24 | { 25 | char * cval; 26 | int ival; 27 | double dval; 28 | } YYSTYPE; 29 | #endif /* !YYSTYPE_IS_DECLARED */ 30 | extern YYSTYPE ok_syntax1_lval; 31 | -------------------------------------------------------------------------------- /test/yacc/pure_calc.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/pure_calc.error -------------------------------------------------------------------------------- /test/yacc/pure_calc.tab.h: -------------------------------------------------------------------------------- 1 | #define DIGIT 257 2 | #define LETTER 258 3 | #define UMINUS 259 4 | -------------------------------------------------------------------------------- /test/yacc/pure_error.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/pure_error.error -------------------------------------------------------------------------------- /test/yacc/pure_error.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 2 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | -------------------------------------------------------------------------------- /test/yacc/pure_error.tab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/pure_error.tab.h -------------------------------------------------------------------------------- /test/yacc/quote_calc-s.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/yacc/quote_calc-s.tab.h: -------------------------------------------------------------------------------- 1 | #define OP_ADD 257 2 | #define OP_SUB 259 3 | #define OP_MUL 261 4 | #define OP_DIV 263 5 | #define OP_MOD 265 6 | #define OP_AND 267 7 | #define DIGIT 269 8 | #define LETTER 270 9 | #define UMINUS 271 10 | -------------------------------------------------------------------------------- /test/yacc/quote_calc.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/yacc/quote_calc.tab.h: -------------------------------------------------------------------------------- 1 | #define OP_ADD 257 2 | #define ADD 258 3 | #define OP_SUB 259 4 | #define SUB 260 5 | #define OP_MUL 261 6 | #define MUL 262 7 | #define OP_DIV 263 8 | #define DIV 264 9 | #define OP_MOD 265 10 | #define MOD 266 11 | #define OP_AND 267 12 | #define AND 268 13 | #define DIGIT 269 14 | #define LETTER 270 15 | #define UMINUS 271 16 | -------------------------------------------------------------------------------- /test/yacc/quote_calc2-s.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/yacc/quote_calc2-s.tab.h: -------------------------------------------------------------------------------- 1 | #define OP_ADD 257 2 | #define OP_SUB 259 3 | #define OP_MUL 261 4 | #define OP_DIV 263 5 | #define OP_MOD 265 6 | #define OP_AND 267 7 | #define DIGIT 269 8 | #define LETTER 270 9 | #define UMINUS 271 10 | -------------------------------------------------------------------------------- /test/yacc/quote_calc2.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/yacc/quote_calc2.tab.h: -------------------------------------------------------------------------------- 1 | #define OP_ADD 257 2 | #define ADD 258 3 | #define OP_SUB 259 4 | #define SUB 260 5 | #define OP_MUL 261 6 | #define MUL 262 7 | #define OP_DIV 263 8 | #define DIV 264 9 | #define OP_MOD 265 10 | #define MOD 266 11 | #define OP_AND 267 12 | #define AND 268 13 | #define DIGIT 269 14 | #define LETTER 270 15 | #define UMINUS 271 16 | -------------------------------------------------------------------------------- /test/yacc/quote_calc3-s.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/yacc/quote_calc3-s.tab.h: -------------------------------------------------------------------------------- 1 | #define OP_ADD 257 2 | #define OP_SUB 259 3 | #define OP_MUL 261 4 | #define OP_DIV 263 5 | #define OP_MOD 265 6 | #define OP_AND 267 7 | #define DIGIT 269 8 | #define LETTER 270 9 | #define UMINUS 271 10 | -------------------------------------------------------------------------------- /test/yacc/quote_calc3.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/yacc/quote_calc3.tab.h: -------------------------------------------------------------------------------- 1 | #define OP_ADD 257 2 | #define OP_SUB 259 3 | #define OP_MUL 261 4 | #define OP_DIV 263 5 | #define OP_MOD 265 6 | #define OP_AND 267 7 | #define DIGIT 269 8 | #define LETTER 270 9 | #define UMINUS 271 10 | -------------------------------------------------------------------------------- /test/yacc/quote_calc4-s.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/yacc/quote_calc4-s.tab.h: -------------------------------------------------------------------------------- 1 | #define OP_ADD 257 2 | #define OP_SUB 259 3 | #define OP_MUL 261 4 | #define OP_DIV 263 5 | #define OP_MOD 265 6 | #define OP_AND 267 7 | #define DIGIT 269 8 | #define LETTER 270 9 | #define UMINUS 271 10 | -------------------------------------------------------------------------------- /test/yacc/quote_calc4.error: -------------------------------------------------------------------------------- 1 | YACC: 54 shift/reduce conflicts. 2 | -------------------------------------------------------------------------------- /test/yacc/quote_calc4.tab.h: -------------------------------------------------------------------------------- 1 | #define OP_ADD 257 2 | #define OP_SUB 259 3 | #define OP_MUL 261 4 | #define OP_DIV 263 5 | #define OP_MOD 265 6 | #define OP_AND 267 7 | #define DIGIT 269 8 | #define LETTER 270 9 | #define UMINUS 271 10 | -------------------------------------------------------------------------------- /test/yacc/rename_debug.error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grandseiken/byacc/4265cbd75de5bbbf85ece8d2b12a4322cfeb40c2/test/yacc/rename_debug.error -------------------------------------------------------------------------------- /test/yacc/rename_debug.h: -------------------------------------------------------------------------------- 1 | #define YYERRCODE 256 2 | -------------------------------------------------------------------------------- /test/yacc/rename_debug.i: -------------------------------------------------------------------------------- 1 | #define YYPREFIX "yy" 2 | 3 | #define YYPURE 0 4 | 5 | #line 2 "code_debug.y" 6 | 7 | #ifdef YYBISON 8 | int yylex(void); 9 | static void yyerror(const char *); 10 | #endif 11 | 12 | 13 | #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED) 14 | /* Default: YYSTYPE is the semantic value type. */ 15 | typedef int YYSTYPE; 16 | # define YYSTYPE_IS_DECLARED 1 17 | #endif 18 | 19 | /* compatibility with bison */ 20 | #ifdef YYPARSE_PARAM 21 | /* compatibility with FreeBSD */ 22 | # ifdef YYPARSE_PARAM_TYPE 23 | # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 24 | # else 25 | # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 26 | # endif 27 | #else 28 | # define YYPARSE_DECL() yyparse(void) 29 | #endif 30 | 31 | /* Parameters sent to lex. */ 32 | #ifdef YYLEX_PARAM 33 | # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 34 | # define YYLEX yylex(YYLEX_PARAM) 35 | #else 36 | # define YYLEX_DECL() yylex(void) 37 | # define YYLEX yylex() 38 | #endif 39 | 40 | /* Parameters sent to yyerror. */ 41 | #ifndef YYERROR_DECL 42 | #define YYERROR_DECL() yyerror(const char *s) 43 | #endif 44 | #ifndef YYERROR_CALL 45 | #define YYERROR_CALL(msg) yyerror(msg) 46 | #endif 47 | 48 | extern int YYPARSE_DECL(); 49 | 50 | extern int yydebug; 51 | extern int yynerrs; 52 | 53 | extern int yyerrflag; 54 | extern int yychar; 55 | extern YYSTYPE yyval; 56 | extern YYSTYPE yylval; 57 | -------------------------------------------------------------------------------- /test/yacc/rename_debug.output: -------------------------------------------------------------------------------- 1 | 0 $accept : S $end 2 | 3 | 1 S : error 4 | 5 | state 0 6 | $accept : . S $end (0) 7 | 8 | error shift 1 9 | . error 10 | 11 | S goto 2 12 | 13 | 14 | state 1 15 | S : error . (1) 16 | 17 | . reduce 1 18 | 19 | 20 | state 2 21 | $accept : S . $end (0) 22 | 23 | $end accept 24 | 25 | 26 | 2 terminals, 2 nonterminals 27 | 2 grammar rules, 3 states 28 | -------------------------------------------------------------------------------- /test/yacc/varsyntax_calc1.error: -------------------------------------------------------------------------------- 1 | YACC: 2 rules never reduced 2 | YACC: 18 shift/reduce conflicts, 26 reduce/reduce conflicts. 3 | -------------------------------------------------------------------------------- /test/yacc/varsyntax_calc1.tab.h: -------------------------------------------------------------------------------- 1 | #define DREG 257 2 | #define VREG 258 3 | #define CONST 259 4 | #define UMINUS 260 5 | #ifdef YYSTYPE 6 | #undef YYSTYPE_IS_DECLARED 7 | #define YYSTYPE_IS_DECLARED 1 8 | #endif 9 | #ifndef YYSTYPE_IS_DECLARED 10 | #define YYSTYPE_IS_DECLARED 1 11 | typedef union 12 | { 13 | int ival; /* dreg & vreg array index values*/ 14 | double dval; /* floating point values*/ 15 | INTERVAL vval; /* interval values*/ 16 | } YYSTYPE; 17 | #endif /* !YYSTYPE_IS_DECLARED */ 18 | extern YYSTYPE varsyntax_calc1_lval; 19 | -------------------------------------------------------------------------------- /warshall.c: -------------------------------------------------------------------------------- 1 | /* $Id: warshall.c,v 1.7 2010/06/06 22:48:51 tom Exp $ */ 2 | 3 | #include "defs.h" 4 | 5 | static void 6 | transitive_closure(unsigned *R, int n) 7 | { 8 | int rowsize; 9 | unsigned i; 10 | unsigned *rowj; 11 | unsigned *rp; 12 | unsigned *rend; 13 | unsigned *ccol; 14 | unsigned *relend; 15 | unsigned *cword; 16 | unsigned *rowi; 17 | 18 | rowsize = WORDSIZE(n); 19 | relend = R + n * rowsize; 20 | 21 | cword = R; 22 | i = 0; 23 | rowi = R; 24 | while (rowi < relend) 25 | { 26 | ccol = cword; 27 | rowj = R; 28 | 29 | while (rowj < relend) 30 | { 31 | if (*ccol & (unsigned)(1 << i)) 32 | { 33 | rp = rowi; 34 | rend = rowj + rowsize; 35 | while (rowj < rend) 36 | *rowj++ |= *rp++; 37 | } 38 | else 39 | { 40 | rowj += rowsize; 41 | } 42 | 43 | ccol += rowsize; 44 | } 45 | 46 | if (++i >= BITS_PER_WORD) 47 | { 48 | i = 0; 49 | cword++; 50 | } 51 | 52 | rowi += rowsize; 53 | } 54 | } 55 | 56 | void 57 | reflexive_transitive_closure(unsigned *R, int n) 58 | { 59 | int rowsize; 60 | unsigned i; 61 | unsigned *rp; 62 | unsigned *relend; 63 | 64 | transitive_closure(R, n); 65 | 66 | rowsize = WORDSIZE(n); 67 | relend = R + n * rowsize; 68 | 69 | i = 0; 70 | rp = R; 71 | while (rp < relend) 72 | { 73 | *rp |= (unsigned)(1 << i); 74 | if (++i >= BITS_PER_WORD) 75 | { 76 | i = 0; 77 | rp++; 78 | } 79 | 80 | rp += rowsize; 81 | } 82 | } 83 | --------------------------------------------------------------------------------