Index: stable/10/contrib/byacc/NOTES-btyacc-Disposition =================================================================== --- stable/10/contrib/byacc/NOTES-btyacc-Disposition (revision 272952) +++ stable/10/contrib/byacc/NOTES-btyacc-Disposition (nonexistent) @@ -1,80 +0,0 @@ -Tom Shields, March 17, 2014 - -NOTE: README.BTYACC needs to be re-written (or another README file created) -to explain how the extensions were adopted into the byacc-20140101 baseline. - -bytacc changes adopted; see README.BTYACC for details. ------------------------------------------------------- - - Changes to the skeleton to send debugging output to stderr. - - Changes to the types of the grammar tables from 'short' to 'int' if -MAXTABLE is defined to be > MAXSHORT for generation of large grammar tables -for large grammars. This can be set with the invocation of configure -using the --with-max-table-size=N option - - Changes to add syntactic sugaring for definition and semantic processing -of inherited attributes associated with non-terminal symbols on the rhs of -rules. Inherited attributes are implemented as {}-actions, and as such may -introduce reduce/reduce conflicts. The advantage over manual {}-actions is -that checking is performed on the number and types of inherited attributes, -and the positions on the semantic stack are automatically calculated. -Identical actions produced by the inherited attribute syntax are collapsed -into a single action, reducing reduce/reduce conflicts. - - The %type specification is extended to define the types of inherited -attributes associated with non-terminal symbols on the lhs of rules, in -addition to its original purpose in yacc for specifying the type of the -symbol itself on the parser's value stack. In order to permit the two - aspects to be used independently, the specification following -%type is optional. - - Added a mechanism to the parser skeleton for computing and propagating -the text position of grammar symbols if %locations directive is present in -the grammar specificaion, or if yacc is invoked with the -L flag. Includes -support for "@$" and "@N" (for N an integer) in actions to refer to symbol -locations. - - Added a bison compatible %destructor directive to define a memory -management mechanism to the parser skeleton that enables cleanup of semantic -values and text positions associated with the parsing stack that are -automatically discarded during error processing. - -The following is only available if configure is invoked with the ---enable-btyacc=yes: - - Changes to enable backtracking with semantic disambiguation, if yacc is -invoked with the -B flag. A yacc parser disambiguates shift/reduce conflicts -by choosing to shift, and reduce/reduce conflicts by reducing using the -earliest grammar rule (in the grammar specification). A btyacc parser handles -a conflict by remembering the current parse point and entering into trial parse -mode. In trial parse mode, the parser tries each of the conflicting options -until the first successs or until all options are exhausted. If the parser -runs into an error while in trial parse mode, it backtracks to the most recent -conflict point and tries the next alternative. If the parser finds a -successful parse, it backtracks to the point where it first entered trial parse -mode and continues with normal parsing, using the action at the start of the -successful trial path. Success in trial parse mode is achieved either by -successfully reducing the start symbol at the end of input or by invocation of -YYVALID (or YYVALID_NESTED). Semantic disambiguation is supported within -[]-actions, which are always executed, with invocation of YYERROR to terminate -a trial path or YYVALID (and YYVALID_NESTED). Yacc {}-actions are only -executed during normal parsing. - - -btyacc changes deferred: ------------------------- - - The -S command line flag to enable use of an alternate parser skeleton, -read from an external file. - - Preprocessor statements: %define, %ifdef/%endif, %include. - - -btyacc changes rejected: ------------------------- - - The yyerror_detailed() option for error messages is replaced by the -byacc feature for specifying options paramters to yyerror(). - - C++-specific features in the parser skeleton. Index: stable/10/contrib/byacc/NOTES-btyacc-Changes =================================================================== --- stable/10/contrib/byacc/NOTES-btyacc-Changes (revision 272952) +++ stable/10/contrib/byacc/NOTES-btyacc-Changes (nonexistent) @@ -1,385 +0,0 @@ -Tom Shields, March 17, 2014 - -PARKING LOT ISSUES: -------------------- -- verify debian packaging still works? - -- there are no #line directives in y.tab.i, other than those that come - from the input file and the skeleton file; to fix this, would need to - count output lines in externs_file and add 'write_externs_lineno()' - similar to 'write_code_lineno()' -- if there are no defined symbols, the .tab.h file isn't empty (weird case, - may not be worth fixing) -- consider: treat []-actions identical to {}-actions if not processing a - backtracking parser (avoids test case error)? - - -BTYACC CHANGES CURRENTLY DEFERRED, BY FILE: -------------------------------------------- - -push.skel -- skeleton for a 'push' parser -- needs to be upgraded match the structure of yaccpar.skel - -defs.h -- adopt '%include' changes -- adopt '%define'/'%ifdef'/'%endif' -- adopt -E flag to print preprocessed grammar to stdout - -error.c -- adopt '%include' changes -- NOTE: there is a btyacc change that might be worth adopting in byacc - [FileError() refactoring to eliminate duplicated code in most of the - error message functions] - -main.c -- adopt '%define' changes -- adopt '-DNAME' command line option to define preprocessor variable NAME -- adopt -E flag to print preprocessed grammar to stdout -- adopt '-S skeleton_file' command line option to select an alternate parser - skeleton file -- the skeleton file named by the -S flag is used as provided to open the - file; consider a change to this behavior to check whether the named file - has a path prefix, and if not, look in 'installation' directory if the - file is not found in the working directory - -output.c -- adopt '%include' changes - -reader.c -- adopt '%include' changes -- adopt '%define'/'%ifdef'/'%endif' changes -- adopt -E flag to print preprocessed grammar to stdout -- NOTE: there is a btyacc change that might be worth adopting in byacc - [copy_string() & copy_comment() refactoring to eliminate duplicated - code in copy_text() and copy_union()] - -warshall.c -- NOTE: there is a btyacc change that might be worth adopting in byacc - [shifting 'mask' incrementally rather than literal '1' by a variable - amount each time thru the loop] - - -================================================================================ - - -new files: ----------- - -skel2c -- modified from btyacc distribution: don't generate #include defs.h -- extended syntax recognized to include '%% insert VERSION here', generating - the defines for YYMAJOR, YYMINOR and YYPATCH at that point -- made generated tables type 'const char *const' to match skelton.c from - byacc-20130925 baseline -- added code to append text for write_section() to end of generated skeleton.c -- remove conversion of tab to \t in generated skeleton.c -- extended syntax recognized to include '%%ifdef', '%%ifndef', '%%else' and - '%%endif'; used in yaccpar.skel to bracket code that is specific to - backtracking - -yaccpar.skel.old -- created from skeleton.c in byacc-20140101 baseline; use of this skeleton - will create a version of skeleton.c that is close to that in the - byacc-20140101 baseline -- eliminated 'body_3' and 'trailer_2' skeleton segments - no need to generate - yyerror() invocation dynamically; YYERROR_CALL() is already generated - earlier, and so can be used in the skeleton to simplify -- added 'const' to types in '%% tables' section to match what skel2c, - start_int_table() and state_str_table() generate -- added a few cosmetic changes (e.g., added some additional comments, - reworded debugging output to match yaccpar.skel, changed yygrowstack() - to return YYENOMEM for 'out of memory' error, rather than -1, to match - yaccpar.skel; changed yyparse() return value from 1 to 2 for the - 'out of memory' error to match yaccpar.skel) -- added '#ifndef'/'#endif' around '#define YYINITSTACKSIZE 200' to allow - the value to be changed at compile time -- changed 'printf(' to 'fprintf(stderr, '; added stack depth (yydepth) to - debugging output from yaccpar.skel -- use 'YYINT' rather than 'short' for integer table types - -yaccpar.skel -- renamed from btyaccpa.ske, merged with btyacc-c.ske -- modified from btyacc distribution to match the latest byacc-20140101 - skeleton structure & data structures -- make local functions static -- change "virtual memory exceeded" to "memory exhausted" for bison - compatibility -- change debug output generation from printf/puts/putc onto stdout to use - fprintf/fputs/fputc onto stderr; include - stack depth and whether or not in trial parsing -- changed types of generated string tables to be 'const pointer to const char' -- check all malloc()/realloc() return values, ensure return value of - yyparse() = 2 if parsing failed due to memory exhaustion -- change YYDBPR() macro to YYSTYPE_TOSTRING(); define semantics as delivering - a char* value representing a semantic value (e.g., yylval or yyval, or the - contents of an entry on the semantic stack); additional parameter passed: - grammar symbol # (to assist interpretation of semantic value) -- change YYPOSN to YYLTYPE and yyposn to yylloc (position corresponding to - yylval) for bison compatibility; add yyloc (corresponding to yyval) -- move default definition of YYLTYPE into output.c, generating a typedef -- add '#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)'/'#endif' around - all lines specific to position processing -- add '#if defined(YYDESTRUCT_CALL)'/'#endif' around all lines specific to - semantic & position stack processing to reclaim memory associated with - discarded symbols -- add '%%ifdef YYBTYACC'/'%%endif' around all lines specific to backtrack - parsing; converted by skel2c into '#if defined(YYBTYACC)'/'#endif' -- distinguish between "yacc stack overflow" and "memory exhausted" situations -- consolidated termination cleanup code; introduced yyreturn, set to 2 after - labels yyoverflow/yyenomem, set to 1 after label yyabort, set to 0 after - label yyaccept; all termination cases jump to label yyreturn, which does - any cleanup then returns yyreturn value -- replaced YYDELETEVAL & YYDELETEPOSN user-supplied macro capability by - implementation of byacc-generated yydestruct() as defined by bison - compatible %destructor mechanism -- moved invocation of 'YYREDUCEPOSNFUNC' macro to immediately prior to, rather - than after, execution of final rule action (so that, at some future - date, implementation extensions can be added to enable custom calculation - of locations associated with non-terminals within rule actions); deleted - unnecessary flag 'reduce_posn'; deleted 'YYCALLREDUCEPOSN' macro; deleted - C++ variant of 'YYREDUCEPOSNFUNC' invocation -- adopt approach similar to bison for default computation of yyloc; change - macro 'YYREDUCEPOSNFUNC' name to 'YYLLOC_DEFAULT' for bison compatibility; - added 'yyerror_loc_range[2]' to hold start & end locations for error - situations that pop the stack -- use 'YYINT' rather than 'short' for integer table types, and for indexing - parser tables - -readskel.c -http://www.verisign.com/index.html- replaced error() with fprintf() - -mstring.h -- moved contents of mstring.h to defs.h - mstring.h is obsolete - -mstring.c -- replaced include of mstring.h with defs.h -- changed 'START' to 'HEAD' to remove conflict with 'START' used for - the start symbol defined in defs.h - -modified byacc files: ---------------------- - -skeleton.c -- skeleton.c is now generated from the appropriate skeleton file by 'skel2c' - -configure.in -- added configuration for --enable-btyacc option; if 'yes' add '-DYYBTYACC' - to DEFINES in makefile.in; --enable-btyacc defaults to 'no' -- added configuration for --with-max-table-size option; if present, - overrides the value of MAXTABLE defined in defs.h -- regenerate configure using autoconf - -makefile.in -- added mstring.c to C_FILES -- added mstring$o to OBJS -- added @DEFINES@ as value of DEFINES make variable -- added new make variable SKELETON with value 'yaccpar.skel' -- added rule to generate skeleton.c from $(SKELETON), depending on skel2c - and makefile -- added rm -f skeleton.c distclean rule -- moved dependency on makefile from only main$o & skeleton$o to $(OBJS), - since if ./configure is run changing, for example, from --enable-btyacc - to --disable-btyacc, all files must be recompiled to ensure a clean - executable -- add @MAXTABLE@ for optional '-DMAXTABLE=nnn' if configured using - --with-max-table-size=nnn -- changed 'cd test && rn 0f test-*'to 'rm -f $(testdir)/test-*' - -test/run_test.sh -- ??? - -test/run_make.sh -- ??? - -defs.h -- moved contents of mstring.h to defs.h - mstring.h is obsolete -- added to get the various system defined machine limits; - changed definitions of MAXCHAR, MAXSHORT, MINSHORT & BITS_PER_WORD to use - defines from ; changed definitions of BIT and SETBIT to use - value of BITS_PER_WORD -- added typedef for __compar_fn_t, conditioned on _COMPAR_FN_T being - undefined (at least for Mac OSX environment) -- adopt new symbol class values ACTION and ARGUMENT -- adopt changes/additions used by inherited attribute processing -- clean up locations of extern function definitions to match where they - actually live in source files -- adopt error functions from inherited attribute processing; added new error - functions -- added keyword code LOCATIONS for %locations -- added keyword code DESTRUCTOR for %destructor -- added extern decl for 'int locations'; true if %locations present -- added extern decl for 'int backtrack'; initialized to 0 (= false), set to - 1 (= true) if -B flag is present -- added extern decl for 'int destructor'; true if at least one %destructor - present in grammar spec file -- define 'YYINT' as the smallest C type that can be used to address a - table of size 'MAXTABLE'; define 'YYINT' based on the value of - 'MAXTABLE' using the standard system type size definitions from ; - define 'MAXYYINT' and 'MINYYINT' accordingly -- change 'Value_t' and 'Index_t' to 'YYINT' from 'short' -- allow 'MAXTABLE' to be defined by '-DMAXTABLE=nnn' at compile-time - -closure.c -- changed print_closure(), print_EFF() and print_first_derives() to 'static'; - added fwd declarations -- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already - used for variables/parameters that were related to variables/parameters - declared as 'short' - -error.c -- adopt error functions from inherited attribute processing; added a few - additional inherited attribute error functions - -graph.c -- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already - used for variables/parameters that were related to variables/parameters - declared as 'short' - -lalr.c -- changed MAXSHORT to MAXYYINT - -lr0.c -- changed MAXSHORT to MAXYYINT -- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already - used for variables/parameters that were related to variables/parameters - declared as 'short' - -main.c -- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already - used for variables/parameters that were related to variables/parameters - declared as 'short' - -mkpar.c -- backtracking attempts to resolve shift/reduce and reduce/reduce conflicts - -output.c -- generate prefix & YYPREFIX defines into externs file (-i, .tab.i) and - code file (-r, .code.c); generate into output file (.tab.c) only if not - using -r option; eliminates doubled output of prefix aliases if -r with - no -i in y.tab.c and y.code.c or if -r & -i in y.tab.i and y.code.c -- changed types of generated string tables to be 'const pointer to const char' -- adopt backtracking as an alternative in cases where otherwise we have a - conflict in the parsing actions (3, rather than 2, choices) -- wrap defines file with (where "yy" is value of 'symbol_prefix') - #ifndef __yy_defines_h_ - #define _yy_defines_h_ - - - - #endif -- avoid writing %%xdecls skeleton section twice if -r used -- eliminated 'body_3' and 'trailer_2' skeleton segments - no need to generate - yyerror() invocation dynamically; YYERROR_CALL() is already generated - earlier, and can be used in the pareser skeleton -- if -P flag (pure_parser), add yylloc as 2nd parameter to yylex() - (declaration & call) -- change YYPOSN to YYLTYPE and yyposn to yylloc (position corresponding to - yylval) for bison compatibility; add yyloc (corresponding to yyval) -- generate yylloc parameters for yylex & yyerror if %locations present -- add location as 1st parameter to declaraion & invocation of yyerror() if - %locations present -- output backtrack parsing tables if -B flag is present -- added generation of yystos[] with output_accessing_symbols() to allow - translation from a parser internal state number to the corresponding - grammar symbol number [0 .. nsyms) of the accessing symbol of that parser - state; used in the generated code for YYDESTRUCT_CALL() & - YYSTYPE_TOSTRING() to enable the correct semantic value union tag to be - determined when executing the implementation of YYDESTRUCT_CALL() or - YYSTYPE_TOSTRING() (similar to yystos[] in bison) -- added to output_prefix(): yystos; yycindex & yyctable if compiling - backtracking; yyloc & yylloc if %locations used -- extended yyname[] to include all grammar symbols, not just the terminal - symbols: '$end', 'error', '$accept', all non-terminals, including internally - generated non-terminals for embedded actions in rules, and 'illegal-symbol' - (which bison spells '$undefined'); '$end' already defined as a symbol 0, - rathern than adding 'end-of-file' as the name of symbol 0; added - 'illegal-symbol' from byacc-20140101 (NOTE: the comment in the code that - says byacc does not predefine '$end' and '$error' is incorrect; however, - both bison and byacc spell '$error' as 'error') -- added generation of #define YYTRANSLATE() from byacc-20140101, but changed - the definition for the undefined symbol case because it is no longer in - yyname[YYMAXTOKEN+1] but rather occurs after the last non-terminal symbol; - added #define YYUNDFTOKEN to contain the index in yyname of 'illegal-symbol' -- generate YYLTYPE in output_ltype() as a struct like for bison rather than - using #define in yaccpar.skel -- added 'write_code_lineno' invocation at start of 'output_prefix' -- added 'write_code_lineno' invocation at start of 'output_pure_parser' -- added 'write_code_lineno' invocation prior to generation of #include - for externs file -- added 'write_code_lineno' invocation after 1st 'write_section(fp, xdecls)' -- added '++outline;' prior to output of '#define YYTRANSLATE' - this was - actually causing almost all of the invocations of 'write_code_lineno' to - put out the correct #line directive -- corrected 'write_code_lineno' - the line number in a #line directive is - the number of the next line, not the number of the #line line -- changed MAXSHORT to MAXYYINT; changed 'high' local static from 'int' to - 'long' so that it can get higher than 'MAXYYINT' without machine-dependent - behavior; changed related formats from '%d' to '%ld' -- generate 'YYINT' rather than 'short' for integer table types -- generate YYDESTRUCT_DECL & YYDESTRUCT_CALL macros, similar to YYERROR_DECL - and YYERROR_CALL macros, that can be redefined by user, if desired, to add - additional parameters to yydestruct() (and even change the 'yydestruct' - function name) -- if at least one %destructor present, generate yydestruct(); 1st parameter - is a string indicating the context in which yydestruct() is invoked - (e.g., discarding input token, discarding state on stack, cleanup when - aborting); 2nd parameter is the internal grammar symbol number [0..nsyms) - of the accessing symbol of the parser state on the top of the stack; 3rd - parameter is a pointer to the semantic value to be reclaimed associated - with the grammar symbol in the 2nd parameter; if %locations is defined, - the 4th parameter is a pointer to the position value to be reclaimed - associated with the grammar symbol in the 2nd parameter - -reader.c -- adopt []-actions, similar to {}-actions; {}-actions are only executed when - not in trial mode, but []-actions are executed regardless of mode -- adopt new symbol class values ACTION and ARGUMENT -- adopt inherited attributes (syntax resembles arguments to non-terminal - symbols) -- adopt keyword table lookup from btyacc, modified to handle equivalence - of '-' and '_' in spelling of keywords -- adopt refactoring of tag table creation into cache_tag() for use in - multiple locations -- added new error functions in place of btyacc's generic error() function -- changed '0' to 'NULL' for pointer initialization -- reworked for-loop at end of get_line (part of DEFERRED '%ifdef/%endif' change) -- added %locations directive for bison compatibility to enable position - processing -- added decl for 'int locations'; true if %locations present -- added decl 'int backtrack'; initialized to 0 (= false), set to - 1 (= true) if -B flag is present -- process %locations if present, set location = 1 -- only process []-actions and only generate 'if (!yytrial)' prefix for - {}-actions if backtracking is enabled -- add decl for 'int destructor'; true if at least one %destructor is present -- add %destructor directive to enable semantic & position stack processing to - reclaim memory associated with discarded symbols -- process bison compatible %destructor (set destructor = 1); support @$ in - %destructor code to reference the position value if %locations is defined -- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already - used for variables/parameters that were related to variables/parameters - declared as 'short' -- if %locations present, support @N and @$ syntax as for bison to reference - the locations associated with the N-th rhs symbol and the lhs symbol, - respectively - -symtab.c -- initialize fields added to 'struct bucket' for non-terminal symbol - inherited attributes - -verbose.c -- for parse states with conflicts, the contents of the y.output file include - the trial shift and/or trial reduce actions -- added output to the end of the verbose report showing the correspondance - between grammar symbol #, internal parser symbol #, and grammar symbol name -- changed 'short' to 'Value_t' (in some instances, 'Value_t' was already - used for variables/parameters that were related to variables/parameters - declared as 'short' - -yacc.1 -- added options 'P', 'V', 'y' and '-o output_file' to the yacc command - synopsis (already covered in the description section) -- added options 'B', 'D' and 'L' to the yacc command synopsis; added text in - the description section -- added %locations description to the extensions section Index: stable/10/contrib/byacc/CHANGES =================================================================== --- stable/10/contrib/byacc/CHANGES (revision 272952) +++ stable/10/contrib/byacc/CHANGES (revision 272953) @@ -1,2138 +1,2173 @@ +2014-07-15 Thomas E. Dickey + + * aclocal.m4: resync with my-autoconf (no change to configure script) + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * test/run_test.sh: + make top-level "make check" work again, by adding another step to filtering + the test results. + +2014-07-14 Thomas E. Dickey + + * test/run_test.sh: changes from Garrett Cooper's patch: + a) ensure that the script returns an error-code if there are differences + b) escape "." character in left side of sed expression for $YACC + c) ensure that $ifBTYACC has a value + + * test/btyacc/big_b.output, test/btyacc/big_l.output, test/btyacc/help.output, test/btyacc/no_b_opt.output, test/btyacc/no_output2.output, test/btyacc/no_p_opt.output, test/btyacc/nostdin.output: + regen (reminder by Garrett Cooper) + +2014-07-14 Garrett.Cooper + + * test/btyacc/err_inherit1.error, test/btyacc/err_inherit2.error, test/btyacc/err_inherit3.error, test/btyacc/err_inherit4.error, test/btyacc/err_inherit5.error, test/btyacc/err_syntax1.error, test/btyacc/err_syntax10.error, test/btyacc/err_syntax11.error, test/btyacc/err_syntax12.error, test/btyacc/err_syntax13.error, test/btyacc/err_syntax14.error, test/btyacc/err_syntax15.error, test/btyacc/err_syntax16.error, test/btyacc/err_syntax17.error, test/btyacc/err_syntax18.error, test/btyacc/err_syntax19.error, test/btyacc/err_syntax2.error, test/btyacc/err_syntax21.error, test/btyacc/err_syntax22.error, test/btyacc/err_syntax23.error, test/btyacc/err_syntax24.error, test/btyacc/err_syntax25.error, test/btyacc/err_syntax26.error, test/btyacc/err_syntax27.error, test/btyacc/err_syntax3.error, test/btyacc/err_syntax4.error, test/btyacc/err_syntax5.error, test/btyacc/err_syntax6.error, test/btyacc/err_syntax7.error, test/btyacc/err_syntax7a.error, test/btyacc/err_syntax7b.error, test/btyacc/err_syntax8.error, test/btyacc/err_syntax8a.error, test/btyacc/err_syntax9.error, test/yacc/err_syntax1.error, test/yacc/err_syntax10.error, test/yacc/err_syntax11.error, test/yacc/err_syntax12.error, test/yacc/err_syntax13.error, test/yacc/err_syntax14.error, test/yacc/err_syntax15.error, test/yacc/err_syntax16.error, test/yacc/err_syntax17.error, test/yacc/err_syntax18.error, test/yacc/err_syntax19.error, test/yacc/err_syntax2.error, test/yacc/err_syntax21.error, test/yacc/err_syntax22.error, test/yacc/err_syntax23.error, test/yacc/err_syntax24.error, test/yacc/err_syntax25.error, test/yacc/err_syntax26.error, test/yacc/err_syntax27.error, test/yacc/err_syntax3.error, test/yacc/err_syntax4.error, test/yacc/err_syntax5.error, test/yacc/err_syntax6.error, test/yacc/err_syntax7.error, test/yacc/err_syntax7a.error, test/yacc/err_syntax7b.error, test/yacc/err_syntax8.error, test/yacc/err_syntax8a.error, test/yacc/err_syntax9.error: + regen + +2014-05-27 Tom.Shields + + * main.c: remove obsolete -D option from usage message + +2014-05-27 Thomas E. Dickey + + * VERSION, package/byacc.spec, package/debian/changelog, test/yacc/big_b.output, test/yacc/big_l.output, test/yacc/help.output, test/yacc/no_b_opt.output, test/yacc/no_output2.output, test/yacc/no_p_opt.output, test/yacc/nostdin.output: + bump + 2014-04-22 Thomas E. Dickey * mstring.c: use vsnprintf() to ensure that msprintf's buffer is large enough. * main.c, defs.h: add mstring_leaks() * configure: regen * output.c: fix a complementary warning * mstring.c: introduce vsnprintf * configure.in, config_h.in: add check for vsnprintf * output.c: quiet a type-conversion warning * mstring.c: fix a potential memory leak on ENOMEM quiet a couple of type-conversion warnings * defs.h: add/use GCC_PRINTFLIKE for msprintf() 2014-04-22 Tom.Shields * README.BTYACC: drop "NOTES-btyacc-Changes" and "NOTES-btyacc-Disposition", merging relevant content into README.BTYACC 2014-04-22 Thomas E. Dickey * package/pkgsrc/Makefile, VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec: bump 2014-04-19 Thomas E. Dickey * config.sub: 2014-04-03 * config.guess: 2014-03-23 2014-04-09 Rick.Spates * main.c, defs.h: patch to allow DEBUG build with WIN32 system 2014-04-09 Thomas E. Dickey * output.c, reader.c: gcc warnings * reader.c: fix const-cast warnings * test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/code_error.tab.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/error.tab.c, test/btyacc/rename_debug.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.tab.c, output.c: fix a few clang --analyze warnings; one was a case where output_ctable emitted an empty table (which should be an error). * reader.c: appease clang --analyze * defs.h: mark two functions as no-return. * package/debian/changelog: reason for release * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump * makefile.in: use $LINT_OPTS from environment via configure script * test/btyacc/ok_syntax1.output, test/btyacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.c, test/ok_syntax1.y, test/yacc/ok_syntax1.output: tweaks to make generated files from ok_syntax1.y compile with check_make rule * test/btyacc/rename_debug.c, test/btyacc/rename_debug.error, test/btyacc/rename_debug.h, test/btyacc/rename_debug.i, test/btyacc/rename_debug.output, test/yacc/rename_debug.c: reference output for testing * test/run_test.sh: retain the renaming done for code_debug.y so that check_make will work. * test/yacc/rename_debug.error, test/yacc/rename_debug.h, test/yacc/rename_debug.i, test/yacc/rename_debug.output: reference output for testing * test/btyacc/ok_syntax1.error: RCS_BASE * test/yacc/quote_calc4-s.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, yaccpar.c: regen * yacc.1: clarify relationship of btyacc features to default configuration. 2014-04-08 Thomas E. Dickey * test/yacc/ok_syntax1.output, test/yacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.h, test/btyacc/ok_syntax1.output, test/btyacc/ok_syntax1.tab.c, test/btyacc/ok_syntax1.tab.h: reference output for testing * test/ok_syntax1.y: RCS_BASE * test/yacc/ok_syntax1.error: reference output for testing * test/yacc/big_b.error, test/yacc/big_b.output, test/yacc/big_l.error, test/yacc/big_l.output, test/btyacc/big_b.error, test/btyacc/big_b.output, test/btyacc/big_l.error, test/btyacc/big_l.output, test/run_test.sh: exercise -L/-B options * test/yacc/code_debug.c, test/btyacc/code_debug.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax27.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/run_test.sh, test/yacc/no_b_opt1.output: use a better renaming of the YYPATCH definition (none of the test-cases rely upon it, but redefinition in the "make check_make" rule is a problem). * test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/varsyntax_calc1.tab.c: undid temporary reordering in reader() by Tom Shields to align with byacc outputs * test/run_test.sh: remove a repeated test-case * mstring.c: minor reformatting to make coverage analysis simpler 2014-04-07 Thomas E. Dickey * test/run_test.sh: tidy * test/yacc/help.error, test/yacc/help.output, test/yacc/no_b_opt.error, test/yacc/no_b_opt.output, test/yacc/no_b_opt1.error, test/yacc/no_b_opt1.output, test/yacc/no_code_c.error, test/yacc/no_code_c.output, test/yacc/no_defines.error, test/yacc/no_defines.output, test/yacc/no_graph.error, test/yacc/no_graph.output, test/yacc/no_include.error, test/yacc/no_include.output, test/yacc/no_opts.error, test/yacc/no_opts.output, test/yacc/no_output.error, test/yacc/no_output.output, test/yacc/no_output1.error, test/yacc/no_output1.output, test/yacc/no_output2.error, test/yacc/no_output2.output, test/yacc/no_p_opt.error, test/yacc/no_p_opt.output, test/yacc/no_p_opt1.error, test/yacc/no_p_opt1.output, test/yacc/no_verbose.error, test/yacc/no_verbose.output, test/yacc/nostdin.error, test/yacc/nostdin.output, test/yacc/test-no_b_opt1.output: reference output for testing * test/run_test.sh: add special checks for flags which depend on writable/existing files * test/btyacc/no_b_opt1.output, test/btyacc/no_p_opt1.output, test/btyacc/no_b_opt.error, test/btyacc/no_b_opt.output, test/btyacc/no_b_opt1.error, test/btyacc/no_code_c.output, test/btyacc/no_p_opt.error, test/btyacc/no_p_opt.output, test/btyacc/no_p_opt1.error, test/btyacc/no_output2.output, test/btyacc/no_code_c.error, test/btyacc/no_output2.error, test/btyacc/no_include.error, test/btyacc/no_include.output, test/btyacc/no_defines.output, test/btyacc/no_defines.error, test/btyacc/no_verbose.output, test/btyacc/no_graph.output, test/btyacc/no_graph.error, test/btyacc/no_opts.error, test/btyacc/no_opts.output, test/btyacc/no_verbose.error, test/btyacc/nostdin.error, test/btyacc/nostdin.output, test/btyacc/no_output.error, test/btyacc/no_output.output, test/btyacc/no_output1.error, test/btyacc/no_output1.output: reference output for testing * main.c: change CREATE_FILE_NAMES() to use local function rather than inline code, to simplify coverage analysis. * test/btyacc/err_syntax27.error, test/btyacc/err_syntax27.output, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax27.tab.h, test/btyacc/help.error, test/btyacc/help.output, test/yacc/err_syntax27.error, test/yacc/err_syntax27.output, test/yacc/err_syntax27.tab.c, test/yacc/err_syntax27.tab.h: reference output for testing * test/err_syntax27.y: testcase for missing_brace() * error.c: ifdef'd non-btyacc function * lr0.c: ifdef'd debug-code * yaccpar.skel: use YYINT's to replace short's as in btyaccpar.skel * test/btyacc/code_debug.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_debug.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, output.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/run_test.sh: 2010/11/26 simplification of output.c using putc_code() and putl_code() omitted an adjustment of the #line value used for code-file. Fix that. Also, amend 2005/05/04 change to run_test.sh to retain a dummy line for YYPATCH #define's to make test-outputs easier to compare #line's (report by Tom Shields) 2014-04-06 Thomas E. Dickey * reader.c: fix for valgrind (the calloc's are intentional - valgrind reported use of uninitialized memory) * lr0.c, output.c: fix for valgrind * test/btyacc/code_debug.c, test/btyacc/code_debug.error, test/btyacc/code_debug.h, test/btyacc/code_debug.i, test/btyacc/code_debug.output: RCS_BASE * test/yacc/code_debug.c, test/yacc/code_debug.h: exercise the -i option * test/yacc/code_debug.i: reference output for testing * test/run_test.sh: exercise the -i option * test/yacc/code_debug.c: reference output for testing * test/run_test.sh: exercise the "-o" option * test/yacc/code_debug.error, test/yacc/code_debug.h, test/yacc/code_debug.output: reference output for testing * output.c: don't call exit() without giving a chance to cleanup. * mstring.c: ifdef'd functions not used in byacc * btyaccpar.c: generated from btyaccpar.skel * yaccpar.c: generated from yaccpar.skel * skel2c: change the generated-by comment to show which version of this script (and which version of the given skeleton file) were used to produce the C-file. * configure: regen * makefile.in: add rules to generate byacc and btyacc parser skeleton files independently * aclocal.m4: CF_PROG_AWK - add to byacc's configure script CF_INTEL_COMPILER cleanup the -no-gcc option which was leftover from testing - prcs does not build with this option. CF_MAKE_DOCS protect $2 from substitution, for luit's "$(manext)" CF_XOPEN_SOURCE for Solaris (tested with gcc/g++ 3.4.3 on Solaris 10 and gcc/g++ 4.5.2 on Solaris 11), suppress the followup check for defining _XOPEN_SOURCE because it is not needed, as well as because g++ 4.7.3 (no package, used in Sage for Solaris 10) has some unspecified header breakage which is triggered by the duplicate definition. * configure.in: modify so skeleton-source is determined by configure options rather than by having developer rename yaccpar.skel.old to yaccpar.skel * descrip.mms: rename skeleton * vmsbuild.com: fwiw, renamed the skeleton for consistency with makefile * skel2c, skeleton.c: resync skeleton and its generating files * yaccpar.skel: renamed yaccpar.skel.old to yaccpar.skel, to allow using makefile suffix rules * yaccpar.skel.old: resync skeleton and its generating files * test/run_make.sh: improve cleanup after error recovery * test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, output.c, skeleton.c, defs.h: use improvement from Tom Shield's btyacc changes, getting rid of special cases for generating two yyerror calls in skeleton * output.c: simplify output_yyerror_decl() * test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.tab.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, output.c: add second "const" to string-table declarations, from Tom Shield's btyacc changes * test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: discard unnecessary call on write_code_lineno() from Tom Shield's changes * test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, output.c: use YYINT typedef from Tom Shield's btyacc changes to replace explicit "short" * test/yacc/code_calc.code.c, test/yacc/code_error.code.c, output.c: use fix from Tom Shield's btyacc changes: remove redundant extern-declaration for YYPARSE_DECL() * test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c: discard unnecessary call on write_code_lineno() from Tom Shield's changes * output.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.tab.c: use fix from Tom Shield's btyacc changes: prefix-definitions went to the output (.tab.c) file in a case where they should have gone to the code (.code.c) file. Remove now-redundant call to output_prefix(). * main.c: do the same for help-message * main.c: use OUTPUT_SUFFIX symbol in an overlooked case * test/run_make.sh: modify to avoid use of VPATH, which has no standard implementation 2014-04-05 Thomas E. Dickey * test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c: discard a change which merged CountLines() with explicit comparisons against code_file because that adds extra to the #line values * test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/calc.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/error.tab.c, output.c: add Tom Shield's change to allow definition of YYSTYPE_IS_DECLARED symbol to override fallback typedef for YYSTYPE when that symbol is undefined * test/btyacc/error.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: minor tweak to coding style - use parenthesis for "defined" operator's parameter * test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c: regen to make YYMAXTOKEN and YYUNDFTOKEN adjacent * test/yacc/err_syntax20.tab.c, test/yacc/grammar.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c: regen after adding the YYUNDFTOKEN symbol * output.c: integrate Tom Shield's btyacc changes which introduce the YYUNDFTOKEN symbol (I changed order of output to keep this adjacent to YYMAXTOKEN) * reader.c: merge all but one small change from Tom Shield's btyacc changes - that changes the order of code-file in the tests. * test/btyacc/btyacc_demo.tab.c: regen * test/btyacc_demo.y: fix prototypes 2014-04-04 Thomas E. Dickey * reader.c, defs.h, main.c: more merging of Tom Shield's btyacc changes. In the merge, I moved the symbol_pval inside the btyacc ifdef's and added some more btyacc ifdefs 2014-04-03 Thomas E. Dickey * reader.c: merge-in 3/4 of btyacc's changes, deferring those which change test-outputs. Tom Shield's changes split-out copy_string() and copy_comment() functions to simplify some logic, as well as adding btyacc-only chunks * makefile.in: build mstring.o, needed for changes in reader.c * output.c: merge-in all of btyacc's changes which do not change byacc's test-output. Some of the merge uses ifdef-changes which I applied to ongoing resync, e.g., the introduction of PER_STATE. 2014-04-02 Thomas E. Dickey * test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c: regen * output.c: fix typo * output.c, reader.c: merge in some chunks of reader and output files which do not affect byacc tests * test/yacc/calc2.tab.c, test/yacc/calc3.tab.c: regen * test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, skeleton.c: incorporate YYENOMEM and YYEOF symbols from btyacc * output.c: merge chunk from btyacc changes for header-guards * btyaccpar.skel: RCS_BASE * yaccpar.skel: comment-out yysccsid[], for FreeBSD build-issues remove GCC_UNUSED to reduce name-pollution as well as being simpler * main.c: move a btyacc symbol outside ifdef to work around current state of merge * defs.h: add USE_HEADER_GUARDS to defer whether to modify byacc's header-output * test/run_make.sh: do not try to compile files used for testing syntax-errors, since they are likely to be incomplete 2014-04-02 Tom.Shields * main.c: changes for btyacc 2014-04-01 Thomas E. Dickey * reader.c: integrate change by Tom Shields to use bsearch rather than successive calls to matchec() * defs.h: typedef __compar_fn_t is unnecessary * test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: omit the GCC_UNUSED, as noted by Tom Shields not really essential 2014-04-01 Tom.Shields * verbose.c: changes for btyacc, ifdef'd 2014-04-01 Thomas E. Dickey * mkpar.c: eliminate most of the ifdef's using macros 2014-04-01 Tom.Shields * mkpar.c: merge btyacc changes (ifdef'd - no change to byacc) * error.c: new functions used for reporting errors from the btyacc configuration (I reordered some, and ifdef'd the new ones -TD) 2014-03-31 Thomas E. Dickey * test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c: omit the GCC_UNUSED, as noted by Tom Shields not really essential * test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c: regen 2014-03-29 Thomas E. Dickey * test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, skeleton.c: comment-out yysccsid in the banner because it produces unnecessary compiler warnings. The suggested alternative (using #pragma ident) in the preceding comment is also obsolete; remove that comment (request by Gleb Smirnoff). * test/run_test.sh: for yacc, ignore the inherit testcases, since they are btyacc-specific 2014-03-28 Thomas E. Dickey * test/yacc/varsyntax_calc1.error, test/yacc/varsyntax_calc1.output, test/yacc/varsyntax_calc1.tab.c, test/yacc/varsyntax_calc1.tab.h, test/yacc/err_inherit3.error, test/yacc/err_inherit3.output, test/yacc/err_inherit3.tab.c, test/yacc/err_inherit3.tab.h, test/yacc/err_inherit4.error, test/yacc/err_inherit4.output, test/yacc/err_inherit4.tab.c, test/yacc/err_inherit4.tab.h, test/yacc/err_inherit5.error, test/yacc/err_inherit5.output, test/yacc/err_inherit5.tab.c, test/yacc/err_inherit5.tab.h, test/yacc/inherit0.error, test/yacc/inherit0.output, test/yacc/inherit0.tab.c, test/yacc/inherit0.tab.h, test/yacc/inherit1.error, test/yacc/inherit1.output, test/yacc/inherit1.tab.c, test/yacc/inherit1.tab.h, test/yacc/inherit2.error, test/yacc/inherit2.output, test/yacc/inherit2.tab.c, test/yacc/inherit2.tab.h, test/yacc/empty.error, test/yacc/empty.output, test/yacc/empty.tab.c, test/yacc/empty.tab.h, test/yacc/err_inherit1.error, test/yacc/err_inherit1.output, test/yacc/err_inherit1.tab.c, test/yacc/err_inherit1.tab.h, test/yacc/err_inherit2.error, test/yacc/err_inherit2.output, test/yacc/err_inherit2.tab.c, test/yacc/err_inherit2.tab.h: reference output for testing * test/run_lint.sh, test/run_make.sh, test/run_test.sh: moving #define's out of makefile broke check for yacc vs btyacc (fix) 2014-03-28 Tom.Shields * test/btyacc/btyacc_demo.tab.c, test/btyacc/err_inherit3.error, test/btyacc/err_inherit3.output, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit3.tab.h, test/btyacc/err_inherit2.error, test/btyacc/err_inherit2.output, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit2.tab.h, test/btyacc/err_inherit4.error, test/btyacc/err_inherit4.output, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit4.tab.h, test/btyacc/err_inherit5.error, test/btyacc/err_inherit5.output, test/btyacc/err_inherit5.tab.c, test/btyacc/err_inherit5.tab.h, test/btyacc/inherit0.error, test/btyacc/inherit0.output, test/btyacc/inherit0.tab.c, test/btyacc/inherit0.tab.h, test/btyacc/inherit1.error, test/btyacc/inherit1.output, test/btyacc/inherit1.tab.c, test/btyacc/inherit1.tab.h, test/btyacc/inherit2.error, test/btyacc/inherit2.output, test/btyacc/inherit2.tab.c, test/btyacc/inherit2.tab.h, test/btyacc/calc.error, test/btyacc/err_inherit1.error, test/btyacc/err_inherit1.output, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit1.tab.h: reference output for testing * defs.h: new functions/variables for btyacc (I reordered and ifdef'd -TD) * test/inherit0.y, test/inherit1.y: testcase for btyacc 2014-03-27 Tom.Shields * test/err_inherit5.y, test/err_inherit4.y, test/err_inherit3.y, test/err_inherit2.y, test/err_inherit1.y, test/inherit2.y: testcase for btyacc 2014-03-25 Tom.Shields * symtab.c: extra initialization needed for btyacc (I ifdef'd -TD) * yacc.1: document -L/-B features from btyacc 2014-03-25 Thomas E. Dickey * yacc.1: typo * configure: regen * configure.in: modified new options to act like those in my other configure-scripts, e.g., showing what option is being tested, and the resulting value. Put the definitions in config.h rather than in the makefile. 2014-03-25 Tom.Shields * makefile.in: add/use LINTFLAGS variable make all of the objects (not just skeleton) rebuild if makefile changes modify check-rule to reflect updates to run_test.sh vs subdirectory * mstring.c: byacc-btyacc-20140323 2014-03-25 Thomas E. Dickey * test/btyacc/RCS, test/yacc/RCS: PERMIT FILE * config_h.in: updated with autoheader-252 2014-03-25 Tom.Shields * README.BTYACC: byacc-btyacc-20140323 2014-03-24 Tom.Shields * test/btyacc/err_syntax1.output, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax1.tab.h, test/btyacc/err_syntax10.error, test/btyacc/err_syntax10.output, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax10.tab.h, test/btyacc/err_syntax11.error, test/btyacc/err_syntax11.output, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax11.tab.h, test/btyacc/err_syntax12.error, test/btyacc/err_syntax12.output, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax12.tab.h, test/btyacc/err_syntax13.error, test/btyacc/err_syntax13.output, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax13.tab.h, test/btyacc/err_syntax14.error, test/btyacc/err_syntax14.output, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax14.tab.h, test/btyacc/err_syntax15.error, test/btyacc/err_syntax15.output, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax15.tab.h, test/btyacc/err_syntax16.error, test/btyacc/err_syntax16.output, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax16.tab.h, test/btyacc/err_syntax17.error, test/btyacc/err_syntax17.output, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax17.tab.h, test/btyacc/err_syntax18.error, test/btyacc/err_syntax18.output, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax18.tab.h, test/btyacc/err_syntax19.error, test/btyacc/err_syntax19.output, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax19.tab.h, test/btyacc/err_syntax2.output, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax2.tab.h, test/btyacc/err_syntax20.error, test/btyacc/err_syntax20.output, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax20.tab.h, test/btyacc/err_syntax21.error, test/btyacc/err_syntax21.output, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax21.tab.h, test/btyacc/err_syntax22.error, test/btyacc/err_syntax22.output, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax22.tab.h, test/btyacc/err_syntax23.error, test/btyacc/err_syntax23.output, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax23.tab.h, test/btyacc/err_syntax24.error, test/btyacc/err_syntax24.output, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax24.tab.h, test/btyacc/err_syntax25.error, test/btyacc/err_syntax25.output, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax25.tab.h, test/btyacc/err_syntax26.error, test/btyacc/err_syntax26.output, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax26.tab.h, test/btyacc/err_syntax3.output, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax3.tab.h, test/btyacc/err_syntax4.output, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax4.tab.h, test/btyacc/err_syntax5.output, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax5.tab.h, test/btyacc/err_syntax6.output, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax6.tab.h, test/btyacc/err_syntax7.output, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7.tab.h, test/btyacc/err_syntax7a.output, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7a.tab.h, test/btyacc/err_syntax7b.output, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax7b.tab.h, test/btyacc/err_syntax8.output, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8.tab.h, test/btyacc/err_syntax8a.output, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax8a.tab.h, test/btyacc/err_syntax9.output, test/btyacc/err_syntax9.tab.c, test/btyacc/err_syntax9.tab.h: reference output for testing 2014-03-24 Thomas E. Dickey * defs.h: fix compiler warnings due to mputc() 2014-03-23 Tom.Shields * test/btyacc_demo.y: testcase for btyacc * test/btyacc/varsyntax_calc1.error, test/btyacc/varsyntax_calc1.output, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/varsyntax_calc1.tab.h: reference output for testing * test/varsyntax_calc1.y, test/btyacc_calc1.y: testcase for btyacc 2014-03-23 Thomas E. Dickey * test/err_syntax26.error, test/err_syntax26.output, test/err_syntax26.tab.c, test/err_syntax26.tab.h, test/yacc/err_syntax26.error, test/yacc/err_syntax26.output, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax26.tab.h: reference output for testing * test/err_syntax26.y: testcase for missing_brace() * test/err_syntax25.error, test/err_syntax25.output, test/err_syntax25.tab.c, test/err_syntax25.tab.h, test/yacc/err_syntax25.error, test/yacc/err_syntax25.output, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax25.tab.h: reference output for testing * test/err_syntax25.y: testcase for over_unionized() * test/err_syntax24.error, test/err_syntax24.output, test/err_syntax24.tab.c, test/err_syntax24.tab.h, test/yacc/err_syntax24.error, test/yacc/err_syntax24.output, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax24.tab.h: reference output for testing * test/err_syntax24.y: testcase for default_action_warning() 2014-03-23 Tom.Shields * test/btyacc/quote_calc3-s.error, test/btyacc/quote_calc4-s.error, test/btyacc/quote_calc4.error, test/btyacc/grammar.dot, test/btyacc/grammar.error, test/btyacc/pure_calc.error, test/btyacc/pure_error.error, test/btyacc/quote_calc-s.error, test/btyacc/quote_calc.error, test/btyacc/quote_calc2-s.error, test/btyacc/quote_calc2.error, test/btyacc/quote_calc3.error, test/btyacc/err_syntax2.error, test/btyacc/err_syntax3.error, test/btyacc/err_syntax4.error, test/btyacc/err_syntax5.error, test/btyacc/err_syntax6.error, test/btyacc/err_syntax7.error, test/btyacc/err_syntax7a.error, test/btyacc/err_syntax7b.error, test/btyacc/err_syntax8.error, test/btyacc/err_syntax8a.error, test/btyacc/err_syntax9.error, test/btyacc/error.error, test/btyacc/calc1.error, test/btyacc/calc2.error, test/btyacc/calc3.error, test/btyacc/code_calc.error, test/btyacc/code_error.error, test/btyacc/empty.error, test/btyacc/err_syntax1.error, test/btyacc/btyacc_calc1.error, test/btyacc/btyacc_demo.error: reference output for testing 2014-03-23 Thomas E. Dickey * test/err_syntax23.error, test/err_syntax23.output, test/err_syntax23.tab.c, test/err_syntax23.tab.h, test/yacc/err_syntax23.error, test/yacc/err_syntax23.output, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax23.tab.h: reference output for testing * test/err_syntax23.y: testcase for untyped_lhs() 2014-03-23 Tom.Shields * test/run_test.sh: move test-outputs into subdirectories to keep btyacc/yacc results separate 2014-03-23 Thomas E. Dickey * test/err_syntax22.error, test/err_syntax22.output, test/err_syntax22.tab.c, test/err_syntax22.tab.h, test/yacc/err_syntax22.error, test/yacc/err_syntax22.output, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax22.tab.h: reference output for testing * test/err_syntax22.y: testcase for untyped_rhs() * test/err_syntax21.error, test/err_syntax21.output, test/err_syntax21.tab.c, test/err_syntax21.tab.h, test/yacc/err_syntax21.error, test/yacc/err_syntax21.output, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax21.tab.h, test/err_syntax20.error, test/err_syntax20.output, test/err_syntax20.tab.c, test/err_syntax20.tab.h, test/yacc/err_syntax20.error, test/yacc/err_syntax20.output, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax20.tab.h: reference output for testing * test/err_syntax20.y: testcase for undefined_symbol_warning() * test/err_syntax21.y: testcase for unknown_rhs() * test/err_syntax19.error, test/err_syntax19.output, test/err_syntax19.tab.c, test/err_syntax19.tab.h, test/yacc/err_syntax19.error, test/yacc/err_syntax19.output, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax19.tab.h: reference output for testing * test/err_syntax19.y: testcase for dollar_error() * test/err_syntax18.error, test/err_syntax18.output, test/err_syntax18.tab.c, test/err_syntax18.tab.h, test/yacc/err_syntax18.error, test/yacc/err_syntax18.output, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax18.tab.h: reference output for testing * test/err_syntax18.y: testcase for dollar_warning() * test/err_syntax17.error, test/err_syntax17.output, test/err_syntax17.tab.c, test/err_syntax17.tab.h, test/yacc/err_syntax17.error, test/yacc/err_syntax17.output, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax17.tab.h: reference output for testing * test/err_syntax17.y: testcase for unterminated_action() 2014-03-22 Thomas E. Dickey * test/err_syntax16.error, test/err_syntax16.output, test/err_syntax16.tab.c, test/err_syntax16.tab.h, test/yacc/err_syntax16.error, test/yacc/err_syntax16.output, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax16.tab.h: reference output for testing * test/err_syntax16.y: testcase for terminal_lhs() * test/err_syntax15.error, test/err_syntax15.output, test/err_syntax15.tab.c, test/err_syntax15.tab.h, test/yacc/err_syntax15.error, test/yacc/err_syntax15.output, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax15.tab.h: reference output for testing * test/err_syntax15.y: testcase for no_grammar() * test/err_syntax14.error, test/err_syntax14.output, test/err_syntax14.tab.c, test/err_syntax14.tab.h, test/yacc/err_syntax14.error, test/yacc/err_syntax14.output, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax14.tab.h: reference output for testing * test/err_syntax14.y: testcase for restarted_warning() and undefined_goal() * test/err_syntax13.error, test/err_syntax13.output, test/err_syntax13.tab.c, test/err_syntax13.tab.h, test/yacc/err_syntax13.error, test/yacc/err_syntax13.output, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax13.tab.h: reference output for testing * test/err_syntax13.y: testcase for terminal_start() * test/err_syntax12.error, test/err_syntax12.output, test/err_syntax12.tab.c, test/err_syntax12.tab.h, test/yacc/err_syntax12.error, test/yacc/err_syntax12.output, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax12.tab.h: reference output for testing * test/err_syntax12.y: testcase for revalued_warning() * test/err_syntax11.error, test/err_syntax11.output, test/err_syntax11.tab.c, test/err_syntax11.tab.h, test/yacc/err_syntax11.error, test/yacc/err_syntax11.output, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax11.tab.h: reference output for testing * test/err_syntax11.y: testcase for reprec_warning() * test/err_syntax10.error, test/err_syntax10.output, test/err_syntax10.tab.c, test/err_syntax10.tab.h, test/yacc/err_syntax10.error, test/yacc/err_syntax10.output, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax10.tab.h: reference output for testing * test/err_syntax10.y: testcase for retyped_warning() 2014-03-21 Thomas E. Dickey * test/err_syntax9.error, test/err_syntax9.output, test/err_syntax9.tab.c, test/err_syntax9.tab.h, test/yacc/err_syntax9.error, test/yacc/err_syntax9.output, test/yacc/err_syntax9.tab.c, test/yacc/err_syntax9.tab.h: reference output for testing * test/err_syntax9.y: testcase for tokenized_start() * test/err_syntax8.error, test/err_syntax8.output, test/err_syntax8.tab.c, test/err_syntax8.tab.h, test/err_syntax8a.error, test/err_syntax8a.output, test/err_syntax8a.tab.c, test/err_syntax8a.tab.h, test/yacc/err_syntax8.error, test/yacc/err_syntax8.output, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8.tab.h, test/yacc/err_syntax8a.error, test/yacc/err_syntax8a.output, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax8a.tab.h: reference output for testing * test/err_syntax8a.y, test/err_syntax8.y: testcase for used_reserved() * test/err_syntax7.error, test/err_syntax7.output, test/err_syntax7.tab.c, test/err_syntax7.tab.h, test/err_syntax7a.error, test/err_syntax7a.output, test/err_syntax7a.tab.c, test/err_syntax7a.tab.h, test/err_syntax7b.error, test/err_syntax7b.output, test/err_syntax7b.tab.c, test/err_syntax7b.tab.h, test/yacc/err_syntax7.error, test/yacc/err_syntax7.output, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7.tab.h, test/yacc/err_syntax7a.error, test/yacc/err_syntax7a.output, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7a.tab.h, test/yacc/err_syntax7b.error, test/yacc/err_syntax7b.output, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax7b.tab.h: reference output for testing * test/err_syntax7b.y, test/err_syntax7a.y, test/err_syntax7.y: testcase for illegal_character() * test/err_syntax6.error, test/err_syntax6.output, test/err_syntax6.tab.c, test/err_syntax6.tab.h, test/yacc/err_syntax6.error, test/yacc/err_syntax6.output, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax6.tab.h: reference output for testing * test/err_syntax6.y: testcase for illegal_tag() * test/err_syntax5.error, test/err_syntax5.output, test/err_syntax5.tab.c, test/err_syntax5.tab.h, test/yacc/err_syntax5.error, test/yacc/err_syntax5.output, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax5.tab.h: reference output for testing * test/err_syntax5.y: testcase for unterminated_union() * test/err_syntax4.error, test/err_syntax4.output, test/err_syntax4.tab.c, test/err_syntax4.tab.h, test/yacc/err_syntax4.error, test/yacc/err_syntax4.output, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax4.tab.h: reference output for testing * test/err_syntax4.y: testcase for unterminated_text() * test/err_syntax3.error, test/err_syntax3.output, test/err_syntax3.tab.c, test/err_syntax3.tab.h, test/yacc/err_syntax3.error, test/yacc/err_syntax3.output, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax3.tab.h: reference output for testing * test/err_syntax3.y: testcase for unterminated_string() * test/err_syntax2.error, test/err_syntax2.output, test/err_syntax2.tab.c, test/err_syntax2.tab.h, test/yacc/err_syntax2.error, test/yacc/err_syntax2.output, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax2.tab.h: reference output for testing * test/err_syntax2.y: testcase for unterminated_comment() * test/err_syntax1.error, test/yacc/err_syntax1.error: reference output for testing * test/err_syntax1.y: test-case with syntax error (and nonprinting character) * test/calc.error, test/calc1.error, test/calc2.error, test/calc3.error, test/code_calc.error, test/code_error.error, test/err_syntax1.error, test/error.error, test/grammar.error, test/pure_calc.error, test/pure_error.error, test/quote_calc-s.error, test/quote_calc.error, test/quote_calc2-s.error, test/quote_calc2.error, test/quote_calc3-s.error, test/quote_calc3.error, test/quote_calc4-s.error, test/quote_calc4.error, test/yacc/calc.error, test/yacc/calc1.error, test/yacc/calc2.error, test/yacc/calc3.error, test/yacc/code_calc.error, test/yacc/code_error.error, test/yacc/error.error, test/yacc/grammar.error, test/yacc/pure_calc.error, test/yacc/pure_error.error, test/yacc/quote_calc-s.error, test/yacc/quote_calc.error, test/yacc/quote_calc2-s.error, test/yacc/quote_calc2.error, test/yacc/quote_calc3-s.error, test/yacc/quote_calc3.error, test/yacc/quote_calc4-s.error, test/yacc/quote_calc4.error: reference output for testing * test/run_test.sh: save stderr to reference files, to capture shift/reduce messages as well as syntax-error messages * test/err_syntax1.output, test/err_syntax1.tab.c, test/err_syntax1.tab.h, test/yacc/err_syntax1.output, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax1.tab.h: reference output for testing * test/run_test.sh: generate a ".dot" file for the grammar file * test/grammar.dot: RCS_BASE * test/yacc/grammar.dot: reference output for testing 2014-03-19 Tom.Shields * output.c: rename MAXSHORT to MAXYYINT 2014-03-18 Tom.Shields * yaccpar.skel: skeleton with btyacc additions * NOTES-btyacc-Changes: byacc-btyacc-20140323 * test/btyacc/btyacc_calc1.output, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_calc1.tab.h: reference output for testing * test/run_make.sh: move test-outputs into subdirectories to keep btyacc/yacc results separate * test/btyacc/pure_calc.tab.c, test/btyacc/pure_calc.tab.h, test/btyacc/pure_error.output, test/btyacc/pure_error.tab.c, test/btyacc/pure_error.tab.h, test/btyacc/quote_calc-s.output, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc-s.tab.h, test/btyacc/quote_calc.output, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc.tab.h, test/btyacc/quote_calc2-s.output, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2-s.tab.h, test/btyacc/quote_calc2.output, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc2.tab.h, test/btyacc/quote_calc3-s.output, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3-s.tab.h, test/btyacc/quote_calc3.output, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc3.tab.h, test/btyacc/quote_calc4-s.output, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4-s.tab.h, test/btyacc/quote_calc4.output, test/btyacc/quote_calc4.tab.c, test/btyacc/quote_calc4.tab.h, test/btyacc/calc1.output, test/btyacc/calc1.tab.c, test/btyacc/calc1.tab.h, test/btyacc/calc2.output, test/btyacc/calc2.tab.c, test/btyacc/calc2.tab.h, test/btyacc/calc3.output, test/btyacc/calc3.tab.c, test/btyacc/calc3.tab.h, test/btyacc/code_calc.code.c, test/btyacc/code_calc.output, test/btyacc/code_calc.tab.c, test/btyacc/code_calc.tab.h, test/btyacc/code_error.code.c, test/btyacc/code_error.output, test/btyacc/code_error.tab.c, test/btyacc/code_error.tab.h, test/btyacc/empty.output, test/btyacc/empty.tab.c, test/btyacc/empty.tab.h, test/btyacc/error.output, test/btyacc/error.tab.c, test/btyacc/error.tab.h, test/btyacc/grammar.output, test/btyacc/grammar.tab.c, test/btyacc/grammar.tab.h, test/btyacc/pure_calc.output, test/btyacc/btyacc_demo.output, test/btyacc/btyacc_demo.tab.h, test/btyacc/calc.output, test/btyacc/calc.tab.c, test/btyacc/calc.tab.h: reference output for testing * defs.h: several changes to help decouple the use of 'short' as the type of value used in yacc parsers. * NOTES-btyacc-Disposition: byacc-btyacc-20140323 2014-03-17 Tom.Shields * skel2c, yaccpar.skel, yaccpar.skel.old: RCS_BASE * test/run_lint.sh: move test-outputs into subdirectories to keep btyacc/yacc results separate * configure.in: add --with-max-table-size and --enable-btyacc options 2014-03-16 Tom.Shields * main.c: use Value_t rather than short 2014-03-11 Tom.Shields * test/empty.y: testcase for btyacc 2014-03-10 Tom.Shields * test/calc3.y, test/calc2.y: fix unused-variable warning 2014-02-18 Tom.Shields * lr0.c, graph.c: use Value_t rather than short * closure.c: use Value_t rather than short ifdef'd forward-reference prototypes to match ifdef'ing of the actual functions * lalr.c: rename MAXSHORT to MAXYYINT 2014-01-01 Thomas E. Dickey * yacc.1: document %token-table, improve presentation of double-quotes * VERSION, package/byacc.spec, package/debian/changelog: bump * test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c: reference output for testing * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_calc.tab.c, test/code_error.code.c, test/code_error.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: regen * output.c, skeleton.c: amend the last change so that yytname is #define'd as needed rather than permanent - to avoid breaking cproto for instance. 2014-01-01 Christos.Zoulas * output.c, defs.h, main.c, reader.c, skeleton.c: changes to build ntpd using byacc: - rename yyname[] to yytname[] - add YYTRANSLATE() macro - recognize bison's %token-table declaration 2014-01-01 Thomas E. Dickey * configure: regen * yacc.1: s/EE/XE/ to work around groff bug on Debian 6 * makefile.in: use CF_MAKE_DOCS * aclocal.m4: add CF_MAKE_DOCS * configure.in: use CF_MAKE_DOCS 2013-12-26 Thomas E. Dickey * config.guess: 2013-11-29 2013-11-19 Thomas E. Dickey * aclocal.m4: resync with my-autoconf (fixes for clang and mingw) 2013-10-25 Thomas E. Dickey * config.sub: 2013-10-01 2013-09-25 Thomas E. Dickey * reader.c: fix two loop-limits found by clang 3.3 --analyze * configure: regen * aclocal.m4: tweaks to CF_MIXEDCASE_FILENAMES and CF_XOPEN_SOURCE for msys from ncurses * package/mingw-byacc.spec: RCS_BASE * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: regen * skeleton.c: Increase default stack-size to match FreeBSD version noted as from "BSD 4.4 Lite Usr.bin Sources". See http://svnweb.freebsd.org/base/vendor/CSRG/dist/usr.bin/yacc/ http://svnweb.freebsd.org/base/head/usr.bin/yacc/ http://svnweb.freebsd.org/base/vendor/byacc/ The original 1.9 sources (on which I based development) used 500 for stacksize; the BSD Lite sources (a year or two later) used 10000. This is a change to default values; the YYMAXDEPTH and YYSTACKSIZE symbols have "always" been overridable by applications, but rarely needed to do this. RedHat began using the FreeBSD source in 2000, and switched to this source in 2007 using the 20050813 snapshot. RedHat #743343 misattributed the change in default stacksize to a regression in byacc, but did not report the issue upstream. * package/debian/changelog, VERSION, package/byacc.spec: bump 2013-09-07 Thomas E. Dickey * config.sub: update to 2013-09-15 * config.guess: update to 2013-06-10 2013-03-04 Thomas E. Dickey * package/debian/changelog, VERSION, package/byacc.spec: bump * aclocal.m4: adapt tweak from Dave Becket to work around long-ago breakage in "new" autoconf. * output.c: fix bogus #include if "-i" is given but not "-d" (report by Richard Mitton). also while testing that, found a case where the union_file is unused; added a check for address that. * test/ftp.output, test/ftp.tab.c, test/ftp.tab.h: regen * test/ftp.y: fix most compiler warnings for "make check_make" * test/calc1.tab.c: regen * test/calc1.y: fix most compiler warnings for "make check_make" * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: regen * skeleton.c: quiet a gcc conversion-warning in yygrowstack() * configure: regen * aclocal.m4: another fix for CF_GCC_VERSION to handle Debian's modification of gcc message. 2013-02-10 Thomas E. Dickey * config.sub, config.guess: update to 2013-02-04 2012-10-03 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump * configure: regen * configure.in: moved AC_PROG_CC_STDC call into CF_PROG_CC * aclocal.m4: moved AC_PROG_CC_STDC call into CF_PROG_CC and (for other uses than byacc) the CF_PROG_CC macro provides the CF_ANSI_CC_REQD for the 2.13 flavor. * aclocal.m4, configure.in: Arian's change dropped my check for misused $CC variable - restore that with alternate macro CF_PROG_CC. 2012-10-03 Adrian.Bunk * aclocal.m4: suggested patch: drop CF_ANSI_CC_REQD, CF_ANSI_CC_CHECK, CF_PROG_EXT since they are not needed. 2012-10-03 Thomas E. Dickey * aclocal.m4: split-out CF_CC_ENV_FLAGS from CF_ANSI_CC_CHECK to avoid losing it in Adrian's suggested changes. * aclocal.m4: CF_CLANG_COMPILER - check if the given compiler is really clang. * aclocal.m4: add check for clang to CF_GCC_WARNINGS. modify CF_GCC_WARNINGS to work around old gcc warning: ncurses change to (try to) use gnatgcc exposed gnatgcc 2.8.1 on my Sarge system (versus 3.3.5 for the normal gcc). The 2.8.1's pointer-arithmetic checks fell afoul of gcc's misuse of void* in string.h; work around by excluding that check for pre-3.x compilers. * aclocal.m4: modify CF_GCC_ATTRIBUTES so that autoheader is able to see the definitions provided by this macro. use AC_DEFINE_UNQUOTED() in CF_GCC_ATTRIBUTES rather than appending to confdefs.h, since long-ago concern about the ability to pass-through parameterized macros appears to be not a problem, testing with 2.13 and 2.52 2012-10-03 Adrian.Bunk * aclocal.m4: add parameter to AC_DEFINE_UNQUOTED() to allow it to be recognized by autoheader, updated macros: CF_CHECK_CACHE CF_DISABLE_LEAKS CF_MKSTEMP CF_MIXEDCASE_FILENAMES CF_NO_LEAKS_OPTION 2012-10-03 Thomas E. Dickey * aclocal.m4: move existence-check for mkstemp out of the AC_TRY_RUN, to help with cross-compiles 2012-10-02 Thomas E. Dickey * config_h.in: Adrian Bunk request - replace this with the output from autoheader 2012-09-29 Adrian.Bunk * configure.in: suggested change: replace CF_ANSI_CC_REQD by AC_PROG_CC_STDC (since no check is needed anymore for standard C compilers), drop AC_CONST (same reason), modify AC_OUTPUT to rely upon template generated by autoheader. bump requirement to autoconf 2.52.20011201 and drop check for CF_PROG_EXT as being obsolete with autoconf 2.52x * configure.in, main.c: drop check for atexit, because it is standard C * makefile.in: add assignment for datarootdir variable. 2012-05-26 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump * reader.c: some versions of gcc may warn that bp is not set in mark_symbol, e.g., if GCC_NORETURN is not handled; appease the compiler. * reader.c: use the declared types Assoc_t and Value_t in some places where compiler only cared about char versus short. * reader.c: use TMALLOC() and TREALLOC() macros to simplify allocation/reallocation (no object change) * defs.h: add fallbacks for GCC_NORETURN and GCC_UNUSED to make it simpler for *BSD packagers to build without configure script. Also remove duplicate declaration of pure_parser variable (prompted by patch by Baptiste Daroussin). Also define new TMALLOC and TREALLOC macros to simplify/replace MALLOC and REALLOC macros. * symtab.c: use TMALLOC() and TREALLOC() macros to simplify allocation/reallocation (no object change) 2012-05-25 Thomas E. Dickey * output.c, main.c, verbose.c, mkpar.c, lr0.c: use TMALLOC() and TREALLOC() macros to simplify allocation/reallocation (no object change) 2012-01-15 Thomas E. Dickey * package/debian/copyright: bump * test/run_make.sh: workaround for breakage due to GNU make 3.82 * test/run_make.sh: tested with Solaris 10 (bison 1.875) and added scripting to exercise the /usr/ccs/bin/yacc executable * test/grammar.tab.c: regen * test/grammar.y: modify to also build with Solaris yacc * VERSION, package/debian/changelog, package/byacc.spec: bump * test/yacc/calc1.output: reference output for testing * test/calc1.output, test/calc1.tab.c: regen * test/calc1.y: undo the change made to appease bison, since it was only a warning. * test/pure_calc.tab.c, test/pure_error.tab.c: regen * test/run_make.sh: another fix for running from top-level directory * makefile.in: ensure that check_make rule depends on having byacc built. * test/run_make.sh: fixes for building from parent directory * test/pure_error.y, test/pure_calc.y: bison-fixes * test/calc2.tab.c, test/calc3.tab.c, test/code_error.code.c, test/ftp.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c: regen * test/code_debug.y: RCS_BASE * test/calc2.y, test/calc3.y, test/code_error.y, test/ftp.y: byacc already declares yyerror * test/pure_error.y, test/pure_calc.y: modified to help make the files build with bison * test/run_make.sh: supply a "%pure-parser" directive when bison needs it. * test/code_calc.code.c: regen * test/code_calc.y: modified to help make the files build with bison * yacc.1: in testing, found that %expect did not work as documented for bison. do not recommend it for portable code. * test/run_make.sh: workaround breakage in bison's %expect directive * test/grammar.y: modified to help make the files build with bison * test/calc1.output, test/calc1.tab.c, test/grammar.tab.c: regen * test/calc1.y: quiet a spurious warning from bison 2.3 * test/calc1.tab.c: regen * test/calc1.y: modified to help make the files build with bison * yacc.1: comment on "-y" and "-P" options. * yacc.1: comment on portability * test/ftp.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc3-s.tab.c: regen * test/ftp.y: modified to help make the files build with bison (bison's "-y" option is of no use in providing "yacc" compatibility) * test/quote_calc2.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: regen * test/code_calc.y, test/quote_calc2.y, test/quote_calc.y, test/quote_calc4.y, test/quote_calc3.y: modified to help make the files build with bison * test/calc.tab.c: regen * test/calc.y: modified to help make the files build with bison * test/error.tab.c: regen * test/error.y: modified to help make the files build with bison * test/calc2.tab.c, test/calc3.tab.c, test/code_error.code.c: regen * test/run_make.sh: check for older bisons which (2.3 for instance) do not support pure parsers * test/code_error.y, test/calc3.y, test/calc2.y: modified to help make the files build with bison * test/run_test.sh: use $opt2 in filenames of the generated files * test/quote_calc2-s.tab.c, test/quote_calc3-s.tab.c, test/quote_calc4-s.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2.tab.c, test/quote_calc3.tab.c, test/quote_calc4.tab.c: regen 2012-01-14 Thomas E. Dickey * test/calc2.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/calc1.tab.c: regen * output.c: Several changes: a) add YYLEX_PARAM_TYPE, like YYPARSE_PARAM_TYPE, but for yylex. b) modify definitions for YYLEX_DECL to be more like YYPARSE_DECL, using YYLEX_PARAM_TYPE and YYLEX_PARAM. c) add ifdef's around #define's for YYERROR_DECL and YYERROR_CALL, to help with redefinitions. * test/pure_calc.tab.c: modified to help make the files build with bison * test/run_make.sh: start work on followup, to check if the generated files build with bison. * test/pure_calc.y, test/pure_error.tab.c: modified to help make the files build with bison * test/calc3.tab.c: regen * test/quote_calc-s.output, test/quote_calc-s.tab.c, test/quote_calc-s.tab.h, test/quote_calc2-s.output, test/quote_calc2-s.tab.c, test/quote_calc2-s.tab.h, test/quote_calc3-s.output, test/quote_calc3-s.tab.c, test/quote_calc3-s.tab.h, test/quote_calc4-s.output, test/quote_calc4-s.tab.c, test/quote_calc4-s.tab.h: RCS_BASE * test/yacc/quote_calc-s.output, test/yacc/quote_calc-s.tab.h, test/yacc/quote_calc2-s.output, test/yacc/quote_calc2-s.tab.h, test/yacc/quote_calc3-s.output, test/yacc/quote_calc3-s.tab.h, test/yacc/quote_calc4-s.output, test/yacc/quote_calc4-s.tab.h: reference output for testing * test/run_test.sh: generate/test with "-s" option applied. 2012-01-13 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump * yacc.1: improve documentation of -s option * yacc.1: note that yacc ignores -y * main.c: add -s option to usage message. * test/quote_calc3.output, test/quote_calc3.tab.c, test/quote_calc4.output, test/quote_calc4.tab.c, test/quote_calc4.tab.h: RCS_BASE * test/yacc/quote_calc3.output, test/yacc/quote_calc4.output, test/yacc/quote_calc4.tab.h: reference output for testing * test/quote_calc3.y, test/quote_calc.tab.h: RCS_BASE * test/yacc/quote_calc.tab.h: reference output for testing * test/quote_calc.output, test/quote_calc.tab.c, test/quote_calc2.output, test/quote_calc2.tab.c, test/quote_calc2.tab.h, test/quote_calc3.tab.h: RCS_BASE * test/yacc/quote_calc.output, test/yacc/quote_calc2.output, test/yacc/quote_calc2.tab.h, test/yacc/quote_calc3.tab.h: reference output for testing * test/quote_calc4.y, test/quote_calc.y, test/quote_calc2.y: RCS_BASE * configure: regen * aclocal.m4: resync with my-autoconf, i.e., fixes for CF_XOPEN_SOURCE 2011-12-19 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump * yacc.1, output.c, main.c, defs.h: add "-s" option to suppress generating #define's based on string contents in a %token statement. For instance %token EQLS "Equals" would generate #define EQLS 256 #define Equals 257 Simply suppressing the second #define makes the behavior closer to yacc. (report by Paulo Andrade). 2011-09-08 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump * output.c: fix some more interaction between -i and -d flags to ensure YYERRCODE and YYSTYPE are declared, tested with cproto. 2011-09-07 Thomas E. Dickey * yacc.1: document "-i" option. * package/debian/changelog, package/byacc.spec, VERSION: bump * output.c: fix an interaction between -i and -d * test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c: regen - changes for "-i" option move the global/impure variables near the macros that may add a prefix, etc. * skeleton.c, output.c, defs.h: changes to support "-i" option. 2011-09-06 Thomas E. Dickey * reader.c: pass explicit file-pointer to write_section() * main.c: add "-i" option, to generate interface-file (suggested by Denis M. Wilson) 2011-09-05 Thomas E. Dickey * configure: regen * aclocal.m4: resync with my-autoconf: CF_ANSI_CC_CHECK (check for $CFLAGS in $CC) and CF_XOPEN_SOURCE (update aix, cygwin and netbsd checks) * defs.h, error.c, reader.c: add check for missing "}" on %parse-param and %lex-param lines (report by Denis M Wilson) 2011-04-01 Thomas E. Dickey * config.sub: update to 2011-04-01 2011-02-02 Thomas E. Dickey * config.guess: update to 2011-01-01 2010-12-29 Thomas E. Dickey * defs.h, skeleton.c: add const qualifier to skeleton data, per NetBSD changes (report by Christos Zoulas) * defs.h: mark all of the error-functions as non-returning (report by Christos Zoulas) * test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c: regen * skeleton.c: use only realloc() rather than realloc+malloc, agree that systems needing this are very rare (prompted by NetBSD change). * test/ftp.tab.c: regen 2010-12-29 Christos.Zoulas * test/ftp.y: improve example, which was stuck in 19XX and assumed file sizes were longs. 2010-12-29 Thomas E. Dickey * test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c: regen * test/pure_error.y, test/pure_calc.y, test/ftp.y, test/error.y, test/code_error.y, test/code_calc.y, test/calc.y, test/calc3.y, test/calc2.y, test/calc1.y: use byacc's YYLEX_DECL/YYERROR_DECL symbols to prototype yylex/yyerror * skeleton.c: remove explicit prototype for yylex() via YYLEX_DECL() macro, since that would prevent declaring yylex() static (request by Christos Zoulas). * test/calc2.tab.c, test/calc3.tab.c: regen 2010-12-29 Christos.Zoulas * output.c: correct definition for YYERROR_DECL() 2010-12-29 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump 2010-12-26 Thomas E. Dickey * defs.h, main.c: change return-type of allocate() to avoid warnings of alignment problems * main.c: Solaris declares chmod() in * configure: regen * main.c: ifdef'd use of fcntl.h * configure.in: add configure checks for fcntl.h, atexit and mkstemp * main.c: for cases where mkstemp() is not available, use tempnam/open * aclocal.m4: add CF_MKSTEMP * aclocal.m4: improve quoting, deprecate ${name-value} in favor of standard ${name:-value} 2010-12-25 Thomas E. Dickey * main.c: start revising use of tmpfile(), to make this work with MinGW. Start by implementing a mkstemp() alternative - noting that mkstemp() also is broken for MinGW. * package/debian/changelog, package/byacc.spec, VERSION: bump 2010-11-27 Thomas E. Dickey * package/byacc.spec, package/debian/changelog, VERSION: bump * test/calc2.tab.c, test/calc3.tab.c: regen * output.c: corrected use of %parse-param value in yyerror(); it doesn't use &yylval (report by Clifford Yapp) 2010-11-26 Thomas E. Dickey * skeleton.c: typo * output.c: correct line-numbering when "-r" option is used; the 'outline' variable should only be incremented when writing to the code-file. * test/code_calc.code.c, test/code_error.code.c: regen * yacc.1: bump date * yacc.1: comment on -b option vs -r * test/calc2.tab.c, test/calc2.y, test/calc3.tab.c, test/calc3.y, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c: regen * output.c: improve on YYERROR_DECL(), adding dummy params which can be used for the actual function declaration. Also add YYERROR_CALL(). The two macros simplify maintaining sets of grammars which may/may not be pure. * test/calc1.y, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c: regen * output.c: generate yyerror() calls in output.c This is for compatibility with bison, which passes the yylval to yyerror when the %parse-param feature is used. * skeleton.c, defs.h: generate yyerror() calls in output.c * output.c: simplified a little, using putc_code() and putl_code() * test/yacc/calc1.tab.h: reference output for testing * test/calc1.tab.h: regen * reader.c: improve ifdef for YYSTYPE union declaration (report by Clifford Yapp) * reader.c: accept underscore as a replacement for dash in command names, e.g., "%pure_parser" vs "%pure-parser". * test/calc1.tab.c: regen * output.c, reader.c: also ifdef YYSTYPE declaration in the generated code (report by Clifford Yapp) * package/debian/changelog, package/byacc.spec, VERSION: bump 2010-11-24 Thomas E. Dickey * main.c, defs.h, symtab.c, error.c: reduce global variables * package/debian/changelog, package/byacc.spec, VERSION: bump * reader.c: amend fix for Redhat #112617 to still call default_action_warning() for empty rules (report by Bruce Cran). 2010-11-22 Thomas E. Dickey * output.c: add ifdef to guard against redefinition of YYSTYPE union (request by Clifford Yapp). * test/calc1.tab.c: regen * test/calc1.y: cleanup compiler warnings * test/grammar.y: add "%expect" * test/calc1.tab.h: regen * test/calc1.output, test/calc1.tab.c, test/calc1.tab.h: RCS_BASE * test/calc2.tab.c, test/calc3.tab.c: regen * test/calc1.y: advanced example from Steve Johnson's paper, uses unions * test/calc3.y, test/calc2.y: init 'base', so examples can run * test/ftp.tab.c, test/ftp.y: tweaks to compile with g++ * output.c: compensate for fix in reader.c * reader.c: add/use putc_both() and puts_both(), incidentally fixing a place where a union copied to the union_file may be missing the end of the last line. * package/debian/changelog, package/byacc.spec, VERSION: bump 2010-09-28 Thomas E. Dickey * config.guess: update to 2010-09-24 2010-09-10 Thomas E. Dickey * config.sub: update to 2010-09-11 2010-06-10 Thomas E. Dickey * yacc.1, package/debian/changelog, package/byacc.spec, VERSION: bump to 2010/06/10 2010-06-09 Thomas E. Dickey * reader.c: free declarations in leak-testing code. * main.c: close code_file if -r option used, for leak-testing * defs.h, reader.c: improve %lex-param / %parse-param implementation by allowing for arrays to be passed as parameters, e.g., "int regs[26]". * test/calc3.tab.c, test/calc3.y, test/calc3.output, test/calc3.tab.h: RCS_BASE * test/yacc/calc3.output, test/yacc/calc3.tab.h: reference output for testing * test/calc2.tab.c, test/calc2.y, test/calc2.tab.h: RCS_BASE * test/yacc/calc2.tab.h: reference output for testing * test/calc2.output: RCS_BASE * test/yacc/calc2.output: reference output for testing * output.c: improve %lex-param / %parse-param implementation by allowing for arrays to be passed as parameters, e.g., "int regs[26]". * test/calc.tab.c, test/calc.y: test-cases and reference files for %lex-param / %parse-param * makefile.in: add docs-rule, for html/pdf/txt form of manpage * configure: regen * aclocal.m4: add CF_XOPEN_SOURCE, etc. * configure.in: use CF_XOPEN_SOURCE check to ensure that strdup is in scope, e.g., for c89 * test/ftp.tab.c, test/ftp.y, reader.c, symtab.c, verbose.c, lr0.c, main.c, mkpar.c, output.c, defs.h, closure.c: fix warnings from clang --analyze 2010-06-08 Thomas E. Dickey * output.c: fix to build with c89, etc. * reader.c: gcc warning * test/ftp.tab.c, test/ftp.y, test/calc.tab.c, test/code_calc.code.c, test/code_error.code.c, test/code_error.y, test/code_calc.y, test/calc.y, test/pure_error.tab.c, test/error.tab.c, test/error.y, test/pure_error.y, test/pure_calc.tab.c, test/pure_calc.y: modified test-cases to allow them to compile, to validate pure-parser changes. updated reference files to match. * output.c: move call for output_stype() earlier since it is used in pure-parser declarations * test/grammar.tab.c, test/grammar.y: modified test-cases to allow them to compile, to validate pure-parser changes. updated reference files to match. * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: regen * yacc.1: document %lex-param and %parse-param * test/run_lint.sh, test/run_make.sh: RCS_BASE * test/run_test.sh: further modify to allow build-directory to be in a different location by passing this directory's location as a parameter to the script. * makefile.in: add check_make and check_lint rules to help validate the generated files in the test-directory 2010-06-07 Thomas E. Dickey * test/pure_calc.tab.c, test/pure_error.tab.c: RCS_BASE * test/run_test.sh: provide for testing -r and -P options by checking if the ".y" filename begins with "code_" or "pure_", respectively. * test/code_error.code.c, test/code_error.tab.c, test/code_error.tab.h: RCS_BASE * test/yacc/code_error.tab.h: reference output for testing * test/code_calc.code.c, test/code_calc.tab.c, test/code_calc.tab.h: RCS_BASE * test/yacc/code_calc.tab.h: reference output for testing * test/pure_calc.output, test/pure_calc.tab.h, test/pure_error.output, test/pure_error.tab.h: RCS_BASE * test/yacc/pure_calc.output, test/yacc/pure_calc.tab.h, test/yacc/pure_error.output, test/yacc/pure_error.tab.h: reference output for testing * test/code_calc.output, test/code_error.output: RCS_BASE * test/yacc/code_calc.output, test/yacc/code_error.output: reference output for testing * test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: regen * test/run_test.sh: changes to support running "make check" in a separate build-tree * main.c: add "-P" to usage message * reader.c: use UCH() macro to hide casts. 2010-06-07 Andres.Mejia * main.c, output.c, reader.c, defs.h, skeleton.c: Fix the output order of the generated parse code file. This allows for the use of YYPARSE_PARAM, by having the output that checks for YYPARSE_PARAM to be defined come after the C code block in the definitions section of a yacc file. Implement support for YYLEX_PARAM, similar to bison. This is useful for support for building reentrant lexers with flex. Fix a compatibility issue with bison's pure-parser option. Bison defines yylex as sending at least one parameter, &yylval, as the first parameter and doesn't seem to have an easy way to remove that parameter. This on the other hand is rather convenient to support saving to yylval from flex when building reentrant lexers and parsers. Add support for the %parse-param and %lex-param directives used in bison. This change bears some similarity to NetBSD's changes to byacc at http://www.mail-archive.com/source-changes-full@netbsd.org/msg08143.html Bison allows for POSIX yacc emulation via a yacc directive in the yacc file, and also via a command line switch. Implement this feature as a no-op for byacc, since byacc is designed to be POSIX yacc compatible anyway. This allows for better compatibility with yacc sources written for bison. 2010-06-07 Thomas E. Dickey * VERSION: bump to 2010/06/07 2010-06-06 Thomas E. Dickey * test/calc.tab.c, configure: regen * skeleton.c: move #include's down into the generated code, to allow user-defined code to override feature definitions, particularly with stdlib.h (request by Marcus Kool). * lr0.c, error.c, reader.c, defs.h: strict gcc 3.4.6 warnings on 64-bit platform * aclocal.m4, configure.in: add check for lint * makefile.in: add lint rule * defs.h, closure.c, lr0.c, warshall.c, main.c: fix gcc warnings, mostly for 64-bit platform * aclocal.m4: add macros for checking ctags/etags, e.g., to work with NetBSD pkgsrc * makefile.in: add etags/TAGS if available * configure.in: add configure check for actual ctags and etags programs * package/debian/copyright: add copyright notices for non-PD files * package/debian/changelog: incorporated scripts in upstream to use for test-builds * makefile.in: drop mkdirs.sh, just use "mkdir -p" * AUTHORS: nicknames for some contributors (see CHANGES for details) * package/byacc.spec: RPM file for byacc * VERSION: bump to 2010/06/06 * aclocal.m4: add copyright notice, from "my-autoconf" macros http://invisible-island.net/autoconf/autoconf.html * package/RCS, package/debian/RCS, package/debian/source/RCS, package/pkgsrc/RCS: PERMIT FILE * aclocal.m4: resync with my-autoconf. summary of changes: a) CF_ADD_CFLAGS, etc., improve quoting of ifelse() parameter b) CF_DISABLE_ECHO, change indent-convention for substituted makefile c) CF_GCC_VERSION, ignore stderr d) CF_GCC_WARNINGS, adjust options to work with c89 wrapper of gcc 2010-04-20 Thomas E. Dickey * package/debian/changelog, package/debian/compat, package/debian/control, package/debian/copyright, package/debian/docs, package/debian/postinst, package/debian/prerm, package/debian/rules, package/debian/watch: scripts from Debian package 2010-02-16 Thomas E. Dickey * yacc.1: document -P and bison-extensions * test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/error.tab.c: regen * output.c: implement %pure-parser * skeleton.c: implement %pure-parser, like bison. To help with this, changed the stack variables, putting them into a struct. * reader.c: implement %pure-parser * defs.h: modified skeleton to support %pure-parser feature * main.c: add -P option to set %pure-parser * output.c: make -r and -p options work together. The -r option splits the generated parser into code/table files; for this case we cannot use static data. Also, we have to repeat the #define's used for prefix (-p) as well as the redeclaration of yyparse(). Finally, allow any of the prefixed names to be overridden, e.g., by passing a -D option to the compiler. Make that a little more readable by putting a blank line before each chunk. * defs.h: add definitions for %pure-parser * skeleton.c: put blank line before/after the redeclaration of yyparse() * output.c: allow for other program redefining yylex() * skeleton.c: split-off xdecls[] array, to move declaration of yyparse() after #define's * defs.h: split-out xdecls[] * VERSION: bump * configure: regen * aclocal.m4: add CF_REMOVE_DEFINE, needed by CF_ADD_CFLAGS * aclocal.m4: resync with my-autoconf CF_ADD_CFLAGS and CF_DISABLE_ECHO changes. 2010-02-16 Ostap.Cherkashi * skeleton.c: fix a memory leak in the generated skeleton 2010-01-01 Thomas E. Dickey * package/debian/source/format: scripts from Debian package 2009-12-31 Thomas E. Dickey * config.guess: update to 2009-12-30 * config.sub: update to 2009-12-31 2009-10-27 Thomas E. Dickey * VERSION: 20091027 * output.c, mkpar.c, defs.h, lalr.c, closure.c, graph.c, lr0.c, verbose.c, main.c, reader.c: strict compiler warnings 2009-10-26 Thomas E. Dickey * test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/error.tab.c: resync * main.c, defs.h: introduce some typedefs for portability, etc. * makefile.in: don't remove "*.log" in mostlyclean rule since it interferes with regression script. * configure: regen * aclocal.m4: resync with my-autoconf 2009-08-25 Thomas E. Dickey * config.guess, config.sub: update to 2009-08-19 2009-02-21 Thomas E. Dickey * VERSION: bump * output.c: restore "yylval" symbol, omitted in cleanup on 2008/8/25 2008-12-26 Thomas E. Dickey * configure: regen with autoconf-2.52 (patched) 2008-12-25 Thomas E. Dickey * test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c: regenerated 2008-12-24 Thomas E. Dickey * VERSION: bump * skeleton.c: remove ifdef-lint from goto yyerrlab, to quiet gcc warning 2008-11-26 Thomas E. Dickey * verbose.c, main.c, defs.h, mkpar.c, reader.c: completed implementation of "%expect" (report by Perry E. Metzger). add "%expect-rr", which is (unlike bison) allowable in LALR parsers. 2008-11-24 Thomas E. Dickey * closure.c, defs.h, error.c, graph.c, lalr.c, lr0.c, main.c, mkpar.c, output.c, reader.c, skeleton.c, symtab.c, verbose.c, warshall.c: change indent-style (request by Perry E. Metzger) 2008-08-27 Thomas E. Dickey * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: better implementation of YYPARSE_PARAM, using YYPARSE_DECL() macro * VERSION: bump * skeleton.c: better implementation of YYPARSE_PARAM, using YYPARSE_DECL() macro * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, skeleton.c: change YYRECOVERING to YYRECOVERING(), for compatibility with other yacc's. * configure: regen'd * configure.in: add -Wwrite-strings to warnings * test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/error.tab.c: add YYPARSE_PARAM and YYPARSE_PARAM_TYPE * skeleton.c: add YYPARSE_PARAM (bison) and YYPARSE_PARAM_TYPE (FreeBSD) features. * main.c, defs.h, output.c, skeleton.c, symtab.c, error.c, reader.c: fixes for gcc -Wwrite-strings * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: generate the tables as static-const (this is an interface change) * output.c: realign columns in start_table() * output.c: generate the tables as static-const (this is an interface change) * output.c: reorder functions to eliminate forward-references * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: remove 'register' keywords 2008-08-26 Thomas E. Dickey * warshall.c, verbose.c, symtab.c, skeleton.c, reader.c, output.c, mkpar.c, main.c, lr0.c, lalr.c, graph.c, error.c, closure.c: remove 'register' keywords 2008-08-25 Thomas E. Dickey * test/ftp.tab.c: regen'd * reader.c: improve the left-curly fix by testing after blanks, to avoid having a " {" at the beginning of a line. * test/error.tab.c, test/grammar.tab.c: regen'd * output.c: move the remaining newline-counting into write_XXX functions. * test/calc.tab.c: regen'd * output.c: simplify part of the output_file formatting using new functions, e.g., start_int_table(), output_newline(). * reader.c: modify copy_action() to indent the first character, it if is is left-curly brace. That makes the output look more like the original, as well as makes it simpler to edit (not confuse editors which look for a left-curly in the first column as if it were the beginning of a function). * skeleton.c: minor fixes to avoid gcc -Wconversion warnings * output.c: align the #define's produced for "-p" option * test/run_test.sh: use the "-p" option for better coverage. * output.c: simplify output_prefix() with new define_prefixed() * skeleton.c: include string.h, for memset() change stack size to unsigned to fix gcc -Wconversion warnings. * VERSION: bump to 2008/8/25 * makefile.in: add dependency on VERSION file. 2008-08-24 Thomas E. Dickey * VERSION: bump * lalr.c: improved memory-leak checking by freeing data in includes[] * test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c: update to match skeleton-change * configure: regen'd * skeleton.c: Add fix for stack discussed http://undeadly.org/cgi?action=article&sid=20080708155228 and applied http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/yacc/skeleton.c.diff?r1=1.28&r2=1.29 * aclocal.m4: resync with my-autoconf (no major changes) 2008-07-24 Thomas E. Dickey * package/pkgsrc/Makefile, package/pkgsrc/distinfo: scripts from NetBSD pkgsrc, for test-builds 2008-03-14 Thomas E. Dickey * config.sub: update to 2008-03-08 * config.guess: update to 2008-03-12 2007-05-09 Thomas E. Dickey * main.c: close graph, verbose files if opened, on exit. * main.c: audit memory leaks - valgrind reported some memory still in use on exit. * lalr.c, output.c, reader.c, mkpar.c, lr0.c: add hook for auditing memory leaks * defs.h: add hooks for auditing memory leaks * configure: regen'd * configure.in: use CF_DISABLE_LEAKS, which combines --disable-leaks, --with-valgrind, --with-dbmalloc and --with-dmalloc * aclocal.m4: add CF_DISABLE_LEAKS and CF_WITH_VALGRIND * aclocal.m4: improve version-checking in CF_GCC_VERSION rework dbmalloc/dmalloc options using CF_NO_LEAKS_OPTION macro * VERSION: 2007/5/9 * main.c: file_prefix did not always have a trailing null. 2007-03-25 Thomas E. Dickey * mkdirs.sh: improved version for "make -j" 2006-12-22 Thomas E. Dickey * config.guess: update to 2006/12/22 2006-12-08 Thomas E. Dickey * config.sub: update to 2006/12/08 2005-08-13 Thomas E. Dickey * main.c: add -V to usage message * makefile.in: remove -t option from ctags * VERSION: 2005/8/13 2005-08-13 schmitz * main.c: Sylvain Schmitz: modify the '-o' option to work like bison's, which sets the file-prefix. 2005-08-13 Matt.Kraai * output.c: Debian #322858 (don't close union_file, which contained data). This feature is used in groff. 2005-08-13 Thomas E. Dickey * configure: regenerated * aclocal.m4: improve checks for Intel compiler warnings 2005-06-25 Thomas E. Dickey * config.sub: update to 2005/6/2 * config.guess: update to 2005/5/27 2005-05-05 Thomas E. Dickey * defs.h: add a fallback for GCC_UNUSED 2005-05-04 Thomas E. Dickey * makefile.in: add "." to include-path to pickup config.h * reader.c: apply fix suggested by Steve Dum for end_rule() in Redhat Bugzilla #112617. * output.c: correct a limit check in pack_vector() - report/analysis by William Evans * main.c: exit after printing version. Otherwise "yacc -V" will exit with an erro after printing the usage message. * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: regenerated after skeleton-changes * skeleton.c: replace a few -1's with YYEMPTY * skeleton.c: delete yynewerror (no one uses it any more, and it just makes compiler warnings) * skeleton.c: adapt yygrowstack() and related definitions from FreeBSD * test/run_test.sh: filter out lines with YYPATCH, since that will change with each update * yacc.1: add -V option * main.c: add -V option to print the version. simplify option-parsing by moving the duplicate logic for setting flags into new function setflag(). * skeleton.c: move the actual definition of YYMAJOR and YYMINOR to defs.h (as numbers). add YYPATCH here so it can be tested by applications. * defs.h: add macros to define VERSION in terms of the (numeric) YYMAJOR, YYMINOR and YYPATCH symbols. * lalr.c, lr0.c, mkpar.c, defs.h, closure.c, warshall.c, output.c, verbose.c, graph.c, reader.c, main.c, symtab.c: reduce externs by making static the procedures that are not referenced outside the module in which they are defined. * makefile.in: the VERSION file holds the patch-date. Define YYPATCH, so this will be compiled into the skeleton. * VERSION: patch-level for byacc * main.c: add "-o" to usage message. It is too long for a single line; rewrite usage() to show one option per line. 2005-05-03 Thomas E. Dickey * main.c: add -o option, to work with scripts that assume bison. simplify create_file_names() with a macro. simplify done() with a macro. adapt fix from FreeBSD for signal race, e.g., if done() is interrupted by onintr(), do not flush output via exit(), but use _exit() instead. * defs.h: remove unnecessary externs for main.c * yacc.1: add -o option * graph.c: remove unused parameter * mkpar.c, defs.h, reader.c: add support for "%expect", a bison feature from FreeBSD sources * lr0.c, reader.c, main.c, skeleton.c, graph.c, symtab.c, closure.c, mkpar.c, lalr.c, error.c, warshall.c, verbose.c, output.c: indent'd * configure: regenerated for 2005/5/5 * aclocal.m4: miscellaneous updates (adds CF_INTEL_COMPILER) 2005-04-27 schmitz * defs.h, graph.c, lr0.c, main.c, makefile.in, reader.c, yacc.1: Sylvain Schmitz : add graphical output of the LALR(1) automaton for graphviz, associated with command-line option `-g' 2005-04-16 Thomas E. Dickey * config.sub: update to 2005/2/10 * config.guess: update to 2005/3/24 2005-04-13 Thomas E. Dickey * package/pkgsrc/PLIST: scripts from NetBSD pkgsrc, for test-builds 2005-03-21 Thomas E. Dickey * package/pkgsrc/DESCR: scripts from NetBSD pkgsrc, for test-builds 2004-03-28 Thomas E. Dickey * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: updates due to adding yyparse() prototype * configure: RCS_BASE * configure.in: add AC_ARG_PROGRAM to make --program-prefix, etc., work. * makefile.in: first cut of script to support --program-prefix * configure.in: reorder AC_INIT/AC_CONFIG_HEADER to make this "work" with autoconf 2.52 * makefile.in: modify so DESTDIR works * makefile.in: use EXEEXT and OBJEXT * configure.in: use CF_PROG_EXT generate a config.h * defs.h: make this use the generated config.h * skeleton.c: add a forward-reference for yyparse() * aclocal.m4: add CF_CHECK_CACHE, needed for CF_PROG_EXT * yacc.1: remove the discussion of TMPDIR since it is obsolete * skeleton.c: fix a couple of minor compiler-warnings in the skeleton * defs.h: remove action_file_name, etc., since we use tmpfile() now. * main.c: use tmpfile() for opening the working files. This quiets a warning advising the use of mkstemp(). * output.c: Do not close temporary-files here, since they are opened with tmpfile(). Just rewind them, and they're ready to read back the data stored in them. * test/grammar.output, test/grammar.tab.c, test/grammar.tab.h: RCS_BASE * test/yacc/grammar.output, test/yacc/grammar.tab.h: reference output for testing * makefile.in: turn on "make check" rule * test/calc.output: RCS_BASE * test/yacc/calc.output: reference output for testing * test/run_test.sh, test/calc.tab.h: RCS_BASE * test/yacc/calc.tab.h: reference output for testing * test/ftp.tab.c: yyparse() is now yyparse(void) * test/calc.tab.c: RCS_BASE * test/error.tab.c: yyparse() is now yyparse(void) * test/README: RCS_BASE * yacc.1: various typography fixes prompted by Debian #100947 * aclocal.m4, makefile.in, configure.in: RCS_BASE * README: updated to note that this is not the original 2004-03-24 Thomas E. Dickey * test/grammar.y: RCS_BASE 2004-02-23 Thomas E. Dickey * config.sub: RCS_BASE 2004-02-17 Thomas E. Dickey * config.guess: RCS_BASE 2003-11-29 Thomas E. Dickey * install-sh: improved quoting 2002-06-29 Thomas E. Dickey * mkdirs.sh: don't use character range, since some locales don't work as expected 2001-06-22 Thomas E. Dickey * install-sh: RCS_BASE 2000-11-20 Thomas E. Dickey * test/calc.y: RCS_BASE * test/code_calc.y, test/pure_calc.y: copy of calc.y * vmsbuild.com: original version 2000-02-23 Thomas E. Dickey * test/RCS, RCS: PERMIT FILE 2000-02-14 Thomas E. Dickey * main.c: fix for VMS port - making pathname for temp-file * descrip.mms: original version 2000-02-13 Thomas E. Dickey * defs.h, verbose.c, reader.c, main.c, skeleton.c, warshall.c, symtab.c, closure.c, mkpar.c, lalr.c, lr0.c, output.c, error.c: ansify 1999-11-30 Thomas E. Dickey * mkdirs.sh: RCS_BASE 1995-01-01 Thomas E. Dickey * config_h.in: RCS_BASE 1993-12-23 unknown * README.DOS, main.c: MSDOS-port 1993-12-22 unknown * reader.c, defs.h: MSDOS-port 1993-03-02 unknown * README: original version 1993-02-22 unknown * test/ftp.output, test/ftp.tab.c, test/ftp.tab.h: RCS_BASE 1993-02-22 Thomas E. Dickey * test/yacc/error.output, test/yacc/error.tab.h: reference output for testing 1993-02-22 unknown * test/error.output, test/error.tab.c, test/error.tab.h: RCS_BASE * skeleton.c, warshall.c, main.c, output.c, reader.c, closure.c, NOTES: original version 1992-10-12 unknown * yacc.1: original version 1992-10-11 unknown * defs.h: original version 1991-01-20 unknown * mkpar.c, verbose.c: original version 1991-01-14 unknown * lr0.c, Makefile, Makefile.old: original version 1990-07-16 unknown * NEW_FEATURES: original version 1990-06-03 unknown * ACKNOWLEDGEMENTS: original version 1990-02-05 unknown * symtab.c, lalr.c, error.c: original version 1990-01-16 Thomas E. Dickey * test/code_error.y, test/pure_error.y: RCS_BASE 1990-01-16 unknown * test/error.y: RCS_BASE 1989-11-22 unknown * NO_WARRANTY: original version 1989-09-23 unknown * test/ftp.y: RCS_BASE Index: stable/10/contrib/byacc/MANIFEST =================================================================== --- stable/10/contrib/byacc/MANIFEST (revision 272952) +++ stable/10/contrib/byacc/MANIFEST (revision 272953) @@ -1,667 +1,667 @@ -MANIFEST for byacc-20140422, version t20140422 +MANIFEST for byacc-20140715, version t20140715 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 AUTHORS nicknames for some contributors (see CHANGES for details) Makefile.old renamed from Makefile NEW_FEATURES original version of byacc - 1993 NOTES original version of byacc - 1993 NO_WARRANTY original version of byacc - 1993 README original version of byacc - 1993 README.BTYACC byacc-btyacc-20140323 VERSION patch-level aclocal.m4 macros for configure-script btyaccpar.c generated from btyaccpar.skel btyaccpar.skel bytacc's parser skeleton (renamed from yaccpar.skel) closure.c original version of byacc - 1993 config.guess configure-script utility config.sub configure-script utility config_h.in template for config.h configure snapshot 2004/3/28 configure.in template for configure-script defs.h original version of byacc - 1993 descrip.mms build-script for VMS error.c original version of byacc - 1993 graph.c write the file y.dot in graphviz format install-sh install-script lalr.c original version of byacc - 1993 lr0.c original version of byacc - 1993 main.c original version of byacc - 1993 makefile.in template for makefile mkpar.c original version of byacc - 1993 mstring.c string-utilities output.c original version of byacc - 1993 reader.c original version of byacc - 1993 skel2c awk script to transform yaccpar.skel into skeleton.c symtab.c original version of byacc - 1993 verbose.c original version of byacc - 1993 vmsbuild.com build-script for VMS warshall.c original version of byacc - 1993 yacc.1 original version of byacc - 1993 yaccpar.c generated from yaccpar.skel yaccpar.skel data which can be transformed into skeleton.c package subdirectory package/byacc.spec RPM file for byacc package/debian subdirectory package/debian/changelog scripts from Debian package package/debian/compat scripts from Debian package package/debian/control scripts from Debian package package/debian/copyright scripts from Debian package package/debian/docs scripts from Debian package package/debian/postinst scripts from Debian package package/debian/prerm scripts from Debian package package/debian/rules scripts from Debian package package/debian/source subdirectory package/debian/source/format scripts from Debian package package/debian subdirectory package/debian/watch scripts from Debian package package subdirectory package/mingw-byacc.spec mingw spec-file, for cross-compiles package/pkgsrc subdirectory package/pkgsrc/DESCR scripts from NetBSD pkgsrc, for test-builds package/pkgsrc/Makefile scripts from NetBSD pkgsrc, for test-builds package/pkgsrc/PLIST scripts from NetBSD pkgsrc, for test-builds package/pkgsrc/distinfo scripts from NetBSD pkgsrc, for test-builds test subdirectory test/README describe contents of "test" subdirectory test/btyacc subdirectory test/btyacc/big_b.error exercise -L/-B options test/btyacc/big_b.output exercise -L/-B options test/btyacc/big_l.error exercise -L/-B options test/btyacc/big_l.output exercise -L/-B options test/btyacc/btyacc_calc1.error reference output for testing test/btyacc/btyacc_calc1.output reference output for testing test/btyacc/btyacc_calc1.tab.c reference output for testing test/btyacc/btyacc_calc1.tab.h reference output for testing test/btyacc/btyacc_demo.error reference output for testing test/btyacc/btyacc_demo.output reference output for testing test/btyacc/btyacc_demo.tab.c reference output for testing test/btyacc/btyacc_demo.tab.h reference output for testing test/btyacc/calc.error reference output for testing test/btyacc/calc.output reference output for testing test/btyacc/calc.tab.c reference output for testing test/btyacc/calc.tab.h reference output for testing test/btyacc/calc1.error reference output for testing test/btyacc/calc1.output reference output for testing test/btyacc/calc1.tab.c reference output for testing test/btyacc/calc1.tab.h reference output for testing test/btyacc/calc2.error reference output for testing test/btyacc/calc2.output reference output for testing test/btyacc/calc2.tab.c reference output for testing test/btyacc/calc2.tab.h reference output for testing test/btyacc/calc3.error reference output for testing test/btyacc/calc3.output reference output for testing test/btyacc/calc3.tab.c reference output for testing test/btyacc/calc3.tab.h reference output for testing test/btyacc/code_calc.code.c reference output for testing test/btyacc/code_calc.error reference output for testing test/btyacc/code_calc.output reference output for testing test/btyacc/code_calc.tab.c reference output for testing test/btyacc/code_calc.tab.h reference output for testing test/btyacc/code_debug.c reference for test-output test/btyacc/code_debug.error reference for test-output test/btyacc/code_debug.h reference for test-output test/btyacc/code_debug.i reference for test-output test/btyacc/code_debug.output reference for test-output test/btyacc/code_error.code.c reference output for testing test/btyacc/code_error.error reference output for testing test/btyacc/code_error.output reference output for testing test/btyacc/code_error.tab.c reference output for testing test/btyacc/code_error.tab.h reference output for testing test/btyacc/empty.error reference output for testing test/btyacc/empty.output reference output for testing test/btyacc/empty.tab.c reference output for testing test/btyacc/empty.tab.h reference output for testing test/btyacc/err_inherit1.error reference output for testing test/btyacc/err_inherit1.output reference output for testing test/btyacc/err_inherit1.tab.c reference output for testing test/btyacc/err_inherit1.tab.h reference output for testing test/btyacc/err_inherit2.error reference output for testing test/btyacc/err_inherit2.output reference output for testing test/btyacc/err_inherit2.tab.c reference output for testing test/btyacc/err_inherit2.tab.h reference output for testing test/btyacc/err_inherit3.error reference output for testing test/btyacc/err_inherit3.output reference output for testing test/btyacc/err_inherit3.tab.c reference output for testing test/btyacc/err_inherit3.tab.h reference output for testing test/btyacc/err_inherit4.error reference output for testing test/btyacc/err_inherit4.output reference output for testing test/btyacc/err_inherit4.tab.c reference output for testing test/btyacc/err_inherit4.tab.h reference output for testing test/btyacc/err_inherit5.error reference output for testing test/btyacc/err_inherit5.output reference output for testing test/btyacc/err_inherit5.tab.c reference output for testing test/btyacc/err_inherit5.tab.h reference output for testing test/btyacc/err_syntax1.error reference output for testing test/btyacc/err_syntax1.output reference output for testing test/btyacc/err_syntax1.tab.c reference output for testing test/btyacc/err_syntax1.tab.h reference output for testing test/btyacc/err_syntax10.error reference output for testing test/btyacc/err_syntax10.output reference output for testing test/btyacc/err_syntax10.tab.c reference output for testing test/btyacc/err_syntax10.tab.h reference output for testing test/btyacc/err_syntax11.error reference output for testing test/btyacc/err_syntax11.output reference output for testing test/btyacc/err_syntax11.tab.c reference output for testing test/btyacc/err_syntax11.tab.h reference output for testing test/btyacc/err_syntax12.error reference output for testing test/btyacc/err_syntax12.output reference output for testing test/btyacc/err_syntax12.tab.c reference output for testing test/btyacc/err_syntax12.tab.h reference output for testing test/btyacc/err_syntax13.error reference output for testing test/btyacc/err_syntax13.output reference output for testing test/btyacc/err_syntax13.tab.c reference output for testing test/btyacc/err_syntax13.tab.h reference output for testing test/btyacc/err_syntax14.error reference output for testing test/btyacc/err_syntax14.output reference output for testing test/btyacc/err_syntax14.tab.c reference output for testing test/btyacc/err_syntax14.tab.h reference output for testing test/btyacc/err_syntax15.error reference output for testing test/btyacc/err_syntax15.output reference output for testing test/btyacc/err_syntax15.tab.c reference output for testing test/btyacc/err_syntax15.tab.h reference output for testing test/btyacc/err_syntax16.error reference output for testing test/btyacc/err_syntax16.output reference output for testing test/btyacc/err_syntax16.tab.c reference output for testing test/btyacc/err_syntax16.tab.h reference output for testing test/btyacc/err_syntax17.error reference output for testing test/btyacc/err_syntax17.output reference output for testing test/btyacc/err_syntax17.tab.c reference output for testing test/btyacc/err_syntax17.tab.h reference output for testing test/btyacc/err_syntax18.error reference output for testing test/btyacc/err_syntax18.output reference output for testing test/btyacc/err_syntax18.tab.c reference output for testing test/btyacc/err_syntax18.tab.h reference output for testing test/btyacc/err_syntax19.error reference output for testing test/btyacc/err_syntax19.output reference output for testing test/btyacc/err_syntax19.tab.c reference output for testing test/btyacc/err_syntax19.tab.h reference output for testing test/btyacc/err_syntax2.error reference output for testing test/btyacc/err_syntax2.output reference output for testing test/btyacc/err_syntax2.tab.c reference output for testing test/btyacc/err_syntax2.tab.h reference output for testing test/btyacc/err_syntax20.error reference output for testing test/btyacc/err_syntax20.output reference output for testing test/btyacc/err_syntax20.tab.c reference output for testing test/btyacc/err_syntax20.tab.h reference output for testing test/btyacc/err_syntax21.error reference output for testing test/btyacc/err_syntax21.output reference output for testing test/btyacc/err_syntax21.tab.c reference output for testing test/btyacc/err_syntax21.tab.h reference output for testing test/btyacc/err_syntax22.error reference output for testing test/btyacc/err_syntax22.output reference output for testing test/btyacc/err_syntax22.tab.c reference output for testing test/btyacc/err_syntax22.tab.h reference output for testing test/btyacc/err_syntax23.error reference output for testing test/btyacc/err_syntax23.output reference output for testing test/btyacc/err_syntax23.tab.c reference output for testing test/btyacc/err_syntax23.tab.h reference output for testing test/btyacc/err_syntax24.error reference output for testing test/btyacc/err_syntax24.output reference output for testing test/btyacc/err_syntax24.tab.c reference output for testing test/btyacc/err_syntax24.tab.h reference output for testing test/btyacc/err_syntax25.error reference output for testing test/btyacc/err_syntax25.output reference output for testing test/btyacc/err_syntax25.tab.c reference output for testing test/btyacc/err_syntax25.tab.h reference output for testing test/btyacc/err_syntax26.error reference output for testing test/btyacc/err_syntax26.output reference output for testing test/btyacc/err_syntax26.tab.c reference output for testing test/btyacc/err_syntax26.tab.h reference output for testing test/btyacc/err_syntax27.error reference output for testing test/btyacc/err_syntax27.output reference output for testing test/btyacc/err_syntax27.tab.c reference output for testing test/btyacc/err_syntax27.tab.h reference output for testing test/btyacc/err_syntax3.error reference output for testing test/btyacc/err_syntax3.output reference output for testing test/btyacc/err_syntax3.tab.c reference output for testing test/btyacc/err_syntax3.tab.h reference output for testing test/btyacc/err_syntax4.error reference output for testing test/btyacc/err_syntax4.output reference output for testing test/btyacc/err_syntax4.tab.c reference output for testing test/btyacc/err_syntax4.tab.h reference output for testing test/btyacc/err_syntax5.error reference output for testing test/btyacc/err_syntax5.output reference output for testing test/btyacc/err_syntax5.tab.c reference output for testing test/btyacc/err_syntax5.tab.h reference output for testing test/btyacc/err_syntax6.error reference output for testing test/btyacc/err_syntax6.output reference output for testing test/btyacc/err_syntax6.tab.c reference output for testing test/btyacc/err_syntax6.tab.h reference output for testing test/btyacc/err_syntax7.error reference output for testing test/btyacc/err_syntax7.output reference output for testing test/btyacc/err_syntax7.tab.c reference output for testing test/btyacc/err_syntax7.tab.h reference output for testing test/btyacc/err_syntax7a.error reference output for testing test/btyacc/err_syntax7a.output reference output for testing test/btyacc/err_syntax7a.tab.c reference output for testing test/btyacc/err_syntax7a.tab.h reference output for testing test/btyacc/err_syntax7b.error reference output for testing test/btyacc/err_syntax7b.output reference output for testing test/btyacc/err_syntax7b.tab.c reference output for testing test/btyacc/err_syntax7b.tab.h reference output for testing test/btyacc/err_syntax8.error reference output for testing test/btyacc/err_syntax8.output reference output for testing test/btyacc/err_syntax8.tab.c reference output for testing test/btyacc/err_syntax8.tab.h reference output for testing test/btyacc/err_syntax8a.error reference output for testing test/btyacc/err_syntax8a.output reference output for testing test/btyacc/err_syntax8a.tab.c reference output for testing test/btyacc/err_syntax8a.tab.h reference output for testing test/btyacc/err_syntax9.error reference output for testing test/btyacc/err_syntax9.output reference output for testing test/btyacc/err_syntax9.tab.c reference output for testing test/btyacc/err_syntax9.tab.h reference output for testing test/btyacc/error.error reference output for testing test/btyacc/error.output reference output for testing test/btyacc/error.tab.c reference output for testing test/btyacc/error.tab.h reference output for testing test/btyacc/grammar.dot reference output for testing test/btyacc/grammar.error reference output for testing test/btyacc/grammar.output reference output for testing test/btyacc/grammar.tab.c reference output for testing test/btyacc/grammar.tab.h reference output for testing test/btyacc/help.error reference output for testing test/btyacc/help.output reference output for testing test/btyacc/inherit0.error reference output for testing test/btyacc/inherit0.output reference output for testing test/btyacc/inherit0.tab.c reference output for testing test/btyacc/inherit0.tab.h reference output for testing test/btyacc/inherit1.error reference output for testing test/btyacc/inherit1.output reference output for testing test/btyacc/inherit1.tab.c reference output for testing test/btyacc/inherit1.tab.h reference output for testing test/btyacc/inherit2.error reference output for testing test/btyacc/inherit2.output reference output for testing test/btyacc/inherit2.tab.c reference output for testing test/btyacc/inherit2.tab.h reference output for testing test/btyacc/no_b_opt.error reference output for testing test/btyacc/no_b_opt.output reference output for testing test/btyacc/no_b_opt1.error reference output for testing test/btyacc/no_b_opt1.output reference output for testing test/btyacc/no_code_c.error reference output for testing test/btyacc/no_code_c.output reference output for testing test/btyacc/no_defines.error reference output for testing test/btyacc/no_defines.output reference output for testing test/btyacc/no_graph.error reference output for testing test/btyacc/no_graph.output reference output for testing test/btyacc/no_include.error reference output for testing test/btyacc/no_include.output reference output for testing test/btyacc/no_opts.error reference output for testing test/btyacc/no_opts.output reference output for testing test/btyacc/no_output.error reference output for testing test/btyacc/no_output.output reference output for testing test/btyacc/no_output1.error reference output for testing test/btyacc/no_output1.output reference output for testing test/btyacc/no_output2.error reference output for testing test/btyacc/no_output2.output reference output for testing test/btyacc/no_p_opt.error reference output for testing test/btyacc/no_p_opt.output reference output for testing test/btyacc/no_p_opt1.error reference output for testing test/btyacc/no_p_opt1.output reference output for testing test/btyacc/no_verbose.error reference output for testing test/btyacc/no_verbose.output reference output for testing test/btyacc/nostdin.error reference output for testing test/btyacc/nostdin.output reference output for testing test/btyacc/ok_syntax1.error reference output for testing test/btyacc/ok_syntax1.output reference output for testing test/btyacc/ok_syntax1.tab.c reference output for testing test/btyacc/ok_syntax1.tab.h reference output for testing test/btyacc/pure_calc.error reference output for testing test/btyacc/pure_calc.output reference output for testing test/btyacc/pure_calc.tab.c reference output for testing test/btyacc/pure_calc.tab.h reference output for testing test/btyacc/pure_error.error reference output for testing test/btyacc/pure_error.output reference output for testing test/btyacc/pure_error.tab.c reference output for testing test/btyacc/pure_error.tab.h reference output for testing test/btyacc/quote_calc-s.error reference output for testing test/btyacc/quote_calc-s.output reference output for testing test/btyacc/quote_calc-s.tab.c reference output for testing test/btyacc/quote_calc-s.tab.h reference output for testing test/btyacc/quote_calc.error reference output for testing test/btyacc/quote_calc.output reference output for testing test/btyacc/quote_calc.tab.c reference output for testing test/btyacc/quote_calc.tab.h reference output for testing test/btyacc/quote_calc2-s.error reference output for testing test/btyacc/quote_calc2-s.output reference output for testing test/btyacc/quote_calc2-s.tab.c reference output for testing test/btyacc/quote_calc2-s.tab.h reference output for testing test/btyacc/quote_calc2.error reference output for testing test/btyacc/quote_calc2.output reference output for testing test/btyacc/quote_calc2.tab.c reference output for testing test/btyacc/quote_calc2.tab.h reference output for testing test/btyacc/quote_calc3-s.error reference output for testing test/btyacc/quote_calc3-s.output reference output for testing test/btyacc/quote_calc3-s.tab.c reference output for testing test/btyacc/quote_calc3-s.tab.h reference output for testing test/btyacc/quote_calc3.error reference output for testing test/btyacc/quote_calc3.output reference output for testing test/btyacc/quote_calc3.tab.c reference output for testing test/btyacc/quote_calc3.tab.h reference output for testing test/btyacc/quote_calc4-s.error reference output for testing test/btyacc/quote_calc4-s.output reference output for testing test/btyacc/quote_calc4-s.tab.c reference output for testing test/btyacc/quote_calc4-s.tab.h reference output for testing test/btyacc/quote_calc4.error reference output for testing test/btyacc/quote_calc4.output reference output for testing test/btyacc/quote_calc4.tab.c reference output for testing test/btyacc/quote_calc4.tab.h reference output for testing test/btyacc/rename_debug.c reference output for testing test/btyacc/rename_debug.error reference output for testing test/btyacc/rename_debug.h reference output for testing test/btyacc/rename_debug.i reference output for testing test/btyacc/rename_debug.output reference output for testing test/btyacc/varsyntax_calc1.error reference output for testing test/btyacc/varsyntax_calc1.output reference output for testing test/btyacc/varsyntax_calc1.tab.c reference output for testing test/btyacc/varsyntax_calc1.tab.h reference output for testing test subdirectory test/btyacc_calc1.y testcase for btyacc test/btyacc_demo.y testcase for btyacc test/calc.y example from VMS freeware version of byacc test/calc1.y advanced example from Steve Johnson's paper. test/calc2.y test-cases and reference files for %lex-param / %parse-param test/calc3.y test-cases and reference files for %lex-param / %parse-param test/code_calc.y reference input for testing test/code_debug.y test-input, for -i, -o, -d options test/code_error.y reference input for testing test/empty.y testcase for btyacc test/err_inherit1.y testcase for btyacc test/err_inherit2.y testcase for btyacc test/err_inherit3.y testcase for btyacc test/err_inherit4.y testcase for btyacc test/err_inherit5.y testcase for btyacc test/err_syntax1.y test-case with syntax error (and nonprinting character) test/err_syntax10.y testcase for retyped_warning() test/err_syntax11.y testcase for reprec_warning() test/err_syntax12.y testcase for revalued_warning() test/err_syntax13.y testcase for terminal_start() test/err_syntax14.y testcase for restarted_warning() and undefined_goal() test/err_syntax15.y testcase for no_grammar() test/err_syntax16.y testcase for terminal_lhs() test/err_syntax17.y testcase for unterminated_action() test/err_syntax18.y testcase for dollar_warning() test/err_syntax19.y testcase for dollar_error() test/err_syntax2.y testcase for unterminated_comment() test/err_syntax20.y testcase for undefined_symbol_warning() test/err_syntax21.y testcase for unknown_rhs() test/err_syntax22.y testcase for untyped_rhs() test/err_syntax23.y testcase for untyped_lhs() test/err_syntax24.y testcase for default_action_warning() test/err_syntax25.y testcase for over_unionized() test/err_syntax26.y testcase for unexpected_EOF() test/err_syntax27.y testcase for missing_brace() test/err_syntax3.y testcase for unterminated_string() test/err_syntax4.y testcase for unterminated_text() test/err_syntax5.y testcase for unterminated_union() test/err_syntax6.y testcase for illegal_tag() test/err_syntax7.y testcase for illegal_character() test/err_syntax7a.y testcase for illegal_character() test/err_syntax7b.y testcase for illegal_character() test/err_syntax8.y testcase for used_reserved() test/err_syntax8a.y testcase for used_reserved() test/err_syntax9.y testcase for tokenized_start() test/error.y original version of byacc - 1993 test/grammar.y grammar from cproto test/inherit0.y testcase for btyacc test/inherit1.y testcase for btyacc test/inherit2.y testcase for btyacc test/ok_syntax1.y testcase for valid literal syntax test/pure_calc.y reference input for testing test/pure_error.y reference input for testing test/quote_calc.y test-case for %token using quoted name test/quote_calc2.y test-case for %token using quoted name test/quote_calc3.y test-case for %token using quoted name test/quote_calc4.y test-case for %token using quoted name test/run_lint.sh run lint, using the build-directory's makefile, on each ".c" file in test-directory test/run_make.sh do a test-compile of each ".c" file in the test-directory test/run_test.sh test-script for byacc test/varsyntax_calc1.y testcase for btyacc test/yacc subdirectory test/yacc/big_b.error exercise -L/-B options test/yacc/big_b.output exercise -L/-B options test/yacc/big_l.error exercise -L/-B options test/yacc/big_l.output exercise -L/-B options test/yacc/calc.error reference output for testing test/yacc/calc.output reference output for testing test/yacc/calc.tab.c reference output for testing test/yacc/calc.tab.h reference output for testing test/yacc/calc1.error reference output for testing test/yacc/calc1.output reference output for testing test/yacc/calc1.tab.c reference output for testing test/yacc/calc1.tab.h reference output for testing test/yacc/calc2.error reference output for testing test/yacc/calc2.output reference output for testing test/yacc/calc2.tab.c reference output for testing test/yacc/calc2.tab.h reference output for testing test/yacc/calc3.error reference output for testing test/yacc/calc3.output reference output for testing test/yacc/calc3.tab.c reference output for testing test/yacc/calc3.tab.h reference output for testing test/yacc/code_calc.code.c reference output for testing test/yacc/code_calc.error reference output for testing test/yacc/code_calc.output reference output for testing test/yacc/code_calc.tab.c reference output for testing test/yacc/code_calc.tab.h reference output for testing test/yacc/code_error.code.c reference output for testing test/yacc/code_error.error reference output for testing test/yacc/code_error.output reference output for testing test/yacc/code_error.tab.c reference output for testing test/yacc/code_error.tab.h reference output for testing test/yacc/empty.error reference output for testing test/yacc/empty.output reference output for testing test/yacc/empty.tab.c reference output for testing test/yacc/empty.tab.h reference output for testing test/yacc/err_syntax1.error reference output for testing test/yacc/err_syntax1.output reference output for testing test/yacc/err_syntax1.tab.c reference output for testing test/yacc/err_syntax1.tab.h reference output for testing test/yacc/err_syntax10.error reference output for testing test/yacc/err_syntax10.output reference output for testing test/yacc/err_syntax10.tab.c reference output for testing test/yacc/err_syntax10.tab.h reference output for testing test/yacc/err_syntax11.error reference output for testing test/yacc/err_syntax11.output reference output for testing test/yacc/err_syntax11.tab.c reference output for testing test/yacc/err_syntax11.tab.h reference output for testing test/yacc/err_syntax12.error reference output for testing test/yacc/err_syntax12.output reference output for testing test/yacc/err_syntax12.tab.c reference output for testing test/yacc/err_syntax12.tab.h reference output for testing test/yacc/err_syntax13.error reference output for testing test/yacc/err_syntax13.output reference output for testing test/yacc/err_syntax13.tab.c reference output for testing test/yacc/err_syntax13.tab.h reference output for testing test/yacc/err_syntax14.error reference output for testing test/yacc/err_syntax14.output reference output for testing test/yacc/err_syntax14.tab.c reference output for testing test/yacc/err_syntax14.tab.h reference output for testing test/yacc/err_syntax15.error reference output for testing test/yacc/err_syntax15.output reference output for testing test/yacc/err_syntax15.tab.c reference output for testing test/yacc/err_syntax15.tab.h reference output for testing test/yacc/err_syntax16.error reference output for testing test/yacc/err_syntax16.output reference output for testing test/yacc/err_syntax16.tab.c reference output for testing test/yacc/err_syntax16.tab.h reference output for testing test/yacc/err_syntax17.error reference output for testing test/yacc/err_syntax17.output reference output for testing test/yacc/err_syntax17.tab.c reference output for testing test/yacc/err_syntax17.tab.h reference output for testing test/yacc/err_syntax18.error reference output for testing test/yacc/err_syntax18.output reference output for testing test/yacc/err_syntax18.tab.c reference output for testing test/yacc/err_syntax18.tab.h reference output for testing test/yacc/err_syntax19.error reference output for testing test/yacc/err_syntax19.output reference output for testing test/yacc/err_syntax19.tab.c reference output for testing test/yacc/err_syntax19.tab.h reference output for testing test/yacc/err_syntax2.error reference output for testing test/yacc/err_syntax2.output reference output for testing test/yacc/err_syntax2.tab.c reference output for testing test/yacc/err_syntax2.tab.h reference output for testing test/yacc/err_syntax20.error reference output for testing test/yacc/err_syntax20.output reference output for testing test/yacc/err_syntax20.tab.c reference output for testing test/yacc/err_syntax20.tab.h reference output for testing test/yacc/err_syntax21.error reference output for testing test/yacc/err_syntax21.output reference output for testing test/yacc/err_syntax21.tab.c reference output for testing test/yacc/err_syntax21.tab.h reference output for testing test/yacc/err_syntax22.error reference output for testing test/yacc/err_syntax22.output reference output for testing test/yacc/err_syntax22.tab.c reference output for testing test/yacc/err_syntax22.tab.h reference output for testing test/yacc/err_syntax23.error reference output for testing test/yacc/err_syntax23.output reference output for testing test/yacc/err_syntax23.tab.c reference output for testing test/yacc/err_syntax23.tab.h reference output for testing test/yacc/err_syntax24.error reference output for testing test/yacc/err_syntax24.output reference output for testing test/yacc/err_syntax24.tab.c reference output for testing test/yacc/err_syntax24.tab.h reference output for testing test/yacc/err_syntax25.error reference output for testing test/yacc/err_syntax25.output reference output for testing test/yacc/err_syntax25.tab.c reference output for testing test/yacc/err_syntax25.tab.h reference output for testing test/yacc/err_syntax26.error reference output for testing test/yacc/err_syntax26.output reference output for testing test/yacc/err_syntax26.tab.c reference output for testing test/yacc/err_syntax26.tab.h reference output for testing test/yacc/err_syntax27.error reference output for testing test/yacc/err_syntax27.output reference output for testing test/yacc/err_syntax27.tab.c reference output for testing test/yacc/err_syntax27.tab.h reference output for testing test/yacc/err_syntax3.error reference output for testing test/yacc/err_syntax3.output reference output for testing test/yacc/err_syntax3.tab.c reference output for testing test/yacc/err_syntax3.tab.h reference output for testing test/yacc/err_syntax4.error reference output for testing test/yacc/err_syntax4.output reference output for testing test/yacc/err_syntax4.tab.c reference output for testing test/yacc/err_syntax4.tab.h reference output for testing test/yacc/err_syntax5.error reference output for testing test/yacc/err_syntax5.output reference output for testing test/yacc/err_syntax5.tab.c reference output for testing test/yacc/err_syntax5.tab.h reference output for testing test/yacc/err_syntax6.error reference output for testing test/yacc/err_syntax6.output reference output for testing test/yacc/err_syntax6.tab.c reference output for testing test/yacc/err_syntax6.tab.h reference output for testing test/yacc/err_syntax7.error reference output for testing test/yacc/err_syntax7.output reference output for testing test/yacc/err_syntax7.tab.c reference output for testing test/yacc/err_syntax7.tab.h reference output for testing test/yacc/err_syntax7a.error reference output for testing test/yacc/err_syntax7a.output reference output for testing test/yacc/err_syntax7a.tab.c reference output for testing test/yacc/err_syntax7a.tab.h reference output for testing test/yacc/err_syntax7b.error reference output for testing test/yacc/err_syntax7b.output reference output for testing test/yacc/err_syntax7b.tab.c reference output for testing test/yacc/err_syntax7b.tab.h reference output for testing test/yacc/err_syntax8.error reference output for testing test/yacc/err_syntax8.output reference output for testing test/yacc/err_syntax8.tab.c reference output for testing test/yacc/err_syntax8.tab.h reference output for testing test/yacc/err_syntax8a.error reference output for testing test/yacc/err_syntax8a.output reference output for testing test/yacc/err_syntax8a.tab.c reference output for testing test/yacc/err_syntax8a.tab.h reference output for testing test/yacc/err_syntax9.error reference output for testing test/yacc/err_syntax9.output reference output for testing test/yacc/err_syntax9.tab.c reference output for testing test/yacc/err_syntax9.tab.h reference output for testing test/yacc/error.error reference output for testing test/yacc/error.output reference output for testing test/yacc/error.tab.c reference output for testing test/yacc/error.tab.h reference output for testing test/yacc/grammar.dot reference output for testing test/yacc/grammar.error reference output for testing test/yacc/grammar.output reference output for testing test/yacc/grammar.tab.c reference output for testing test/yacc/grammar.tab.h reference output for testing test/yacc/help.error reference output for testing test/yacc/help.output reference output for testing test/yacc/no_b_opt.error reference output for testing test/yacc/no_b_opt.output reference output for testing test/yacc/no_b_opt1.error reference output for testing test/yacc/no_b_opt1.output reference output for testing test/yacc/no_code_c.error reference output for testing test/yacc/no_code_c.output reference output for testing test/yacc/no_defines.error reference output for testing test/yacc/no_defines.output reference output for testing test/yacc/no_graph.error reference output for testing test/yacc/no_graph.output reference output for testing test/yacc/no_include.error reference output for testing test/yacc/no_include.output reference output for testing test/yacc/no_opts.error reference output for testing test/yacc/no_opts.output reference output for testing test/yacc/no_output.error reference output for testing test/yacc/no_output.output reference output for testing test/yacc/no_output1.error reference output for testing test/yacc/no_output1.output reference output for testing test/yacc/no_output2.error reference output for testing test/yacc/no_output2.output reference output for testing test/yacc/no_p_opt.error reference output for testing test/yacc/no_p_opt.output reference output for testing test/yacc/no_p_opt1.error reference output for testing test/yacc/no_p_opt1.output reference output for testing test/yacc/no_verbose.error reference output for testing test/yacc/no_verbose.output reference output for testing test/yacc/nostdin.error reference output for testing test/yacc/nostdin.output reference output for testing test/yacc/ok_syntax1.error reference output for testing test/yacc/ok_syntax1.output reference output for testing test/yacc/ok_syntax1.tab.c reference output for testing test/yacc/ok_syntax1.tab.h reference output for testing test/yacc/pure_calc.error reference output for testing test/yacc/pure_calc.output reference output for testing test/yacc/pure_calc.tab.c reference output for testing test/yacc/pure_calc.tab.h reference output for testing test/yacc/pure_error.error reference output for testing test/yacc/pure_error.output reference output for testing test/yacc/pure_error.tab.c reference output for testing test/yacc/pure_error.tab.h reference output for testing test/yacc/quote_calc-s.error reference output for testing test/yacc/quote_calc-s.output reference output for testing test/yacc/quote_calc-s.tab.c reference output for testing test/yacc/quote_calc-s.tab.h reference output for testing test/yacc/quote_calc.error reference output for testing test/yacc/quote_calc.output reference output for testing test/yacc/quote_calc.tab.c reference output for testing test/yacc/quote_calc.tab.h reference output for testing test/yacc/quote_calc2-s.error reference output for testing test/yacc/quote_calc2-s.output reference output for testing test/yacc/quote_calc2-s.tab.c reference output for testing test/yacc/quote_calc2-s.tab.h reference output for testing test/yacc/quote_calc2.error reference output for testing test/yacc/quote_calc2.output reference output for testing test/yacc/quote_calc2.tab.c reference output for testing test/yacc/quote_calc2.tab.h reference output for testing test/yacc/quote_calc3-s.error reference output for testing test/yacc/quote_calc3-s.output reference output for testing test/yacc/quote_calc3-s.tab.c reference output for testing test/yacc/quote_calc3-s.tab.h reference output for testing test/yacc/quote_calc3.error reference output for testing test/yacc/quote_calc3.output reference output for testing test/yacc/quote_calc3.tab.c reference output for testing test/yacc/quote_calc3.tab.h reference output for testing test/yacc/quote_calc4-s.error reference output for testing test/yacc/quote_calc4-s.output reference output for testing test/yacc/quote_calc4-s.tab.c reference output for testing test/yacc/quote_calc4-s.tab.h reference output for testing test/yacc/quote_calc4.error reference output for testing test/yacc/quote_calc4.output reference output for testing test/yacc/quote_calc4.tab.c reference output for testing test/yacc/quote_calc4.tab.h reference output for testing test/yacc/rename_debug.c reference output for testing test/yacc/rename_debug.error reference output for testing test/yacc/rename_debug.h reference output for testing test/yacc/rename_debug.i reference output for testing test/yacc/rename_debug.output reference output for testing test/yacc/varsyntax_calc1.error reference output for testing test/yacc/varsyntax_calc1.output reference output for testing test/yacc/varsyntax_calc1.tab.c reference output for testing test/yacc/varsyntax_calc1.tab.h reference output for testing Index: stable/10/contrib/byacc/VERSION =================================================================== --- stable/10/contrib/byacc/VERSION (revision 272952) +++ stable/10/contrib/byacc/VERSION (revision 272953) @@ -1 +1 @@ -20140422 +20140715 Index: stable/10/contrib/byacc/aclocal.m4 =================================================================== --- stable/10/contrib/byacc/aclocal.m4 (revision 272952) +++ stable/10/contrib/byacc/aclocal.m4 (revision 272953) @@ -1,1206 +1,1206 @@ -dnl $Id: aclocal.m4,v 1.34 2014/04/06 19:16:18 tom Exp $ +dnl $Id: aclocal.m4,v 1.35 2014/07/15 19:38:05 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- dnl Copyright 2004-2013,2014 Thomas E. Dickey dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the dnl "Software"), to deal in the Software without restriction, including dnl without limitation the rights to use, copy, modify, merge, publish, dnl distribute, distribute with modifications, sublicense, and/or sell dnl copies of the Software, and to permit persons to whom the Software is dnl furnished to do so, subject to the following conditions: dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. dnl dnl Except as contained in this notice, the name(s) of the above copyright dnl holders shall not be used in advertising or otherwise to promote the dnl sale, use or other dealings in this Software without prior written dnl authorization. dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- -dnl CF_ACVERSION_CHECK version: 4 updated: 2013/03/04 19:52:56 +dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49 dnl ------------------ dnl Conditionally generate script according to whether we're using a given autoconf. dnl dnl $1 = version to compare against dnl $2 = code to use if AC_ACVERSION is at least as high as $1. dnl $3 = code to use if AC_ACVERSION is older than $1. define([CF_ACVERSION_CHECK], [ -ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])dnl +ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl ifdef([m4_version_compare], [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], [CF_ACVERSION_COMPARE( AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl dnl --------------------------------------------------------------------------- dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53 dnl -------------------- dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1, dnl MAJOR2, MINOR2, TERNARY2, dnl PRINTABLE2, not FOUND, FOUND) define([CF_ACVERSION_COMPARE], [ifelse(builtin([eval], [$2 < $5]), 1, [ifelse([$8], , ,[$8])], [ifelse([$9], , ,[$9])])])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. dnl dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily dnl confused by the quotes (which require backslashes to keep them usable). AC_DEFUN([CF_ADD_CFLAGS], [ cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $1 do case $cf_fix_cppflags in no) case $cf_add_cflags in #(vi -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi case $cf_add_cflags in -D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in *$cf_add_cflags) #(vi ;; *) #(vi case $cf_add_cflags in #(vi -D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) ;; esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; *) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 dnl -------------- dnl Allow user to disable a normally-on option. AC_DEFUN([CF_ARG_DISABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42 dnl ------------- dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus dnl values. dnl dnl Parameters: dnl $1 = option name dnl $2 = help-string dnl $3 = action to perform if option is not default dnl $4 = action if perform if option is default dnl $5 = default option value (either 'yes' or 'no') AC_DEFUN([CF_ARG_OPTION], [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes) if test "$enableval" != "$5" ; then ifelse([$3],,[ :]dnl ,[ $3]) ifelse([$4],,,[ else $4]) fi],[enableval=$5 ifelse([$4],,,[ $4 ])dnl ])])dnl dnl --------------------------------------------------------------------------- dnl CF_CC_ENV_FLAGS version: 1 updated: 2012/10/03 05:25:49 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler with dnl options, but eliminates a more common category of user confusion. AC_DEFUN([CF_CC_ENV_FLAGS], [ # This should have been defined by AC_PROG_CC : ${CC:=cc} AC_MSG_CHECKING(\$CC variable) case "$CC" in #(vi *[[\ \ ]]-[[IUD]]*) AC_MSG_RESULT(broken) AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'` CC=`echo "$CC" | sed -e 's/[[ ]].*//'` CF_ADD_CFLAGS($cf_flags) ;; *) AC_MSG_RESULT(ok) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. dnl dnl If we've packaged config.guess and config.sub, run that (since it does a dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM dnl which is useful in cross-compiles. dnl dnl Note: we would use $ac_config_sub, but that is one of the places where dnl autoconf 2.5x broke compatibility with autoconf 2.13 AC_DEFUN([CF_CHECK_CACHE], [ if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then ifelse([$1],,[AC_CANONICAL_HOST],[$1]) system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" if test -z "$system_name" ; then system_name="`(hostname) 2>/dev/null`" fi fi test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.]) AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) test -z "$system_name" && system_name="$cf_cv_system_name" test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) if test ".$system_name" != ".$cf_cv_system_name" ; then AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) AC_MSG_ERROR("Please remove config.cache and try again.") fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35 dnl ----------------- dnl Check if the given compiler is really clang. clang's C driver defines dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does dnl not ignore some gcc options. dnl dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX dnl $2 = CLANG_COMPILER (default) dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_CLANG_COMPILER],[ ifelse([$2],,CLANG_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments" AC_TRY_COMPILE([],[ #ifdef __clang__ #else make an error #endif ],[ifelse([$2],,CLANG_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) fi ]) dnl --------------------------------------------------------------------------- dnl CF_DISABLE_ECHO version: 12 updated: 2012/10/06 16:30:28 dnl --------------- dnl You can always use "make -n" to see the actual options, but it's hard to dnl pick out/analyze warning messages when the compile-line is long. dnl dnl Sets: dnl ECHO_LT - symbol to control if libtool is verbose dnl ECHO_LD - symbol to prefix "cc -o" lines dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o) dnl SHOW_CC - symbol to put before explicit "cc -c" lines dnl ECHO_CC - symbol to put before any "cc" line dnl AC_DEFUN([CF_DISABLE_ECHO],[ AC_MSG_CHECKING(if you want to see long compiling messages) CF_ARG_DISABLE(echo, [ --disable-echo do not display "compiling" commands], [ ECHO_LT='--silent' ECHO_LD='@echo linking [$]@;' RULE_CC='@echo compiling [$]<' SHOW_CC='@echo compiling [$]@' ECHO_CC='@' ],[ ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' ]) AC_MSG_RESULT($enableval) AC_SUBST(ECHO_LT) AC_SUBST(ECHO_LD) AC_SUBST(RULE_CC) AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) ])dnl dnl --------------------------------------------------------------------------- dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. AC_DEFUN([CF_DISABLE_LEAKS],[ AC_REQUIRE([CF_WITH_DMALLOC]) AC_REQUIRE([CF_WITH_DBMALLOC]) AC_REQUIRE([CF_WITH_VALGRIND]) AC_MSG_CHECKING(if you want to perform memory-leak testing) AC_ARG_ENABLE(leaks, [ --disable-leaks test: free permanent memory, analyze leaks], [if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi], : ${with_no_leaks:=no}) AC_MSG_RESULT($with_no_leaks) if test "$with_no_leaks" = yes ; then AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_ATTRIBUTES version: 16 updated: 2012/10/02 20:55:03 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary dnl to documentation, unrecognized directives cause older compilers to barf. AC_DEFUN([CF_GCC_ATTRIBUTES], [ if test "$GCC" = yes then cat > conftest.i < conftest.$ac_ext <&AC_FD_CC case $cf_attribute in #(vi printf) #(vi cf_printf_attribute=yes cat >conftest.h <conftest.h <conftest.h <>confdefs.h case $cf_attribute in #(vi noreturn) #(vi AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc]) ;; printf) #(vi cf_value='/* nothing */' if test "$cf_printf_attribute" != no ; then cf_value='__attribute__((format(printf,fmt,var)))' AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.]) fi AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc]) ;; scanf) #(vi cf_value='/* nothing */' if test "$cf_scanf_attribute" != no ; then cf_value='__attribute__((format(scanf,fmt,var)))' AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.]) fi AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc]) ;; unused) #(vi AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc]) ;; esac fi done else fgrep define conftest.i >>confdefs.h fi rm -rf conftest* fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33 dnl -------------- dnl Find version of gcc AC_DEFUN([CF_GCC_VERSION],[ AC_REQUIRE([AC_PROG_CC]) GCC_VERSION=none if test "$GCC" = yes ; then AC_MSG_CHECKING(version of $CC) GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_WARNINGS version: 31 updated: 2013/11/19 19:23:35 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: dnl dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x) dnl -Wredundant-decls (system headers make this too noisy) dnl -Wtraditional (combines too many unrelated messages, only a few useful) dnl -Wwrite-strings (too noisy, but should review occasionally). This dnl is enabled for ncurses using "--enable-const". dnl -pedantic dnl dnl Parameter: dnl $1 is an optional list of gcc warning flags that a particular dnl application might want to use, e.g., "no-unused" for dnl -Wno-unused dnl Special: dnl If $with_ext_const is "yes", add a check for -Wwrite-strings dnl AC_DEFUN([CF_GCC_WARNINGS], [ AC_REQUIRE([CF_GCC_VERSION]) CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) cat > conftest.$ac_ext <],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_cv_gnu_source=no], [cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" AC_TRY_COMPILE([#include ],[ #ifdef _XOPEN_SOURCE make an error #endif], [cf_cv_gnu_source=no], [cf_cv_gnu_source=yes]) CPPFLAGS="$cf_save" ]) ]) test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" ])dnl dnl --------------------------------------------------------------------------- dnl CF_INTEL_COMPILER version: 6 updated: 2014/03/17 13:13:07 dnl ----------------- dnl Check if the given compiler is really the Intel compiler for Linux. It dnl tries to imitate gcc, but does not return an error when it finds a mismatch dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK. dnl dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_INTEL_COMPILER],[ AC_REQUIRE([AC_CANONICAL_HOST]) ifelse([$2],,INTEL_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then case $host_os in linux*|gnu*) AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc" AC_TRY_COMPILE([],[ #ifdef __INTEL_COMPILER #else make an error #endif ],[ifelse([$2],,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) ;; esac fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAKE_DOCS version: 3 updated: 2014/01/05 13:21:25 dnl ------------ dnl $1 = name(s) to generate rules for dnl $2 = suffix of corresponding manpages used as input. define([CF_MAKE_DOCS],[ test -z "$cf_make_docs" && cf_make_docs=0 cf_output=makefile test -f "$cf_output" || cf_output=Makefile if test "$cf_make_docs" = 0 then cat >>$cf_output <<"CF_EOF" ################################################################################ .SUFFIXES : .html .$2 .man .ps .pdf .txt .$2.html : GROFF_NO_SGR=stupid [$](SHELL) -c "tbl [$]*.$2 | groff -P -o0 -I$*_ -Thtml -man" >[$]@ .$2.ps : [$](SHELL) -c "tbl [$]*.$2 | groff -man" >[$]@ .$2.txt : GROFF_NO_SGR=stupid [$](SHELL) -c "tbl [$]*.$2 | nroff -Tascii -man | col -bx" >[$]@ .ps.pdf : ps2pdf [$]*.ps CF_EOF cf_make_docs=1 fi for cf_name in $1 do cat >>$cf_output <conftest if test -f CONFTEST ; then cf_cv_mixedcase=no else cf_cv_mixedcase=yes fi rm -f conftest CONFTEST fi ]) test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_MKSTEMP version: 9 updated: 2012/10/03 04:34:49 dnl ---------- dnl Check for a working mkstemp. This creates two files, checks that they are dnl successfully created and distinct (AmigaOS apparently fails on the last). AC_DEFUN([CF_MKSTEMP],[ AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ rm -rf conftest* AC_TRY_RUN([ #include #include #include #include #include int main() { char *tmpl = "conftestXXXXXX"; char name[2][80]; int n; int result = 0; int fd; struct stat sb; umask(077); for (n = 0; n < 2; ++n) { strcpy(name[n], tmpl); if ((fd = mkstemp(name[n])) >= 0) { if (!strcmp(name[n], tmpl) || stat(name[n], &sb) != 0 || (sb.st_mode & S_IFMT) != S_IFREG || (sb.st_mode & 077) != 0) { result = 1; } close(fd); } } if (result == 0 && !strcmp(name[0], name[1])) result = 1; ${cf_cv_main_return:-return}(result); } ],[cf_cv_func_mkstemp=yes ],[cf_cv_func_mkstemp=no ],[cf_cv_func_mkstemp=maybe]) ]) if test "x$cf_cv_func_mkstemp" = xmaybe ; then AC_CHECK_FUNC(mkstemp) fi if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then AC_DEFINE(HAVE_MKSTEMP,1,[Define to 1 if mkstemp() is available and working.]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 dnl ---------- dnl Write a debug message to config.log, along with the line number in the dnl configure script. AC_DEFUN([CF_MSG_LOG],[ echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- dnl CF_NO_LEAKS_OPTION version: 5 updated: 2012/10/02 20:55:03 dnl ------------------ dnl see CF_WITH_NO_LEAKS AC_DEFUN([CF_NO_LEAKS_OPTION],[ AC_MSG_CHECKING(if you want to use $1 for testing) AC_ARG_WITH($1, [$2], [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[ $4 ]) : ${with_cflags:=-g} : ${with_no_leaks:=yes} with_$1=yes], [with_$1=]) AC_MSG_RESULT(${with_$1:-no}) case .$with_cflags in #(vi .*-g*) case .$CFLAGS in #(vi .*-g*) #(vi ;; *) CF_ADD_CFLAGS([-g]) ;; esac ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl dnl POSIX.1-1990 _POSIX_SOURCE dnl POSIX.1-1990 and _POSIX_SOURCE and dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2 dnl Bindings Option dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L dnl X/Open 2000 _POSIX_C_SOURCE=200112L dnl dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], [ cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE) CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE) AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ CF_MSG_LOG(if the symbol is already defined go no further) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE make an error #endif], [cf_cv_posix_c_source=no], [cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in #(vi .[[12]]??*) #(vi cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; .2) #(vi cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; .*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then AC_TRY_COMPILE([#include ],[ #ifdef _POSIX_SOURCE make an error #endif],[], cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") fi CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" CF_MSG_LOG(if the second compile does not leave our definition intact error) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE make an error #endif],, [cf_cv_posix_c_source=no]) CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" ]) ]) if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" CF_ADD_CFLAGS($cf_cv_posix_c_source) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59 dnl ----------- dnl Check for awk, ensure that the check found something. AC_DEFUN([CF_PROG_AWK], [ AC_PROG_AWK test -z "$AWK" && AC_MSG_ERROR(No awk program found) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_CC version: 3 updated: 2012/10/06 15:31:55 +dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58 dnl ---------- dnl standard check for CC, plus followup sanity checks dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name AC_DEFUN([CF_PROG_CC],[ ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)]) CF_GCC_VERSION CF_ACVERSION_CHECK(2.52, [AC_PROG_CC_STDC], [CF_ANSI_CC_REQD]) -CF_CC_ENV_FLAGS +CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint) AC_SUBST(LINT_OPTS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list dnl of C compiler options. This works around the problem that not all dnl compilers process -U and -D options from left-to-right, so a -U option dnl cannot be used to cancel the effect of a preceding -D option. dnl dnl $1 = target (which could be the same as the source variable) dnl $2 = source (including '$') dnl $3 = symbol to remove define([CF_REMOVE_DEFINE], [ $1=`echo "$2" | \ sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_TRY_XOPEN_SOURCE version: 1 updated: 2011/10/30 17:09:50 dnl ------------------- dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we dnl can define it successfully. AC_DEFUN([CF_TRY_XOPEN_SOURCE],[ AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ AC_TRY_COMPILE([ #include #include #include ],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" AC_TRY_COMPILE([ #include #include #include ],[ #ifdef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) CPPFLAGS="$cf_save" ]) ]) if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" CF_ADD_CFLAGS($cf_temp_xopen_source) fi ]) dnl --------------------------------------------------------------------------- dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59 dnl -------- dnl Make an uppercase version of a variable dnl $1=uppercase($2) AC_DEFUN([CF_UPPER], [ $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings AC_DEFUN([CF_VERBOSE], [test -n "$verbose" && echo " $1" 1>&AC_FD_MSG CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl ---------------- dnl Configure-option for dbmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. AC_DEFUN([CF_WITH_DBMALLOC],[ CF_NO_LEAKS_OPTION(dbmalloc, [ --with-dbmalloc test: use Conor Cahill's dbmalloc library], [USE_DBMALLOC]) if test "$with_dbmalloc" = yes ; then AC_CHECK_HEADER(dbmalloc.h, [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl --------------- dnl Configure-option for dmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. AC_DEFUN([CF_WITH_DMALLOC],[ CF_NO_LEAKS_OPTION(dmalloc, [ --with-dmalloc test: use Gray Watson's dmalloc library], [USE_DMALLOC]) if test "$with_dmalloc" = yes ; then AC_CHECK_HEADER(dmalloc.h, [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21 dnl ---------------- AC_DEFUN([CF_WITH_VALGRIND],[ CF_NO_LEAKS_OPTION(valgrind, [ --with-valgrind test: use valgrind], [USE_VALGRIND]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_WARNINGS version: 5 updated: 2004/07/23 14:40:34 dnl ---------------- dnl Combine the checks for gcc features into a configure-script option dnl dnl Parameters: dnl $1 - see CF_GCC_WARNINGS AC_DEFUN([CF_WITH_WARNINGS], [ if ( test "$GCC" = yes || test "$GXX" = yes ) then AC_MSG_CHECKING(if you want to check for gcc warnings) AC_ARG_WITH(warnings, [ --with-warnings test: turn on gcc warnings], [cf_opt_with_warnings=$withval], [cf_opt_with_warnings=no]) AC_MSG_RESULT($cf_opt_with_warnings) if test "$cf_opt_with_warnings" != no ; then CF_GCC_ATTRIBUTES CF_GCC_WARNINGS([$1]) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_XOPEN_SOURCE version: 46 updated: 2014/02/09 19:30:15 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, dnl without losing the common non-POSIX features. dnl dnl Parameters: dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ AC_REQUIRE([AC_CANONICAL_HOST]) cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) cf_xopen_source= case $host_os in #(vi aix[[4-7]]*) #(vi cf_xopen_source="-D_ALL_SOURCE" ;; cygwin|msys) #(vi cf_XOPEN_SOURCE=600 ;; darwin[[0-8]].*) #(vi cf_xopen_source="-D_APPLE_C_SOURCE" ;; darwin*) #(vi cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; freebsd*|dragonfly*) #(vi # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; hpux11*) #(vi cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; hpux*) #(vi cf_xopen_source="-D_HPUX_SOURCE" ;; irix[[56]].*) #(vi cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; linux*|gnu*|mint*|k*bsd*-gnu) #(vi CF_GNU_SOURCE ;; mirbsd*) #(vi # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks and other headers which use u_int / u_short types cf_XOPEN_SOURCE= CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; netbsd*) #(vi cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; openbsd[[4-9]]*) #(vi # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600 ;; openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[[45]]*) #(vi cf_xopen_source="-D_OSF_SOURCE" ;; nto-qnx*) #(vi cf_xopen_source="-D_QNX_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; solaris2.*) #(vi cf_xopen_source="-D__EXTENSIONS__" cf_cv_xopen_source=broken ;; *) CF_TRY_XOPEN_SOURCE CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; esac if test -n "$cf_xopen_source" ; then CF_ADD_CFLAGS($cf_xopen_source) fi dnl In anything but the default case, we may have system-specific setting dnl which is still not guaranteed to provide all of the entrypoints that dnl _XOPEN_SOURCE would yield. if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then AC_MSG_CHECKING(if _XOPEN_SOURCE really is set) AC_TRY_COMPILE([#include ],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_XOPEN_SOURCE_set=yes], [cf_XOPEN_SOURCE_set=no]) AC_MSG_RESULT($cf_XOPEN_SOURCE_set) if test $cf_XOPEN_SOURCE_set = yes then AC_TRY_COMPILE([#include ],[ #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE make an error #endif], [cf_XOPEN_SOURCE_set_ok=yes], [cf_XOPEN_SOURCE_set_ok=no]) if test $cf_XOPEN_SOURCE_set_ok = no then AC_MSG_WARN(_XOPEN_SOURCE is lower than requested) fi else CF_TRY_XOPEN_SOURCE fi fi ]) Index: stable/10/contrib/byacc/main.c =================================================================== --- stable/10/contrib/byacc/main.c (revision 272952) +++ stable/10/contrib/byacc/main.c (revision 272953) @@ -1,703 +1,702 @@ -/* $Id: main.c,v 1.50 2014/04/22 23:34:47 tom Exp $ */ +/* $Id: main.c,v 1.51 2014/05/28 02:01:55 Tom.Shields Exp $ */ #include #ifndef _WIN32 #include /* for _exit() */ #else #include /* for _exit() */ #endif #include "defs.h" #ifdef HAVE_MKSTEMP # define USE_MKSTEMP 1 #elif defined(HAVE_FCNTL_H) # define USE_MKSTEMP 1 # include /* for open(), O_EXCL, etc. */ #else # define USE_MKSTEMP 0 #endif #if USE_MKSTEMP #include #include typedef struct _my_tmpfiles { struct _my_tmpfiles *next; char *name; } MY_TMPFILES; static MY_TMPFILES *my_tmpfiles; #endif /* USE_MKSTEMP */ char dflag; char gflag; char iflag; char lflag; static char oflag; char rflag; char sflag; char tflag; char vflag; const char *symbol_prefix; const char *myname = "yacc"; int lineno; int outline; static char empty_string[] = ""; static char default_file_prefix[] = "y"; static char *file_prefix = default_file_prefix; char *code_file_name; char *input_file_name = empty_string; char *defines_file_name; char *externs_file_name; static char *graph_file_name; static char *output_file_name; static char *verbose_file_name; FILE *action_file; /* a temp file, used to save actions associated */ /* with rules until the parser is written */ FILE *code_file; /* y.code.c (used when the -r option is specified) */ FILE *defines_file; /* y.tab.h */ FILE *externs_file; /* y.tab.i */ FILE *input_file; /* the input file */ FILE *output_file; /* y.tab.c */ FILE *text_file; /* a temp file, used to save text until all */ /* symbols have been defined */ FILE *union_file; /* a temp file, used to save the union */ /* definition until all symbol have been */ /* defined */ FILE *verbose_file; /* y.output */ FILE *graph_file; /* y.dot */ Value_t nitems; Value_t nrules; Value_t nsyms; Value_t ntokens; Value_t nvars; Value_t start_symbol; char **symbol_name; char **symbol_pname; Value_t *symbol_value; Value_t *symbol_prec; char *symbol_assoc; int pure_parser; int token_table; #if defined(YYBTYACC) Value_t *symbol_pval; char **symbol_destructor; char **symbol_type_tag; int locations = 0; /* default to no position processing */ int backtrack = 0; /* default is no backtracking */ #endif int exit_code; Value_t *ritem; Value_t *rlhs; Value_t *rrhs; Value_t *rprec; Assoc_t *rassoc; Value_t **derives; char *nullable; /* * Since fclose() is called via the signal handler, it might die. Don't loop * if there is a problem closing a file. */ #define DO_CLOSE(fp) \ if (fp != 0) { \ FILE *use = fp; \ fp = 0; \ fclose(use); \ } static int got_intr = 0; void done(int k) { DO_CLOSE(input_file); DO_CLOSE(output_file); if (iflag) DO_CLOSE(externs_file); if (rflag) DO_CLOSE(code_file); DO_CLOSE(action_file); DO_CLOSE(defines_file); DO_CLOSE(graph_file); DO_CLOSE(text_file); DO_CLOSE(union_file); DO_CLOSE(verbose_file); if (got_intr) _exit(EXIT_FAILURE); #ifdef NO_LEAKS if (rflag) DO_FREE(code_file_name); if (dflag) DO_FREE(defines_file_name); if (iflag) DO_FREE(externs_file_name); if (oflag) DO_FREE(output_file_name); if (vflag) DO_FREE(verbose_file_name); if (gflag) DO_FREE(graph_file_name); lr0_leaks(); lalr_leaks(); mkpar_leaks(); mstring_leaks(); output_leaks(); reader_leaks(); #endif exit(k); } static void onintr(int sig GCC_UNUSED) { got_intr = 1; done(EXIT_FAILURE); } static void set_signals(void) { #ifdef SIGINT if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, onintr); #endif #ifdef SIGTERM if (signal(SIGTERM, SIG_IGN) != SIG_IGN) signal(SIGTERM, onintr); #endif #ifdef SIGHUP if (signal(SIGHUP, SIG_IGN) != SIG_IGN) signal(SIGHUP, onintr); #endif } static void usage(void) { static const char *msg[] = { "" ,"Options:" ," -b file_prefix set filename prefix (default \"y.\")" ," -B create a backtracking parser" ," -d write definitions (" DEFINES_SUFFIX ")" - ," -D enable value stack memory reclamation" ," -i write interface (y.tab.i)" ," -g write a graphical description" ," -l suppress #line directives" ," -L enable position processing, e.g., \"%locations\"" ," -o output_file (default \"" OUTPUT_SUFFIX "\")" ," -p symbol_prefix set symbol prefix (default \"yy\")" ," -P create a reentrant parser, e.g., \"%pure-parser\"" ," -r produce separate code and table files (y.code.c)" ," -s suppress #define's for quoted names in %token lines" ," -t add debugging support" ," -v write description (y.output)" ," -V show version information and exit" }; unsigned n; fflush(stdout); fprintf(stderr, "Usage: %s [options] filename\n", myname); for (n = 0; n < sizeof(msg) / sizeof(msg[0]); ++n) fprintf(stderr, "%s\n", msg[n]); exit(1); } static void setflag(int ch) { switch (ch) { case 'B': #if defined(YYBTYACC) backtrack = 1; #else unsupported_flag_warning("-B", "reconfigure with --enable-btyacc"); #endif break; case 'd': dflag = 1; break; case 'g': gflag = 1; break; case 'i': iflag = 1; break; case 'l': lflag = 1; break; case 'L': #if defined(YYBTYACC) locations = 1; #else unsupported_flag_warning("-B", "reconfigure with --enable-btyacc"); #endif break; case 'P': pure_parser = 1; break; case 'r': rflag = 1; break; case 's': sflag = 1; break; case 't': tflag = 1; break; case 'v': vflag = 1; break; case 'V': printf("%s - %s\n", myname, VERSION); exit(EXIT_SUCCESS); case 'y': /* noop for bison compatibility. byacc is already designed to be posix * yacc compatible. */ break; default: usage(); } } static void getargs(int argc, char *argv[]) { int i; char *s; int ch; if (argc > 0) myname = argv[0]; for (i = 1; i < argc; ++i) { s = argv[i]; if (*s != '-') break; switch (ch = *++s) { case '\0': input_file = stdin; if (i + 1 < argc) usage(); return; case '-': ++i; goto no_more_options; case 'b': if (*++s) file_prefix = s; else if (++i < argc) file_prefix = argv[i]; else usage(); continue; case 'o': if (*++s) output_file_name = s; else if (++i < argc) output_file_name = argv[i]; else usage(); continue; case 'p': if (*++s) symbol_prefix = s; else if (++i < argc) symbol_prefix = argv[i]; else usage(); continue; default: setflag(ch); break; } for (;;) { switch (ch = *++s) { case '\0': goto end_of_option; default: setflag(ch); break; } } end_of_option:; } no_more_options:; if (i + 1 != argc) usage(); input_file_name = argv[i]; } void * allocate(size_t n) { void *p; p = NULL; if (n) { p = CALLOC(1, n); NO_SPACE(p); } return (p); } #define CREATE_FILE_NAME(dest, suffix) \ dest = alloc_file_name(len, suffix) static char * alloc_file_name(size_t len, const char *suffix) { char *result = TMALLOC(char, len + strlen(suffix) + 1); if (result == 0) no_space(); strcpy(result, file_prefix); strcpy(result + len, suffix); return result; } static void create_file_names(void) { size_t len; const char *defines_suffix; const char *externs_suffix; char *prefix; prefix = NULL; defines_suffix = DEFINES_SUFFIX; externs_suffix = EXTERNS_SUFFIX; /* compute the file_prefix from the user provided output_file_name */ if (output_file_name != 0) { if (!(prefix = strstr(output_file_name, OUTPUT_SUFFIX)) && (prefix = strstr(output_file_name, ".c"))) { defines_suffix = ".h"; externs_suffix = ".i"; } } if (prefix != NULL) { len = (size_t) (prefix - output_file_name); file_prefix = TMALLOC(char, len + 1); NO_SPACE(file_prefix); strncpy(file_prefix, output_file_name, len)[len] = 0; } else len = strlen(file_prefix); /* if "-o filename" was not given */ if (output_file_name == 0) { oflag = 1; CREATE_FILE_NAME(output_file_name, OUTPUT_SUFFIX); } if (rflag) { CREATE_FILE_NAME(code_file_name, CODE_SUFFIX); } else code_file_name = output_file_name; if (dflag) { CREATE_FILE_NAME(defines_file_name, defines_suffix); } if (iflag) { CREATE_FILE_NAME(externs_file_name, externs_suffix); } if (vflag) { CREATE_FILE_NAME(verbose_file_name, VERBOSE_SUFFIX); } if (gflag) { CREATE_FILE_NAME(graph_file_name, GRAPH_SUFFIX); } if (prefix != NULL) { FREE(file_prefix); } } #if USE_MKSTEMP static void close_tmpfiles(void) { while (my_tmpfiles != 0) { MY_TMPFILES *next = my_tmpfiles->next; chmod(my_tmpfiles->name, 0644); unlink(my_tmpfiles->name); free(my_tmpfiles->name); free(my_tmpfiles); my_tmpfiles = next; } } #ifndef HAVE_MKSTEMP static int my_mkstemp(char *temp) { int fd; char *dname; char *fname; char *name; /* * Split-up to use tempnam, rather than tmpnam; the latter (like * mkstemp) is unusable on Windows. */ if ((fname = strrchr(temp, '/')) != 0) { dname = strdup(temp); dname[++fname - temp] = '\0'; } else { dname = 0; fname = temp; } if ((name = tempnam(dname, fname)) != 0) { fd = open(name, O_CREAT | O_EXCL | O_RDWR); strcpy(temp, name); } else { fd = -1; } if (dname != 0) free(dname); return fd; } #define mkstemp(s) my_mkstemp(s) #endif #endif /* * tmpfile() should be adequate, except that it may require special privileges * to use, e.g., MinGW and Windows 7 where it tries to use the root directory. */ static FILE * open_tmpfile(const char *label) { FILE *result; #if USE_MKSTEMP int fd; const char *tmpdir; char *name; const char *mark; if ((tmpdir = getenv("TMPDIR")) == 0 || access(tmpdir, W_OK) != 0) { #ifdef P_tmpdir tmpdir = P_tmpdir; #else tmpdir = "/tmp"; #endif if (access(tmpdir, W_OK) != 0) tmpdir = "."; } name = malloc(strlen(tmpdir) + 10 + strlen(label)); result = 0; if (name != 0) { if ((mark = strrchr(label, '_')) == 0) mark = label + strlen(label); sprintf(name, "%s/%.*sXXXXXX", tmpdir, (int)(mark - label), label); fd = mkstemp(name); if (fd >= 0) { result = fdopen(fd, "w+"); if (result != 0) { MY_TMPFILES *item; if (my_tmpfiles == 0) { atexit(close_tmpfiles); } item = NEW(MY_TMPFILES); NO_SPACE(item); item->name = name; NO_SPACE(item->name); item->next = my_tmpfiles; my_tmpfiles = item; } } } #else result = tmpfile(); #endif if (result == 0) open_error(label); return result; } static void open_files(void) { create_file_names(); if (input_file == 0) { input_file = fopen(input_file_name, "r"); if (input_file == 0) open_error(input_file_name); } action_file = open_tmpfile("action_file"); text_file = open_tmpfile("text_file"); if (vflag) { verbose_file = fopen(verbose_file_name, "w"); if (verbose_file == 0) open_error(verbose_file_name); } if (gflag) { graph_file = fopen(graph_file_name, "w"); if (graph_file == 0) open_error(graph_file_name); fprintf(graph_file, "digraph %s {\n", file_prefix); fprintf(graph_file, "\tedge [fontsize=10];\n"); fprintf(graph_file, "\tnode [shape=box,fontsize=10];\n"); fprintf(graph_file, "\torientation=landscape;\n"); fprintf(graph_file, "\trankdir=LR;\n"); fprintf(graph_file, "\t/*\n"); fprintf(graph_file, "\tmargin=0.2;\n"); fprintf(graph_file, "\tpage=\"8.27,11.69\"; // for A4 printing\n"); fprintf(graph_file, "\tratio=auto;\n"); fprintf(graph_file, "\t*/\n"); } if (dflag) { defines_file = fopen(defines_file_name, "w"); if (defines_file == 0) open_error(defines_file_name); union_file = open_tmpfile("union_file"); } if (iflag) { externs_file = fopen(externs_file_name, "w"); if (externs_file == 0) open_error(externs_file_name); } output_file = fopen(output_file_name, "w"); if (output_file == 0) open_error(output_file_name); if (rflag) { code_file = fopen(code_file_name, "w"); if (code_file == 0) open_error(code_file_name); } else code_file = output_file; } int main(int argc, char *argv[]) { SRexpect = -1; RRexpect = -1; exit_code = EXIT_SUCCESS; set_signals(); getargs(argc, argv); open_files(); reader(); lr0(); lalr(); make_parser(); graph(); finalize_closure(); verbose(); output(); done(exit_code); /*NOTREACHED */ } Index: stable/10/contrib/byacc/package/byacc.spec =================================================================== --- stable/10/contrib/byacc/package/byacc.spec (revision 272952) +++ stable/10/contrib/byacc/package/byacc.spec (revision 272953) @@ -1,60 +1,60 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20140422 +%define AppVersion 20140715 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.20 2014/04/22 08:13:20 tom Exp $ +# $XTermId: byacc.spec,v 1.22 2014/07/15 19:36:54 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 License: Public Domain, MIT Group: Applications/Development URL: ftp://invisible-island.net/%{AppProgram} Source0: %{AppProgram}-%{AppVersion}.tgz Packager: Thomas Dickey %description This package provides a parser generator utility that reads a grammar specification from a file and generates an LR(1) parser for it. The parsers consist of a set of LALR(1) parsing tables and a driver routine written in the C programming language. It has a public domain license which includes the generated C. %prep %setup -q -n %{AppProgram}-%{AppVersion} %build INSTALL_PROGRAM='${INSTALL}' \ ./configure \ --program-prefix=b \ --target %{_target_platform} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --libdir=%{_libdir} \ --mandir=%{_mandir} make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT ( cd $RPM_BUILD_ROOT%{_bindir} && ln -s %{AppProgram} %{UseProgram} ) strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_prefix}/bin/%{AppProgram} %{_prefix}/bin/%{UseProgram} %{_mandir}/man1/%{AppProgram}.* %changelog # each patch should add its ChangeLog entries here * Sun Jun 06 2010 Thomas Dickey - initial version Index: stable/10/contrib/byacc/package/debian/changelog =================================================================== --- stable/10/contrib/byacc/package/debian/changelog (revision 272952) +++ stable/10/contrib/byacc/package/debian/changelog (revision 272953) @@ -1,266 +1,278 @@ +byacc (20140715) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey Tue, 15 Jul 2014 15:36:54 -0400 + +byacc (20140527) unstable; urgency=low + + * remove obsolete option from usage message + + -- Thomas E. Dickey Tue, 27 May 2014 22:01:55 -0400 + byacc (20140422) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Tue, 22 Apr 2014 04:13:20 -0400 byacc (20140409) unstable; urgency=low * integrate Tom Shield's btyacc-related changes * add test-cases to fill in gaps reported by lcov -- Thomas E. Dickey Wed, 09 Apr 2014 15:53:59 -0400 byacc (20140101) unstable; urgency=low * yytname[] changes -- Thomas E. Dickey Wed, 01 Jan 2014 10:02:12 -0500 byacc (20130925) unstable; urgency=low * increase default stack-size -- Thomas E. Dickey Wed, 25 Sep 2013 18:41:54 -0400 byacc (20130304) unstable; urgency=low * changes prompted by Richard Mitton bug-report -- Thomas E. Dickey Mon, 04 Mar 2013 20:17:32 -0500 byacc (20121003) unstable; urgency=low * changes from or prompted by Adrian Bunk. -- Thomas E. Dickey Sat, 29 Sep 2012 09:14:31 -0400 byacc (20120526) unstable; urgency=low * minor code-cleanup. -- Thomas E. Dickey Sat, 26 May 2012 12:14:17 -0400 byacc (20120115) unstable; urgency=low * add testcases, improve documentation for "-s" option. -- Thomas E. Dickey Fri, 13 Jan 2012 20:44:34 -0500 byacc (20111219) unstable; urgency=low * add "-s" option. -- Thomas E. Dickey Mon, 19 Dec 2011 20:54:09 -0500 byacc (20110908) unstable; urgency=low * add "-i" option. * add error-check in reader.c -- Thomas E. Dickey Mon, 05 Sep 2011 20:05:51 -0400 byacc (20101229) unstable; urgency=low * fixes from Christos Zoulos -- Thomas E. Dickey Wed, 29 Dec 2010 13:03:50 -0500 byacc (20101226) unstable; urgency=low * portability fix for MinGW -- Thomas E. Dickey Sat, 25 Dec 2010 19:37:54 -0500 byacc (20101127) unstable; urgency=low * corrected yyerror use of %parse-param data -- Thomas E. Dickey Sat, 27 Nov 2010 12:32:00 -0500 byacc (20101126) unstable; urgency=low * additional fix to generated code to avoid symbol conflict -- Thomas E. Dickey Fri, 26 Nov 2010 04:23:08 -0500 byacc (20101124) unstable; urgency=low * amend fix for Red Hat #112617 to restore warning message. -- Thomas E. Dickey Mon, 22 Nov 2010 08:21:23 -0500 byacc (20101122) unstable; urgency=low * fix for generated header to avoid symbol conflict -- Thomas E. Dickey Mon, 22 Nov 2010 08:21:23 -0500 byacc (20100610) unstable; urgency=low * Add package scripts to upstream source, for test-builds. -- Thomas E. Dickey Thu, 10 Jun 2010 08:59:11 -0400 byacc (20100216-1) unstable; urgency=low * New upstream release * debian/source/format: Added using format "3.0 (quilt)" -- Dave Beckett Tue, 20 Apr 2010 12:56:11 -0700 byacc (20091027-1) unstable; urgency=low * New upstream release * debian/control: - Updated to policy 3.8.4 - Add ${misc:Depends} -- Dave Beckett Tue, 02 Feb 2010 21:36:34 -0800 byacc (20090221-1) unstable; urgency=low * New upstream release -- Dave Beckett Thu, 26 Feb 2009 21:06:20 -0800 byacc (20080826-1) unstable; urgency=high * New upstream release * debian/patches/02-skeleton.patch: Removed - merged upstream * debian/control: Updated to policy 3.8.0 * debian/preinst, debian/postrm: removed - empty (lintian) * debian/watch: version 3 and make FTP passive * Acknowledge NMU - thanks. -- Dave Beckett Wed, 11 Sep 2008 23:58:00 -0700 byacc (20070509-1.1) unstable; urgency=high * Non-maintainer upload. * Fix stack overflow in skeleton.c with upstream patch. Closes: #491182 aka CVE-2008-3196 -- Thomas Viehmann Sun, 24 Aug 2008 23:13:07 +0200 byacc (20070509-1) unstable; urgency=low * New upstream release * debian/watch: Fix to use passive FTP * debian/compat: added instead of use of DH_COMPAT in debian/rules -- Dave Beckett Tue, 26 Jun 2007 22:39:45 -0700 byacc (20050813-1) unstable; urgency=low * New upstream release: - Do not close union_file for -d option (Closes: #322858) -- Dave Beckett Sun, 14 Aug 2005 10:14:12 +0100 byacc (20050505-1) unstable; urgency=low * New maintainer (Closes: #321377) * Switch to new upstream and new source (Closes: #240662) * debian/copyright: Update to new upstream and add source information (Closes: #166300) * Acknowledge fix in NMUs (Closes: #283174) * New manual page does not have the formatting problem (Closes: #100947) * Added debian/watch file. -- Dave Beckett Fri, 5 Aug 2005 22:50:20 +0100 byacc (1.9.1-1.1) unstable; urgency=low * Remove alternative in prerm. Closes: #283174 -- LaMont Jones Fri, 26 Nov 2004 18:49:09 -0700 byacc (1.9.1-1) unstable; urgency=low * Maintainer upload. * Fixed alternatives entry, closes: Bug#146195; * Changed priority to "extra" at behest of Daniel Bungert, closes: Bug#142271. * Fixed awful packaging error which meant the test/ directory was excluded from the orig.tar.gz. -- Jason Henry Parker Fri, 27 Sep 2002 16:25:27 -0400 byacc (1.9-13.1) unstable; urgency=low * Non-maintainer upload * Removed erraneous escapes in manpage - some data wasn't visable, closes: Bug#100947 * Alternatives entry added, closes: Bug#113168 * Standards-version: 3.5.6 * Maintainer script cleaning -- Daniel Bungert Fri, 29 Mar 2002 16:58:30 -0500 byacc (1.9-13) unstable; urgency=low * Applied patch from "Randolph Chung" to fix build problems on ia64, closes: Bug#91966 -- Jason Henry Parker Thu, 29 Mar 2001 21:41:19 +1000 byacc (1.9-12) unstable; urgency=low * Updated to latest version of debhelper, and Standards-Version: 3.2.1.0, closes: Bug#81444 * Added Build-Depends: debhelper, closes: Bug#70207 * Removed mktemp() calls in main.c -- Jason Henry Parker Mon, 18 Dec 2000 08:02:54 +1000 byacc (1.9-11.7) unstable; urgency=low * New maintainer. * Updated to dh_make and standards version 2.4.0.0, no lintian errors or warnings. * Added several more files from the upstream distribution to /usr/doc/byacc. -- Jason Henry Parker Sat, 2 Jan 1999 03:04:17 +1000 byacc (1.9-11.6) unstable; urgency=low * Patch by to remove some superfluous files that can interfere with the build process on other architectures. (Bug #21607). -- Vincent Renardias Fri, 24 Apr 1998 19:56:58 +0200 byacc (1.9-11.5) unstable; urgency=low * Added 'binary-arch' target in debian/rules (Bug #12742). -- Vincent Renardias Sun, 9 Nov 1997 23:37:31 +0100 byacc (1.9-11.4) unstable; urgency=low * Cosmetic change (Fix bug #9623). -- Vincent Renardias Fri, 9 May 1997 16:30:24 +0200 byacc (1.9-11.3) unstable; urgency=low * Rebuilt with libc6. -- Debian QA Group Thu, 1 May 1997 22:02:04 +0200 byacc (1.9-11.2) unstable; urgency=low * Orphaned the package at his maintainer's request (dgregor@coil.com). -- Debian QA Group Sun, 20 Apr 1997 20:03:03 +0200 byacc (1.9-11.1) unstable; urgency=low * Converted to new source format (Fixes #8085). * Compressed manpage. * Fixed to allow compilation on non-i386 (Fixes #3361). * Added extended description (Fixes #3567). * Added diversion to avoid conflict with bison (Fixes #8086). -- Vincent Renardias Sun, 20 Apr 1997 15:59:28 +0200 Index: stable/10/contrib/byacc/package/mingw-byacc.spec =================================================================== --- stable/10/contrib/byacc/package/mingw-byacc.spec (revision 272952) +++ stable/10/contrib/byacc/package/mingw-byacc.spec (revision 272953) @@ -1,60 +1,60 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20140422 +%define AppVersion 20140715 %define UseProgram yacc -# $XTermId: mingw-byacc.spec,v 1.3 2014/04/22 08:13:20 tom Exp $ +# $XTermId: mingw-byacc.spec,v 1.4 2014/07/15 19:36:54 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 License: Public Domain, MIT Group: Applications/Development URL: ftp://invisible-island.net/%{AppProgram} Source0: %{AppProgram}-%{AppVersion}.tgz Packager: Thomas Dickey %description This package provides a parser generator utility that reads a grammar specification from a file and generates an LR(1) parser for it. The parsers consist of a set of LALR(1) parsing tables and a driver routine written in the C programming language. It has a public domain license which includes the generated C. %prep %setup -q -n %{AppProgram}-%{AppVersion} %build INSTALL_PROGRAM='${INSTALL}' \ ./configure \ --program-prefix=b \ --target %{_target_platform} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --libdir=%{_libdir} \ --mandir=%{_mandir} make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT ( cd $RPM_BUILD_ROOT%{_bindir} && ln -s %{AppProgram} %{UseProgram} ) strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_prefix}/bin/%{AppProgram} %{_prefix}/bin/%{UseProgram} %{_mandir}/man1/%{AppProgram}.* %changelog # each patch should add its ChangeLog entries here * Wed Sep 25 2013 Thomas Dickey - cloned from byacc.spec Index: stable/10/contrib/byacc/package/pkgsrc/Makefile =================================================================== --- stable/10/contrib/byacc/package/pkgsrc/Makefile (revision 272952) +++ stable/10/contrib/byacc/package/pkgsrc/Makefile (revision 272953) @@ -1,19 +1,19 @@ # $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $ # -DISTNAME= byacc-20140422 +DISTNAME= byacc-20140715 PKGREVISION= 1 CATEGORIES= devel MASTER_SITES= ftp://invisible-island.net/byacc/ EXTRACT_SUFX= .tgz MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://dickey.his.com/byacc/byacc.html COMMENT= Berkeley Yacc PKG_DESTDIR_SUPPORT= user-destdir GNU_CONFIGURE= YES MAKE_FILE= makefile .include "../../mk/bsd.pkg.mk" Index: stable/10/contrib/byacc/test/btyacc/big_b.output =================================================================== --- stable/10/contrib/byacc/test/btyacc/big_b.output (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/big_b.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/btyacc/big_l.output =================================================================== --- stable/10/contrib/byacc/test/btyacc/big_l.output (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/big_l.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/btyacc/err_inherit1.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_inherit1.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_inherit1.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 64 of "./test/err_inherit1.y", unterminated argument list +YACC: e - line 64 of "./err_inherit1.y", unterminated argument list namelist($c, $t ^ Index: stable/10/contrib/byacc/test/btyacc/err_inherit2.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_inherit2.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_inherit2.error (revision 272953) @@ -1,5 +1,5 @@ -YACC: w - line 64 of "./test/err_inherit2.y", number of arguments of namelist doesn't agree with previous declaration -YACC: w - line 64 of "./test/err_inherit2.y", type of argument 1 to namelist doesn't agree with previous declaration -YACC: e - line 64 of "./test/err_inherit2.y", bad formal argument list +YACC: w - line 64 of "./err_inherit2.y", number of arguments of namelist doesn't agree with previous declaration +YACC: w - line 64 of "./err_inherit2.y", type of argument 1 to namelist doesn't agree with previous declaration +YACC: e - line 64 of "./err_inherit2.y", bad formal argument list namelist($c, $t, extra): namelist NAME ^ Index: stable/10/contrib/byacc/test/btyacc/err_inherit3.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_inherit3.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_inherit3.error (revision 272953) @@ -1,23 +1,23 @@ -YACC: w - line 64 of "./test/err_inherit3.y", number of arguments of namelist doesn't agree with previous declaration -YACC: w - line 64 of "./test/err_inherit3.y", wrong number of arguments for namelist +YACC: w - line 64 of "./err_inherit3.y", number of arguments of namelist doesn't agree with previous declaration +YACC: w - line 64 of "./err_inherit3.y", wrong number of arguments for namelist namelist: namelist($c) NAME ^ -YACC: w - line 64 of "./test/err_inherit3.y", unknown argument $c -YACC: w - line 64 of "./test/err_inherit3.y", untyped argument $c -YACC: w - line 65 of "./test/err_inherit3.y", unknown argument $t +YACC: w - line 64 of "./err_inherit3.y", unknown argument $c +YACC: w - line 64 of "./err_inherit3.y", untyped argument $c +YACC: w - line 65 of "./err_inherit3.y", unknown argument $t { $$->s = mksymbol($t, $c, $2); ^ -YACC: w - line 65 of "./test/err_inherit3.y", unknown argument $c +YACC: w - line 65 of "./err_inherit3.y", unknown argument $c { $$->s = mksymbol($t, $c, $2); ^ -YACC: w - line 69 of "./test/err_inherit3.y", unknown argument $t +YACC: w - line 69 of "./err_inherit3.y", unknown argument $t { $$->s = mksymbol($t, $c, $1); ^ -YACC: w - line 69 of "./test/err_inherit3.y", untyped argument $t -YACC: w - line 69 of "./test/err_inherit3.y", unknown argument $c +YACC: w - line 69 of "./err_inherit3.y", untyped argument $t +YACC: w - line 69 of "./err_inherit3.y", unknown argument $c { $$->s = mksymbol($t, $c, $1); ^ -YACC: w - line 69 of "./test/err_inherit3.y", untyped argument $c -YACC: w - line 0 of "./test/err_inherit3.y", start symbol declaration requires arguments +YACC: w - line 69 of "./err_inherit3.y", untyped argument $c +YACC: w - line 0 of "./err_inherit3.y", start symbol declaration requires arguments YACC: 1 rule never reduced YACC: 3 shift/reduce conflicts. Index: stable/10/contrib/byacc/test/btyacc/err_inherit4.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_inherit4.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_inherit4.error (revision 272953) @@ -1,13 +1,13 @@ -YACC: w - line 32 of "./test/err_inherit4.y", destructor redeclared +YACC: w - line 32 of "./err_inherit4.y", destructor redeclared %destructor { ^ -YACC: w - line 77 of "./test/err_inherit4.y", wrong number of default arguments for namelist +YACC: w - line 77 of "./err_inherit4.y", wrong number of default arguments for namelist { $$ = $1; @$ = @2; } ^ -YACC: w - line 77 of "./test/err_inherit4.y", wrong type for default argument 2 to namelist +YACC: w - line 77 of "./err_inherit4.y", wrong type for default argument 2 to namelist { $$ = $1; @$ = @2; } ^ -YACC: w - line 77 of "./test/err_inherit4.y", wrong type for default argument 1 to namelist +YACC: w - line 77 of "./err_inherit4.y", wrong type for default argument 1 to namelist { $$ = $1; @$ = @2; } ^ -YACC: w - line 77 of "./test/err_inherit4.y", @2 references beyond the end of the current rule +YACC: w - line 77 of "./err_inherit4.y", @2 references beyond the end of the current rule Index: stable/10/contrib/byacc/test/btyacc/err_inherit5.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_inherit5.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_inherit5.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 74 of "./test/err_inherit5.y", illegal @$ or @N reference +YACC: e - line 74 of "./err_inherit5.y", illegal @$ or @N reference Index: stable/10/contrib/byacc/test/btyacc/err_syntax1.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax1.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax1.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax1.y", syntax error +YACC: e - line 1 of "./err_syntax1.y", syntax error ?% { ^ Index: stable/10/contrib/byacc/test/btyacc/err_syntax10.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax10.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax10.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: w - line 7 of "./test/err_syntax10.y", the type of '(' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '*' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '&' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '(' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '*' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '&' has been redeclared Index: stable/10/contrib/byacc/test/btyacc/err_syntax11.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax11.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax11.error (revision 272953) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax11.y", the precedence of '|' has been redeclared +YACC: w - line 7 of "./err_syntax11.y", the precedence of '|' has been redeclared Index: stable/10/contrib/byacc/test/btyacc/err_syntax12.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax12.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax12.error (revision 272953) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax12.y", the value of text has been redeclared +YACC: w - line 7 of "./err_syntax12.y", the value of text has been redeclared Index: stable/10/contrib/byacc/test/btyacc/err_syntax13.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax13.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax13.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax13.y", the start symbol text is a token +YACC: e - line 7 of "./err_syntax13.y", the start symbol text is a token Index: stable/10/contrib/byacc/test/btyacc/err_syntax14.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax14.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax14.error (revision 272953) @@ -1,2 +1,2 @@ -YACC: w - line 7 of "./test/err_syntax14.y", the start symbol has been redeclared +YACC: w - line 7 of "./err_syntax14.y", the start symbol has been redeclared YACC: e - the start symbol text2 is undefined Index: stable/10/contrib/byacc/test/btyacc/err_syntax15.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax15.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax15.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 9 of "./test/err_syntax15.y", no grammar has been specified +YACC: e - line 9 of "./err_syntax15.y", no grammar has been specified Index: stable/10/contrib/byacc/test/btyacc/err_syntax16.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax16.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax16.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 14 of "./test/err_syntax16.y", a token appears on the lhs of a production +YACC: e - line 14 of "./err_syntax16.y", a token appears on the lhs of a production Index: stable/10/contrib/byacc/test/btyacc/err_syntax17.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax17.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax17.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 8 of "./test/err_syntax17.y", unterminated action +YACC: e - line 8 of "./err_syntax17.y", unterminated action S: { error ^ Index: stable/10/contrib/byacc/test/btyacc/err_syntax18.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax18.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax18.error (revision 272953) @@ -1 +1 @@ -YACC: w - line 9 of "./test/err_syntax18.y", $4 references beyond the end of the current rule +YACC: w - line 9 of "./err_syntax18.y", $4 references beyond the end of the current rule Index: stable/10/contrib/byacc/test/btyacc/err_syntax19.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax19.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax19.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 9 of "./test/err_syntax19.y", illegal $-name +YACC: e - line 9 of "./err_syntax19.y", illegal $-name { $$ = $; } ^ Index: stable/10/contrib/byacc/test/btyacc/err_syntax2.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax2.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax2.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax2.y", unmatched /* +YACC: e - line 1 of "./err_syntax2.y", unmatched /* %{ /* ^ Index: stable/10/contrib/byacc/test/btyacc/err_syntax21.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax21.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax21.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 12 of "./test/err_syntax21.y", $0 is untyped +YACC: e - line 12 of "./err_syntax21.y", $0 is untyped Index: stable/10/contrib/byacc/test/btyacc/err_syntax22.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax22.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax22.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 17 of "./test/err_syntax22.y", $2 (recur) is untyped +YACC: e - line 17 of "./err_syntax22.y", $2 (recur) is untyped Index: stable/10/contrib/byacc/test/btyacc/err_syntax23.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax23.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax23.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 18 of "./test/err_syntax23.y", $$ is untyped +YACC: e - line 18 of "./err_syntax23.y", $$ is untyped Index: stable/10/contrib/byacc/test/btyacc/err_syntax24.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax24.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax24.error (revision 272953) @@ -1,2 +1,2 @@ -YACC: w - line 21 of "./test/err_syntax24.y", the default action assigns an undefined value to $$ -YACC: e - line 22 of "./test/err_syntax24.y", $$ is untyped +YACC: w - line 21 of "./err_syntax24.y", the default action assigns an undefined value to $$ +YACC: e - line 22 of "./err_syntax24.y", $$ is untyped Index: stable/10/contrib/byacc/test/btyacc/err_syntax25.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax25.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax25.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 11 of "./test/err_syntax25.y", too many %union declarations +YACC: e - line 11 of "./err_syntax25.y", too many %union declarations %union { ^ Index: stable/10/contrib/byacc/test/btyacc/err_syntax26.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax26.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax26.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax26.y", unexpected end-of-file +YACC: e - line 6 of "./err_syntax26.y", unexpected end-of-file Index: stable/10/contrib/byacc/test/btyacc/err_syntax27.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax27.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax27.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 3 of "./test/err_syntax27.y", missing '}' +YACC: e - line 3 of "./err_syntax27.y", missing '}' Index: stable/10/contrib/byacc/test/btyacc/err_syntax3.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax3.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax3.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax3.y", unterminated string +YACC: e - line 6 of "./err_syntax3.y", unterminated string %token '(' '*' '& ^ Index: stable/10/contrib/byacc/test/btyacc/err_syntax4.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax4.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax4.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax4.y", unmatched %{ +YACC: e - line 1 of "./err_syntax4.y", unmatched %{ %{ ^ Index: stable/10/contrib/byacc/test/btyacc/err_syntax5.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax5.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax5.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax5.y", unterminated %union declaration +YACC: e - line 6 of "./err_syntax5.y", unterminated %union declaration %union { ^ Index: stable/10/contrib/byacc/test/btyacc/err_syntax6.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax6.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax6.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax6.y", illegal tag +YACC: e - line 6 of "./err_syntax6.y", illegal tag %token '\777' ^ Index: stable/10/contrib/byacc/test/btyacc/err_syntax7a.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax7a.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax7a.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7a.y", illegal character +YACC: e - line 6 of "./err_syntax7a.y", illegal character %token '\xfff' ^ Index: stable/10/contrib/byacc/test/btyacc/err_syntax7b.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax7b.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax7b.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7b.y", illegal character +YACC: e - line 6 of "./err_syntax7b.y", illegal character %token '\x.' ^ Index: stable/10/contrib/byacc/test/btyacc/err_syntax8.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax8.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax8.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8.y", illegal use of reserved symbol . +YACC: e - line 6 of "./err_syntax8.y", illegal use of reserved symbol . Index: stable/10/contrib/byacc/test/btyacc/err_syntax8a.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax8a.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax8a.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8a.y", illegal use of reserved symbol $$123 +YACC: e - line 6 of "./err_syntax8a.y", illegal use of reserved symbol $$123 Index: stable/10/contrib/byacc/test/btyacc/err_syntax9.error =================================================================== --- stable/10/contrib/byacc/test/btyacc/err_syntax9.error (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/err_syntax9.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax9.y", the start symbol text cannot be declared to be a token +YACC: e - line 7 of "./err_syntax9.y", the start symbol text cannot be declared to be a token Index: stable/10/contrib/byacc/test/btyacc/help.output =================================================================== --- stable/10/contrib/byacc/test/btyacc/help.output (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/help.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/btyacc/no_b_opt.output =================================================================== --- stable/10/contrib/byacc/test/btyacc/no_b_opt.output (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/no_b_opt.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/btyacc/no_output2.output =================================================================== --- stable/10/contrib/byacc/test/btyacc/no_output2.output (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/no_output2.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/btyacc/no_p_opt.output =================================================================== --- stable/10/contrib/byacc/test/btyacc/no_p_opt.output (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/no_p_opt.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/btyacc/nostdin.output =================================================================== --- stable/10/contrib/byacc/test/btyacc/nostdin.output (revision 272952) +++ stable/10/contrib/byacc/test/btyacc/nostdin.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/run_test.sh =================================================================== --- stable/10/contrib/byacc/test/run_test.sh (revision 272952) +++ stable/10/contrib/byacc/test/run_test.sh (revision 272953) @@ -1,238 +1,246 @@ #!/bin/sh -# $Id: run_test.sh,v 1.22 2014/04/09 11:00:45 tom Exp $ +# $Id: run_test.sh,v 1.24 2014/07/15 19:21:10 tom Exp $ # vi:ts=4 sw=4: +errors=0 + # NEW is the file created by the testcase # REF is the reference file against which to compare test_diffs() { # echo "...test_diffs $NEW vs $REF" mv -f $NEW ${REF_DIR}/ CMP=${REF_DIR}/${NEW} if test ! -f $CMP then echo "...not found $CMP" + errors=1 else sed -e s,$NEW,$REF, \ - -e "s%$YACC%YACC%" \ + -e "s%$YACC_escaped%YACC%" \ -e '/YYPATCH/s/[0-9][0-9]*/"yyyymmdd"/' \ -e '/#define YYPATCH/s/PATCH/CHECK/' \ -e 's,#line \([1-9][0-9]*\) "'$REF_DIR'/,#line \1 ",' \ -e 's,#line \([1-9][0-9]*\) "'$TEST_DIR'/,#line \1 ",' \ + -e 's,\(YACC:.* line [0-9][0-9]* of "\)'$TEST_DIR/',\1./,' \ < $CMP >$tmpfile \ && mv $tmpfile $CMP if test ! -f $REF then mv $CMP $REF echo "...saved $REF" elif ( cmp -s $REF $CMP ) then echo "...ok $REF" rm -f $CMP else echo "...diff $REF" diff -u $REF $CMP + errors=1 fi fi } test_flags() { echo "** testing flags $*" root=$1 ROOT=test-$root shift 1 $YACC $* >$ROOT.output \ 2>&1 >$ROOT.error for type in .output .error do NEW=$ROOT$type REF=$REF_DIR/$root$type test_diffs done } if test $# = 1 then PROG_DIR=`pwd` TEST_DIR=$1 PROG_DIR=`echo "$PROG_DIR" | sed -e 's/ /\\\\ /g'` TEST_DIR=`echo "$TEST_DIR" | sed -e 's/ /\\\\ /g'` else PROG_DIR=.. TEST_DIR=. fi YACC=$PROG_DIR/yacc +YACC_escaped=`echo "$PROG_DIR/yacc" | sed -e 's/\./\\\./g'` tmpfile=temp$$ -ifBTYACC=`fgrep -l 'define YYBTYACC' config.h > /dev/null; test $? != 0; echo $?` +ifBTYACC=`fgrep -l 'define YYBTYACC' $PROG_DIR/config.h > /dev/null; test $? != 0; echo $?` if test $ifBTYACC = 0; then REF_DIR=${TEST_DIR}/yacc else REF_DIR=${TEST_DIR}/btyacc fi rm -f ${REF_DIR}/test-* echo '** '`date` # Tests which do not need files MYFILE=nosuchfile test_flags help -z test_flags big_b -B test_flags big_l -L # Test attempts to read non-existent file rm -f $MYFILE.* test_flags nostdin - $MYFILE.y test_flags no_opts -- $MYFILE.y # Test attempts to write to readonly file touch $MYFILE.y touch $MYFILE.c chmod 444 $MYFILE.* test_flags no_b_opt -b test_flags no_b_opt1 -bBASE -o $MYFILE.c $MYFILE.y touch $MYFILE.c chmod 444 $MYFILE.* test_flags no_p_opt -p test_flags no_p_opt1 -pBASE -o $MYFILE.c $MYFILE.y rm -f BASE$MYFILE.c touch $MYFILE.dot chmod 444 $MYFILE.* test_flags no_graph -g -o $MYFILE.c $MYFILE.y rm -f $MYFILE.dot touch $MYFILE.output chmod 444 $MYFILE.* test_flags no_verbose -v -o $MYFILE.c $MYFILE.y test_flags no_output -o $MYFILE.output $MYFILE.y test_flags no_output1 -o$MYFILE.output $MYFILE.y test_flags no_output2 -o rm -f $MYFILE.output touch $MYFILE.h chmod 444 $MYFILE.* test_flags no_defines -d -o $MYFILE.c $MYFILE.y rm -f $MYFILE.h touch $MYFILE.i chmod 444 $MYFILE.* test_flags no_include -i -o $MYFILE.c $MYFILE.y rm -f $MYFILE.i touch $MYFILE.code.c chmod 444 $MYFILE.* test_flags no_code_c -r -o $MYFILE.c $MYFILE.y rm -f $MYFILE.code.c rm -f $MYFILE.* for input in ${TEST_DIR}/*.y do case $input in test-*) echo "?? ignored $input" ;; *) root=`basename $input .y` ROOT="test-$root" prefix=${root}_ OPTS= OPT2= OOPT= TYPE=".error .output .tab.c .tab.h" case $input in ${TEST_DIR}/btyacc_*) if test $ifBTYACC = 0; then continue; fi OPTS="$OPTS -B" prefix=`echo "$prefix" | sed -e 's/^btyacc_//'` ;; ${TEST_DIR}/grammar*) OPTS="$OPTS -g" TYPE="$TYPE .dot" ;; ${TEST_DIR}/code_debug*) OPTS="$OPTS -t -i" OOPT=rename_debug.c TYPE="$TYPE .i" prefix= ;; ${TEST_DIR}/code_*) OPTS="$OPTS -r" TYPE="$TYPE .code.c" prefix=`echo "$prefix" | sed -e 's/^code_//'` ;; ${TEST_DIR}/pure_*) OPTS="$OPTS -P" prefix=`echo "$prefix" | sed -e 's/^pure_//'` ;; ${TEST_DIR}/quote_*) OPT2="-s" ;; ${TEST_DIR}/inherit*|\ ${TEST_DIR}/err_inherit*) if test $ifBTYACC = 0; then continue; fi ;; esac echo "** testing $input" test -n "$prefix" && prefix="-p $prefix" for opt2 in "" $OPT2 do output=$OOPT if test -n "$output" then output="-o $output" error=`basename $OOPT .c`.error else error=${ROOT}${opt2}.error fi $YACC $OPTS $opt2 -v -d $output $prefix -b $ROOT${opt2} $input 2>$error for type in $TYPE do REF=${REF_DIR}/${root}${opt2}${type} # handle renaming due to "-o" option if test -n "$OOPT" then case $type in *.tab.c) type=.c ;; *.tab.h) type=.h ;; *) ;; esac NEW=`basename $OOPT .c`${type} case $NEW in test-*) ;; *) if test -f "$NEW" then REF=${REF_DIR}/$NEW mv $NEW test-$NEW NEW=test-$NEW fi ;; esac else NEW=${ROOT}${opt2}${type} fi test_diffs done done ;; esac done + +exit $errors Index: stable/10/contrib/byacc/test/yacc/big_b.output =================================================================== --- stable/10/contrib/byacc/test/yacc/big_b.output (revision 272952) +++ stable/10/contrib/byacc/test/yacc/big_b.output (revision 272953) @@ -1,20 +1,19 @@ YACC: w - -B flag unsupported, reconfigure with --enable-btyacc Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/yacc/big_l.output =================================================================== --- stable/10/contrib/byacc/test/yacc/big_l.output (revision 272952) +++ stable/10/contrib/byacc/test/yacc/big_l.output (revision 272953) @@ -1,20 +1,19 @@ YACC: w - -B flag unsupported, reconfigure with --enable-btyacc Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/yacc/err_syntax1.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax1.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax1.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax1.y", syntax error +YACC: e - line 1 of "./err_syntax1.y", syntax error ?% { ^ Index: stable/10/contrib/byacc/test/yacc/err_syntax10.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax10.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax10.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: w - line 7 of "./test/err_syntax10.y", the type of '(' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '*' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '&' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '(' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '*' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '&' has been redeclared Index: stable/10/contrib/byacc/test/yacc/err_syntax11.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax11.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax11.error (revision 272953) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax11.y", the precedence of '|' has been redeclared +YACC: w - line 7 of "./err_syntax11.y", the precedence of '|' has been redeclared Index: stable/10/contrib/byacc/test/yacc/err_syntax12.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax12.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax12.error (revision 272953) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax12.y", the value of text has been redeclared +YACC: w - line 7 of "./err_syntax12.y", the value of text has been redeclared Index: stable/10/contrib/byacc/test/yacc/err_syntax13.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax13.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax13.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax13.y", the start symbol text is a token +YACC: e - line 7 of "./err_syntax13.y", the start symbol text is a token Index: stable/10/contrib/byacc/test/yacc/err_syntax14.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax14.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax14.error (revision 272953) @@ -1,2 +1,2 @@ -YACC: w - line 7 of "./test/err_syntax14.y", the start symbol has been redeclared +YACC: w - line 7 of "./err_syntax14.y", the start symbol has been redeclared YACC: e - the start symbol text2 is undefined Index: stable/10/contrib/byacc/test/yacc/err_syntax15.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax15.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax15.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 9 of "./test/err_syntax15.y", no grammar has been specified +YACC: e - line 9 of "./err_syntax15.y", no grammar has been specified Index: stable/10/contrib/byacc/test/yacc/err_syntax16.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax16.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax16.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 14 of "./test/err_syntax16.y", a token appears on the lhs of a production +YACC: e - line 14 of "./err_syntax16.y", a token appears on the lhs of a production Index: stable/10/contrib/byacc/test/yacc/err_syntax17.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax17.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax17.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 8 of "./test/err_syntax17.y", unterminated action +YACC: e - line 8 of "./err_syntax17.y", unterminated action S: { error ^ Index: stable/10/contrib/byacc/test/yacc/err_syntax18.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax18.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax18.error (revision 272953) @@ -1 +1 @@ -YACC: w - line 9 of "./test/err_syntax18.y", $4 references beyond the end of the current rule +YACC: w - line 9 of "./err_syntax18.y", $4 references beyond the end of the current rule Index: stable/10/contrib/byacc/test/yacc/err_syntax19.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax19.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax19.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 9 of "./test/err_syntax19.y", illegal $-name +YACC: e - line 9 of "./err_syntax19.y", illegal $-name { $$ = $; } ^ Index: stable/10/contrib/byacc/test/yacc/err_syntax2.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax2.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax2.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax2.y", unmatched /* +YACC: e - line 1 of "./err_syntax2.y", unmatched /* %{ /* ^ Index: stable/10/contrib/byacc/test/yacc/err_syntax21.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax21.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax21.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 12 of "./test/err_syntax21.y", $0 is untyped +YACC: e - line 12 of "./err_syntax21.y", $0 is untyped Index: stable/10/contrib/byacc/test/yacc/err_syntax22.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax22.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax22.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 17 of "./test/err_syntax22.y", $2 (recur) is untyped +YACC: e - line 17 of "./err_syntax22.y", $2 (recur) is untyped Index: stable/10/contrib/byacc/test/yacc/err_syntax23.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax23.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax23.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 18 of "./test/err_syntax23.y", $$ is untyped +YACC: e - line 18 of "./err_syntax23.y", $$ is untyped Index: stable/10/contrib/byacc/test/yacc/err_syntax24.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax24.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax24.error (revision 272953) @@ -1,2 +1,2 @@ -YACC: w - line 21 of "./test/err_syntax24.y", the default action assigns an undefined value to $$ -YACC: e - line 22 of "./test/err_syntax24.y", $$ is untyped +YACC: w - line 21 of "./err_syntax24.y", the default action assigns an undefined value to $$ +YACC: e - line 22 of "./err_syntax24.y", $$ is untyped Index: stable/10/contrib/byacc/test/yacc/err_syntax25.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax25.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax25.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 11 of "./test/err_syntax25.y", too many %union declarations +YACC: e - line 11 of "./err_syntax25.y", too many %union declarations %union { ^ Index: stable/10/contrib/byacc/test/yacc/err_syntax26.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax26.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax26.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax26.y", unexpected end-of-file +YACC: e - line 6 of "./err_syntax26.y", unexpected end-of-file Index: stable/10/contrib/byacc/test/yacc/err_syntax27.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax27.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax27.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 3 of "./test/err_syntax27.y", missing '}' +YACC: e - line 3 of "./err_syntax27.y", missing '}' Index: stable/10/contrib/byacc/test/yacc/err_syntax3.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax3.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax3.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax3.y", unterminated string +YACC: e - line 6 of "./err_syntax3.y", unterminated string %token '(' '*' '& ^ Index: stable/10/contrib/byacc/test/yacc/err_syntax4.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax4.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax4.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax4.y", unmatched %{ +YACC: e - line 1 of "./err_syntax4.y", unmatched %{ %{ ^ Index: stable/10/contrib/byacc/test/yacc/err_syntax5.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax5.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax5.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax5.y", unterminated %union declaration +YACC: e - line 6 of "./err_syntax5.y", unterminated %union declaration %union { ^ Index: stable/10/contrib/byacc/test/yacc/err_syntax6.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax6.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax6.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax6.y", illegal tag +YACC: e - line 6 of "./err_syntax6.y", illegal tag %token '\777' ^ Index: stable/10/contrib/byacc/test/yacc/err_syntax7a.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax7a.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax7a.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7a.y", illegal character +YACC: e - line 6 of "./err_syntax7a.y", illegal character %token '\xfff' ^ Index: stable/10/contrib/byacc/test/yacc/err_syntax7b.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax7b.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax7b.error (revision 272953) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7b.y", illegal character +YACC: e - line 6 of "./err_syntax7b.y", illegal character %token '\x.' ^ Index: stable/10/contrib/byacc/test/yacc/err_syntax8.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax8.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax8.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8.y", illegal use of reserved symbol . +YACC: e - line 6 of "./err_syntax8.y", illegal use of reserved symbol . Index: stable/10/contrib/byacc/test/yacc/err_syntax8a.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax8a.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax8a.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8a.y", illegal use of reserved symbol $$123 +YACC: e - line 6 of "./err_syntax8a.y", illegal use of reserved symbol $$123 Index: stable/10/contrib/byacc/test/yacc/err_syntax9.error =================================================================== --- stable/10/contrib/byacc/test/yacc/err_syntax9.error (revision 272952) +++ stable/10/contrib/byacc/test/yacc/err_syntax9.error (revision 272953) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax9.y", the start symbol text cannot be declared to be a token +YACC: e - line 7 of "./err_syntax9.y", the start symbol text cannot be declared to be a token Index: stable/10/contrib/byacc/test/yacc/help.output =================================================================== --- stable/10/contrib/byacc/test/yacc/help.output (revision 272952) +++ stable/10/contrib/byacc/test/yacc/help.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/yacc/no_b_opt.output =================================================================== --- stable/10/contrib/byacc/test/yacc/no_b_opt.output (revision 272952) +++ stable/10/contrib/byacc/test/yacc/no_b_opt.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/yacc/no_output2.output =================================================================== --- stable/10/contrib/byacc/test/yacc/no_output2.output (revision 272952) +++ stable/10/contrib/byacc/test/yacc/no_output2.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/yacc/no_p_opt.output =================================================================== --- stable/10/contrib/byacc/test/yacc/no_p_opt.output (revision 272952) +++ stable/10/contrib/byacc/test/yacc/no_p_opt.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/contrib/byacc/test/yacc/nostdin.output =================================================================== --- stable/10/contrib/byacc/test/yacc/nostdin.output (revision 272952) +++ stable/10/contrib/byacc/test/yacc/nostdin.output (revision 272953) @@ -1,19 +1,18 @@ Usage: YACC [options] filename Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives -L enable position processing, e.g., "%locations" -o output_file (default ".tab.c") -p symbol_prefix set symbol prefix (default "yy") -P create a reentrant parser, e.g., "%pure-parser" -r produce separate code and table files (y.code.c) -s suppress #define's for quoted names in %token lines -t add debugging support -v write description (y.output) -V show version information and exit Index: stable/10/usr.bin/yacc/tests/calc.y =================================================================== --- stable/10/usr.bin/yacc/tests/calc.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/calc.y (nonexistent) @@ -1,106 +0,0 @@ -%{ -# include -# include - -int regs[26]; -int base; - -extern int yylex(void); -static void yyerror(const char *s); - -%} - -%start list - -%token DIGIT LETTER - -%left '|' -%left '&' -%left '+' '-' -%left '*' '/' '%' -%left UMINUS /* supplies precedence for unary minus */ - -%% /* beginning of rules section */ - -list : /* empty */ - | list stat '\n' - | list error '\n' - { yyerrok ; } - ; - -stat : expr - { printf("%d\n",$1);} - | LETTER '=' expr - { regs[$1] = $3; } - ; - -expr : '(' expr ')' - { $$ = $2; } - | expr '+' expr - { $$ = $1 + $3; } - | expr '-' expr - { $$ = $1 - $3; } - | expr '*' expr - { $$ = $1 * $3; } - | expr '/' expr - { $$ = $1 / $3; } - | expr '%' expr - { $$ = $1 % $3; } - | expr '&' expr - { $$ = $1 & $3; } - | expr '|' expr - { $$ = $1 | $3; } - | '-' expr %prec UMINUS - { $$ = - $2; } - | LETTER - { $$ = regs[$1]; } - | number - ; - -number: DIGIT - { $$ = $1; base = ($1==0) ? 8 : 10; } - | number DIGIT - { $$ = base * $1 + $2; } - ; - -%% /* start of programs */ - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) -{ - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} Property changes on: stable/10/usr.bin/yacc/tests/calc.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/quote_calc.y =================================================================== --- stable/10/usr.bin/yacc/tests/quote_calc.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/quote_calc.y (nonexistent) @@ -1,112 +0,0 @@ -%{ -# include -# include - -int regs[26]; -int base; - -int yylex(void); -static void yyerror(const char *s); - -%} - -%start list - -%token OP_ADD "ADD" -%token OP_SUB "SUB" -%token OP_MUL "MUL" -%token OP_DIV "DIV" -%token OP_MOD "MOD" -%token OP_AND "AND" - -%token DIGIT LETTER - -%left '|' -%left '&' -%left '+' '-' -%left '*' '/' '%' -%left UMINUS /* supplies precedence for unary minus */ - -%% /* beginning of rules section */ - -list : /* empty */ - | list stat '\n' - | list error '\n' - { yyerrok ; } - ; - -stat : expr - { printf("%d\n",$1);} - | LETTER '=' expr - { regs[$1] = $3; } - ; - -expr : '(' expr ')' - { $$ = $2; } - | expr OP_ADD expr - { $$ = $1 + $3; } - | expr OP_SUB expr - { $$ = $1 - $3; } - | expr OP_MUL expr - { $$ = $1 * $3; } - | expr OP_DIV expr - { $$ = $1 / $3; } - | expr OP_MOD expr - { $$ = $1 % $3; } - | expr OP_AND expr - { $$ = $1 & $3; } - | expr '|' expr - { $$ = $1 | $3; } - | OP_SUB expr %prec UMINUS - { $$ = - $2; } - | LETTER - { $$ = regs[$1]; } - | number - ; - -number: DIGIT - { $$ = $1; base = ($1==0) ? 8 : 10; } - | number DIGIT - { $$ = base * $1 + $2; } - ; - -%% /* start of programs */ - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) { - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} Property changes on: stable/10/usr.bin/yacc/tests/quote_calc.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/pure_calc.y =================================================================== --- stable/10/usr.bin/yacc/tests/pure_calc.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/pure_calc.y (nonexistent) @@ -1,116 +0,0 @@ -%{ -# include -# include - -int regs[26]; -int base; - -#ifdef YYBISON -#define YYSTYPE int -#define YYLEX_PARAM &yylval -#define YYLEX_DECL() yylex(YYSTYPE *yylval) -#define YYERROR_DECL() yyerror(const char *s) -int YYLEX_DECL(); -static void YYERROR_DECL(); -#endif - -%} - -%start list - -%token DIGIT LETTER - -%left '|' -%left '&' -%left '+' '-' -%left '*' '/' '%' -%left UMINUS /* supplies precedence for unary minus */ - -%% /* beginning of rules section */ - -list : /* empty */ - | list stat '\n' - | list error '\n' - { yyerrok ; } - ; - -stat : expr - { printf("%d\n",$1);} - | LETTER '=' expr - { regs[$1] = $3; } - ; - -expr : '(' expr ')' - { $$ = $2; } - | expr '+' expr - { $$ = $1 + $3; } - | expr '-' expr - { $$ = $1 - $3; } - | expr '*' expr - { $$ = $1 * $3; } - | expr '/' expr - { $$ = $1 / $3; } - | expr '%' expr - { $$ = $1 % $3; } - | expr '&' expr - { $$ = $1 & $3; } - | expr '|' expr - { $$ = $1 | $3; } - | '-' expr %prec UMINUS - { $$ = - $2; } - | LETTER - { $$ = regs[$1]; } - | number - ; - -number: DIGIT - { $$ = $1; base = ($1==0) ? 8 : 10; } - | number DIGIT - { $$ = base * $1 + $2; } - ; - -%% /* start of programs */ - -#ifdef YYBYACC -static int YYLEX_DECL(); -#endif - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -YYERROR_DECL() -{ - fprintf(stderr, "%s\n", s); -} - -int -YYLEX_DECL() -{ - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - *yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - *yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} Property changes on: stable/10/usr.bin/yacc/tests/pure_calc.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/pure_error.y =================================================================== --- stable/10/usr.bin/yacc/tests/pure_error.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/pure_error.y (nonexistent) @@ -1,41 +0,0 @@ -%{ - -#ifdef YYBISON -#define YYSTYPE int -#define YYLEX_PARAM &yylval -#define YYLEX_DECL() yylex(YYSTYPE *yylval) -#define YYERROR_DECL() yyerror(const char *s) -int YYLEX_DECL(); -static void YYERROR_DECL(); -#endif - -%} - -%% -S: error -%% - -#include - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -int -main(void) -{ - printf("yyparse() = %d\n", yyparse()); - return 0; -} - -int -yylex(YYSTYPE *value) -{ - return value ? 0 : -1; -} - -static void -yyerror(const char* s) -{ - printf("%s\n", s); -} Property changes on: stable/10/usr.bin/yacc/tests/pure_error.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/legacy_test.sh =================================================================== --- stable/10/usr.bin/yacc/tests/legacy_test.sh (revision 272952) +++ stable/10/usr.bin/yacc/tests/legacy_test.sh (nonexistent) @@ -1,6 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -SRCDIR="$(dirname "${0}")"; export SRCDIR - -m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh Property changes on: stable/10/usr.bin/yacc/tests/legacy_test.sh ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/undefined.y =================================================================== --- stable/10/usr.bin/yacc/tests/undefined.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/undefined.y (nonexistent) @@ -1,5 +0,0 @@ -%type rule -%% -rule: - ; -%% Property changes on: stable/10/usr.bin/yacc/tests/undefined.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/calc1.y =================================================================== --- stable/10/usr.bin/yacc/tests/calc1.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/calc1.y (nonexistent) @@ -1,305 +0,0 @@ -%{ - -/* http://dinosaur.compilertools.net/yacc/index.html */ - -#include -#include -#include -#include - -typedef struct interval -{ - double lo, hi; -} -INTERVAL; - -INTERVAL vmul(double, double, INTERVAL); -INTERVAL vdiv(double, double, INTERVAL); - -extern int yylex(void); -static void yyerror(const char *s); - -int dcheck(INTERVAL); - -double dreg[26]; -INTERVAL vreg[26]; - -%} -%expect 18 - -%start line -%union -{ - int ival; - double dval; - INTERVAL vval; -} - -%token DREG VREG /* indices into dreg, vreg arrays */ -%token CONST /* floating point constant */ - -%type dexp /* expression */ -%type vexp /* interval expression */ - - /* precedence information about the operators */ - -%left '+' '-' -%left '*' '/' -%left UMINUS /* precedence for unary minus */ - -%% /* beginning of rules section */ - -lines : /* empty */ - | lines line - ; - -line : dexp '\n' - { - (void) printf("%15.8f\n", $1); - } - | vexp '\n' - { - (void) printf("(%15.8f, %15.8f)\n", $1.lo, $1.hi); - } - | DREG '=' dexp '\n' - { - dreg[$1] = $3; - } - | VREG '=' vexp '\n' - { - vreg[$1] = $3; - } - | error '\n' - { - yyerrok; - } - ; - -dexp : CONST - | DREG - { - $$ = dreg[$1]; - } - | dexp '+' dexp - { - $$ = $1 + $3; - } - | dexp '-' dexp - { - $$ = $1 - $3; - } - | dexp '*' dexp - { - $$ = $1 * $3; - } - | dexp '/' dexp - { - $$ = $1 / $3; - } - | '-' dexp %prec UMINUS - { - $$ = -$2; - } - | '(' dexp ')' - { - $$ = $2; - } - ; - -vexp : dexp - { - $$.hi = $$.lo = $1; - } - | '(' dexp ',' dexp ')' - { - $$.lo = $2; - $$.hi = $4; - if ( $$.lo > $$.hi ) - { - (void) printf("interval out of order\n"); - YYERROR; - } - } - | VREG - { - $$ = vreg[$1]; - } - | vexp '+' vexp - { - $$.hi = $1.hi + $3.hi; - $$.lo = $1.lo + $3.lo; - } - | dexp '+' vexp - { - $$.hi = $1 + $3.hi; - $$.lo = $1 + $3.lo; - } - | vexp '-' vexp - { - $$.hi = $1.hi - $3.lo; - $$.lo = $1.lo - $3.hi; - } - | dexp '-' vexp - { - $$.hi = $1 - $3.lo; - $$.lo = $1 - $3.hi; - } - | vexp '*' vexp - { - $$ = vmul( $1.lo, $1.hi, $3 ); - } - | dexp '*' vexp - { - $$ = vmul ($1, $1, $3 ); - } - | vexp '/' vexp - { - if (dcheck($3)) YYERROR; - $$ = vdiv ( $1.lo, $1.hi, $3 ); - } - | dexp '/' vexp - { - if (dcheck ( $3 )) YYERROR; - $$ = vdiv ($1, $1, $3 ); - } - | '-' vexp %prec UMINUS - { - $$.hi = -$2.lo; - $$.lo = -$2.hi; - } - | '(' vexp ')' - { - $$ = $2; - } - ; - -%% /* beginning of subroutines section */ - -#define BSZ 50 /* buffer size for floating point numbers */ - - /* lexical analysis */ - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) -{ - int c; - - while ((c = getchar()) == ' ') - { /* skip over blanks */ - } - - if (isupper(c)) - { - yylval.ival = c - 'A'; - return (VREG); - } - if (islower(c)) - { - yylval.ival = c - 'a'; - return (DREG); - } - - if (isdigit(c) || c == '.') - { - /* gobble up digits, points, exponents */ - char buf[BSZ + 1], *cp = buf; - int dot = 0, expr = 0; - - for (; (cp - buf) < BSZ; ++cp, c = getchar()) - { - - *cp = c; - if (isdigit(c)) - continue; - if (c == '.') - { - if (dot++ || expr) - return ('.'); /* will cause syntax error */ - continue; - } - - if (c == 'e') - { - if (expr++) - return ('e'); /* will cause syntax error */ - continue; - } - - /* end of number */ - break; - } - *cp = '\0'; - - if ((cp - buf) >= BSZ) - printf("constant too long: truncated\n"); - else - ungetc(c, stdin); /* push back last char read */ - yylval.dval = atof(buf); - return (CONST); - } - return (c); -} - -static INTERVAL -hilo(double a, double b, double c, double d) -{ - /* returns the smallest interval containing a, b, c, and d */ - /* used by *, / routines */ - INTERVAL v; - - if (a > b) - { - v.hi = a; - v.lo = b; - } - else - { - v.hi = b; - v.lo = a; - } - - if (c > d) - { - if (c > v.hi) - v.hi = c; - if (d < v.lo) - v.lo = d; - } - else - { - if (d > v.hi) - v.hi = d; - if (c < v.lo) - v.lo = c; - } - return (v); -} - -INTERVAL -vmul(double a, double b, INTERVAL v) -{ - return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo)); -} - -int -dcheck(INTERVAL v) -{ - if (v.hi >= 0. && v.lo <= 0.) - { - printf("divisor interval contains 0.\n"); - return (1); - } - return (0); -} - -INTERVAL -vdiv(double a, double b, INTERVAL v) -{ - return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); -} Property changes on: stable/10/usr.bin/yacc/tests/calc1.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/calc2.y =================================================================== --- stable/10/usr.bin/yacc/tests/calc2.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/calc2.y (nonexistent) @@ -1,120 +0,0 @@ -%parse-param { int regs[26] } -%parse-param { int *base } - -%lex-param { int *base } - -%{ -# include -# include - -#ifdef YYBISON -#define YYLEX_PARAM base -#define YYLEX_DECL() yylex(int *YYLEX_PARAM) -#define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s) -int YYLEX_DECL(); -static void YYERROR_DECL(); -#endif - -%} - -%start list - -%token DIGIT LETTER - -%left '|' -%left '&' -%left '+' '-' -%left '*' '/' '%' -%left UMINUS /* supplies precedence for unary minus */ - -%% /* beginning of rules section */ - -list : /* empty */ - | list stat '\n' - | list error '\n' - { yyerrok ; } - ; - -stat : expr - { printf("%d\n",$1);} - | LETTER '=' expr - { regs[$1] = $3; } - ; - -expr : '(' expr ')' - { $$ = $2; } - | expr '+' expr - { $$ = $1 + $3; } - | expr '-' expr - { $$ = $1 - $3; } - | expr '*' expr - { $$ = $1 * $3; } - | expr '/' expr - { $$ = $1 / $3; } - | expr '%' expr - { $$ = $1 % $3; } - | expr '&' expr - { $$ = $1 & $3; } - | expr '|' expr - { $$ = $1 | $3; } - | '-' expr %prec UMINUS - { $$ = - $2; } - | LETTER - { $$ = regs[$1]; } - | number - ; - -number: DIGIT - { $$ = $1; (*base) = ($1==0) ? 8 : 10; } - | number DIGIT - { $$ = (*base) * $1 + $2; } - ; - -%% /* start of programs */ - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -int -main (void) -{ - int regs[26]; - int base = 10; - - while(!feof(stdin)) { - yyparse(regs, &base); - } - return 0; -} - -static void -YYERROR_DECL() -{ - fprintf(stderr, "%s\n", s); -} - -int -YYLEX_DECL() -{ - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = (c - '0') % (*base); - return ( DIGIT ); - } - return( c ); -} Property changes on: stable/10/usr.bin/yacc/tests/calc2.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.09.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.09.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.09.out (nonexistent) @@ -1,599 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 2 "pure_calc.y" -# include -# include - -int regs[26]; -int base; - -#ifdef YYBISON -#define YYSTYPE int -#define YYLEX_PARAM &yylval -#define YYLEX_DECL() yylex(YYSTYPE *yylval) -#define YYERROR_DECL() yyerror(const char *s) -int YYLEX_DECL(); -static void YYERROR_DECL(); -#endif - -#line 35 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define DIGIT 257 -#define LETTER 258 -#define UMINUS 259 -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 3, 3, -}; -static const short yylen[] = { 2, - 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 1, 1, 1, 2, -}; -static const short yydefred[] = { 1, - 0, 0, 17, 0, 0, 0, 0, 0, 0, 3, - 0, 15, 14, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, - 10, 11, -}; -static const short yydgoto[] = { 1, - 7, 8, 9, -}; -static const short yysindex[] = { 0, - -40, -7, 0, -55, -38, -38, 1, -29, -247, 0, - -38, 0, 0, 22, 0, -38, -38, -38, -38, -38, - -38, -38, 0, -29, 0, 51, 60, -20, -20, 0, - 0, 0, -}; -static const short yyrindex[] = { 0, - 0, 0, 0, 2, 0, 0, 0, 9, -9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 10, 0, -6, 14, 5, 13, 0, - 0, 0, -}; -static const short yygindex[] = { 0, - 0, 65, 0, -}; -#define YYTABLESIZE 220 -static const short yytable[] = { 6, - 16, 6, 10, 13, 5, 11, 5, 22, 17, 23, - 15, 15, 20, 18, 7, 19, 22, 21, 4, 5, - 0, 20, 8, 12, 0, 0, 21, 16, 16, 0, - 0, 16, 16, 16, 13, 16, 0, 16, 15, 15, - 0, 0, 7, 15, 15, 7, 15, 7, 15, 7, - 8, 12, 0, 8, 12, 8, 0, 8, 22, 17, - 0, 0, 25, 20, 18, 0, 19, 0, 21, 13, - 14, 0, 0, 0, 0, 24, 0, 0, 0, 0, - 26, 27, 28, 29, 30, 31, 32, 22, 17, 0, - 0, 0, 20, 18, 16, 19, 22, 21, 0, 0, - 0, 20, 18, 0, 19, 0, 21, 0, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 13, 0, 0, - 0, 0, 0, 0, 0, 15, 0, 0, 7, 0, - 0, 0, 0, 0, 0, 0, 8, 12, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 2, 3, 4, 3, 12, -}; -static const short yycheck[] = { 40, - 10, 40, 10, 10, 45, 61, 45, 37, 38, 257, - 10, 10, 42, 43, 10, 45, 37, 47, 10, 10, - -1, 42, 10, 10, -1, -1, 47, 37, 38, -1, - -1, 41, 42, 43, 41, 45, -1, 47, 37, 38, - -1, -1, 38, 42, 43, 41, 45, 43, 47, 45, - 38, 38, -1, 41, 41, 43, -1, 45, 37, 38, - -1, -1, 41, 42, 43, -1, 45, -1, 47, 5, - 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, - 16, 17, 18, 19, 20, 21, 22, 37, 38, -1, - -1, -1, 42, 43, 124, 45, 37, 47, -1, -1, - -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, - -1, -1, -1, -1, 124, -1, -1, 124, -1, -1, - -1, -1, -1, -1, -1, 124, -1, -1, 124, -1, - -1, -1, -1, -1, -1, -1, 124, 124, -1, -1, - -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 256, 257, 258, 257, 258, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 259 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0, -0,0,0,0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : list", -"list :", -"list : list stat '\\n'", -"list : list error '\\n'", -"stat : expr", -"stat : LETTER '=' expr", -"expr : '(' expr ')'", -"expr : expr '+' expr", -"expr : expr '-' expr", -"expr : expr '*' expr", -"expr : expr '/' expr", -"expr : expr '%' expr", -"expr : expr '&' expr", -"expr : expr '|' expr", -"expr : '-' expr", -"expr : LETTER", -"expr : number", -"number : DIGIT", -"number : number DIGIT", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 72 "pure_calc.y" - /* start of programs */ - -#ifdef YYBYACC -static int YYLEX_DECL(); -#endif - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -YYERROR_DECL() -{ - fprintf(stderr, "%s\n", s); -} - -int -YYLEX_DECL() -{ - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - *yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - *yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} -#line 277 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 3: -#line 34 "pure_calc.y" - { yyerrok ; } -break; -case 4: -#line 38 "pure_calc.y" - { printf("%d\n",yystack.l_mark[0]);} -break; -case 5: -#line 40 "pure_calc.y" - { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; } -break; -case 6: -#line 44 "pure_calc.y" - { yyval = yystack.l_mark[-1]; } -break; -case 7: -#line 46 "pure_calc.y" - { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; } -break; -case 8: -#line 48 "pure_calc.y" - { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; } -break; -case 9: -#line 50 "pure_calc.y" - { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; } -break; -case 10: -#line 52 "pure_calc.y" - { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; } -break; -case 11: -#line 54 "pure_calc.y" - { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; } -break; -case 12: -#line 56 "pure_calc.y" - { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; } -break; -case 13: -#line 58 "pure_calc.y" - { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; } -break; -case 14: -#line 60 "pure_calc.y" - { yyval = - yystack.l_mark[0]; } -break; -case 15: -#line 62 "pure_calc.y" - { yyval = regs[yystack.l_mark[0]]; } -break; -case 17: -#line 67 "pure_calc.y" - { yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; } -break; -case 18: -#line 69 "pure_calc.y" - { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } -break; -#line 539 "/dev/stdout" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.09.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.08.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.08.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.08.out (nonexistent) @@ -1,1942 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 9 "grammar.y" -#ifdef YYBISON -#include -#define YYSTYPE_IS_DECLARED -#define yyerror yaccError -#endif - -#if defined(YYBISON) || !defined(YYBYACC) -static void yyerror(const char *s); -#endif -#line 81 "grammar.y" -#include -#include -#include - -#define OPT_LINTLIBRARY 1 - -#ifndef TRUE -#define TRUE (1) -#endif - -#ifndef FALSE -#define FALSE (0) -#endif - -/* #include "cproto.h" */ -#define MAX_TEXT_SIZE 1024 - -/* Prototype styles */ -#if OPT_LINTLIBRARY -#define PROTO_ANSI_LLIB -2 /* form ANSI lint-library source */ -#define PROTO_LINTLIBRARY -1 /* form lint-library source */ -#endif -#define PROTO_NONE 0 /* do not output any prototypes */ -#define PROTO_TRADITIONAL 1 /* comment out parameters */ -#define PROTO_ABSTRACT 2 /* comment out parameter names */ -#define PROTO_ANSI 3 /* ANSI C prototype */ - -typedef int PrototypeStyle; - -typedef char boolean; - -extern boolean types_out; -extern PrototypeStyle proto_style; - -#define ansiLintLibrary() (proto_style == PROTO_ANSI_LLIB) -#define knrLintLibrary() (proto_style == PROTO_LINTLIBRARY) -#define lintLibrary() (knrLintLibrary() || ansiLintLibrary()) - -#if OPT_LINTLIBRARY -#define FUNC_UNKNOWN -1 /* unspecified */ -#else -#define FUNC_UNKNOWN 0 /* unspecified (same as FUNC_NONE) */ -#endif -#define FUNC_NONE 0 /* not a function definition */ -#define FUNC_TRADITIONAL 1 /* traditional style */ -#define FUNC_ANSI 2 /* ANSI style */ -#define FUNC_BOTH 3 /* both styles */ - -typedef int FuncDefStyle; - -/* Source file text */ -typedef struct text { - char text[MAX_TEXT_SIZE]; /* source text */ - long begin; /* offset in temporary file */ -} Text; - -/* Declaration specifier flags */ -#define DS_NONE 0 /* default */ -#define DS_EXTERN 1 /* contains "extern" specifier */ -#define DS_STATIC 2 /* contains "static" specifier */ -#define DS_CHAR 4 /* contains "char" type specifier */ -#define DS_SHORT 8 /* contains "short" type specifier */ -#define DS_FLOAT 16 /* contains "float" type specifier */ -#define DS_INLINE 32 /* contains "inline" specifier */ -#define DS_JUNK 64 /* we're not interested in this declaration */ - -/* This structure stores information about a declaration specifier. */ -typedef struct decl_spec { - unsigned short flags; /* flags defined above */ - char *text; /* source text */ - long begin; /* offset in temporary file */ -} DeclSpec; - -/* This is a list of function parameters. */ -typedef struct _ParameterList { - struct parameter *first; /* pointer to first parameter in list */ - struct parameter *last; /* pointer to last parameter in list */ - long begin_comment; /* begin offset of comment */ - long end_comment; /* end offset of comment */ - char *comment; /* comment at start of parameter list */ -} ParameterList; - -/* This structure stores information about a declarator. */ -typedef struct _Declarator { - char *name; /* name of variable or function */ - char *text; /* source text */ - long begin; /* offset in temporary file */ - long begin_comment; /* begin offset of comment */ - long end_comment; /* end offset of comment */ - FuncDefStyle func_def; /* style of function definition */ - ParameterList params; /* function parameters */ - boolean pointer; /* TRUE if it declares a pointer */ - struct _Declarator *head; /* head function declarator */ - struct _Declarator *func_stack; /* stack of function declarators */ - struct _Declarator *next; /* next declarator in list */ -} Declarator; - -/* This structure stores information about a function parameter. */ -typedef struct parameter { - struct parameter *next; /* next parameter in list */ - DeclSpec decl_spec; - Declarator *declarator; - char *comment; /* comment following the parameter */ -} Parameter; - -/* This is a list of declarators. */ -typedef struct declarator_list { - Declarator *first; /* pointer to first declarator in list */ - Declarator *last; /* pointer to last declarator in list */ -} DeclaratorList; - -/* #include "symbol.h" */ -typedef struct symbol { - struct symbol *next; /* next symbol in list */ - char *name; /* name of symbol */ - char *value; /* value of symbol (for defines) */ - short flags; /* symbol attributes */ -} Symbol; - -/* parser stack entry type */ -typedef union { - Text text; - DeclSpec decl_spec; - Parameter *parameter; - ParameterList param_list; - Declarator *declarator; - DeclaratorList decl_list; -} YYSTYPE; - -/* The hash table length should be a prime number. */ -#define SYM_MAX_HASH 251 - -typedef struct symbol_table { - Symbol *bucket[SYM_MAX_HASH]; /* hash buckets */ -} SymbolTable; - -extern SymbolTable *new_symbol_table /* Create symbol table */ - (void); -extern void free_symbol_table /* Destroy symbol table */ - (SymbolTable *s); -extern Symbol *find_symbol /* Lookup symbol name */ - (SymbolTable *s, const char *n); -extern Symbol *new_symbol /* Define new symbol */ - (SymbolTable *s, const char *n, const char *v, int f); - -/* #include "semantic.h" */ -extern void new_decl_spec (DeclSpec *, const char *, long, int); -extern void free_decl_spec (DeclSpec *); -extern void join_decl_specs (DeclSpec *, DeclSpec *, DeclSpec *); -extern void check_untagged (DeclSpec *); -extern Declarator *new_declarator (const char *, const char *, long); -extern void free_declarator (Declarator *); -extern void new_decl_list (DeclaratorList *, Declarator *); -extern void free_decl_list (DeclaratorList *); -extern void add_decl_list (DeclaratorList *, DeclaratorList *, Declarator *); -extern Parameter *new_parameter (DeclSpec *, Declarator *); -extern void free_parameter (Parameter *); -extern void new_param_list (ParameterList *, Parameter *); -extern void free_param_list (ParameterList *); -extern void add_param_list (ParameterList *, ParameterList *, Parameter *); -extern void new_ident_list (ParameterList *); -extern void add_ident_list (ParameterList *, ParameterList *, const char *); -extern void set_param_types (ParameterList *, DeclSpec *, DeclaratorList *); -extern void gen_declarations (DeclSpec *, DeclaratorList *); -extern void gen_prototype (DeclSpec *, Declarator *); -extern void gen_func_declarator (Declarator *); -extern void gen_func_definition (DeclSpec *, Declarator *); - -extern void init_parser (void); -extern void process_file (FILE *infile, char *name); -extern char *cur_text (void); -extern char *cur_file_name (void); -extern char *implied_typedef (void); -extern void include_file (char *name, int convert); -extern char *supply_parm (int count); -extern char *xstrdup (const char *); -extern int already_declared (char *name); -extern int is_actual_func (Declarator *d); -extern int lint_ellipsis (Parameter *p); -extern int want_typedef (void); -extern void begin_tracking (void); -extern void begin_typedef (void); -extern void copy_typedef (char *s); -extern void ellipsis_varargs (Declarator *d); -extern void end_typedef (void); -extern void flush_varargs (void); -extern void fmt_library (int code); -extern void imply_typedef (const char *s); -extern void indent (FILE *outf); -extern void put_blankline (FILE *outf); -extern void put_body (FILE *outf, DeclSpec *decl_spec, Declarator *declarator); -extern void put_char (FILE *outf, int c); -extern void put_error (void); -extern void put_newline (FILE *outf); -extern void put_padded (FILE *outf, const char *s); -extern void put_string (FILE *outf, const char *s); -extern void track_in (void); - -extern boolean file_comments; -extern FuncDefStyle func_style; -extern char base_file[]; - -extern int yylex (void); - -/* declaration specifier attributes for the typedef statement currently being - * scanned - */ -static int cur_decl_spec_flags; - -/* pointer to parameter list for the current function definition */ -static ParameterList *func_params; - -/* A parser semantic action sets this pointer to the current declarator in - * a function parameter declaration in order to catch any comments following - * the parameter declaration on the same line. If the lexer scans a comment - * and is not NULL, then the comment is attached to the - * declarator. To ignore subsequent comments, the lexer sets this to NULL - * after scanning a comment or end of line. - */ -static Declarator *cur_declarator; - -/* temporary string buffer */ -static char buf[MAX_TEXT_SIZE]; - -/* table of typedef names */ -static SymbolTable *typedef_names; - -/* table of define names */ -static SymbolTable *define_names; - -/* table of type qualifiers */ -static SymbolTable *type_qualifiers; - -/* information about the current input file */ -typedef struct { - char *base_name; /* base input file name */ - char *file_name; /* current file name */ - FILE *file; /* input file */ - unsigned line_num; /* current line number in input file */ - FILE *tmp_file; /* temporary file */ - long begin_comment; /* tmp file offset after last written ) or ; */ - long end_comment; /* tmp file offset after last comment */ - boolean convert; /* if TRUE, convert function definitions */ - boolean changed; /* TRUE if conversion done in this file */ -} IncludeStack; - -static IncludeStack *cur_file; /* current input file */ - -/* #include "yyerror.c" */ - -static int haveAnsiParam (void); - - -/* Flags to enable us to find if a procedure returns a value. - */ -static int return_val; /* nonzero on BRACES iff return-expression found */ - -static const char * -dft_decl_spec (void) -{ - return (lintLibrary() && !return_val) ? "void" : "int"; -} - -static int -haveAnsiParam (void) -{ - Parameter *p; - if (func_params != 0) { - for (p = func_params->first; p != 0; p = p->next) { - if (p->declarator->func_def == FUNC_ANSI) { - return TRUE; - } - } - } - return FALSE; -} -#line 306 "/dev/stdout" - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define T_IDENTIFIER 257 -#define T_TYPEDEF_NAME 258 -#define T_DEFINE_NAME 259 -#define T_AUTO 260 -#define T_EXTERN 261 -#define T_REGISTER 262 -#define T_STATIC 263 -#define T_TYPEDEF 264 -#define T_INLINE 265 -#define T_EXTENSION 266 -#define T_CHAR 267 -#define T_DOUBLE 268 -#define T_FLOAT 269 -#define T_INT 270 -#define T_VOID 271 -#define T_LONG 272 -#define T_SHORT 273 -#define T_SIGNED 274 -#define T_UNSIGNED 275 -#define T_ENUM 276 -#define T_STRUCT 277 -#define T_UNION 278 -#define T_Bool 279 -#define T_Complex 280 -#define T_Imaginary 281 -#define T_TYPE_QUALIFIER 282 -#define T_BRACKETS 283 -#define T_LBRACE 284 -#define T_MATCHRBRACE 285 -#define T_ELLIPSIS 286 -#define T_INITIALIZER 287 -#define T_STRING_LITERAL 288 -#define T_ASM 289 -#define T_ASMARG 290 -#define T_VA_DCL 291 -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, 0, 26, 26, 27, 27, 27, 27, 27, 27, - 27, 31, 30, 30, 28, 28, 34, 28, 32, 32, - 33, 33, 35, 35, 37, 38, 29, 39, 29, 36, - 36, 36, 40, 40, 1, 1, 2, 2, 2, 3, - 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 6, 6, 6, 19, 19, 8, 8, 9, - 41, 9, 7, 7, 7, 25, 23, 23, 10, 10, - 11, 11, 11, 11, 11, 20, 20, 21, 21, 22, - 22, 14, 14, 15, 15, 16, 16, 16, 17, 17, - 18, 18, 24, 24, 12, 12, 12, 13, 13, 13, - 13, 13, 13, 13, -}; -static const short yylen[] = { 2, - 0, 1, 1, 2, 1, 1, 1, 1, 3, 2, - 2, 2, 3, 3, 2, 3, 0, 5, 2, 1, - 0, 1, 1, 3, 0, 0, 7, 0, 5, 0, - 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 2, 2, 1, 1, 1, 3, 1, - 0, 4, 3, 2, 2, 1, 1, 1, 2, 1, - 1, 3, 2, 4, 4, 2, 3, 0, 1, 1, - 2, 1, 3, 1, 3, 2, 2, 1, 0, 1, - 1, 3, 1, 2, 1, 2, 1, 3, 2, 1, - 4, 3, 3, 2, -}; -static const short yydefred[] = { 0, - 0, 0, 0, 0, 77, 0, 62, 40, 0, 42, - 43, 20, 44, 0, 46, 47, 48, 49, 54, 50, - 51, 52, 53, 76, 66, 67, 55, 56, 57, 61, - 0, 7, 0, 0, 35, 37, 38, 39, 59, 60, - 28, 0, 0, 0, 103, 81, 0, 0, 3, 5, - 6, 8, 0, 10, 11, 78, 0, 90, 0, 0, - 104, 0, 19, 0, 41, 45, 15, 36, 0, 68, - 0, 0, 0, 83, 0, 0, 64, 0, 0, 74, - 4, 58, 0, 82, 87, 91, 0, 14, 13, 9, - 16, 0, 71, 0, 31, 33, 0, 0, 0, 0, - 0, 94, 0, 0, 101, 12, 63, 73, 0, 0, - 69, 0, 0, 0, 34, 0, 110, 96, 97, 0, - 0, 84, 0, 85, 0, 23, 0, 0, 72, 26, - 29, 114, 0, 0, 0, 109, 0, 93, 95, 102, - 18, 0, 0, 108, 113, 112, 0, 24, 27, 111, -}; -static const short yydgoto[] = { 33, - 87, 35, 36, 37, 38, 39, 40, 69, 70, 41, - 42, 119, 120, 100, 101, 102, 103, 104, 43, 44, - 59, 60, 45, 46, 47, 48, 49, 50, 51, 52, - 77, 53, 127, 109, 128, 97, 94, 143, 72, 98, - 112, -}; -static const short yysindex[] = { -2, - -3, 27, -239, -177, 0, 0, 0, 0, -274, 0, - 0, 0, 0, -246, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -266, 0, 0, 455, 0, 0, 0, 0, 0, 0, - 0, -35, -245, 128, 0, 0, -245, -2, 0, 0, - 0, 0, 642, 0, 0, 0, -15, 0, -12, -239, - 0, 590, 0, -27, 0, 0, 0, 0, -10, 0, - -11, 534, -72, 0, -237, -232, 0, -35, -232, 0, - 0, 0, 642, 0, 0, 0, 455, 0, 0, 0, - 0, 27, 0, 534, 0, 0, -222, 617, 209, 34, - 39, 0, 44, 42, 0, 0, 0, 0, 27, -11, - 0, -200, -196, -195, 0, 174, 0, 0, 0, -33, - 243, 0, 561, 0, -177, 0, 33, 49, 0, 0, - 0, 0, 53, 55, 417, 0, -33, 0, 0, 0, - 0, 27, -188, 0, 0, 0, 57, 0, 0, 0, -}; -static const short yyrindex[] = { 99, - 0, 0, 275, 0, 0, -38, 0, 0, 481, 0, - 0, 0, 0, 509, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 30, 0, 0, 0, 0, 0, 101, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 343, 309, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 98, -182, 62, 0, 0, 133, 0, 64, 379, 0, - 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -182, 0, 0, 0, -180, -19, 0, - 65, 0, 0, 68, 0, 0, 0, 0, 51, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, - 19, 0, 0, 0, 0, 0, 0, 52, 0, 0, - 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; -static const short yygindex[] = { 0, - 11, -17, 0, 0, 13, 0, 0, 0, 20, 8, - -43, -1, -8, -89, 0, -9, 0, 0, 0, -44, - 0, 0, 4, 0, 0, 0, 70, -53, 0, 0, - -18, 0, 0, 0, 0, 22, 0, 0, 0, 0, - 0, -}; -#define YYTABLESIZE 924 -static const short yytable[] = { 58, - 78, 58, 58, 58, 73, 58, 135, 61, 88, 57, - 34, 5, 56, 62, 85, 58, 68, 63, 96, 7, - 58, 98, 78, 64, 98, 84, 134, 107, 80, 3, - 107, 90, 17, 92, 17, 4, 17, 2, 75, 3, - 96, 71, 30, 89, 115, 147, 76, 106, 91, 93, - 79, 75, 70, 17, 121, 55, 32, 107, 34, 105, - 108, 114, 105, 83, 4, 68, 2, 70, 3, 68, - 80, 121, 86, 80, 122, 106, 105, 78, 106, 5, - 56, 68, 123, 99, 124, 125, 129, 130, 80, 131, - 80, 141, 142, 144, 110, 145, 149, 150, 1, 110, - 2, 30, 99, 32, 79, 92, 118, 79, 100, 21, - 22, 111, 137, 139, 133, 113, 126, 81, 0, 0, - 0, 0, 79, 57, 79, 0, 99, 0, 140, 0, - 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, - 0, 70, 0, 0, 0, 99, 0, 0, 0, 148, - 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, - 0, 0, 0, 0, 0, 4, 0, 2, 0, 0, - 65, 0, 65, 65, 65, 0, 65, 0, 0, 0, - 0, 0, 0, 0, 5, 6, 7, 8, 65, 10, - 11, 65, 13, 66, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 0, 4, 0, 116, 132, 3, 0, 0, 58, 58, - 58, 58, 58, 58, 58, 78, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 78, 4, 74, 116, 136, - 3, 17, 78, 1, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 4, 54, 116, 5, 56, 0, 31, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 88, 80, 88, 88, 88, 0, 88, 0, - 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 89, 79, 89, 89, - 89, 0, 89, 0, 79, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 86, 25, 86, 86, 5, 56, 86, 0, 25, 65, - 65, 65, 65, 65, 65, 65, 0, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 75, 0, 75, 75, - 75, 0, 75, 0, 0, 0, 0, 0, 0, 0, - 5, 6, 7, 8, 65, 10, 11, 75, 13, 66, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 117, 146, 0, 0, - 0, 0, 0, 0, 0, 5, 6, 7, 8, 65, - 10, 11, 0, 13, 66, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 117, 4, 0, 2, 0, 3, 0, 0, 5, - 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 67, 0, 0, 0, 0, 41, 0, - 41, 0, 41, 0, 0, 117, 0, 0, 0, 0, - 0, 88, 88, 0, 0, 0, 0, 0, 0, 41, - 0, 0, 0, 0, 0, 0, 45, 0, 45, 0, - 45, 0, 0, 0, 0, 0, 0, 88, 0, 0, - 0, 0, 0, 0, 0, 89, 89, 45, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 89, 0, 0, 0, 0, 0, 0, 0, 86, - 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 75, 75, 75, 75, 75, - 75, 75, 0, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82, 7, 8, 65, 10, 11, - 0, 13, 66, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 6, 7, 8, 65, 10, 11, 0, 13, - 66, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 41, 41, 41, - 41, 41, 41, 41, 0, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 0, 0, 45, 45, 45, 45, 45, - 45, 45, 0, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 82, 7, 8, 65, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 0, 0, 82, 7, - 8, 65, 10, 11, 95, 13, 66, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 0, 0, 0, 138, 82, 7, 8, - 65, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 0, 75, 82, 7, 8, 65, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 82, - 7, 8, 65, 10, 11, 0, 13, 66, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, -}; -static const short yycheck[] = { 38, - 44, 40, 41, 42, 40, 44, 40, 4, 62, 2, - 0, 257, 258, 288, 59, 3, 34, 264, 72, 259, - 59, 41, 61, 290, 44, 41, 116, 41, 47, 42, - 44, 59, 38, 44, 40, 38, 42, 40, 284, 42, - 94, 34, 282, 62, 98, 135, 43, 285, 59, 61, - 47, 284, 44, 59, 99, 59, 59, 76, 48, 41, - 79, 284, 44, 53, 38, 83, 40, 59, 42, 87, - 41, 116, 60, 44, 41, 41, 73, 121, 44, 257, - 258, 99, 44, 73, 41, 44, 287, 284, 59, 285, - 61, 59, 44, 41, 87, 41, 285, 41, 0, 92, - 0, 284, 41, 284, 41, 41, 99, 44, 41, 59, - 59, 92, 121, 123, 116, 94, 109, 48, -1, -1, - -1, -1, 59, 116, 61, -1, 116, -1, 125, -1, - -1, -1, -1, 123, -1, -1, -1, -1, -1, -1, - -1, 44, -1, -1, -1, 135, -1, -1, -1, 142, - -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, - -1, -1, -1, -1, -1, 38, -1, 40, -1, -1, - 38, -1, 40, 41, 42, -1, 44, -1, -1, -1, - -1, -1, -1, -1, 257, 258, 259, 260, 261, 262, - 263, 59, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - -1, 38, -1, 40, 41, 42, -1, -1, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 38, 283, 40, 283, - 42, 257, 291, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 38, 285, 40, 257, 258, -1, 289, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 38, 284, 40, 41, 42, -1, 44, -1, - 291, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 38, 284, 40, 41, - 42, -1, 44, -1, 291, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 38, 284, 40, 41, 257, 258, 44, -1, 291, 257, - 258, 259, 260, 261, 262, 263, -1, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 38, -1, 40, 41, - 42, -1, 44, -1, -1, -1, -1, -1, -1, -1, - 257, 258, 259, 260, 261, 262, 263, 59, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 41, -1, -1, - -1, -1, -1, -1, -1, 257, 258, 259, 260, 261, - 262, 263, -1, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 38, -1, 40, -1, 42, -1, -1, 257, - 258, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 59, -1, -1, -1, -1, 38, -1, - 40, -1, 42, -1, -1, 283, -1, -1, -1, -1, - -1, 257, 258, -1, -1, -1, -1, -1, -1, 59, - -1, -1, -1, -1, -1, -1, 38, -1, 40, -1, - 42, -1, -1, -1, -1, -1, -1, 283, -1, -1, - -1, -1, -1, -1, -1, 257, 258, 59, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 283, -1, -1, -1, -1, -1, -1, -1, 257, - 258, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 283, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 257, 258, 259, 260, 261, - 262, 263, -1, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 258, 259, 260, 261, 262, 263, - -1, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 257, 258, 259, 260, 261, 262, 263, -1, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 257, 258, 259, - 260, 261, 262, 263, -1, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, -1, -1, 257, 258, 259, 260, 261, - 262, 263, -1, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, -1, -1, 258, 259, - 260, 261, 262, 263, 291, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, -1, -1, -1, 286, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, -1, 284, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 258, - 259, 260, 261, 262, 263, -1, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, -}; -#define YYFINAL 33 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 291 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"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, -0,0,0,0,"'&'",0,"'('","')'","'*'",0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,0,"';'",0, -"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -"T_IDENTIFIER","T_TYPEDEF_NAME","T_DEFINE_NAME","T_AUTO","T_EXTERN", -"T_REGISTER","T_STATIC","T_TYPEDEF","T_INLINE","T_EXTENSION","T_CHAR", -"T_DOUBLE","T_FLOAT","T_INT","T_VOID","T_LONG","T_SHORT","T_SIGNED", -"T_UNSIGNED","T_ENUM","T_STRUCT","T_UNION","T_Bool","T_Complex","T_Imaginary", -"T_TYPE_QUALIFIER","T_BRACKETS","T_LBRACE","T_MATCHRBRACE","T_ELLIPSIS", -"T_INITIALIZER","T_STRING_LITERAL","T_ASM","T_ASMARG","T_VA_DCL", -"illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : program", -"program :", -"program : translation_unit", -"translation_unit : external_declaration", -"translation_unit : translation_unit external_declaration", -"external_declaration : declaration", -"external_declaration : function_definition", -"external_declaration : ';'", -"external_declaration : linkage_specification", -"external_declaration : T_ASM T_ASMARG ';'", -"external_declaration : error T_MATCHRBRACE", -"external_declaration : error ';'", -"braces : T_LBRACE T_MATCHRBRACE", -"linkage_specification : T_EXTERN T_STRING_LITERAL braces", -"linkage_specification : T_EXTERN T_STRING_LITERAL declaration", -"declaration : decl_specifiers ';'", -"declaration : decl_specifiers init_declarator_list ';'", -"$$1 :", -"declaration : any_typedef decl_specifiers $$1 opt_declarator_list ';'", -"any_typedef : T_EXTENSION T_TYPEDEF", -"any_typedef : T_TYPEDEF", -"opt_declarator_list :", -"opt_declarator_list : declarator_list", -"declarator_list : declarator", -"declarator_list : declarator_list ',' declarator", -"$$2 :", -"$$3 :", -"function_definition : decl_specifiers declarator $$2 opt_declaration_list T_LBRACE $$3 T_MATCHRBRACE", -"$$4 :", -"function_definition : declarator $$4 opt_declaration_list T_LBRACE T_MATCHRBRACE", -"opt_declaration_list :", -"opt_declaration_list : T_VA_DCL", -"opt_declaration_list : declaration_list", -"declaration_list : declaration", -"declaration_list : declaration_list declaration", -"decl_specifiers : decl_specifier", -"decl_specifiers : decl_specifiers decl_specifier", -"decl_specifier : storage_class", -"decl_specifier : type_specifier", -"decl_specifier : type_qualifier", -"storage_class : T_AUTO", -"storage_class : T_EXTERN", -"storage_class : T_REGISTER", -"storage_class : T_STATIC", -"storage_class : T_INLINE", -"storage_class : T_EXTENSION", -"type_specifier : T_CHAR", -"type_specifier : T_DOUBLE", -"type_specifier : T_FLOAT", -"type_specifier : T_INT", -"type_specifier : T_LONG", -"type_specifier : T_SHORT", -"type_specifier : T_SIGNED", -"type_specifier : T_UNSIGNED", -"type_specifier : T_VOID", -"type_specifier : T_Bool", -"type_specifier : T_Complex", -"type_specifier : T_Imaginary", -"type_specifier : T_TYPEDEF_NAME", -"type_specifier : struct_or_union_specifier", -"type_specifier : enum_specifier", -"type_qualifier : T_TYPE_QUALIFIER", -"type_qualifier : T_DEFINE_NAME", -"struct_or_union_specifier : struct_or_union any_id braces", -"struct_or_union_specifier : struct_or_union braces", -"struct_or_union_specifier : struct_or_union any_id", -"struct_or_union : T_STRUCT", -"struct_or_union : T_UNION", -"init_declarator_list : init_declarator", -"init_declarator_list : init_declarator_list ',' init_declarator", -"init_declarator : declarator", -"$$5 :", -"init_declarator : declarator '=' $$5 T_INITIALIZER", -"enum_specifier : enumeration any_id braces", -"enum_specifier : enumeration braces", -"enum_specifier : enumeration any_id", -"enumeration : T_ENUM", -"any_id : T_IDENTIFIER", -"any_id : T_TYPEDEF_NAME", -"declarator : pointer direct_declarator", -"declarator : direct_declarator", -"direct_declarator : identifier_or_ref", -"direct_declarator : '(' declarator ')'", -"direct_declarator : direct_declarator T_BRACKETS", -"direct_declarator : direct_declarator '(' parameter_type_list ')'", -"direct_declarator : direct_declarator '(' opt_identifier_list ')'", -"pointer : '*' opt_type_qualifiers", -"pointer : '*' opt_type_qualifiers pointer", -"opt_type_qualifiers :", -"opt_type_qualifiers : type_qualifier_list", -"type_qualifier_list : type_qualifier", -"type_qualifier_list : type_qualifier_list type_qualifier", -"parameter_type_list : parameter_list", -"parameter_type_list : parameter_list ',' T_ELLIPSIS", -"parameter_list : parameter_declaration", -"parameter_list : parameter_list ',' parameter_declaration", -"parameter_declaration : decl_specifiers declarator", -"parameter_declaration : decl_specifiers abs_declarator", -"parameter_declaration : decl_specifiers", -"opt_identifier_list :", -"opt_identifier_list : identifier_list", -"identifier_list : any_id", -"identifier_list : identifier_list ',' any_id", -"identifier_or_ref : any_id", -"identifier_or_ref : '&' any_id", -"abs_declarator : pointer", -"abs_declarator : pointer direct_abs_declarator", -"abs_declarator : direct_abs_declarator", -"direct_abs_declarator : '(' abs_declarator ')'", -"direct_abs_declarator : direct_abs_declarator T_BRACKETS", -"direct_abs_declarator : T_BRACKETS", -"direct_abs_declarator : direct_abs_declarator '(' parameter_type_list ')'", -"direct_abs_declarator : direct_abs_declarator '(' ')'", -"direct_abs_declarator : '(' parameter_type_list ')'", -"direct_abs_declarator : '(' ')'", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 1014 "grammar.y" - -/* lex.yy.c */ -#define BEGIN yy_start = 1 + 2 * - -#define CPP1 1 -#define INIT1 2 -#define INIT2 3 -#define CURLY 4 -#define LEXYACC 5 -#define ASM 6 -#define CPP_INLINE 7 - -extern char *yytext; -extern FILE *yyin, *yyout; - -static int curly; /* number of curly brace nesting levels */ -static int ly_count; /* number of occurrences of %% */ -static int inc_depth; /* include nesting level */ -static SymbolTable *included_files; /* files already included */ -static int yy_start = 0; /* start state number */ - -#define grammar_error(s) yaccError(s) - -static void -yaccError (const char *msg) -{ - func_params = NULL; - put_error(); /* tell what line we're on, and what file */ - fprintf(stderr, "%s at token '%s'\n", msg, yytext); -} - -/* Initialize the table of type qualifier keywords recognized by the lexical - * analyzer. - */ -void -init_parser (void) -{ - static const char *keywords[] = { - "const", - "restrict", - "volatile", - "interrupt", -#ifdef vms - "noshare", - "readonly", -#endif -#if defined(MSDOS) || defined(OS2) - "__cdecl", - "__export", - "__far", - "__fastcall", - "__fortran", - "__huge", - "__inline", - "__interrupt", - "__loadds", - "__near", - "__pascal", - "__saveregs", - "__segment", - "__stdcall", - "__syscall", - "_cdecl", - "_cs", - "_ds", - "_es", - "_export", - "_far", - "_fastcall", - "_fortran", - "_huge", - "_interrupt", - "_loadds", - "_near", - "_pascal", - "_saveregs", - "_seg", - "_segment", - "_ss", - "cdecl", - "far", - "huge", - "near", - "pascal", -#ifdef OS2 - "__far16", -#endif -#endif -#ifdef __GNUC__ - /* gcc aliases */ - "__builtin_va_arg", - "__builtin_va_list", - "__const", - "__const__", - "__inline", - "__inline__", - "__restrict", - "__restrict__", - "__volatile", - "__volatile__", -#endif - }; - unsigned i; - - /* Initialize type qualifier table. */ - type_qualifiers = new_symbol_table(); - for (i = 0; i < sizeof(keywords)/sizeof(keywords[0]); ++i) { - new_symbol(type_qualifiers, keywords[i], NULL, DS_NONE); - } -} - -/* Process the C source file. Write function prototypes to the standard - * output. Convert function definitions and write the converted source - * code to a temporary file. - */ -void -process_file (FILE *infile, char *name) -{ - char *s; - - if (strlen(name) > 2) { - s = name + strlen(name) - 2; - if (*s == '.') { - ++s; - if (*s == 'l' || *s == 'y') - BEGIN LEXYACC; -#if defined(MSDOS) || defined(OS2) - if (*s == 'L' || *s == 'Y') - BEGIN LEXYACC; -#endif - } - } - - included_files = new_symbol_table(); - typedef_names = new_symbol_table(); - define_names = new_symbol_table(); - inc_depth = -1; - curly = 0; - ly_count = 0; - func_params = NULL; - yyin = infile; - include_file(strcpy(base_file, name), func_style != FUNC_NONE); - if (file_comments) { -#if OPT_LINTLIBRARY - if (lintLibrary()) { - put_blankline(stdout); - begin_tracking(); - } -#endif - put_string(stdout, "/* "); - put_string(stdout, cur_file_name()); - put_string(stdout, " */\n"); - } - yyparse(); - free_symbol_table(define_names); - free_symbol_table(typedef_names); - free_symbol_table(included_files); -} - -#ifdef NO_LEAKS -void -free_parser(void) -{ - free_symbol_table (type_qualifiers); -#ifdef FLEX_SCANNER - if (yy_current_buffer != 0) - yy_delete_buffer(yy_current_buffer); -#endif -} -#endif -#line 1006 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 10: -#line 377 "grammar.y" - { - yyerrok; - } -break; -case 11: -#line 381 "grammar.y" - { - yyerrok; - } -break; -case 13: -#line 392 "grammar.y" - { - /* Provide an empty action here so bison will not complain about - * incompatible types in the default action it normally would - * have generated. - */ - } -break; -case 14: -#line 399 "grammar.y" - { - /* empty */ - } -break; -case 15: -#line 406 "grammar.y" - { -#if OPT_LINTLIBRARY - if (types_out && want_typedef()) { - gen_declarations(&yystack.l_mark[-1].decl_spec, (DeclaratorList *)0); - flush_varargs(); - } -#endif - free_decl_spec(&yystack.l_mark[-1].decl_spec); - end_typedef(); - } -break; -case 16: -#line 417 "grammar.y" - { - if (func_params != NULL) { - set_param_types(func_params, &yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list); - } else { - gen_declarations(&yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list); -#if OPT_LINTLIBRARY - flush_varargs(); -#endif - free_decl_list(&yystack.l_mark[-1].decl_list); - } - free_decl_spec(&yystack.l_mark[-2].decl_spec); - end_typedef(); - } -break; -case 17: -#line 431 "grammar.y" - { - cur_decl_spec_flags = yystack.l_mark[0].decl_spec.flags; - free_decl_spec(&yystack.l_mark[0].decl_spec); - } -break; -case 18: -#line 436 "grammar.y" - { - end_typedef(); - } -break; -case 19: -#line 443 "grammar.y" - { - begin_typedef(); - } -break; -case 20: -#line 447 "grammar.y" - { - begin_typedef(); - } -break; -case 23: -#line 459 "grammar.y" - { - int flags = cur_decl_spec_flags; - - /* If the typedef is a pointer type, then reset the short type - * flags so it does not get promoted. - */ - if (strcmp(yystack.l_mark[0].declarator->text, yystack.l_mark[0].declarator->name) != 0) - flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT); - new_symbol(typedef_names, yystack.l_mark[0].declarator->name, NULL, flags); - free_declarator(yystack.l_mark[0].declarator); - } -break; -case 24: -#line 471 "grammar.y" - { - int flags = cur_decl_spec_flags; - - if (strcmp(yystack.l_mark[0].declarator->text, yystack.l_mark[0].declarator->name) != 0) - flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT); - new_symbol(typedef_names, yystack.l_mark[0].declarator->name, NULL, flags); - free_declarator(yystack.l_mark[0].declarator); - } -break; -case 25: -#line 483 "grammar.y" - { - check_untagged(&yystack.l_mark[-1].decl_spec); - if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) { - yyerror("syntax error"); - YYERROR; - } - func_params = &(yystack.l_mark[0].declarator->head->params); - func_params->begin_comment = cur_file->begin_comment; - func_params->end_comment = cur_file->end_comment; - } -break; -case 26: -#line 494 "grammar.y" - { - /* If we're converting to K&R and we've got a nominally K&R - * function which has a parameter which is ANSI (i.e., a prototyped - * function pointer), then we must override the deciphered value of - * 'func_def' so that the parameter will be converted. - */ - if (func_style == FUNC_TRADITIONAL - && haveAnsiParam() - && yystack.l_mark[-3].declarator->head->func_def == func_style) { - yystack.l_mark[-3].declarator->head->func_def = FUNC_BOTH; - } - - func_params = NULL; - - if (cur_file->convert) - gen_func_definition(&yystack.l_mark[-4].decl_spec, yystack.l_mark[-3].declarator); - gen_prototype(&yystack.l_mark[-4].decl_spec, yystack.l_mark[-3].declarator); -#if OPT_LINTLIBRARY - flush_varargs(); -#endif - free_decl_spec(&yystack.l_mark[-4].decl_spec); - free_declarator(yystack.l_mark[-3].declarator); - } -break; -case 28: -#line 519 "grammar.y" - { - if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) { - yyerror("syntax error"); - YYERROR; - } - func_params = &(yystack.l_mark[0].declarator->head->params); - func_params->begin_comment = cur_file->begin_comment; - func_params->end_comment = cur_file->end_comment; - } -break; -case 29: -#line 529 "grammar.y" - { - DeclSpec decl_spec; - - func_params = NULL; - - new_decl_spec(&decl_spec, dft_decl_spec(), yystack.l_mark[-4].declarator->begin, DS_NONE); - if (cur_file->convert) - gen_func_definition(&decl_spec, yystack.l_mark[-4].declarator); - gen_prototype(&decl_spec, yystack.l_mark[-4].declarator); -#if OPT_LINTLIBRARY - flush_varargs(); -#endif - free_decl_spec(&decl_spec); - free_declarator(yystack.l_mark[-4].declarator); - } -break; -case 36: -#line 560 "grammar.y" - { - join_decl_specs(&yyval.decl_spec, &yystack.l_mark[-1].decl_spec, &yystack.l_mark[0].decl_spec); - free(yystack.l_mark[-1].decl_spec.text); - free(yystack.l_mark[0].decl_spec.text); - } -break; -case 40: -#line 575 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); - } -break; -case 41: -#line 579 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_EXTERN); - } -break; -case 42: -#line 583 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); - } -break; -case 43: -#line 587 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_STATIC); - } -break; -case 44: -#line 591 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_INLINE); - } -break; -case 45: -#line 595 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_JUNK); - } -break; -case 46: -#line 602 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR); - } -break; -case 47: -#line 606 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); - } -break; -case 48: -#line 610 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_FLOAT); - } -break; -case 49: -#line 614 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); - } -break; -case 50: -#line 618 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); - } -break; -case 51: -#line 622 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_SHORT); - } -break; -case 52: -#line 626 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); - } -break; -case 53: -#line 630 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); - } -break; -case 54: -#line 634 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); - } -break; -case 55: -#line 638 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR); - } -break; -case 56: -#line 642 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); - } -break; -case 57: -#line 646 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); - } -break; -case 58: -#line 650 "grammar.y" - { - Symbol *s; - s = find_symbol(typedef_names, yystack.l_mark[0].text.text); - if (s != NULL) - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, s->flags); - } -break; -case 61: -#line 662 "grammar.y" - { - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); - } -break; -case 62: -#line 666 "grammar.y" - { - /* This rule allows the nonterminal to scan #define - * names as if they were type modifiers. - */ - Symbol *s; - s = find_symbol(define_names, yystack.l_mark[0].text.text); - if (s != NULL) - new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, s->flags); - } -break; -case 63: -#line 679 "grammar.y" - { - char *s; - if ((s = implied_typedef()) == 0) - (void)sprintf(s = buf, "%s %s", yystack.l_mark[-2].text.text, yystack.l_mark[-1].text.text); - new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE); - } -break; -case 64: -#line 686 "grammar.y" - { - char *s; - if ((s = implied_typedef()) == 0) - (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text); - new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE); - } -break; -case 65: -#line 693 "grammar.y" - { - (void)sprintf(buf, "%s %s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text); - new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE); - } -break; -case 66: -#line 701 "grammar.y" - { - imply_typedef(yyval.text.text); - } -break; -case 67: -#line 705 "grammar.y" - { - imply_typedef(yyval.text.text); - } -break; -case 68: -#line 712 "grammar.y" - { - new_decl_list(&yyval.decl_list, yystack.l_mark[0].declarator); - } -break; -case 69: -#line 716 "grammar.y" - { - add_decl_list(&yyval.decl_list, &yystack.l_mark[-2].decl_list, yystack.l_mark[0].declarator); - } -break; -case 70: -#line 723 "grammar.y" - { - if (yystack.l_mark[0].declarator->func_def != FUNC_NONE && func_params == NULL && - func_style == FUNC_TRADITIONAL && cur_file->convert) { - gen_func_declarator(yystack.l_mark[0].declarator); - fputs(cur_text(), cur_file->tmp_file); - } - cur_declarator = yyval.declarator; - } -break; -case 71: -#line 732 "grammar.y" - { - if (yystack.l_mark[-1].declarator->func_def != FUNC_NONE && func_params == NULL && - func_style == FUNC_TRADITIONAL && cur_file->convert) { - gen_func_declarator(yystack.l_mark[-1].declarator); - fputs(" =", cur_file->tmp_file); - } - } -break; -case 73: -#line 744 "grammar.y" - { - char *s; - if ((s = implied_typedef()) == 0) - (void)sprintf(s = buf, "enum %s", yystack.l_mark[-1].text.text); - new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE); - } -break; -case 74: -#line 751 "grammar.y" - { - char *s; - if ((s = implied_typedef()) == 0) - (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text); - new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE); - } -break; -case 75: -#line 758 "grammar.y" - { - (void)sprintf(buf, "enum %s", yystack.l_mark[0].text.text); - new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE); - } -break; -case 76: -#line 766 "grammar.y" - { - imply_typedef("enum"); - yyval.text = yystack.l_mark[0].text; - } -break; -case 79: -#line 779 "grammar.y" - { - yyval.declarator = yystack.l_mark[0].declarator; - (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text); - free(yyval.declarator->text); - yyval.declarator->text = xstrdup(buf); - yyval.declarator->begin = yystack.l_mark[-1].text.begin; - yyval.declarator->pointer = TRUE; - } -break; -case 81: -#line 792 "grammar.y" - { - yyval.declarator = new_declarator(yystack.l_mark[0].text.text, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin); - } -break; -case 82: -#line 796 "grammar.y" - { - yyval.declarator = yystack.l_mark[-1].declarator; - (void)sprintf(buf, "(%s)", yyval.declarator->text); - free(yyval.declarator->text); - yyval.declarator->text = xstrdup(buf); - yyval.declarator->begin = yystack.l_mark[-2].text.begin; - } -break; -case 83: -#line 804 "grammar.y" - { - yyval.declarator = yystack.l_mark[-1].declarator; - (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text); - free(yyval.declarator->text); - yyval.declarator->text = xstrdup(buf); - } -break; -case 84: -#line 811 "grammar.y" - { - yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin); - yyval.declarator->params = yystack.l_mark[-1].param_list; - yyval.declarator->func_stack = yystack.l_mark[-3].declarator; - yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head; - yyval.declarator->func_def = FUNC_ANSI; - } -break; -case 85: -#line 819 "grammar.y" - { - yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin); - yyval.declarator->params = yystack.l_mark[-1].param_list; - yyval.declarator->func_stack = yystack.l_mark[-3].declarator; - yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head; - yyval.declarator->func_def = FUNC_TRADITIONAL; - } -break; -case 86: -#line 830 "grammar.y" - { - (void)sprintf(yyval.text.text, "*%s", yystack.l_mark[0].text.text); - yyval.text.begin = yystack.l_mark[-1].text.begin; - } -break; -case 87: -#line 835 "grammar.y" - { - (void)sprintf(yyval.text.text, "*%s%s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text); - yyval.text.begin = yystack.l_mark[-2].text.begin; - } -break; -case 88: -#line 843 "grammar.y" - { - strcpy(yyval.text.text, ""); - yyval.text.begin = 0L; - } -break; -case 90: -#line 852 "grammar.y" - { - (void)sprintf(yyval.text.text, "%s ", yystack.l_mark[0].decl_spec.text); - yyval.text.begin = yystack.l_mark[0].decl_spec.begin; - free(yystack.l_mark[0].decl_spec.text); - } -break; -case 91: -#line 858 "grammar.y" - { - (void)sprintf(yyval.text.text, "%s%s ", yystack.l_mark[-1].text.text, yystack.l_mark[0].decl_spec.text); - yyval.text.begin = yystack.l_mark[-1].text.begin; - free(yystack.l_mark[0].decl_spec.text); - } -break; -case 93: -#line 868 "grammar.y" - { - add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, "..."); - } -break; -case 94: -#line 875 "grammar.y" - { - new_param_list(&yyval.param_list, yystack.l_mark[0].parameter); - } -break; -case 95: -#line 879 "grammar.y" - { - add_param_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].parameter); - } -break; -case 96: -#line 886 "grammar.y" - { - check_untagged(&yystack.l_mark[-1].decl_spec); - yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator); - } -break; -case 97: -#line 891 "grammar.y" - { - check_untagged(&yystack.l_mark[-1].decl_spec); - yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator); - } -break; -case 98: -#line 896 "grammar.y" - { - check_untagged(&yystack.l_mark[0].decl_spec); - yyval.parameter = new_parameter(&yystack.l_mark[0].decl_spec, (Declarator *)0); - } -break; -case 99: -#line 904 "grammar.y" - { - new_ident_list(&yyval.param_list); - } -break; -case 101: -#line 912 "grammar.y" - { - new_ident_list(&yyval.param_list); - add_ident_list(&yyval.param_list, &yyval.param_list, yystack.l_mark[0].text.text); - } -break; -case 102: -#line 917 "grammar.y" - { - add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].text.text); - } -break; -case 103: -#line 924 "grammar.y" - { - yyval.text = yystack.l_mark[0].text; - } -break; -case 104: -#line 928 "grammar.y" - { -#if OPT_LINTLIBRARY - if (lintLibrary()) { /* Lint doesn't grok C++ ref variables */ - yyval.text = yystack.l_mark[0].text; - } else -#endif - (void)sprintf(yyval.text.text, "&%s", yystack.l_mark[0].text.text); - yyval.text.begin = yystack.l_mark[-1].text.begin; - } -break; -case 105: -#line 941 "grammar.y" - { - yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin); - } -break; -case 106: -#line 945 "grammar.y" - { - yyval.declarator = yystack.l_mark[0].declarator; - (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text); - free(yyval.declarator->text); - yyval.declarator->text = xstrdup(buf); - yyval.declarator->begin = yystack.l_mark[-1].text.begin; - } -break; -case 108: -#line 957 "grammar.y" - { - yyval.declarator = yystack.l_mark[-1].declarator; - (void)sprintf(buf, "(%s)", yyval.declarator->text); - free(yyval.declarator->text); - yyval.declarator->text = xstrdup(buf); - yyval.declarator->begin = yystack.l_mark[-2].text.begin; - } -break; -case 109: -#line 965 "grammar.y" - { - yyval.declarator = yystack.l_mark[-1].declarator; - (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text); - free(yyval.declarator->text); - yyval.declarator->text = xstrdup(buf); - } -break; -case 110: -#line 972 "grammar.y" - { - yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin); - } -break; -case 111: -#line 976 "grammar.y" - { - yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-3].declarator->begin); - yyval.declarator->params = yystack.l_mark[-1].param_list; - yyval.declarator->func_stack = yystack.l_mark[-3].declarator; - yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head; - yyval.declarator->func_def = FUNC_ANSI; - } -break; -case 112: -#line 984 "grammar.y" - { - yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].declarator->begin); - yyval.declarator->func_stack = yystack.l_mark[-2].declarator; - yyval.declarator->head = (yystack.l_mark[-2].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-2].declarator->head; - yyval.declarator->func_def = FUNC_ANSI; - } -break; -case 113: -#line 991 "grammar.y" - { - Declarator *d; - - d = new_declarator("", "", yystack.l_mark[-2].text.begin); - yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].text.begin); - yyval.declarator->params = yystack.l_mark[-1].param_list; - yyval.declarator->func_stack = d; - yyval.declarator->head = yyval.declarator; - yyval.declarator->func_def = FUNC_ANSI; - } -break; -case 114: -#line 1002 "grammar.y" - { - Declarator *d; - - d = new_declarator("", "", yystack.l_mark[-1].text.begin); - yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-1].text.begin); - yyval.declarator->func_stack = d; - yyval.declarator->head = yyval.declarator; - yyval.declarator->func_def = FUNC_ANSI; - } -break; -#line 1882 "/dev/stdout" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.08.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.07.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.07.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.07.out (nonexistent) @@ -1,1912 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 26 "ftp.y" - -/* sccsid[] = "@(#)ftpcmd.y 5.20.1.1 (Berkeley) 3/2/89"; */ - -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef YYBISON -int yylex(void); -static void yyerror(const char *); -#endif - -extern struct sockaddr_in data_dest; -extern int logged_in; -extern struct passwd *pw; -extern int guest; -extern int logging; -extern int type; -extern int form; -extern int debug; -extern int timeout; -extern int maxtimeout; -extern int pdata; -extern char hostname[], remotehost[]; -extern char proctitle[]; -extern char *globerr; -extern int usedefault; -extern int transflag; -extern char tmpline[]; - -extern char **glob(char *); -extern char *renamefrom(char *); -extern void cwd(const char *); - -extern void dologout(int); -extern void fatal(const char *); -extern void makedir(const char *); -extern void nack(const char *); -extern void pass(const char *); -extern void passive(void); -extern void pwd(void); -extern void removedir(char *); -extern void renamecmd(char *, char *); -extern void retrieve(const char *, const char *); -extern void send_file_list(const char *); -extern void statcmd(void); -extern void statfilecmd(const char *); -extern void store(char *, const char *, int); -extern void user(const char *); - -extern void perror_reply(int, const char *, ...); -extern void reply(int, const char *, ...); -extern void lreply(int, const char *, ...); - -static int cmd_type; -static int cmd_form; -static int cmd_bytesz; -char cbuf[512]; -char *fromname; - -struct tab { - const char *name; - short token; - short state; - short implemented; /* 1 if command is implemented */ - const char *help; -}; - -static char * copy(const char *); - -#ifdef YYBISON -static void sizecmd(char *filename); -static void help(struct tab *ctab, char *s); -struct tab cmdtab[]; -struct tab sitetab[]; -#endif - -static void -yyerror(const char *msg) -{ - perror(msg); -} -#line 118 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define A 257 -#define B 258 -#define C 259 -#define E 260 -#define F 261 -#define I 262 -#define L 263 -#define N 264 -#define P 265 -#define R 266 -#define S 267 -#define T 268 -#define SP 269 -#define CRLF 270 -#define COMMA 271 -#define STRING 272 -#define NUMBER 273 -#define USER 274 -#define PASS 275 -#define ACCT 276 -#define REIN 277 -#define QUIT 278 -#define PORT 279 -#define PASV 280 -#define TYPE 281 -#define STRU 282 -#define MODE 283 -#define RETR 284 -#define STOR 285 -#define APPE 286 -#define MLFL 287 -#define MAIL 288 -#define MSND 289 -#define MSOM 290 -#define MSAM 291 -#define MRSQ 292 -#define MRCP 293 -#define ALLO 294 -#define REST 295 -#define RNFR 296 -#define RNTO 297 -#define ABOR 298 -#define DELE 299 -#define CWD 300 -#define LIST 301 -#define NLST 302 -#define SITE 303 -#define STAT 304 -#define HELP 305 -#define NOOP 306 -#define MKD 307 -#define RMD 308 -#define PWD 309 -#define CDUP 310 -#define STOU 311 -#define SMNT 312 -#define SYST 313 -#define SIZE 314 -#define MDTM 315 -#define UMASK 316 -#define IDLE 317 -#define CHMOD 318 -#define LEXERR 319 -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 3, 4, 4, - 12, 5, 13, 13, 13, 6, 6, 6, 6, 6, - 6, 6, 6, 7, 7, 7, 8, 8, 8, 10, - 14, 11, 9, -}; -static const short yylen[] = { 2, - 0, 2, 2, 4, 4, 4, 2, 4, 4, 4, - 4, 8, 5, 5, 5, 3, 5, 3, 5, 5, - 2, 5, 4, 2, 3, 5, 2, 4, 2, 5, - 5, 3, 3, 4, 6, 5, 7, 9, 4, 6, - 5, 2, 5, 5, 2, 2, 5, 1, 0, 1, - 1, 11, 1, 1, 1, 1, 3, 1, 3, 1, - 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, -}; -static const short yydefred[] = { 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 73, 73, 73, 0, 73, 0, 0, 73, 73, 73, - 73, 0, 0, 0, 0, 73, 73, 73, 73, 73, - 0, 73, 73, 2, 3, 46, 0, 0, 45, 0, - 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 24, 0, 0, 0, 0, 0, 21, 0, 0, 27, - 29, 0, 0, 0, 0, 0, 42, 0, 0, 48, - 0, 50, 0, 0, 0, 0, 0, 60, 0, 0, - 64, 66, 65, 0, 68, 69, 67, 0, 0, 0, - 0, 0, 0, 71, 0, 70, 0, 0, 25, 0, - 18, 0, 16, 0, 73, 0, 73, 0, 0, 0, - 0, 32, 33, 0, 0, 0, 4, 5, 0, 6, - 0, 0, 0, 51, 63, 8, 9, 10, 0, 0, - 0, 0, 11, 0, 23, 0, 0, 0, 0, 0, - 34, 0, 0, 39, 0, 0, 28, 0, 0, 0, - 0, 0, 0, 55, 53, 54, 57, 59, 62, 13, - 14, 15, 0, 47, 22, 26, 19, 17, 0, 0, - 36, 0, 0, 20, 30, 31, 41, 43, 44, 0, - 0, 35, 72, 0, 40, 0, 0, 0, 37, 0, - 0, 12, 0, 0, 38, 0, 0, 0, 52, -}; -static const short yydgoto[] = { 1, - 34, 35, 71, 73, 75, 80, 84, 88, 45, 95, - 184, 125, 157, 96, -}; -static const short yysindex[] = { 0, - -224, -247, -239, -236, -232, -222, -204, -200, -181, -177, - 0, 0, 0, -166, 0, -161, -199, 0, 0, 0, - 0, -160, -159, -264, -158, 0, 0, 0, 0, 0, - -157, 0, 0, 0, 0, 0, -167, -162, 0, -156, - 0, -250, -198, -165, -155, -154, -153, -151, -150, -152, - 0, -145, -252, -229, -217, -302, 0, -144, -146, 0, - 0, -142, -141, -140, -139, -137, 0, -136, -135, 0, - -134, 0, -133, -132, -130, -131, -128, 0, -249, -127, - 0, 0, 0, -126, 0, 0, 0, -125, -152, -152, - -152, -205, -152, 0, -124, 0, -152, -152, 0, -152, - 0, -143, 0, -173, 0, -171, 0, -152, -123, -152, - -152, 0, 0, -152, -152, -152, 0, 0, -138, 0, - -164, -164, -122, 0, 0, 0, 0, 0, -121, -120, - -118, -148, 0, -117, 0, -116, -115, -114, -113, -112, - 0, -163, -111, 0, -110, -109, 0, -107, -106, -105, - -104, -103, -129, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -101, 0, 0, 0, 0, 0, -100, -102, - 0, -98, -102, 0, 0, 0, 0, 0, 0, -99, - -97, 0, 0, -95, 0, -96, -94, -92, 0, -152, - -93, 0, -91, -90, 0, -88, -87, -86, 0, -}; -static const short yyrindex[] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -83, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -82, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -81, -80, 0, -158, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; -static const short yygindex[] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 16, -89, - -25, 35, 47, 0, -}; -#define YYTABLESIZE 190 -static const short yytable[] = { 129, - 130, 131, 104, 134, 59, 60, 76, 136, 137, 77, - 138, 78, 79, 105, 106, 107, 98, 99, 146, 123, - 148, 149, 36, 124, 150, 151, 152, 46, 47, 37, - 49, 2, 38, 52, 53, 54, 55, 39, 58, 100, - 101, 62, 63, 64, 65, 66, 40, 68, 69, 3, - 4, 102, 103, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 81, 132, 133, 41, 82, 83, 42, 14, - 51, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 43, 31, 32, - 33, 44, 85, 86, 154, 140, 141, 143, 144, 155, - 193, 87, 48, 156, 70, 170, 171, 50, 56, 72, - 57, 61, 67, 89, 90, 91, 74, 163, 93, 94, - 142, 92, 145, 97, 108, 109, 110, 111, 139, 112, - 113, 114, 115, 116, 153, 117, 118, 121, 119, 120, - 122, 180, 126, 127, 128, 135, 147, 186, 160, 161, - 124, 162, 164, 165, 166, 167, 168, 159, 173, 169, - 174, 172, 175, 176, 177, 178, 179, 181, 158, 182, - 183, 185, 190, 187, 189, 188, 191, 192, 195, 194, - 196, 0, 0, 198, 197, 73, 199, 49, 56, 58, -}; -static const short yycheck[] = { 89, - 90, 91, 305, 93, 269, 270, 257, 97, 98, 260, - 100, 262, 263, 316, 317, 318, 269, 270, 108, 269, - 110, 111, 270, 273, 114, 115, 116, 12, 13, 269, - 15, 256, 269, 18, 19, 20, 21, 270, 23, 269, - 270, 26, 27, 28, 29, 30, 269, 32, 33, 274, - 275, 269, 270, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 261, 269, 270, 270, 265, 266, 269, 294, - 270, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 269, 313, 314, - 315, 269, 258, 259, 259, 269, 270, 269, 270, 264, - 190, 267, 269, 268, 272, 269, 270, 269, 269, 272, - 270, 270, 270, 269, 269, 269, 273, 266, 269, 272, - 105, 273, 107, 269, 269, 272, 269, 269, 272, 270, - 270, 269, 269, 269, 273, 270, 270, 269, 271, 270, - 269, 271, 270, 270, 270, 270, 270, 173, 270, 270, - 273, 270, 270, 270, 270, 270, 270, 123, 269, 272, - 270, 273, 270, 270, 270, 270, 270, 269, 122, 270, - 273, 270, 269, 273, 270, 273, 271, 270, 270, 273, - 271, -1, -1, 271, 273, 269, 273, 270, 270, 270, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 319 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"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, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"A","B","C","E","F","I","L","N", -"P","R","S","T","SP","CRLF","COMMA","STRING","NUMBER","USER","PASS","ACCT", -"REIN","QUIT","PORT","PASV","TYPE","STRU","MODE","RETR","STOR","APPE","MLFL", -"MAIL","MSND","MSOM","MSAM","MRSQ","MRCP","ALLO","REST","RNFR","RNTO","ABOR", -"DELE","CWD","LIST","NLST","SITE","STAT","HELP","NOOP","MKD","RMD","PWD","CDUP", -"STOU","SMNT","SYST","SIZE","MDTM","UMASK","IDLE","CHMOD","LEXERR", -"illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : cmd_list", -"cmd_list :", -"cmd_list : cmd_list cmd", -"cmd_list : cmd_list rcmd", -"cmd : USER SP username CRLF", -"cmd : PASS SP password CRLF", -"cmd : PORT SP host_port CRLF", -"cmd : PASV CRLF", -"cmd : TYPE SP type_code CRLF", -"cmd : STRU SP struct_code CRLF", -"cmd : MODE SP mode_code CRLF", -"cmd : ALLO SP NUMBER CRLF", -"cmd : ALLO SP NUMBER SP R SP NUMBER CRLF", -"cmd : RETR check_login SP pathname CRLF", -"cmd : STOR check_login SP pathname CRLF", -"cmd : APPE check_login SP pathname CRLF", -"cmd : NLST check_login CRLF", -"cmd : NLST check_login SP STRING CRLF", -"cmd : LIST check_login CRLF", -"cmd : LIST check_login SP pathname CRLF", -"cmd : STAT check_login SP pathname CRLF", -"cmd : STAT CRLF", -"cmd : DELE check_login SP pathname CRLF", -"cmd : RNTO SP pathname CRLF", -"cmd : ABOR CRLF", -"cmd : CWD check_login CRLF", -"cmd : CWD check_login SP pathname CRLF", -"cmd : HELP CRLF", -"cmd : HELP SP STRING CRLF", -"cmd : NOOP CRLF", -"cmd : MKD check_login SP pathname CRLF", -"cmd : RMD check_login SP pathname CRLF", -"cmd : PWD check_login CRLF", -"cmd : CDUP check_login CRLF", -"cmd : SITE SP HELP CRLF", -"cmd : SITE SP HELP SP STRING CRLF", -"cmd : SITE SP UMASK check_login CRLF", -"cmd : SITE SP UMASK check_login SP octal_number CRLF", -"cmd : SITE SP CHMOD check_login SP octal_number SP pathname CRLF", -"cmd : SITE SP IDLE CRLF", -"cmd : SITE SP IDLE SP NUMBER CRLF", -"cmd : STOU check_login SP pathname CRLF", -"cmd : SYST CRLF", -"cmd : SIZE check_login SP pathname CRLF", -"cmd : MDTM check_login SP pathname CRLF", -"cmd : QUIT CRLF", -"cmd : error CRLF", -"rcmd : RNFR check_login SP pathname CRLF", -"username : STRING", -"password :", -"password : STRING", -"byte_size : NUMBER", -"host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER", -"form_code : N", -"form_code : T", -"form_code : C", -"type_code : A", -"type_code : A SP form_code", -"type_code : E", -"type_code : E SP form_code", -"type_code : I", -"type_code : L", -"type_code : L SP byte_size", -"type_code : L byte_size", -"struct_code : F", -"struct_code : R", -"struct_code : P", -"mode_code : S", -"mode_code : B", -"mode_code : C", -"pathname : pathstring", -"pathstring : STRING", -"octal_number : NUMBER", -"check_login :", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 707 "ftp.y" - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -extern jmp_buf errcatch; - -static void upper(char *); - -#define CMD 0 /* beginning of command */ -#define ARGS 1 /* expect miscellaneous arguments */ -#define STR1 2 /* expect SP followed by STRING */ -#define STR2 3 /* expect STRING */ -#define OSTR 4 /* optional SP then STRING */ -#define ZSTR1 5 /* SP then optional STRING */ -#define ZSTR2 6 /* optional STRING after SP */ -#define SITECMD 7 /* SITE command */ -#define NSTR 8 /* Number followed by a string */ - -struct tab cmdtab[] = { /* In order defined in RFC 765 */ - { "USER", USER, STR1, 1, " username" }, - { "PASS", PASS, ZSTR1, 1, " password" }, - { "ACCT", ACCT, STR1, 0, "(specify account)" }, - { "SMNT", SMNT, ARGS, 0, "(structure mount)" }, - { "REIN", REIN, ARGS, 0, "(reinitialize server state)" }, - { "QUIT", QUIT, ARGS, 1, "(terminate service)", }, - { "PORT", PORT, ARGS, 1, " b0, b1, b2, b3, b4" }, - { "PASV", PASV, ARGS, 1, "(set server in passive mode)" }, - { "TYPE", TYPE, ARGS, 1, " [ A | E | I | L ]" }, - { "STRU", STRU, ARGS, 1, "(specify file structure)" }, - { "MODE", MODE, ARGS, 1, "(specify transfer mode)" }, - { "RETR", RETR, STR1, 1, " file-name" }, - { "STOR", STOR, STR1, 1, " file-name" }, - { "APPE", APPE, STR1, 1, " file-name" }, - { "MLFL", MLFL, OSTR, 0, "(mail file)" }, - { "MAIL", MAIL, OSTR, 0, "(mail to user)" }, - { "MSND", MSND, OSTR, 0, "(mail send to terminal)" }, - { "MSOM", MSOM, OSTR, 0, "(mail send to terminal or mailbox)" }, - { "MSAM", MSAM, OSTR, 0, "(mail send to terminal and mailbox)" }, - { "MRSQ", MRSQ, OSTR, 0, "(mail recipient scheme question)" }, - { "MRCP", MRCP, STR1, 0, "(mail recipient)" }, - { "ALLO", ALLO, ARGS, 1, "allocate storage (vacuously)" }, - { "REST", REST, ARGS, 0, "(restart command)" }, - { "RNFR", RNFR, STR1, 1, " file-name" }, - { "RNTO", RNTO, STR1, 1, " file-name" }, - { "ABOR", ABOR, ARGS, 1, "(abort operation)" }, - { "DELE", DELE, STR1, 1, " file-name" }, - { "CWD", CWD, OSTR, 1, "[ directory-name ]" }, - { "XCWD", CWD, OSTR, 1, "[ directory-name ]" }, - { "LIST", LIST, OSTR, 1, "[ path-name ]" }, - { "NLST", NLST, OSTR, 1, "[ path-name ]" }, - { "SITE", SITE, SITECMD, 1, "site-cmd [ arguments ]" }, - { "SYST", SYST, ARGS, 1, "(get type of operating system)" }, - { "STAT", STAT, OSTR, 1, "[ path-name ]" }, - { "HELP", HELP, OSTR, 1, "[ ]" }, - { "NOOP", NOOP, ARGS, 1, "" }, - { "MKD", MKD, STR1, 1, " path-name" }, - { "XMKD", MKD, STR1, 1, " path-name" }, - { "RMD", RMD, STR1, 1, " path-name" }, - { "XRMD", RMD, STR1, 1, " path-name" }, - { "PWD", PWD, ARGS, 1, "(return current directory)" }, - { "XPWD", PWD, ARGS, 1, "(return current directory)" }, - { "CDUP", CDUP, ARGS, 1, "(change to parent directory)" }, - { "XCUP", CDUP, ARGS, 1, "(change to parent directory)" }, - { "STOU", STOU, STR1, 1, " file-name" }, - { "SIZE", SIZE, OSTR, 1, " path-name" }, - { "MDTM", MDTM, OSTR, 1, " path-name" }, - { 0, 0, 0, 0, 0 } -}; - -struct tab sitetab[] = { - { "UMASK", UMASK, ARGS, 1, "[ umask ]" }, - { "IDLE", IDLE, ARGS, 1, "[ maximum-idle-time ]" }, - { "CHMOD", CHMOD, NSTR, 1, " mode file-name" }, - { "HELP", HELP, OSTR, 1, "[ ]" }, - { 0, 0, 0, 0, 0 } -}; - -static struct tab * -lookup(struct tab *p, char *cmd) -{ - - for (; p->name != 0; p++) - if (strcmp(cmd, p->name) == 0) - return (p); - return (0); -} - -#include - -/* - * get_line - a hacked up version of fgets to ignore TELNET escape codes. - */ -static char * -get_line(char *s, int n, FILE *iop) -{ - register int c; - register char *cs; - - cs = s; -/* tmpline may contain saved command from urgent mode interruption */ - for (c = 0; tmpline[c] != '\0' && --n > 0; ++c) { - *cs++ = tmpline[c]; - if (tmpline[c] == '\n') { - *cs = '\0'; - if (debug) - syslog(LOG_DEBUG, "command: %s", s); - tmpline[0] = '\0'; - return(s); - } - if (c == 0) - tmpline[0] = '\0'; - } - while ((c = getc(iop)) != EOF) { - c &= 0377; - if (c == IAC) { - if ((c = getc(iop)) != EOF) { - c &= 0377; - switch (c) { - case WILL: - case WONT: - c = getc(iop); - printf("%c%c%c", IAC, DONT, 0377&c); - (void) fflush(stdout); - continue; - case DO: - case DONT: - c = getc(iop); - printf("%c%c%c", IAC, WONT, 0377&c); - (void) fflush(stdout); - continue; - case IAC: - break; - default: - continue; /* ignore command */ - } - } - } - *cs++ = c; - if (--n <= 0 || c == '\n') - break; - } - if (c == EOF && cs == s) - return (0); - *cs = '\0'; - if (debug) - syslog(LOG_DEBUG, "command: %s", s); - return (s); -} - -static void -toolong(int sig) -{ - time_t now; - - (void) sig; - reply(421, - "Timeout (%d seconds): closing control connection.", timeout); - (void) time(&now); - if (logging) { - syslog(LOG_INFO, - "User %s timed out after %d seconds at %s", - (pw ? pw -> pw_name : "unknown"), timeout, ctime(&now)); - } - dologout(1); -} - -int -yylex(void) -{ - static int cpos, state; - register char *cp, *cp2; - register struct tab *p; - int n; - char c; - - for (;;) { - switch (state) { - - case CMD: - (void) signal(SIGALRM, toolong); - (void) alarm((unsigned) timeout); - if (get_line(cbuf, sizeof(cbuf)-1, stdin) == 0) { - reply(221, "You could at least say goodbye."); - dologout(0); - } - (void) alarm(0); -#ifdef SETPROCTITLE - if (strncasecmp(cbuf, "PASS", 4) != 0) - setproctitle("%s: %s", proctitle, cbuf); -#endif /* SETPROCTITLE */ - if ((cp = strchr(cbuf, '\r'))) { - *cp++ = '\n'; - *cp = '\0'; - } - if ((cp = strpbrk(cbuf, " \n"))) - cpos = cp - cbuf; - if (cpos == 0) - cpos = 4; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - upper(cbuf); - p = lookup(cmdtab, cbuf); - cbuf[cpos] = c; - if (p != 0) { - if (p->implemented == 0) { - nack(p->name); - longjmp(errcatch,0); - /* NOTREACHED */ - } - state = p->state; - *(const char **)(&yylval) = p->name; - return (p->token); - } - break; - - case SITECMD: - if (cbuf[cpos] == ' ') { - cpos++; - return (SP); - } - cp = &cbuf[cpos]; - if ((cp2 = strpbrk(cp, " \n"))) - cpos = cp2 - cbuf; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - upper(cp); - p = lookup(sitetab, cp); - cbuf[cpos] = c; - if (p != 0) { - if (p->implemented == 0) { - state = CMD; - nack(p->name); - longjmp(errcatch,0); - /* NOTREACHED */ - } - state = p->state; - *(const char **)(&yylval) = p->name; - return (p->token); - } - state = CMD; - break; - - case OSTR: - if (cbuf[cpos] == '\n') { - state = CMD; - return (CRLF); - } - /* FALLTHROUGH */ - - case STR1: - case ZSTR1: - dostr1: - if (cbuf[cpos] == ' ') { - cpos++; - if (state == OSTR) - state = STR2; - else - ++state; - return (SP); - } - break; - - case ZSTR2: - if (cbuf[cpos] == '\n') { - state = CMD; - return (CRLF); - } - /* FALLTHROUGH */ - - case STR2: - cp = &cbuf[cpos]; - n = strlen(cp); - cpos += n - 1; - /* - * Make sure the string is nonempty and \n terminated. - */ - if (n > 1 && cbuf[cpos] == '\n') { - cbuf[cpos] = '\0'; - *(char **)&yylval = copy(cp); - cbuf[cpos] = '\n'; - state = ARGS; - return (STRING); - } - break; - - case NSTR: - if (cbuf[cpos] == ' ') { - cpos++; - return (SP); - } - if (isdigit(cbuf[cpos])) { - cp = &cbuf[cpos]; - while (isdigit(cbuf[++cpos])) - ; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - yylval = atoi(cp); - cbuf[cpos] = c; - state = STR1; - return (NUMBER); - } - state = STR1; - goto dostr1; - - case ARGS: - if (isdigit(cbuf[cpos])) { - cp = &cbuf[cpos]; - while (isdigit(cbuf[++cpos])) - ; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - yylval = atoi(cp); - cbuf[cpos] = c; - return (NUMBER); - } - switch (cbuf[cpos++]) { - - case '\n': - state = CMD; - return (CRLF); - - case ' ': - return (SP); - - case ',': - return (COMMA); - - case 'A': - case 'a': - return (A); - - case 'B': - case 'b': - return (B); - - case 'C': - case 'c': - return (C); - - case 'E': - case 'e': - return (E); - - case 'F': - case 'f': - return (F); - - case 'I': - case 'i': - return (I); - - case 'L': - case 'l': - return (L); - - case 'N': - case 'n': - return (N); - - case 'P': - case 'p': - return (P); - - case 'R': - case 'r': - return (R); - - case 'S': - case 's': - return (S); - - case 'T': - case 't': - return (T); - - } - break; - - default: - fatal("Unknown state in scanner."); - } - yyerror((char *) 0); - state = CMD; - longjmp(errcatch,0); - } -} - -static void -upper(char *s) -{ - while (*s != '\0') { - if (islower(*s)) - *s = toupper(*s); - s++; - } -} - -static char * -copy(const char *s) -{ - char *p; - - p = (char * )malloc(strlen(s) + 1); - if (p == 0) - fatal("Ran out of memory."); - else - (void) strcpy(p, s); - return (p); -} - -static void -help(struct tab *ctab, char *s) -{ - register struct tab *c; - register int width, NCMDS; - const char *help_type; - - if (ctab == sitetab) - help_type = "SITE "; - else - help_type = ""; - width = 0, NCMDS = 0; - for (c = ctab; c->name != 0; c++) { - int len = strlen(c->name); - - if (len > width) - width = len; - NCMDS++; - } - width = (width + 8) &~ 7; - if (s == 0) { - register int i, j, w; - int columns, lines; - - lreply(214, "The following %scommands are recognized %s.", - help_type, "(* =>'s unimplemented)"); - columns = 76 / width; - if (columns == 0) - columns = 1; - lines = (NCMDS + columns - 1) / columns; - for (i = 0; i < lines; i++) { - printf(" "); - for (j = 0; j < columns; j++) { - c = ctab + j * lines + i; - assert(c->name != 0); - printf("%s%c", c->name, - c->implemented ? ' ' : '*'); - if (c + lines >= &ctab[NCMDS]) - break; - w = strlen(c->name) + 1; - while (w < width) { - putchar(' '); - w++; - } - } - printf("\r\n"); - } - (void) fflush(stdout); - reply(214, "Direct comments to ftp-bugs@%s.", hostname); - return; - } - upper(s); - c = lookup(ctab, s); - if (c == (struct tab *)0) { - reply(502, "Unknown command %s.", s); - return; - } - if (c->implemented) - reply(214, "Syntax: %s%s %s", help_type, c->name, c->help); - else - reply(214, "%s%-*s\t%s; unimplemented.", help_type, width, - c->name, c->help); -} - -static void -sizecmd(char *filename) -{ - switch (type) { - case TYPE_L: - case TYPE_I: { - struct stat stbuf; - if (stat(filename, &stbuf) < 0 || - (stbuf.st_mode&S_IFMT) != S_IFREG) - reply(550, "%s: not a plain file.", filename); - else -#ifdef HAVE_LONG_LONG - reply(213, "%llu", (long long) stbuf.st_size); -#else - reply(213, "%lu", stbuf.st_size); -#endif - break;} - case TYPE_A: { - FILE *fin; - register int c, count; - struct stat stbuf; - fin = fopen(filename, "r"); - if (fin == 0) { - perror_reply(550, filename); - return; - } - if (fstat(fileno(fin), &stbuf) < 0 || - (stbuf.st_mode&S_IFMT) != S_IFREG) { - reply(550, "%s: not a plain file.", filename); - (void) fclose(fin); - return; - } - - count = 0; - while((c=getc(fin)) != EOF) { - if (c == '\n') /* will get expanded to \r\n */ - count++; - count++; - } - (void) fclose(fin); - - reply(213, "%ld", count); - break;} - default: - reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]); - } -} -#line 1013 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 2: -#line 150 "ftp.y" - { - fromname = (char *) 0; - } -break; -case 4: -#line 157 "ftp.y" - { - user((char *) yystack.l_mark[-1]); - free((char *) yystack.l_mark[-1]); - } -break; -case 5: -#line 162 "ftp.y" - { - pass((char *) yystack.l_mark[-1]); - free((char *) yystack.l_mark[-1]); - } -break; -case 6: -#line 167 "ftp.y" - { - usedefault = 0; - if (pdata >= 0) { - (void) close(pdata); - pdata = -1; - } - reply(200, "PORT command successful."); - } -break; -case 7: -#line 176 "ftp.y" - { - passive(); - } -break; -case 8: -#line 180 "ftp.y" - { - switch (cmd_type) { - - case TYPE_A: - if (cmd_form == FORM_N) { - reply(200, "Type set to A."); - type = cmd_type; - form = cmd_form; - } else - reply(504, "Form must be N."); - break; - - case TYPE_E: - reply(504, "Type E not implemented."); - break; - - case TYPE_I: - reply(200, "Type set to I."); - type = cmd_type; - break; - - case TYPE_L: -#if NBBY == 8 - if (cmd_bytesz == 8) { - reply(200, - "Type set to L (byte size 8)."); - type = cmd_type; - } else - reply(504, "Byte size must be 8."); -#else /* NBBY == 8 */ - UNIMPLEMENTED for NBBY != 8 -#endif /* NBBY == 8 */ - } - } -break; -case 9: -#line 215 "ftp.y" - { - switch (yystack.l_mark[-1]) { - - case STRU_F: - reply(200, "STRU F ok."); - break; - - default: - reply(504, "Unimplemented STRU type."); - } - } -break; -case 10: -#line 227 "ftp.y" - { - switch (yystack.l_mark[-1]) { - - case MODE_S: - reply(200, "MODE S ok."); - break; - - default: - reply(502, "Unimplemented MODE type."); - } - } -break; -case 11: -#line 239 "ftp.y" - { - reply(202, "ALLO command ignored."); - } -break; -case 12: -#line 243 "ftp.y" - { - reply(202, "ALLO command ignored."); - } -break; -case 13: -#line 247 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - retrieve((char *) 0, (char *) yystack.l_mark[-1]); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 14: -#line 254 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - store((char *) yystack.l_mark[-1], "w", 0); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 15: -#line 261 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - store((char *) yystack.l_mark[-1], "a", 0); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 16: -#line 268 "ftp.y" - { - if (yystack.l_mark[-1]) - send_file_list("."); - } -break; -case 17: -#line 273 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - send_file_list((char *) yystack.l_mark[-1]); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 18: -#line 280 "ftp.y" - { - if (yystack.l_mark[-1]) - retrieve("/bin/ls -lgA", ""); - } -break; -case 19: -#line 285 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - retrieve("/bin/ls -lgA %s", (char *) yystack.l_mark[-1]); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 20: -#line 292 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - statfilecmd((char *) yystack.l_mark[-1]); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 21: -#line 299 "ftp.y" - { - statcmd(); - } -break; -case 22: -#line 303 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - remove((char *) yystack.l_mark[-1]); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 23: -#line 310 "ftp.y" - { - if (fromname) { - renamecmd(fromname, (char *) yystack.l_mark[-1]); - free(fromname); - fromname = (char *) 0; - } else { - reply(503, "Bad sequence of commands."); - } - free((char *) yystack.l_mark[-1]); - } -break; -case 24: -#line 321 "ftp.y" - { - reply(225, "ABOR command successful."); - } -break; -case 25: -#line 325 "ftp.y" - { - if (yystack.l_mark[-1]) - cwd(pw->pw_dir); - } -break; -case 26: -#line 330 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - cwd((char *) yystack.l_mark[-1]); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 27: -#line 337 "ftp.y" - { - help(cmdtab, (char *) 0); - } -break; -case 28: -#line 341 "ftp.y" - { - register char *cp = (char *)yystack.l_mark[-1]; - - if (strncasecmp(cp, "SITE", 4) == 0) { - cp = (char *)yystack.l_mark[-1] + 4; - if (*cp == ' ') - cp++; - if (*cp) - help(sitetab, cp); - else - help(sitetab, (char *) 0); - } else - help(cmdtab, (char *) yystack.l_mark[-1]); - } -break; -case 29: -#line 356 "ftp.y" - { - reply(200, "NOOP command successful."); - } -break; -case 30: -#line 360 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - makedir((char *) yystack.l_mark[-1]); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 31: -#line 367 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - removedir((char *) yystack.l_mark[-1]); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 32: -#line 374 "ftp.y" - { - if (yystack.l_mark[-1]) - pwd(); - } -break; -case 33: -#line 379 "ftp.y" - { - if (yystack.l_mark[-1]) - cwd(".."); - } -break; -case 34: -#line 384 "ftp.y" - { - help(sitetab, (char *) 0); - } -break; -case 35: -#line 388 "ftp.y" - { - help(sitetab, (char *) yystack.l_mark[-1]); - } -break; -case 36: -#line 392 "ftp.y" - { - int oldmask; - - if (yystack.l_mark[-1]) { - oldmask = umask(0); - (void) umask(oldmask); - reply(200, "Current UMASK is %03o", oldmask); - } - } -break; -case 37: -#line 402 "ftp.y" - { - int oldmask; - - if (yystack.l_mark[-3]) { - if ((yystack.l_mark[-1] == -1) || (yystack.l_mark[-1] > 0777)) { - reply(501, "Bad UMASK value"); - } else { - oldmask = umask(yystack.l_mark[-1]); - reply(200, - "UMASK set to %03o (was %03o)", - yystack.l_mark[-1], oldmask); - } - } - } -break; -case 38: -#line 417 "ftp.y" - { - if (yystack.l_mark[-5] && (yystack.l_mark[-1] != 0)) { - if (yystack.l_mark[-3] > 0777) - reply(501, - "CHMOD: Mode value must be between 0 and 0777"); - else if (chmod((char *) yystack.l_mark[-1], yystack.l_mark[-3]) < 0) - perror_reply(550, (char *) yystack.l_mark[-1]); - else - reply(200, "CHMOD command successful."); - } - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 39: -#line 431 "ftp.y" - { - reply(200, - "Current IDLE time limit is %d seconds; max %d", - timeout, maxtimeout); - } -break; -case 40: -#line 437 "ftp.y" - { - if (yystack.l_mark[-1] < 30 || yystack.l_mark[-1] > maxtimeout) { - reply(501, - "Maximum IDLE time must be between 30 and %d seconds", - maxtimeout); - } else { - timeout = yystack.l_mark[-1]; - (void) alarm((unsigned) timeout); - reply(200, - "Maximum IDLE time set to %d seconds", - timeout); - } - } -break; -case 41: -#line 451 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - store((char *) yystack.l_mark[-1], "w", 1); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 42: -#line 458 "ftp.y" - { -#ifdef unix -#ifdef BSD - reply(215, "UNIX Type: L%d Version: BSD-%d", - NBBY, BSD); -#else /* BSD */ - reply(215, "UNIX Type: L%d", NBBY); -#endif /* BSD */ -#else /* unix */ - reply(215, "UNKNOWN Type: L%d", NBBY); -#endif /* unix */ - } -break; -case 43: -#line 479 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) - sizecmd((char *) yystack.l_mark[-1]); - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 44: -#line 496 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1] != 0) { - struct stat stbuf; - if (stat((char *) yystack.l_mark[-1], &stbuf) < 0) - perror_reply(550, "%s", (char *) yystack.l_mark[-1]); - else if ((stbuf.st_mode&S_IFMT) != S_IFREG) { - reply(550, "%s: not a plain file.", - (char *) yystack.l_mark[-1]); - } else { - register struct tm *t; - t = gmtime(&stbuf.st_mtime); - reply(213, - "%04d%02d%02d%02d%02d%02d", - 1900 + t->tm_year, - t->tm_mon+1, t->tm_mday, - t->tm_hour, t->tm_min, t->tm_sec); - } - } - if (yystack.l_mark[-1] != 0) - free((char *) yystack.l_mark[-1]); - } -break; -case 45: -#line 518 "ftp.y" - { - reply(221, "Goodbye."); - dologout(0); - } -break; -case 46: -#line 523 "ftp.y" - { - yyerrok; - } -break; -case 47: -#line 528 "ftp.y" - { - if (yystack.l_mark[-3] && yystack.l_mark[-1]) { - fromname = renamefrom((char *) yystack.l_mark[-1]); - if (fromname == (char *) 0 && yystack.l_mark[-1]) { - free((char *) yystack.l_mark[-1]); - } - } - } -break; -case 49: -#line 542 "ftp.y" - { - *(const char **)(&(yyval)) = ""; - } -break; -case 52: -#line 553 "ftp.y" - { - register char *a, *p; - - a = (char *)&data_dest.sin_addr; - a[0] = yystack.l_mark[-10]; a[1] = yystack.l_mark[-8]; a[2] = yystack.l_mark[-6]; a[3] = yystack.l_mark[-4]; - p = (char *)&data_dest.sin_port; - p[0] = yystack.l_mark[-2]; p[1] = yystack.l_mark[0]; - data_dest.sin_family = AF_INET; - } -break; -case 53: -#line 565 "ftp.y" - { - yyval = FORM_N; - } -break; -case 54: -#line 569 "ftp.y" - { - yyval = FORM_T; - } -break; -case 55: -#line 573 "ftp.y" - { - yyval = FORM_C; - } -break; -case 56: -#line 579 "ftp.y" - { - cmd_type = TYPE_A; - cmd_form = FORM_N; - } -break; -case 57: -#line 584 "ftp.y" - { - cmd_type = TYPE_A; - cmd_form = yystack.l_mark[0]; - } -break; -case 58: -#line 589 "ftp.y" - { - cmd_type = TYPE_E; - cmd_form = FORM_N; - } -break; -case 59: -#line 594 "ftp.y" - { - cmd_type = TYPE_E; - cmd_form = yystack.l_mark[0]; - } -break; -case 60: -#line 599 "ftp.y" - { - cmd_type = TYPE_I; - } -break; -case 61: -#line 603 "ftp.y" - { - cmd_type = TYPE_L; - cmd_bytesz = NBBY; - } -break; -case 62: -#line 608 "ftp.y" - { - cmd_type = TYPE_L; - cmd_bytesz = yystack.l_mark[0]; - } -break; -case 63: -#line 614 "ftp.y" - { - cmd_type = TYPE_L; - cmd_bytesz = yystack.l_mark[0]; - } -break; -case 64: -#line 621 "ftp.y" - { - yyval = STRU_F; - } -break; -case 65: -#line 625 "ftp.y" - { - yyval = STRU_R; - } -break; -case 66: -#line 629 "ftp.y" - { - yyval = STRU_P; - } -break; -case 67: -#line 635 "ftp.y" - { - yyval = MODE_S; - } -break; -case 68: -#line 639 "ftp.y" - { - yyval = MODE_B; - } -break; -case 69: -#line 643 "ftp.y" - { - yyval = MODE_C; - } -break; -case 70: -#line 649 "ftp.y" - { - /* - * Problem: this production is used for all pathname - * processing, but only gives a 550 error reply. - * This is a valid reply in some cases but not in others. - */ - if (logged_in && yystack.l_mark[0] && strncmp((char *) yystack.l_mark[0], "~", 1) == 0) { - *(char **)&(yyval) = *glob((char *) yystack.l_mark[0]); - if (globerr != 0) { - reply(550, globerr); - yyval = 0; - } - free((char *) yystack.l_mark[0]); - } else - yyval = yystack.l_mark[0]; - } -break; -case 72: -#line 671 "ftp.y" - { - register int ret, dec, multby, digit; - - /* - * Convert a number that was read as decimal number - * to what it would be if it had been read as octal. - */ - dec = yystack.l_mark[0]; - multby = 1; - ret = 0; - while (dec) { - digit = dec%10; - if (digit > 7) { - ret = -1; - break; - } - ret += digit * multby; - multby *= 8; - dec /= 10; - } - yyval = ret; - } -break; -case 73: -#line 696 "ftp.y" - { - if (logged_in) - yyval = 1; - else { - reply(530, "Please login with USER and PASS."); - yyval = 0; - } - } -break; -#line 1852 "/dev/stdout" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.07.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.06.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.06.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.06.out (nonexistent) @@ -1,417 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 2 "error.y" -int yylex(void); -static void yyerror(const char *); -#line 22 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, -}; -static const short yylen[] = { 2, - 1, -}; -static const short yydefred[] = { 0, - 1, 0, -}; -static const short yydgoto[] = { 2, -}; -static const short yysindex[] = { -256, - 0, 0, -}; -static const short yyrindex[] = { 0, - 0, 0, -}; -static const short yygindex[] = { 0, -}; -#define YYTABLESIZE 0 -static const short yytable[] = { 1, -}; -static const short yycheck[] = { 256, -}; -#define YYFINAL 2 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 0 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : S", -"S : error", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 8 "error.y" - -#include - -int -main(void) -{ - printf("yyparse() = %d\n", yyparse()); - return 0; -} - -int -yylex(void) -{ - return -1; -} - -static void -yyerror(const char* s) -{ - printf("%s\n", s); -} -#line 156 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.06.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.05.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.05.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.05.out (nonexistent) @@ -1,425 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 2 "code_error.y" - -#ifdef YYBISON -int yylex(void); -static void yyerror(const char *); -#endif - -#line 26 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, -}; -static const short yylen[] = { 2, - 1, -}; -static const short yydefred[] = { 0, - 1, 0, -}; -static const short yydgoto[] = { 2, -}; -static const short yysindex[] = { -256, - 0, 0, -}; -static const short yyrindex[] = { 0, - 0, 0, -}; -static const short yygindex[] = { 0, -}; -#define YYTABLESIZE 0 -static const short yytable[] = { 1, -}; -static const short yycheck[] = { 256, -}; -#define YYFINAL 2 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 0 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : S", -"S : error", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 12 "code_error.y" - -#include - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -int -main(void) -{ - printf("yyparse() = %d\n", yyparse()); - return 0; -} - -int -yylex(void) -{ - return -1; -} - -static void -yyerror(const char* s) -{ - printf("%s\n", s); -} -#line 164 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.05.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.04.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.04.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.04.out (nonexistent) @@ -1,595 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 2 "code_calc.y" -# include -# include - -int regs[26]; -int base; - -#ifdef YYBISON -int yylex(void); -static void yyerror(const char *s); -#endif - -#line 31 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define DIGIT 257 -#define LETTER 258 -#define UMINUS 259 -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 3, 3, -}; -static const short yylen[] = { 2, - 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 1, 1, 1, 2, -}; -static const short yydefred[] = { 1, - 0, 0, 17, 0, 0, 0, 0, 0, 0, 3, - 0, 15, 14, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, - 10, 11, -}; -static const short yydgoto[] = { 1, - 7, 8, 9, -}; -static const short yysindex[] = { 0, - -40, -7, 0, -55, -38, -38, 1, -29, -247, 0, - -38, 0, 0, 22, 0, -38, -38, -38, -38, -38, - -38, -38, 0, -29, 0, 51, 60, -20, -20, 0, - 0, 0, -}; -static const short yyrindex[] = { 0, - 0, 0, 0, 2, 0, 0, 0, 9, -9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 10, 0, -6, 14, 5, 13, 0, - 0, 0, -}; -static const short yygindex[] = { 0, - 0, 65, 0, -}; -#define YYTABLESIZE 220 -static const short yytable[] = { 6, - 16, 6, 10, 13, 5, 11, 5, 22, 17, 23, - 15, 15, 20, 18, 7, 19, 22, 21, 4, 5, - 0, 20, 8, 12, 0, 0, 21, 16, 16, 0, - 0, 16, 16, 16, 13, 16, 0, 16, 15, 15, - 0, 0, 7, 15, 15, 7, 15, 7, 15, 7, - 8, 12, 0, 8, 12, 8, 0, 8, 22, 17, - 0, 0, 25, 20, 18, 0, 19, 0, 21, 13, - 14, 0, 0, 0, 0, 24, 0, 0, 0, 0, - 26, 27, 28, 29, 30, 31, 32, 22, 17, 0, - 0, 0, 20, 18, 16, 19, 22, 21, 0, 0, - 0, 20, 18, 0, 19, 0, 21, 0, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 13, 0, 0, - 0, 0, 0, 0, 0, 15, 0, 0, 7, 0, - 0, 0, 0, 0, 0, 0, 8, 12, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 2, 3, 4, 3, 12, -}; -static const short yycheck[] = { 40, - 10, 40, 10, 10, 45, 61, 45, 37, 38, 257, - 10, 10, 42, 43, 10, 45, 37, 47, 10, 10, - -1, 42, 10, 10, -1, -1, 47, 37, 38, -1, - -1, 41, 42, 43, 41, 45, -1, 47, 37, 38, - -1, -1, 38, 42, 43, 41, 45, 43, 47, 45, - 38, 38, -1, 41, 41, 43, -1, 45, 37, 38, - -1, -1, 41, 42, 43, -1, 45, -1, 47, 5, - 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, - 16, 17, 18, 19, 20, 21, 22, 37, 38, -1, - -1, -1, 42, 43, 124, 45, 37, 47, -1, -1, - -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, - -1, -1, -1, -1, 124, -1, -1, 124, -1, -1, - -1, -1, -1, -1, -1, 124, -1, -1, 124, -1, - -1, -1, -1, -1, -1, -1, 124, 124, -1, -1, - -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 256, 257, 258, 257, 258, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 259 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0, -0,0,0,0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : list", -"list :", -"list : list stat '\\n'", -"list : list error '\\n'", -"stat : expr", -"stat : LETTER '=' expr", -"expr : '(' expr ')'", -"expr : expr '+' expr", -"expr : expr '-' expr", -"expr : expr '*' expr", -"expr : expr '/' expr", -"expr : expr '%' expr", -"expr : expr '&' expr", -"expr : expr '|' expr", -"expr : '-' expr", -"expr : LETTER", -"expr : number", -"number : DIGIT", -"number : number DIGIT", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 68 "code_calc.y" - /* start of programs */ - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) -{ - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} -#line 273 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 3: -#line 30 "code_calc.y" - { yyerrok ; } -break; -case 4: -#line 34 "code_calc.y" - { printf("%d\n",yystack.l_mark[0]);} -break; -case 5: -#line 36 "code_calc.y" - { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; } -break; -case 6: -#line 40 "code_calc.y" - { yyval = yystack.l_mark[-1]; } -break; -case 7: -#line 42 "code_calc.y" - { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; } -break; -case 8: -#line 44 "code_calc.y" - { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; } -break; -case 9: -#line 46 "code_calc.y" - { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; } -break; -case 10: -#line 48 "code_calc.y" - { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; } -break; -case 11: -#line 50 "code_calc.y" - { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; } -break; -case 12: -#line 52 "code_calc.y" - { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; } -break; -case 13: -#line 54 "code_calc.y" - { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; } -break; -case 14: -#line 56 "code_calc.y" - { yyval = - yystack.l_mark[0]; } -break; -case 15: -#line 58 "code_calc.y" - { yyval = regs[yystack.l_mark[0]]; } -break; -case 17: -#line 63 "code_calc.y" - { yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; } -break; -case 18: -#line 65 "code_calc.y" - { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } -break; -#line 535 "/dev/stdout" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.04.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.03.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.03.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.03.out (nonexistent) @@ -1,603 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 1 - -#line 9 "calc3.y" -# include -# include - -#ifdef YYBISON -#define YYSTYPE int -#define YYLEX_PARAM base -#define YYLEX_DECL() yylex(YYSTYPE *yylval, int *YYLEX_PARAM) -#define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s) -int YYLEX_DECL(); -static void YYERROR_DECL(); -#endif - -#line 32 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(int regs[26], int * base) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# ifdef YYLEX_PARAM_TYPE -# define YYLEX_DECL() yylex(YYSTYPE *yylval, YYLEX_PARAM_TYPE YYLEX_PARAM) -# else -# define YYLEX_DECL() yylex(YYSTYPE *yylval, void * YYLEX_PARAM) -# endif -# define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(YYSTYPE *yylval, int * base) -# define YYLEX yylex(&yylval, base) -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(int regs[26], int * base, const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(regs, base, msg) -#endif - -extern int YYPARSE_DECL(); - -#define DIGIT 257 -#define LETTER 258 -#define UMINUS 259 -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 3, 3, -}; -static const short yylen[] = { 2, - 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 1, 1, 1, 2, -}; -static const short yydefred[] = { 1, - 0, 0, 17, 0, 0, 0, 0, 0, 0, 3, - 0, 15, 14, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, - 10, 11, -}; -static const short yydgoto[] = { 1, - 7, 8, 9, -}; -static const short yysindex[] = { 0, - -40, -7, 0, -55, -38, -38, 1, -29, -247, 0, - -38, 0, 0, 22, 0, -38, -38, -38, -38, -38, - -38, -38, 0, -29, 0, 51, 60, -20, -20, 0, - 0, 0, -}; -static const short yyrindex[] = { 0, - 0, 0, 0, 2, 0, 0, 0, 9, -9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 10, 0, -6, 14, 5, 13, 0, - 0, 0, -}; -static const short yygindex[] = { 0, - 0, 65, 0, -}; -#define YYTABLESIZE 220 -static const short yytable[] = { 6, - 16, 6, 10, 13, 5, 11, 5, 22, 17, 23, - 15, 15, 20, 18, 7, 19, 22, 21, 4, 5, - 0, 20, 8, 12, 0, 0, 21, 16, 16, 0, - 0, 16, 16, 16, 13, 16, 0, 16, 15, 15, - 0, 0, 7, 15, 15, 7, 15, 7, 15, 7, - 8, 12, 0, 8, 12, 8, 0, 8, 22, 17, - 0, 0, 25, 20, 18, 0, 19, 0, 21, 13, - 14, 0, 0, 0, 0, 24, 0, 0, 0, 0, - 26, 27, 28, 29, 30, 31, 32, 22, 17, 0, - 0, 0, 20, 18, 16, 19, 22, 21, 0, 0, - 0, 20, 18, 0, 19, 0, 21, 0, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 13, 0, 0, - 0, 0, 0, 0, 0, 15, 0, 0, 7, 0, - 0, 0, 0, 0, 0, 0, 8, 12, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 2, 3, 4, 3, 12, -}; -static const short yycheck[] = { 40, - 10, 40, 10, 10, 45, 61, 45, 37, 38, 257, - 10, 10, 42, 43, 10, 45, 37, 47, 10, 10, - -1, 42, 10, 10, -1, -1, 47, 37, 38, -1, - -1, 41, 42, 43, 41, 45, -1, 47, 37, 38, - -1, -1, 38, 42, 43, 41, 45, 43, 47, 45, - 38, 38, -1, 41, 41, 43, -1, 45, 37, 38, - -1, -1, 41, 42, 43, -1, 45, -1, 47, 5, - 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, - 16, 17, 18, 19, 20, 21, 22, 37, 38, -1, - -1, -1, 42, 43, 124, 45, 37, 47, -1, -1, - -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, - -1, -1, -1, -1, 124, -1, -1, 124, -1, -1, - -1, -1, -1, -1, -1, 124, -1, -1, 124, -1, - -1, -1, -1, -1, -1, -1, 124, 124, -1, -1, - -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 256, 257, 258, 257, 258, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 259 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0, -0,0,0,0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : list", -"list :", -"list : list stat '\\n'", -"list : list error '\\n'", -"stat : expr", -"stat : LETTER '=' expr", -"expr : '(' expr ')'", -"expr : expr '+' expr", -"expr : expr '-' expr", -"expr : expr '*' expr", -"expr : expr '/' expr", -"expr : expr '%' expr", -"expr : expr '&' expr", -"expr : expr '|' expr", -"expr : '-' expr", -"expr : LETTER", -"expr : number", -"number : DIGIT", -"number : number DIGIT", - -}; -#endif - -int yydebug; -int yynerrs; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -#line 76 "calc3.y" - /* start of programs */ - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -int -main (void) -{ - int regs[26]; - int base = 10; - - while(!feof(stdin)) { - yyparse(regs, &base); - } - return 0; -} - -static void -YYERROR_DECL() -{ - fprintf(stderr, "%s\n", s); -} - -int -YYLEX_DECL() -{ - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - *yylval = (c - 'a'); - return ( LETTER ); - } - if( isdigit( c )) { - *yylval = (c - '0') % (*base); - return ( DIGIT ); - } - return( c ); -} -#line 274 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yyerrflag; - int yychar; - YYSTYPE yyval; - YYSTYPE yylval; - - /* variables for the parser stack */ - YYSTACKDATA yystack; - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror(regs, base, "syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 3: -#line 38 "calc3.y" - { yyerrok ; } -break; -case 4: -#line 42 "calc3.y" - { printf("%d\n",yystack.l_mark[0]);} -break; -case 5: -#line 44 "calc3.y" - { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; } -break; -case 6: -#line 48 "calc3.y" - { yyval = yystack.l_mark[-1]; } -break; -case 7: -#line 50 "calc3.y" - { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; } -break; -case 8: -#line 52 "calc3.y" - { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; } -break; -case 9: -#line 54 "calc3.y" - { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; } -break; -case 10: -#line 56 "calc3.y" - { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; } -break; -case 11: -#line 58 "calc3.y" - { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; } -break; -case 12: -#line 60 "calc3.y" - { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; } -break; -case 13: -#line 62 "calc3.y" - { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; } -break; -case 14: -#line 64 "calc3.y" - { yyval = - yystack.l_mark[0]; } -break; -case 15: -#line 66 "calc3.y" - { yyval = regs[yystack.l_mark[0]]; } -break; -case 17: -#line 71 "calc3.y" - { yyval = yystack.l_mark[0]; (*base) = (yystack.l_mark[0]==0) ? 8 : 10; } -break; -case 18: -#line 73 "calc3.y" - { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } -break; -#line 543 "/dev/stdout" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror(regs, base, "yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.03.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.02.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.02.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.02.out (nonexistent) @@ -1,831 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 2 "calc1.y" - -/* http://dinosaur.compilertools.net/yacc/index.html */ - -#include -#include -#include -#include - -typedef struct interval -{ - double lo, hi; -} -INTERVAL; - -INTERVAL vmul(double, double, INTERVAL); -INTERVAL vdiv(double, double, INTERVAL); - -extern int yylex(void); -static void yyerror(const char *s); - -int dcheck(INTERVAL); - -double dreg[26]; -INTERVAL vreg[26]; - -#line 31 "calc1.y" -#ifdef YYSTYPE -#undef YYSTYPE_IS_DECLARED -#define YYSTYPE_IS_DECLARED 1 -#endif -#ifndef YYSTYPE_IS_DECLARED -#define YYSTYPE_IS_DECLARED 1 -typedef union -{ - int ival; - double dval; - INTERVAL vval; -} YYSTYPE; -#endif /* !YYSTYPE_IS_DECLARED */ -#line 59 "/dev/stdout" - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define DREG 257 -#define VREG 258 -#define CONST 259 -#define UMINUS 260 -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 3, 3, 0, 0, 0, 0, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, -}; -static const short yylen[] = { 2, - 0, 2, 2, 2, 4, 4, 2, 1, 1, 3, - 3, 3, 3, 2, 3, 1, 5, 1, 3, 3, - 3, 3, 3, 3, 3, 3, 2, 3, -}; -static const short yydefred[] = { 0, - 0, 0, 0, 8, 0, 0, 0, 0, 0, 7, - 0, 0, 9, 18, 14, 27, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, - 0, 0, 0, 15, 0, 28, 0, 0, 0, 0, - 12, 24, 13, 26, 0, 0, 23, 25, 14, 0, - 0, 0, 0, 0, 5, 6, 0, 0, 0, 12, - 13, 17, -}; -static const short yydgoto[] = { 7, - 32, 9, 0, -}; -static const short yysindex[] = { -40, - -8, -48, -47, 0, -37, -37, 0, 2, 17, 0, - -34, -37, 0, 0, 0, 0, -25, 90, -37, -37, - -37, -37, 0, -37, -37, -37, -37, 0, -34, -34, - 25, 125, 31, 0, -34, 0, -11, 37, -11, 37, - 0, 0, 0, 0, 37, 37, 0, 0, 0, 111, - -34, -34, -34, -34, 0, 0, 118, 69, 69, 0, - 0, 0, -}; -static const short yyrindex[] = { 0, - 0, 38, 44, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -9, 0, 0, 0, 0, 51, -3, 56, 61, - 0, 0, 0, 0, 67, 72, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 78, 83, 0, - 0, 0, -}; -static const short yygindex[] = { 0, - 4, 124, 0, -}; -#define YYTABLESIZE 225 -static const short yytable[] = { 6, - 16, 10, 6, 8, 5, 30, 20, 5, 15, 17, - 29, 23, 11, 12, 31, 34, 21, 19, 35, 20, - 0, 22, 37, 39, 41, 43, 28, 0, 0, 0, - 21, 16, 49, 50, 55, 22, 0, 20, 57, 20, - 56, 20, 0, 21, 19, 0, 20, 9, 22, 0, - 0, 0, 0, 18, 58, 59, 60, 61, 26, 24, - 10, 25, 0, 27, 0, 11, 53, 51, 0, 52, - 22, 54, 26, 24, 0, 25, 19, 27, 26, 9, - 9, 21, 9, 27, 9, 18, 18, 10, 18, 0, - 18, 10, 11, 10, 10, 10, 11, 0, 11, 11, - 11, 22, 0, 22, 0, 22, 0, 19, 0, 19, - 53, 19, 21, 0, 21, 54, 21, 0, 10, 0, - 10, 0, 10, 11, 0, 11, 0, 11, 16, 18, - 36, 26, 24, 0, 25, 33, 27, 0, 0, 0, - 0, 0, 38, 40, 42, 44, 0, 45, 46, 47, - 48, 34, 53, 51, 0, 52, 0, 54, 62, 53, - 51, 0, 52, 0, 54, 0, 21, 19, 0, 20, - 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 2, 3, 4, 13, - 14, 4, 13, 0, 4, -}; -static const short yycheck[] = { 40, - 10, 10, 40, 0, 45, 40, 10, 45, 5, 6, - 45, 10, 61, 61, 11, 41, 42, 43, 44, 45, - -1, 47, 19, 20, 21, 22, 10, -1, -1, -1, - 42, 41, 29, 30, 10, 47, -1, 41, 35, 43, - 10, 45, -1, 42, 43, -1, 45, 10, 47, -1, - -1, -1, -1, 10, 51, 52, 53, 54, 42, 43, - 10, 45, -1, 47, -1, 10, 42, 43, -1, 45, - 10, 47, 42, 43, -1, 45, 10, 47, 42, 42, - 43, 10, 45, 47, 47, 42, 43, 10, 45, -1, - 47, 41, 10, 43, 44, 45, 41, -1, 43, 44, - 45, 41, -1, 43, -1, 45, -1, 41, -1, 43, - 42, 45, 41, -1, 43, 47, 45, -1, 41, -1, - 43, -1, 45, 41, -1, 43, -1, 45, 5, 6, - 41, 42, 43, -1, 45, 12, 47, -1, -1, -1, - -1, -1, 19, 20, 21, 22, -1, 24, 25, 26, - 27, 41, 42, 43, -1, 45, -1, 47, 41, 42, - 43, -1, 45, -1, 47, -1, 42, 43, -1, 45, - -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 256, 257, 258, 259, 257, - 258, 259, 257, -1, 259, -}; -#define YYFINAL 7 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 260 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,0,0,0,0, -0,0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,"DREG","VREG","CONST","UMINUS","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : line", -"lines :", -"lines : lines line", -"line : dexp '\\n'", -"line : vexp '\\n'", -"line : DREG '=' dexp '\\n'", -"line : VREG '=' vexp '\\n'", -"line : error '\\n'", -"dexp : CONST", -"dexp : DREG", -"dexp : dexp '+' dexp", -"dexp : dexp '-' dexp", -"dexp : dexp '*' dexp", -"dexp : dexp '/' dexp", -"dexp : '-' dexp", -"dexp : '(' dexp ')'", -"vexp : dexp", -"vexp : '(' dexp ',' dexp ')'", -"vexp : VREG", -"vexp : vexp '+' vexp", -"vexp : dexp '+' vexp", -"vexp : vexp '-' vexp", -"vexp : dexp '-' vexp", -"vexp : vexp '*' vexp", -"vexp : dexp '*' vexp", -"vexp : vexp '/' vexp", -"vexp : dexp '/' vexp", -"vexp : '-' vexp", -"vexp : '(' vexp ')'", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 176 "calc1.y" - /* beginning of subroutines section */ - -#define BSZ 50 /* buffer size for floating point numbers */ - - /* lexical analysis */ - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) -{ - int c; - - while ((c = getchar()) == ' ') - { /* skip over blanks */ - } - - if (isupper(c)) - { - yylval.ival = c - 'A'; - return (VREG); - } - if (islower(c)) - { - yylval.ival = c - 'a'; - return (DREG); - } - - if (isdigit(c) || c == '.') - { - /* gobble up digits, points, exponents */ - char buf[BSZ + 1], *cp = buf; - int dot = 0, expr = 0; - - for (; (cp - buf) < BSZ; ++cp, c = getchar()) - { - - *cp = c; - if (isdigit(c)) - continue; - if (c == '.') - { - if (dot++ || expr) - return ('.'); /* will cause syntax error */ - continue; - } - - if (c == 'e') - { - if (expr++) - return ('e'); /* will cause syntax error */ - continue; - } - - /* end of number */ - break; - } - *cp = '\0'; - - if ((cp - buf) >= BSZ) - printf("constant too long: truncated\n"); - else - ungetc(c, stdin); /* push back last char read */ - yylval.dval = atof(buf); - return (CONST); - } - return (c); -} - -static INTERVAL -hilo(double a, double b, double c, double d) -{ - /* returns the smallest interval containing a, b, c, and d */ - /* used by *, / routines */ - INTERVAL v; - - if (a > b) - { - v.hi = a; - v.lo = b; - } - else - { - v.hi = b; - v.lo = a; - } - - if (c > d) - { - if (c > v.hi) - v.hi = c; - if (d < v.lo) - v.lo = d; - } - else - { - if (d > v.hi) - v.hi = d; - if (c < v.lo) - v.lo = c; - } - return (v); -} - -INTERVAL -vmul(double a, double b, INTERVAL v) -{ - return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo)); -} - -int -dcheck(INTERVAL v) -{ - if (v.hi >= 0. && v.lo <= 0.) - { - printf("divisor interval contains 0.\n"); - return (1); - } - return (0); -} - -INTERVAL -vdiv(double a, double b, INTERVAL v) -{ - return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); -} -#line 406 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 3: -#line 57 "calc1.y" - { - (void) printf("%15.8f\n", yystack.l_mark[-1].dval); - } -break; -case 4: -#line 61 "calc1.y" - { - (void) printf("(%15.8f, %15.8f)\n", yystack.l_mark[-1].vval.lo, yystack.l_mark[-1].vval.hi); - } -break; -case 5: -#line 65 "calc1.y" - { - dreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].dval; - } -break; -case 6: -#line 69 "calc1.y" - { - vreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].vval; - } -break; -case 7: -#line 73 "calc1.y" - { - yyerrok; - } -break; -case 9: -#line 80 "calc1.y" - { - yyval.dval = dreg[yystack.l_mark[0].ival]; - } -break; -case 10: -#line 84 "calc1.y" - { - yyval.dval = yystack.l_mark[-2].dval + yystack.l_mark[0].dval; - } -break; -case 11: -#line 88 "calc1.y" - { - yyval.dval = yystack.l_mark[-2].dval - yystack.l_mark[0].dval; - } -break; -case 12: -#line 92 "calc1.y" - { - yyval.dval = yystack.l_mark[-2].dval * yystack.l_mark[0].dval; - } -break; -case 13: -#line 96 "calc1.y" - { - yyval.dval = yystack.l_mark[-2].dval / yystack.l_mark[0].dval; - } -break; -case 14: -#line 100 "calc1.y" - { - yyval.dval = -yystack.l_mark[0].dval; - } -break; -case 15: -#line 104 "calc1.y" - { - yyval.dval = yystack.l_mark[-1].dval; - } -break; -case 16: -#line 110 "calc1.y" - { - yyval.vval.hi = yyval.vval.lo = yystack.l_mark[0].dval; - } -break; -case 17: -#line 114 "calc1.y" - { - yyval.vval.lo = yystack.l_mark[-3].dval; - yyval.vval.hi = yystack.l_mark[-1].dval; - if ( yyval.vval.lo > yyval.vval.hi ) - { - (void) printf("interval out of order\n"); - YYERROR; - } - } -break; -case 18: -#line 124 "calc1.y" - { - yyval.vval = vreg[yystack.l_mark[0].ival]; - } -break; -case 19: -#line 128 "calc1.y" - { - yyval.vval.hi = yystack.l_mark[-2].vval.hi + yystack.l_mark[0].vval.hi; - yyval.vval.lo = yystack.l_mark[-2].vval.lo + yystack.l_mark[0].vval.lo; - } -break; -case 20: -#line 133 "calc1.y" - { - yyval.vval.hi = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.hi; - yyval.vval.lo = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.lo; - } -break; -case 21: -#line 138 "calc1.y" - { - yyval.vval.hi = yystack.l_mark[-2].vval.hi - yystack.l_mark[0].vval.lo; - yyval.vval.lo = yystack.l_mark[-2].vval.lo - yystack.l_mark[0].vval.hi; - } -break; -case 22: -#line 143 "calc1.y" - { - yyval.vval.hi = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.lo; - yyval.vval.lo = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.hi; - } -break; -case 23: -#line 148 "calc1.y" - { - yyval.vval = vmul( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval ); - } -break; -case 24: -#line 152 "calc1.y" - { - yyval.vval = vmul (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval ); - } -break; -case 25: -#line 156 "calc1.y" - { - if (dcheck(yystack.l_mark[0].vval)) YYERROR; - yyval.vval = vdiv ( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval ); - } -break; -case 26: -#line 161 "calc1.y" - { - if (dcheck ( yystack.l_mark[0].vval )) YYERROR; - yyval.vval = vdiv (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval ); - } -break; -case 27: -#line 166 "calc1.y" - { - yyval.vval.hi = -yystack.l_mark[0].vval.lo; - yyval.vval.lo = -yystack.l_mark[0].vval.hi; - } -break; -case 28: -#line 171 "calc1.y" - { - yyval.vval = yystack.l_mark[-1].vval; - } -break; -#line 771 "/dev/stdout" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.02.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.01.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.01.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.01.out (nonexistent) @@ -1,589 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 2 "calc.y" -# include -# include - -int regs[26]; -int base; - -extern int yylex(void); -static void yyerror(const char *s); - -#line 29 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define DIGIT 257 -#define LETTER 258 -#define UMINUS 259 -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 3, 3, -}; -static const short yylen[] = { 2, - 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 1, 1, 1, 2, -}; -static const short yydefred[] = { 1, - 0, 0, 17, 0, 0, 0, 0, 0, 0, 3, - 0, 15, 14, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, - 10, 11, -}; -static const short yydgoto[] = { 1, - 7, 8, 9, -}; -static const short yysindex[] = { 0, - -40, -7, 0, -55, -38, -38, 1, -29, -247, 0, - -38, 0, 0, 22, 0, -38, -38, -38, -38, -38, - -38, -38, 0, -29, 0, 51, 60, -20, -20, 0, - 0, 0, -}; -static const short yyrindex[] = { 0, - 0, 0, 0, 2, 0, 0, 0, 9, -9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 10, 0, -6, 14, 5, 13, 0, - 0, 0, -}; -static const short yygindex[] = { 0, - 0, 65, 0, -}; -#define YYTABLESIZE 220 -static const short yytable[] = { 6, - 16, 6, 10, 13, 5, 11, 5, 22, 17, 23, - 15, 15, 20, 18, 7, 19, 22, 21, 4, 5, - 0, 20, 8, 12, 0, 0, 21, 16, 16, 0, - 0, 16, 16, 16, 13, 16, 0, 16, 15, 15, - 0, 0, 7, 15, 15, 7, 15, 7, 15, 7, - 8, 12, 0, 8, 12, 8, 0, 8, 22, 17, - 0, 0, 25, 20, 18, 0, 19, 0, 21, 13, - 14, 0, 0, 0, 0, 24, 0, 0, 0, 0, - 26, 27, 28, 29, 30, 31, 32, 22, 17, 0, - 0, 0, 20, 18, 16, 19, 22, 21, 0, 0, - 0, 20, 18, 0, 19, 0, 21, 0, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 13, 0, 0, - 0, 0, 0, 0, 0, 15, 0, 0, 7, 0, - 0, 0, 0, 0, 0, 0, 8, 12, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 2, 3, 4, 3, 12, -}; -static const short yycheck[] = { 40, - 10, 40, 10, 10, 45, 61, 45, 37, 38, 257, - 10, 10, 42, 43, 10, 45, 37, 47, 10, 10, - -1, 42, 10, 10, -1, -1, 47, 37, 38, -1, - -1, 41, 42, 43, 41, 45, -1, 47, 37, 38, - -1, -1, 38, 42, 43, 41, 45, 43, 47, 45, - 38, 38, -1, 41, 41, 43, -1, 45, 37, 38, - -1, -1, 41, 42, 43, -1, 45, -1, 47, 5, - 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, - 16, 17, 18, 19, 20, 21, 22, 37, 38, -1, - -1, -1, 42, 43, 124, 45, 37, 47, -1, -1, - -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, - -1, -1, -1, -1, 124, -1, -1, 124, -1, -1, - -1, -1, -1, -1, -1, 124, -1, -1, 124, -1, - -1, -1, -1, -1, -1, -1, 124, 124, -1, -1, - -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 256, 257, 258, 257, 258, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 259 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0, -0,0,0,0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : list", -"list :", -"list : list stat '\\n'", -"list : list error '\\n'", -"stat : expr", -"stat : LETTER '=' expr", -"expr : '(' expr ')'", -"expr : expr '+' expr", -"expr : expr '-' expr", -"expr : expr '*' expr", -"expr : expr '/' expr", -"expr : expr '%' expr", -"expr : expr '&' expr", -"expr : expr '|' expr", -"expr : '-' expr", -"expr : LETTER", -"expr : number", -"number : DIGIT", -"number : number DIGIT", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 66 "calc.y" - /* start of programs */ - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) -{ - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} -#line 267 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 3: -#line 28 "calc.y" - { yyerrok ; } -break; -case 4: -#line 32 "calc.y" - { printf("%d\n",yystack.l_mark[0]);} -break; -case 5: -#line 34 "calc.y" - { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; } -break; -case 6: -#line 38 "calc.y" - { yyval = yystack.l_mark[-1]; } -break; -case 7: -#line 40 "calc.y" - { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; } -break; -case 8: -#line 42 "calc.y" - { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; } -break; -case 9: -#line 44 "calc.y" - { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; } -break; -case 10: -#line 46 "calc.y" - { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; } -break; -case 11: -#line 48 "calc.y" - { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; } -break; -case 12: -#line 50 "calc.y" - { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; } -break; -case 13: -#line 52 "calc.y" - { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; } -break; -case 14: -#line 54 "calc.y" - { yyval = - yystack.l_mark[0]; } -break; -case 15: -#line 56 "calc.y" - { yyval = regs[yystack.l_mark[0]]; } -break; -case 17: -#line 61 "calc.y" - { yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; } -break; -case 18: -#line 63 "calc.y" - { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } -break; -#line 529 "/dev/stdout" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.01.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.00.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.00.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.00.out (nonexistent) @@ -1,386 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, -}; -static const short yylen[] = { 2, - 0, -}; -static const short yydefred[] = { 1, - 0, -}; -static const short yydgoto[] = { 1, -}; -static const short yysindex[] = { 0, - 0, -}; -static const short yyrindex[] = { 0, - 0, -}; -static const short yygindex[] = { 0, -}; -#define YYTABLESIZE 0 -static const short yytable[] = { 0, -}; -static const short yycheck[] = { -1, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 0 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : rule", -"rule :", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.00.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/calc3.y =================================================================== --- stable/10/usr.bin/yacc/tests/calc3.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/calc3.y (nonexistent) @@ -1,123 +0,0 @@ -%pure-parser - -%parse-param { int regs[26] } -%parse-param { int *base } - -%lex-param { int *base } - -%{ -# include -# include - -#ifdef YYBISON -#define YYSTYPE int -#define YYLEX_PARAM base -#define YYLEX_DECL() yylex(YYSTYPE *yylval, int *YYLEX_PARAM) -#define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s) -int YYLEX_DECL(); -static void YYERROR_DECL(); -#endif - -%} - -%start list - -%token DIGIT LETTER - -%left '|' -%left '&' -%left '+' '-' -%left '*' '/' '%' -%left UMINUS /* supplies precedence for unary minus */ - -%% /* beginning of rules section */ - -list : /* empty */ - | list stat '\n' - | list error '\n' - { yyerrok ; } - ; - -stat : expr - { printf("%d\n",$1);} - | LETTER '=' expr - { regs[$1] = $3; } - ; - -expr : '(' expr ')' - { $$ = $2; } - | expr '+' expr - { $$ = $1 + $3; } - | expr '-' expr - { $$ = $1 - $3; } - | expr '*' expr - { $$ = $1 * $3; } - | expr '/' expr - { $$ = $1 / $3; } - | expr '%' expr - { $$ = $1 % $3; } - | expr '&' expr - { $$ = $1 & $3; } - | expr '|' expr - { $$ = $1 | $3; } - | '-' expr %prec UMINUS - { $$ = - $2; } - | LETTER - { $$ = regs[$1]; } - | number - ; - -number: DIGIT - { $$ = $1; (*base) = ($1==0) ? 8 : 10; } - | number DIGIT - { $$ = (*base) * $1 + $2; } - ; - -%% /* start of programs */ - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -int -main (void) -{ - int regs[26]; - int base = 10; - - while(!feof(stdin)) { - yyparse(regs, &base); - } - return 0; -} - -static void -YYERROR_DECL() -{ - fprintf(stderr, "%s\n", s); -} - -int -YYLEX_DECL() -{ - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - *yylval = (c - 'a'); - return ( LETTER ); - } - if( isdigit( c )) { - *yylval = (c - '0') % (*base); - return ( DIGIT ); - } - return( c ); -} Property changes on: stable/10/usr.bin/yacc/tests/calc3.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.14.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.14.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.14.out (nonexistent) @@ -1,604 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 2 "quote_calc4.y" -# include -# include - -int regs[26]; -int base; - -int yylex(void); -static void yyerror(const char *s); - -#line 29 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define OP_ADD 257 -#define OP_SUB 259 -#define OP_MUL 261 -#define OP_DIV 263 -#define OP_MOD 265 -#define OP_AND 267 -#define DIGIT 269 -#define LETTER 270 -#define UMINUS 271 -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 3, 3, -}; -static const short yylen[] = { 2, - 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 1, 1, 1, 2, -}; -static const short yydefred[] = { 1, - 0, 0, 0, 17, 0, 0, 0, 0, 0, 3, - 15, 0, 0, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, - 0, 0, -}; -static const short yydgoto[] = { 1, - 7, 8, 9, -}; -static const short yysindex[] = { 0, - -38, 4, -36, 0, -51, -36, 6, -121, -249, 0, - 0, -243, -36, -23, 0, -36, -36, -36, -36, -36, - -36, -36, 0, -121, 0, -121, -121, -121, -121, -121, - -121, -243, -}; -static const short yyrindex[] = { 0, - 0, 0, 0, 0, -9, 0, 0, 12, -10, 0, - 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 14, 0, -3, -2, -1, 1, 2, - 3, -4, -}; -static const short yygindex[] = { 0, - 0, 42, 0, -}; -#define YYTABLESIZE 259 -static const short yytable[] = { 16, - 15, 6, 22, 6, 14, 13, 7, 8, 9, 13, - 10, 11, 12, 10, 16, 15, 17, 25, 18, 23, - 19, 4, 20, 5, 21, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 14, 13, 7, 8, 9, - 0, 10, 11, 12, 12, 0, 0, 14, 0, 0, - 0, 0, 0, 0, 24, 0, 0, 26, 27, 28, - 29, 30, 31, 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, - 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 15, 0, 0, 0, 14, 13, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 16, 0, 17, 0, - 18, 0, 19, 0, 20, 0, 21, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, - 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, - 4, 5, 4, 11, 16, 0, 17, 0, 18, 0, - 19, 0, 20, 0, 21, 0, 0, 16, 15, 16, - 15, 16, 15, 16, 15, 16, 15, 16, 15, -}; -static const short yycheck[] = { 10, - 10, 40, 124, 40, 10, 10, 10, 10, 10, 61, - 10, 10, 10, 10, 258, 10, 260, 41, 262, 269, - 264, 10, 266, 10, 268, -1, -1, -1, -1, -1, - 41, -1, -1, -1, -1, 41, 41, 41, 41, 41, - -1, 41, 41, 41, 3, -1, -1, 6, -1, -1, - -1, -1, -1, -1, 13, -1, -1, 16, 17, 18, - 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 124, 124, -1, -1, -1, 124, 124, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 258, -1, 260, -1, - 262, -1, 264, -1, 266, -1, 268, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, - -1, 260, -1, 260, -1, -1, -1, -1, -1, -1, - 269, 270, 269, 270, 258, -1, 260, -1, 262, -1, - 264, -1, 266, -1, 268, -1, -1, 258, 258, 260, - 260, 262, 262, 264, 264, 266, 266, 268, 268, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 271 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0, -0,0,0,0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"OP_ADD","\"ADD-operator\"","OP_SUB","\"SUB-operator\"","OP_MUL", -"\"MUL-operator\"","OP_DIV","\"DIV-operator\"","OP_MOD","\"MOD-operator\"", -"OP_AND","\"AND-operator\"","DIGIT","LETTER","UMINUS","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : list", -"list :", -"list : list stat '\\n'", -"list : list error '\\n'", -"stat : expr", -"stat : LETTER '=' expr", -"expr : '(' expr ')'", -"expr : expr \"ADD-operator\" expr", -"expr : expr \"SUB-operator\" expr", -"expr : expr \"MUL-operator\" expr", -"expr : expr \"DIV-operator\" expr", -"expr : expr \"MOD-operator\" expr", -"expr : expr \"AND-operator\" expr", -"expr : expr '|' expr", -"expr : \"SUB-operator\" expr", -"expr : LETTER", -"expr : number", -"number : DIGIT", -"number : number DIGIT", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 73 "quote_calc4.y" - /* start of programs */ - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) { - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} -#line 282 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 3: -#line 35 "quote_calc4.y" - { yyerrok ; } -break; -case 4: -#line 39 "quote_calc4.y" - { printf("%d\n",yystack.l_mark[0]);} -break; -case 5: -#line 41 "quote_calc4.y" - { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; } -break; -case 6: -#line 45 "quote_calc4.y" - { yyval = yystack.l_mark[-1]; } -break; -case 7: -#line 47 "quote_calc4.y" - { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; } -break; -case 8: -#line 49 "quote_calc4.y" - { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; } -break; -case 9: -#line 51 "quote_calc4.y" - { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; } -break; -case 10: -#line 53 "quote_calc4.y" - { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; } -break; -case 11: -#line 55 "quote_calc4.y" - { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; } -break; -case 12: -#line 57 "quote_calc4.y" - { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; } -break; -case 13: -#line 59 "quote_calc4.y" - { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; } -break; -case 14: -#line 61 "quote_calc4.y" - { yyval = - yystack.l_mark[0]; } -break; -case 15: -#line 63 "quote_calc4.y" - { yyval = regs[yystack.l_mark[0]]; } -break; -case 17: -#line 68 "quote_calc4.y" - { yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; } -break; -case 18: -#line 70 "quote_calc4.y" - { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } -break; -#line 544 "/dev/stdout" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.14.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.13.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.13.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.13.out (nonexistent) @@ -1,604 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 2 "quote_calc3.y" -# include -# include - -int regs[26]; -int base; - -int yylex(void); -static void yyerror(const char *s); - -#line 29 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define OP_ADD 257 -#define OP_SUB 259 -#define OP_MUL 261 -#define OP_DIV 263 -#define OP_MOD 265 -#define OP_AND 267 -#define DIGIT 269 -#define LETTER 270 -#define UMINUS 271 -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 3, 3, -}; -static const short yylen[] = { 2, - 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 1, 1, 1, 2, -}; -static const short yydefred[] = { 1, - 0, 0, 0, 17, 0, 0, 0, 0, 0, 3, - 15, 0, 0, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, - 0, 0, -}; -static const short yydgoto[] = { 1, - 7, 8, 9, -}; -static const short yysindex[] = { 0, - -38, 5, -36, 0, -51, -36, 7, -121, -248, 0, - 0, -243, -36, -22, 0, -36, -36, -36, -36, -36, - -36, -36, 0, -121, 0, -121, -121, -121, -121, -121, - -121, -243, -}; -static const short yyrindex[] = { 0, - 0, 0, 0, 0, -9, 0, 0, 13, -10, 0, - 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 0, -3, -2, -1, 1, 2, - 3, -4, -}; -static const short yygindex[] = { 0, - 0, 42, 0, -}; -#define YYTABLESIZE 258 -static const short yytable[] = { 16, - 15, 6, 22, 6, 14, 13, 7, 8, 9, 13, - 10, 11, 12, 16, 10, 17, 15, 18, 25, 19, - 23, 20, 4, 21, 5, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 14, 13, 7, 8, 9, - 0, 10, 11, 12, 12, 0, 0, 14, 0, 0, - 0, 0, 0, 0, 24, 0, 0, 26, 27, 28, - 29, 30, 31, 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, 22, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 15, 0, 0, 0, 14, 13, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 17, 0, 18, - 0, 19, 0, 20, 0, 21, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, - 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, - 4, 5, 4, 11, 16, 0, 17, 0, 18, 0, - 19, 0, 20, 0, 21, 0, 16, 15, 16, 15, - 16, 15, 16, 15, 16, 15, 16, 15, -}; -static const short yycheck[] = { 10, - 10, 40, 124, 40, 10, 10, 10, 10, 10, 61, - 10, 10, 10, 257, 10, 259, 10, 261, 41, 263, - 269, 265, 10, 267, 10, -1, -1, -1, -1, -1, - 41, -1, -1, -1, -1, 41, 41, 41, 41, 41, - -1, 41, 41, 41, 3, -1, -1, 6, -1, -1, - -1, -1, -1, -1, 13, -1, -1, 16, 17, 18, - 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 124, 124, -1, -1, -1, 124, 124, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 257, -1, 259, -1, 261, - -1, 263, -1, 265, -1, 267, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, - 259, -1, 259, -1, -1, -1, -1, -1, -1, -1, - 269, 270, 269, 270, 257, -1, 259, -1, 261, -1, - 263, -1, 265, -1, 267, -1, 257, 257, 259, 259, - 261, 261, 263, 263, 265, 265, 267, 267, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 271 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0, -0,0,0,0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"OP_ADD","\"ADD-operator\"","OP_SUB","\"SUB-operator\"","OP_MUL", -"\"MUL-operator\"","OP_DIV","\"DIV-operator\"","OP_MOD","\"MOD-operator\"", -"OP_AND","\"AND-operator\"","DIGIT","LETTER","UMINUS","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : list", -"list :", -"list : list stat '\\n'", -"list : list error '\\n'", -"stat : expr", -"stat : LETTER '=' expr", -"expr : '(' expr ')'", -"expr : expr OP_ADD expr", -"expr : expr OP_SUB expr", -"expr : expr OP_MUL expr", -"expr : expr OP_DIV expr", -"expr : expr OP_MOD expr", -"expr : expr OP_AND expr", -"expr : expr '|' expr", -"expr : OP_SUB expr", -"expr : LETTER", -"expr : number", -"number : DIGIT", -"number : number DIGIT", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 73 "quote_calc3.y" - /* start of programs */ - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) { - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} -#line 282 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 3: -#line 35 "quote_calc3.y" - { yyerrok ; } -break; -case 4: -#line 39 "quote_calc3.y" - { printf("%d\n",yystack.l_mark[0]);} -break; -case 5: -#line 41 "quote_calc3.y" - { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; } -break; -case 6: -#line 45 "quote_calc3.y" - { yyval = yystack.l_mark[-1]; } -break; -case 7: -#line 47 "quote_calc3.y" - { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; } -break; -case 8: -#line 49 "quote_calc3.y" - { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; } -break; -case 9: -#line 51 "quote_calc3.y" - { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; } -break; -case 10: -#line 53 "quote_calc3.y" - { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; } -break; -case 11: -#line 55 "quote_calc3.y" - { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; } -break; -case 12: -#line 57 "quote_calc3.y" - { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; } -break; -case 13: -#line 59 "quote_calc3.y" - { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; } -break; -case 14: -#line 61 "quote_calc3.y" - { yyval = - yystack.l_mark[0]; } -break; -case 15: -#line 63 "quote_calc3.y" - { yyval = regs[yystack.l_mark[0]]; } -break; -case 17: -#line 68 "quote_calc3.y" - { yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; } -break; -case 18: -#line 70 "quote_calc3.y" - { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } -break; -#line 544 "/dev/stdout" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.13.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.12.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.12.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.12.out (nonexistent) @@ -1,610 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 2 "quote_calc2.y" -# include -# include - -int regs[26]; -int base; - -int yylex(void); -static void yyerror(const char *s); - -#line 29 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define OP_ADD 257 -#define ADD 258 -#define OP_SUB 259 -#define SUB 260 -#define OP_MUL 261 -#define MUL 262 -#define OP_DIV 263 -#define DIV 264 -#define OP_MOD 265 -#define MOD 266 -#define OP_AND 267 -#define AND 268 -#define DIGIT 269 -#define LETTER 270 -#define UMINUS 271 -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 3, 3, -}; -static const short yylen[] = { 2, - 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 1, 1, 1, 2, -}; -static const short yydefred[] = { 1, - 0, 0, 0, 17, 0, 0, 0, 0, 0, 3, - 15, 0, 0, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, - 0, 0, -}; -static const short yydgoto[] = { 1, - 7, 8, 9, -}; -static const short yysindex[] = { 0, - -38, 4, -36, 0, -51, -36, 6, -121, -249, 0, - 0, -243, -36, -23, 0, -36, -36, -36, -36, -36, - -36, -36, 0, -121, 0, -121, -121, -121, -121, -121, - -121, -243, -}; -static const short yyrindex[] = { 0, - 0, 0, 0, 0, -9, 0, 0, 12, -10, 0, - 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 14, 0, -3, -2, -1, 1, 2, - 3, -4, -}; -static const short yygindex[] = { 0, - 0, 42, 0, -}; -#define YYTABLESIZE 259 -static const short yytable[] = { 16, - 15, 6, 22, 6, 14, 13, 7, 8, 9, 13, - 10, 11, 12, 10, 16, 15, 17, 25, 18, 23, - 19, 4, 20, 5, 21, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 14, 13, 7, 8, 9, - 0, 10, 11, 12, 12, 0, 0, 14, 0, 0, - 0, 0, 0, 0, 24, 0, 0, 26, 27, 28, - 29, 30, 31, 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, - 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 15, 0, 0, 0, 14, 13, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 16, 0, 17, 0, - 18, 0, 19, 0, 20, 0, 21, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, - 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, - 4, 5, 4, 11, 16, 0, 17, 0, 18, 0, - 19, 0, 20, 0, 21, 0, 0, 16, 15, 16, - 15, 16, 15, 16, 15, 16, 15, 16, 15, -}; -static const short yycheck[] = { 10, - 10, 40, 124, 40, 10, 10, 10, 10, 10, 61, - 10, 10, 10, 10, 258, 10, 260, 41, 262, 269, - 264, 10, 266, 10, 268, -1, -1, -1, -1, -1, - 41, -1, -1, -1, -1, 41, 41, 41, 41, 41, - -1, 41, 41, 41, 3, -1, -1, 6, -1, -1, - -1, -1, -1, -1, 13, -1, -1, 16, 17, 18, - 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 124, 124, -1, -1, -1, 124, 124, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 258, -1, 260, -1, - 262, -1, 264, -1, 266, -1, 268, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, - -1, 260, -1, 260, -1, -1, -1, -1, -1, -1, - 269, 270, 269, 270, 258, -1, 260, -1, 262, -1, - 264, -1, 266, -1, 268, -1, -1, 258, 258, 260, - 260, 262, 262, 264, 264, 266, 266, 268, 268, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 271 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0, -0,0,0,0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"OP_ADD","\"ADD\"","OP_SUB","\"SUB\"","OP_MUL","\"MUL\"","OP_DIV", -"\"DIV\"","OP_MOD","\"MOD\"","OP_AND","\"AND\"","DIGIT","LETTER","UMINUS", -"illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : list", -"list :", -"list : list stat '\\n'", -"list : list error '\\n'", -"stat : expr", -"stat : LETTER '=' expr", -"expr : '(' expr ')'", -"expr : expr \"ADD\" expr", -"expr : expr \"SUB\" expr", -"expr : expr \"MUL\" expr", -"expr : expr \"DIV\" expr", -"expr : expr \"MOD\" expr", -"expr : expr \"AND\" expr", -"expr : expr '|' expr", -"expr : \"SUB\" expr", -"expr : LETTER", -"expr : number", -"number : DIGIT", -"number : number DIGIT", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 73 "quote_calc2.y" - /* start of programs */ - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) { - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} -#line 288 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 3: -#line 35 "quote_calc2.y" - { yyerrok ; } -break; -case 4: -#line 39 "quote_calc2.y" - { printf("%d\n",yystack.l_mark[0]);} -break; -case 5: -#line 41 "quote_calc2.y" - { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; } -break; -case 6: -#line 45 "quote_calc2.y" - { yyval = yystack.l_mark[-1]; } -break; -case 7: -#line 47 "quote_calc2.y" - { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; } -break; -case 8: -#line 49 "quote_calc2.y" - { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; } -break; -case 9: -#line 51 "quote_calc2.y" - { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; } -break; -case 10: -#line 53 "quote_calc2.y" - { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; } -break; -case 11: -#line 55 "quote_calc2.y" - { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; } -break; -case 12: -#line 57 "quote_calc2.y" - { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; } -break; -case 13: -#line 59 "quote_calc2.y" - { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; } -break; -case 14: -#line 61 "quote_calc2.y" - { yyval = - yystack.l_mark[0]; } -break; -case 15: -#line 63 "quote_calc2.y" - { yyval = regs[yystack.l_mark[0]]; } -break; -case 17: -#line 68 "quote_calc2.y" - { yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; } -break; -case 18: -#line 70 "quote_calc2.y" - { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } -break; -#line 550 "/dev/stdout" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.12.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.11.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.11.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.11.out (nonexistent) @@ -1,610 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 2 "quote_calc.y" -# include -# include - -int regs[26]; -int base; - -int yylex(void); -static void yyerror(const char *s); - -#line 29 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define OP_ADD 257 -#define ADD 258 -#define OP_SUB 259 -#define SUB 260 -#define OP_MUL 261 -#define MUL 262 -#define OP_DIV 263 -#define DIV 264 -#define OP_MOD 265 -#define MOD 266 -#define OP_AND 267 -#define AND 268 -#define DIGIT 269 -#define LETTER 270 -#define UMINUS 271 -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 3, 3, -}; -static const short yylen[] = { 2, - 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 1, 1, 1, 2, -}; -static const short yydefred[] = { 1, - 0, 0, 0, 17, 0, 0, 0, 0, 0, 3, - 15, 0, 0, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, - 0, 0, -}; -static const short yydgoto[] = { 1, - 7, 8, 9, -}; -static const short yysindex[] = { 0, - -38, 5, -36, 0, -51, -36, 7, -121, -248, 0, - 0, -243, -36, -22, 0, -36, -36, -36, -36, -36, - -36, -36, 0, -121, 0, -121, -121, -121, -121, -121, - -121, -243, -}; -static const short yyrindex[] = { 0, - 0, 0, 0, 0, -9, 0, 0, 13, -10, 0, - 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 0, -3, -2, -1, 1, 2, - 3, -4, -}; -static const short yygindex[] = { 0, - 0, 42, 0, -}; -#define YYTABLESIZE 258 -static const short yytable[] = { 16, - 15, 6, 22, 6, 14, 13, 7, 8, 9, 13, - 10, 11, 12, 16, 10, 17, 15, 18, 25, 19, - 23, 20, 4, 21, 5, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 14, 13, 7, 8, 9, - 0, 10, 11, 12, 12, 0, 0, 14, 0, 0, - 0, 0, 0, 0, 24, 0, 0, 26, 27, 28, - 29, 30, 31, 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, 22, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 15, 0, 0, 0, 14, 13, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 17, 0, 18, - 0, 19, 0, 20, 0, 21, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, - 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, - 4, 5, 4, 11, 16, 0, 17, 0, 18, 0, - 19, 0, 20, 0, 21, 0, 16, 15, 16, 15, - 16, 15, 16, 15, 16, 15, 16, 15, -}; -static const short yycheck[] = { 10, - 10, 40, 124, 40, 10, 10, 10, 10, 10, 61, - 10, 10, 10, 257, 10, 259, 10, 261, 41, 263, - 269, 265, 10, 267, 10, -1, -1, -1, -1, -1, - 41, -1, -1, -1, -1, 41, 41, 41, 41, 41, - -1, 41, 41, 41, 3, -1, -1, 6, -1, -1, - -1, -1, -1, -1, 13, -1, -1, 16, 17, 18, - 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 124, 124, -1, -1, -1, 124, 124, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 257, -1, 259, -1, 261, - -1, 263, -1, 265, -1, 267, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, - 259, -1, 259, -1, -1, -1, -1, -1, -1, -1, - 269, 270, 269, 270, 257, -1, 259, -1, 261, -1, - 263, -1, 265, -1, 267, -1, 257, 257, 259, 259, - 261, 261, 263, 263, 265, 265, 267, 267, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 271 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0, -0,0,0,0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"OP_ADD","\"ADD\"","OP_SUB","\"SUB\"","OP_MUL","\"MUL\"","OP_DIV", -"\"DIV\"","OP_MOD","\"MOD\"","OP_AND","\"AND\"","DIGIT","LETTER","UMINUS", -"illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : list", -"list :", -"list : list stat '\\n'", -"list : list error '\\n'", -"stat : expr", -"stat : LETTER '=' expr", -"expr : '(' expr ')'", -"expr : expr OP_ADD expr", -"expr : expr OP_SUB expr", -"expr : expr OP_MUL expr", -"expr : expr OP_DIV expr", -"expr : expr OP_MOD expr", -"expr : expr OP_AND expr", -"expr : expr '|' expr", -"expr : OP_SUB expr", -"expr : LETTER", -"expr : number", -"number : DIGIT", -"number : number DIGIT", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 73 "quote_calc.y" - /* start of programs */ - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) { - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} -#line 288 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 3: -#line 35 "quote_calc.y" - { yyerrok ; } -break; -case 4: -#line 39 "quote_calc.y" - { printf("%d\n",yystack.l_mark[0]);} -break; -case 5: -#line 41 "quote_calc.y" - { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; } -break; -case 6: -#line 45 "quote_calc.y" - { yyval = yystack.l_mark[-1]; } -break; -case 7: -#line 47 "quote_calc.y" - { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; } -break; -case 8: -#line 49 "quote_calc.y" - { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; } -break; -case 9: -#line 51 "quote_calc.y" - { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; } -break; -case 10: -#line 53 "quote_calc.y" - { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; } -break; -case 11: -#line 55 "quote_calc.y" - { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; } -break; -case 12: -#line 57 "quote_calc.y" - { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; } -break; -case 13: -#line 59 "quote_calc.y" - { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; } -break; -case 14: -#line 61 "quote_calc.y" - { yyval = - yystack.l_mark[0]; } -break; -case 15: -#line 63 "quote_calc.y" - { yyval = regs[yystack.l_mark[0]]; } -break; -case 17: -#line 68 "quote_calc.y" - { yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; } -break; -case 18: -#line 70 "quote_calc.y" - { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } -break; -#line 550 "/dev/stdout" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.11.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.10.out =================================================================== --- stable/10/usr.bin/yacc/tests/regress.10.out (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.10.out (nonexistent) @@ -1,429 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYPATCH 20140101 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - -#define YYPREFIX "yy" - -#define YYPURE 0 - -#line 2 "pure_error.y" - -#ifdef YYBISON -#define YYSTYPE int -#define YYLEX_PARAM &yylval -#define YYLEX_DECL() yylex(YYSTYPE *yylval) -#define YYERROR_DECL() yyerror(const char *s) -int YYLEX_DECL(); -static void YYERROR_DECL(); -#endif - -#line 30 "/dev/stdout" - -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define YYERRCODE 256 -static const short yylhs[] = { -1, - 0, -}; -static const short yylen[] = { 2, - 1, -}; -static const short yydefred[] = { 0, - 1, 0, -}; -static const short yydgoto[] = { 2, -}; -static const short yysindex[] = { -256, - 0, 0, -}; -static const short yyrindex[] = { 0, - 0, 0, -}; -static const short yygindex[] = { 0, -}; -#define YYTABLESIZE 0 -static const short yytable[] = { 1, -}; -static const short yycheck[] = { 256, -}; -#define YYFINAL 2 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 0 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : S", -"S : error", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 17 "pure_error.y" - -#include - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -int -main(void) -{ - printf("yyparse() = %d\n", yyparse()); - return 0; -} - -int -yylex(YYSTYPE *value) -{ - return value ? 0 : -1; -} - -static void -yyerror(const char* s) -{ - printf("%s\n", s); -} -#line 168 "/dev/stdout" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} Property changes on: stable/10/usr.bin/yacc/tests/regress.10.out ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/grammar.y =================================================================== --- stable/10/usr.bin/yacc/tests/grammar.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/grammar.y (nonexistent) @@ -1,1183 +0,0 @@ -/* $Id: grammar.y,v 1.5 2012/01/15 20:00:59 tom Exp $ - * - * yacc grammar for C function prototype generator - * This was derived from the grammar in Appendix A of - * "The C Programming Language" by Kernighan and Ritchie. - */ -%expect 1 -%{ -#ifdef YYBISON -#include -#define YYSTYPE_IS_DECLARED -#define yyerror yaccError -#endif - -#if defined(YYBISON) || !defined(YYBYACC) -static void yyerror(const char *s); -#endif -%} - -%token '(' '*' '&' - /* identifiers that are not reserved words */ - T_IDENTIFIER T_TYPEDEF_NAME T_DEFINE_NAME - - /* storage class */ - T_AUTO T_EXTERN T_REGISTER T_STATIC T_TYPEDEF - /* This keyword included for compatibility with C++. */ - T_INLINE - /* This keyword included for compatibility with GCC */ - T_EXTENSION - - /* type specifiers */ - T_CHAR T_DOUBLE T_FLOAT T_INT T_VOID - T_LONG T_SHORT T_SIGNED T_UNSIGNED - T_ENUM T_STRUCT T_UNION - /* C9X new types */ - T_Bool T_Complex T_Imaginary - - /* type qualifiers */ - T_TYPE_QUALIFIER - - /* paired square brackets and everything between them: [ ... ] */ - T_BRACKETS - -%token - /* left brace */ - T_LBRACE - /* all input to the matching right brace */ - T_MATCHRBRACE - - /* three periods */ - T_ELLIPSIS - - /* constant expression or paired braces following an equal sign */ - T_INITIALIZER - - /* string literal */ - T_STRING_LITERAL - - /* asm */ - T_ASM - /* ( "string literal" ) following asm keyword */ - T_ASMARG - - /* va_dcl from */ - T_VA_DCL - -%type decl_specifiers decl_specifier -%type storage_class type_specifier type_qualifier -%type struct_or_union_specifier enum_specifier -%type init_declarator_list -%type init_declarator declarator direct_declarator -%type abs_declarator direct_abs_declarator -%type parameter_type_list parameter_list -%type parameter_declaration -%type opt_identifier_list identifier_list -%type struct_or_union pointer opt_type_qualifiers type_qualifier_list - any_id identifier_or_ref -%type enumeration - -%{ -#include -#include -#include - -#define OPT_LINTLIBRARY 1 - -#ifndef TRUE -#define TRUE (1) -#endif - -#ifndef FALSE -#define FALSE (0) -#endif - -/* #include "cproto.h" */ -#define MAX_TEXT_SIZE 1024 - -/* Prototype styles */ -#if OPT_LINTLIBRARY -#define PROTO_ANSI_LLIB -2 /* form ANSI lint-library source */ -#define PROTO_LINTLIBRARY -1 /* form lint-library source */ -#endif -#define PROTO_NONE 0 /* do not output any prototypes */ -#define PROTO_TRADITIONAL 1 /* comment out parameters */ -#define PROTO_ABSTRACT 2 /* comment out parameter names */ -#define PROTO_ANSI 3 /* ANSI C prototype */ - -typedef int PrototypeStyle; - -typedef char boolean; - -extern boolean types_out; -extern PrototypeStyle proto_style; - -#define ansiLintLibrary() (proto_style == PROTO_ANSI_LLIB) -#define knrLintLibrary() (proto_style == PROTO_LINTLIBRARY) -#define lintLibrary() (knrLintLibrary() || ansiLintLibrary()) - -#if OPT_LINTLIBRARY -#define FUNC_UNKNOWN -1 /* unspecified */ -#else -#define FUNC_UNKNOWN 0 /* unspecified (same as FUNC_NONE) */ -#endif -#define FUNC_NONE 0 /* not a function definition */ -#define FUNC_TRADITIONAL 1 /* traditional style */ -#define FUNC_ANSI 2 /* ANSI style */ -#define FUNC_BOTH 3 /* both styles */ - -typedef int FuncDefStyle; - -/* Source file text */ -typedef struct text { - char text[MAX_TEXT_SIZE]; /* source text */ - long begin; /* offset in temporary file */ -} Text; - -/* Declaration specifier flags */ -#define DS_NONE 0 /* default */ -#define DS_EXTERN 1 /* contains "extern" specifier */ -#define DS_STATIC 2 /* contains "static" specifier */ -#define DS_CHAR 4 /* contains "char" type specifier */ -#define DS_SHORT 8 /* contains "short" type specifier */ -#define DS_FLOAT 16 /* contains "float" type specifier */ -#define DS_INLINE 32 /* contains "inline" specifier */ -#define DS_JUNK 64 /* we're not interested in this declaration */ - -/* This structure stores information about a declaration specifier. */ -typedef struct decl_spec { - unsigned short flags; /* flags defined above */ - char *text; /* source text */ - long begin; /* offset in temporary file */ -} DeclSpec; - -/* This is a list of function parameters. */ -typedef struct _ParameterList { - struct parameter *first; /* pointer to first parameter in list */ - struct parameter *last; /* pointer to last parameter in list */ - long begin_comment; /* begin offset of comment */ - long end_comment; /* end offset of comment */ - char *comment; /* comment at start of parameter list */ -} ParameterList; - -/* This structure stores information about a declarator. */ -typedef struct _Declarator { - char *name; /* name of variable or function */ - char *text; /* source text */ - long begin; /* offset in temporary file */ - long begin_comment; /* begin offset of comment */ - long end_comment; /* end offset of comment */ - FuncDefStyle func_def; /* style of function definition */ - ParameterList params; /* function parameters */ - boolean pointer; /* TRUE if it declares a pointer */ - struct _Declarator *head; /* head function declarator */ - struct _Declarator *func_stack; /* stack of function declarators */ - struct _Declarator *next; /* next declarator in list */ -} Declarator; - -/* This structure stores information about a function parameter. */ -typedef struct parameter { - struct parameter *next; /* next parameter in list */ - DeclSpec decl_spec; - Declarator *declarator; - char *comment; /* comment following the parameter */ -} Parameter; - -/* This is a list of declarators. */ -typedef struct declarator_list { - Declarator *first; /* pointer to first declarator in list */ - Declarator *last; /* pointer to last declarator in list */ -} DeclaratorList; - -/* #include "symbol.h" */ -typedef struct symbol { - struct symbol *next; /* next symbol in list */ - char *name; /* name of symbol */ - char *value; /* value of symbol (for defines) */ - short flags; /* symbol attributes */ -} Symbol; - -/* parser stack entry type */ -typedef union { - Text text; - DeclSpec decl_spec; - Parameter *parameter; - ParameterList param_list; - Declarator *declarator; - DeclaratorList decl_list; -} YYSTYPE; - -/* The hash table length should be a prime number. */ -#define SYM_MAX_HASH 251 - -typedef struct symbol_table { - Symbol *bucket[SYM_MAX_HASH]; /* hash buckets */ -} SymbolTable; - -extern SymbolTable *new_symbol_table /* Create symbol table */ - (void); -extern void free_symbol_table /* Destroy symbol table */ - (SymbolTable *s); -extern Symbol *find_symbol /* Lookup symbol name */ - (SymbolTable *s, const char *n); -extern Symbol *new_symbol /* Define new symbol */ - (SymbolTable *s, const char *n, const char *v, int f); - -/* #include "semantic.h" */ -extern void new_decl_spec (DeclSpec *, const char *, long, int); -extern void free_decl_spec (DeclSpec *); -extern void join_decl_specs (DeclSpec *, DeclSpec *, DeclSpec *); -extern void check_untagged (DeclSpec *); -extern Declarator *new_declarator (const char *, const char *, long); -extern void free_declarator (Declarator *); -extern void new_decl_list (DeclaratorList *, Declarator *); -extern void free_decl_list (DeclaratorList *); -extern void add_decl_list (DeclaratorList *, DeclaratorList *, Declarator *); -extern Parameter *new_parameter (DeclSpec *, Declarator *); -extern void free_parameter (Parameter *); -extern void new_param_list (ParameterList *, Parameter *); -extern void free_param_list (ParameterList *); -extern void add_param_list (ParameterList *, ParameterList *, Parameter *); -extern void new_ident_list (ParameterList *); -extern void add_ident_list (ParameterList *, ParameterList *, const char *); -extern void set_param_types (ParameterList *, DeclSpec *, DeclaratorList *); -extern void gen_declarations (DeclSpec *, DeclaratorList *); -extern void gen_prototype (DeclSpec *, Declarator *); -extern void gen_func_declarator (Declarator *); -extern void gen_func_definition (DeclSpec *, Declarator *); - -extern void init_parser (void); -extern void process_file (FILE *infile, char *name); -extern char *cur_text (void); -extern char *cur_file_name (void); -extern char *implied_typedef (void); -extern void include_file (char *name, int convert); -extern char *supply_parm (int count); -extern char *xstrdup (const char *); -extern int already_declared (char *name); -extern int is_actual_func (Declarator *d); -extern int lint_ellipsis (Parameter *p); -extern int want_typedef (void); -extern void begin_tracking (void); -extern void begin_typedef (void); -extern void copy_typedef (char *s); -extern void ellipsis_varargs (Declarator *d); -extern void end_typedef (void); -extern void flush_varargs (void); -extern void fmt_library (int code); -extern void imply_typedef (const char *s); -extern void indent (FILE *outf); -extern void put_blankline (FILE *outf); -extern void put_body (FILE *outf, DeclSpec *decl_spec, Declarator *declarator); -extern void put_char (FILE *outf, int c); -extern void put_error (void); -extern void put_newline (FILE *outf); -extern void put_padded (FILE *outf, const char *s); -extern void put_string (FILE *outf, const char *s); -extern void track_in (void); - -extern boolean file_comments; -extern FuncDefStyle func_style; -extern char base_file[]; - -extern int yylex (void); - -/* declaration specifier attributes for the typedef statement currently being - * scanned - */ -static int cur_decl_spec_flags; - -/* pointer to parameter list for the current function definition */ -static ParameterList *func_params; - -/* A parser semantic action sets this pointer to the current declarator in - * a function parameter declaration in order to catch any comments following - * the parameter declaration on the same line. If the lexer scans a comment - * and is not NULL, then the comment is attached to the - * declarator. To ignore subsequent comments, the lexer sets this to NULL - * after scanning a comment or end of line. - */ -static Declarator *cur_declarator; - -/* temporary string buffer */ -static char buf[MAX_TEXT_SIZE]; - -/* table of typedef names */ -static SymbolTable *typedef_names; - -/* table of define names */ -static SymbolTable *define_names; - -/* table of type qualifiers */ -static SymbolTable *type_qualifiers; - -/* information about the current input file */ -typedef struct { - char *base_name; /* base input file name */ - char *file_name; /* current file name */ - FILE *file; /* input file */ - unsigned line_num; /* current line number in input file */ - FILE *tmp_file; /* temporary file */ - long begin_comment; /* tmp file offset after last written ) or ; */ - long end_comment; /* tmp file offset after last comment */ - boolean convert; /* if TRUE, convert function definitions */ - boolean changed; /* TRUE if conversion done in this file */ -} IncludeStack; - -static IncludeStack *cur_file; /* current input file */ - -/* #include "yyerror.c" */ - -static int haveAnsiParam (void); - - -/* Flags to enable us to find if a procedure returns a value. - */ -static int return_val; /* nonzero on BRACES iff return-expression found */ - -static const char * -dft_decl_spec (void) -{ - return (lintLibrary() && !return_val) ? "void" : "int"; -} - -static int -haveAnsiParam (void) -{ - Parameter *p; - if (func_params != 0) { - for (p = func_params->first; p != 0; p = p->next) { - if (p->declarator->func_def == FUNC_ANSI) { - return TRUE; - } - } - } - return FALSE; -} -%} -%% - -program - : /* empty */ - | translation_unit - ; - -translation_unit - : external_declaration - | translation_unit external_declaration - ; - -external_declaration - : declaration - | function_definition - | ';' - | linkage_specification - | T_ASM T_ASMARG ';' - | error T_MATCHRBRACE - { - yyerrok; - } - | error ';' - { - yyerrok; - } - ; - -braces - : T_LBRACE T_MATCHRBRACE - ; - -linkage_specification - : T_EXTERN T_STRING_LITERAL braces - { - /* Provide an empty action here so bison will not complain about - * incompatible types in the default action it normally would - * have generated. - */ - } - | T_EXTERN T_STRING_LITERAL declaration - { - /* empty */ - } - ; - -declaration - : decl_specifiers ';' - { -#if OPT_LINTLIBRARY - if (types_out && want_typedef()) { - gen_declarations(&$1, (DeclaratorList *)0); - flush_varargs(); - } -#endif - free_decl_spec(&$1); - end_typedef(); - } - | decl_specifiers init_declarator_list ';' - { - if (func_params != NULL) { - set_param_types(func_params, &$1, &$2); - } else { - gen_declarations(&$1, &$2); -#if OPT_LINTLIBRARY - flush_varargs(); -#endif - free_decl_list(&$2); - } - free_decl_spec(&$1); - end_typedef(); - } - | any_typedef decl_specifiers - { - cur_decl_spec_flags = $2.flags; - free_decl_spec(&$2); - } - opt_declarator_list ';' - { - end_typedef(); - } - ; - -any_typedef - : T_EXTENSION T_TYPEDEF - { - begin_typedef(); - } - | T_TYPEDEF - { - begin_typedef(); - } - ; - -opt_declarator_list - : /* empty */ - | declarator_list - ; - -declarator_list - : declarator - { - int flags = cur_decl_spec_flags; - - /* If the typedef is a pointer type, then reset the short type - * flags so it does not get promoted. - */ - if (strcmp($1->text, $1->name) != 0) - flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT); - new_symbol(typedef_names, $1->name, NULL, flags); - free_declarator($1); - } - | declarator_list ',' declarator - { - int flags = cur_decl_spec_flags; - - if (strcmp($3->text, $3->name) != 0) - flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT); - new_symbol(typedef_names, $3->name, NULL, flags); - free_declarator($3); - } - ; - -function_definition - : decl_specifiers declarator - { - check_untagged(&$1); - if ($2->func_def == FUNC_NONE) { - yyerror("syntax error"); - YYERROR; - } - func_params = &($2->head->params); - func_params->begin_comment = cur_file->begin_comment; - func_params->end_comment = cur_file->end_comment; - } - opt_declaration_list T_LBRACE - { - /* If we're converting to K&R and we've got a nominally K&R - * function which has a parameter which is ANSI (i.e., a prototyped - * function pointer), then we must override the deciphered value of - * 'func_def' so that the parameter will be converted. - */ - if (func_style == FUNC_TRADITIONAL - && haveAnsiParam() - && $2->head->func_def == func_style) { - $2->head->func_def = FUNC_BOTH; - } - - func_params = NULL; - - if (cur_file->convert) - gen_func_definition(&$1, $2); - gen_prototype(&$1, $2); -#if OPT_LINTLIBRARY - flush_varargs(); -#endif - free_decl_spec(&$1); - free_declarator($2); - } - T_MATCHRBRACE - | declarator - { - if ($1->func_def == FUNC_NONE) { - yyerror("syntax error"); - YYERROR; - } - func_params = &($1->head->params); - func_params->begin_comment = cur_file->begin_comment; - func_params->end_comment = cur_file->end_comment; - } - opt_declaration_list T_LBRACE T_MATCHRBRACE - { - DeclSpec decl_spec; - - func_params = NULL; - - new_decl_spec(&decl_spec, dft_decl_spec(), $1->begin, DS_NONE); - if (cur_file->convert) - gen_func_definition(&decl_spec, $1); - gen_prototype(&decl_spec, $1); -#if OPT_LINTLIBRARY - flush_varargs(); -#endif - free_decl_spec(&decl_spec); - free_declarator($1); - } - ; - -opt_declaration_list - : /* empty */ - | T_VA_DCL - | declaration_list - ; - -declaration_list - : declaration - | declaration_list declaration - ; - -decl_specifiers - : decl_specifier - | decl_specifiers decl_specifier - { - join_decl_specs(&$$, &$1, &$2); - free($1.text); - free($2.text); - } - ; - -decl_specifier - : storage_class - | type_specifier - | type_qualifier - ; - -storage_class - : T_AUTO - { - new_decl_spec(&$$, $1.text, $1.begin, DS_NONE); - } - | T_EXTERN - { - new_decl_spec(&$$, $1.text, $1.begin, DS_EXTERN); - } - | T_REGISTER - { - new_decl_spec(&$$, $1.text, $1.begin, DS_NONE); - } - | T_STATIC - { - new_decl_spec(&$$, $1.text, $1.begin, DS_STATIC); - } - | T_INLINE - { - new_decl_spec(&$$, $1.text, $1.begin, DS_INLINE); - } - | T_EXTENSION - { - new_decl_spec(&$$, $1.text, $1.begin, DS_JUNK); - } - ; - -type_specifier - : T_CHAR - { - new_decl_spec(&$$, $1.text, $1.begin, DS_CHAR); - } - | T_DOUBLE - { - new_decl_spec(&$$, $1.text, $1.begin, DS_NONE); - } - | T_FLOAT - { - new_decl_spec(&$$, $1.text, $1.begin, DS_FLOAT); - } - | T_INT - { - new_decl_spec(&$$, $1.text, $1.begin, DS_NONE); - } - | T_LONG - { - new_decl_spec(&$$, $1.text, $1.begin, DS_NONE); - } - | T_SHORT - { - new_decl_spec(&$$, $1.text, $1.begin, DS_SHORT); - } - | T_SIGNED - { - new_decl_spec(&$$, $1.text, $1.begin, DS_NONE); - } - | T_UNSIGNED - { - new_decl_spec(&$$, $1.text, $1.begin, DS_NONE); - } - | T_VOID - { - new_decl_spec(&$$, $1.text, $1.begin, DS_NONE); - } - | T_Bool - { - new_decl_spec(&$$, $1.text, $1.begin, DS_CHAR); - } - | T_Complex - { - new_decl_spec(&$$, $1.text, $1.begin, DS_NONE); - } - | T_Imaginary - { - new_decl_spec(&$$, $1.text, $1.begin, DS_NONE); - } - | T_TYPEDEF_NAME - { - Symbol *s; - s = find_symbol(typedef_names, $1.text); - if (s != NULL) - new_decl_spec(&$$, $1.text, $1.begin, s->flags); - } - | struct_or_union_specifier - | enum_specifier - ; - -type_qualifier - : T_TYPE_QUALIFIER - { - new_decl_spec(&$$, $1.text, $1.begin, DS_NONE); - } - | T_DEFINE_NAME - { - /* This rule allows the nonterminal to scan #define - * names as if they were type modifiers. - */ - Symbol *s; - s = find_symbol(define_names, $1.text); - if (s != NULL) - new_decl_spec(&$$, $1.text, $1.begin, s->flags); - } - ; - -struct_or_union_specifier - : struct_or_union any_id braces - { - char *s; - if ((s = implied_typedef()) == 0) - (void)sprintf(s = buf, "%s %s", $1.text, $2.text); - new_decl_spec(&$$, s, $1.begin, DS_NONE); - } - | struct_or_union braces - { - char *s; - if ((s = implied_typedef()) == 0) - (void)sprintf(s = buf, "%s {}", $1.text); - new_decl_spec(&$$, s, $1.begin, DS_NONE); - } - | struct_or_union any_id - { - (void)sprintf(buf, "%s %s", $1.text, $2.text); - new_decl_spec(&$$, buf, $1.begin, DS_NONE); - } - ; - -struct_or_union - : T_STRUCT - { - imply_typedef($$.text); - } - | T_UNION - { - imply_typedef($$.text); - } - ; - -init_declarator_list - : init_declarator - { - new_decl_list(&$$, $1); - } - | init_declarator_list ',' init_declarator - { - add_decl_list(&$$, &$1, $3); - } - ; - -init_declarator - : declarator - { - if ($1->func_def != FUNC_NONE && func_params == NULL && - func_style == FUNC_TRADITIONAL && cur_file->convert) { - gen_func_declarator($1); - fputs(cur_text(), cur_file->tmp_file); - } - cur_declarator = $$; - } - | declarator '=' - { - if ($1->func_def != FUNC_NONE && func_params == NULL && - func_style == FUNC_TRADITIONAL && cur_file->convert) { - gen_func_declarator($1); - fputs(" =", cur_file->tmp_file); - } - } - T_INITIALIZER - ; - -enum_specifier - : enumeration any_id braces - { - char *s; - if ((s = implied_typedef()) == 0) - (void)sprintf(s = buf, "enum %s", $2.text); - new_decl_spec(&$$, s, $1.begin, DS_NONE); - } - | enumeration braces - { - char *s; - if ((s = implied_typedef()) == 0) - (void)sprintf(s = buf, "%s {}", $1.text); - new_decl_spec(&$$, s, $1.begin, DS_NONE); - } - | enumeration any_id - { - (void)sprintf(buf, "enum %s", $2.text); - new_decl_spec(&$$, buf, $1.begin, DS_NONE); - } - ; - -enumeration - : T_ENUM - { - imply_typedef("enum"); - $$ = $1; - } - ; - -any_id - : T_IDENTIFIER - | T_TYPEDEF_NAME - ; - -declarator - : pointer direct_declarator - { - $$ = $2; - (void)sprintf(buf, "%s%s", $1.text, $$->text); - free($$->text); - $$->text = xstrdup(buf); - $$->begin = $1.begin; - $$->pointer = TRUE; - } - | direct_declarator - ; - -direct_declarator - : identifier_or_ref - { - $$ = new_declarator($1.text, $1.text, $1.begin); - } - | '(' declarator ')' - { - $$ = $2; - (void)sprintf(buf, "(%s)", $$->text); - free($$->text); - $$->text = xstrdup(buf); - $$->begin = $1.begin; - } - | direct_declarator T_BRACKETS - { - $$ = $1; - (void)sprintf(buf, "%s%s", $$->text, $2.text); - free($$->text); - $$->text = xstrdup(buf); - } - | direct_declarator '(' parameter_type_list ')' - { - $$ = new_declarator("%s()", $1->name, $1->begin); - $$->params = $3; - $$->func_stack = $1; - $$->head = ($1->func_stack == NULL) ? $$ : $1->head; - $$->func_def = FUNC_ANSI; - } - | direct_declarator '(' opt_identifier_list ')' - { - $$ = new_declarator("%s()", $1->name, $1->begin); - $$->params = $3; - $$->func_stack = $1; - $$->head = ($1->func_stack == NULL) ? $$ : $1->head; - $$->func_def = FUNC_TRADITIONAL; - } - ; - -pointer - : '*' opt_type_qualifiers - { - (void)sprintf($$.text, "*%s", $2.text); - $$.begin = $1.begin; - } - | '*' opt_type_qualifiers pointer - { - (void)sprintf($$.text, "*%s%s", $2.text, $3.text); - $$.begin = $1.begin; - } - ; - -opt_type_qualifiers - : /* empty */ - { - strcpy($$.text, ""); - $$.begin = 0L; - } - | type_qualifier_list - ; - -type_qualifier_list - : type_qualifier - { - (void)sprintf($$.text, "%s ", $1.text); - $$.begin = $1.begin; - free($1.text); - } - | type_qualifier_list type_qualifier - { - (void)sprintf($$.text, "%s%s ", $1.text, $2.text); - $$.begin = $1.begin; - free($2.text); - } - ; - -parameter_type_list - : parameter_list - | parameter_list ',' T_ELLIPSIS - { - add_ident_list(&$$, &$1, "..."); - } - ; - -parameter_list - : parameter_declaration - { - new_param_list(&$$, $1); - } - | parameter_list ',' parameter_declaration - { - add_param_list(&$$, &$1, $3); - } - ; - -parameter_declaration - : decl_specifiers declarator - { - check_untagged(&$1); - $$ = new_parameter(&$1, $2); - } - | decl_specifiers abs_declarator - { - check_untagged(&$1); - $$ = new_parameter(&$1, $2); - } - | decl_specifiers - { - check_untagged(&$1); - $$ = new_parameter(&$1, (Declarator *)0); - } - ; - -opt_identifier_list - : /* empty */ - { - new_ident_list(&$$); - } - | identifier_list - ; - -identifier_list - : any_id - { - new_ident_list(&$$); - add_ident_list(&$$, &$$, $1.text); - } - | identifier_list ',' any_id - { - add_ident_list(&$$, &$1, $3.text); - } - ; - -identifier_or_ref - : any_id - { - $$ = $1; - } - | '&' any_id - { -#if OPT_LINTLIBRARY - if (lintLibrary()) { /* Lint doesn't grok C++ ref variables */ - $$ = $2; - } else -#endif - (void)sprintf($$.text, "&%s", $2.text); - $$.begin = $1.begin; - } - ; - -abs_declarator - : pointer - { - $$ = new_declarator($1.text, "", $1.begin); - } - | pointer direct_abs_declarator - { - $$ = $2; - (void)sprintf(buf, "%s%s", $1.text, $$->text); - free($$->text); - $$->text = xstrdup(buf); - $$->begin = $1.begin; - } - | direct_abs_declarator - ; - -direct_abs_declarator - : '(' abs_declarator ')' - { - $$ = $2; - (void)sprintf(buf, "(%s)", $$->text); - free($$->text); - $$->text = xstrdup(buf); - $$->begin = $1.begin; - } - | direct_abs_declarator T_BRACKETS - { - $$ = $1; - (void)sprintf(buf, "%s%s", $$->text, $2.text); - free($$->text); - $$->text = xstrdup(buf); - } - | T_BRACKETS - { - $$ = new_declarator($1.text, "", $1.begin); - } - | direct_abs_declarator '(' parameter_type_list ')' - { - $$ = new_declarator("%s()", "", $1->begin); - $$->params = $3; - $$->func_stack = $1; - $$->head = ($1->func_stack == NULL) ? $$ : $1->head; - $$->func_def = FUNC_ANSI; - } - | direct_abs_declarator '(' ')' - { - $$ = new_declarator("%s()", "", $1->begin); - $$->func_stack = $1; - $$->head = ($1->func_stack == NULL) ? $$ : $1->head; - $$->func_def = FUNC_ANSI; - } - | '(' parameter_type_list ')' - { - Declarator *d; - - d = new_declarator("", "", $1.begin); - $$ = new_declarator("%s()", "", $1.begin); - $$->params = $2; - $$->func_stack = d; - $$->head = $$; - $$->func_def = FUNC_ANSI; - } - | '(' ')' - { - Declarator *d; - - d = new_declarator("", "", $1.begin); - $$ = new_declarator("%s()", "", $1.begin); - $$->func_stack = d; - $$->head = $$; - $$->func_def = FUNC_ANSI; - } - ; - -%% - -/* lex.yy.c */ -#define BEGIN yy_start = 1 + 2 * - -#define CPP1 1 -#define INIT1 2 -#define INIT2 3 -#define CURLY 4 -#define LEXYACC 5 -#define ASM 6 -#define CPP_INLINE 7 - -extern char *yytext; -extern FILE *yyin, *yyout; - -static int curly; /* number of curly brace nesting levels */ -static int ly_count; /* number of occurrences of %% */ -static int inc_depth; /* include nesting level */ -static SymbolTable *included_files; /* files already included */ -static int yy_start = 0; /* start state number */ - -#define grammar_error(s) yaccError(s) - -static void -yaccError (const char *msg) -{ - func_params = NULL; - put_error(); /* tell what line we're on, and what file */ - fprintf(stderr, "%s at token '%s'\n", msg, yytext); -} - -/* Initialize the table of type qualifier keywords recognized by the lexical - * analyzer. - */ -void -init_parser (void) -{ - static const char *keywords[] = { - "const", - "restrict", - "volatile", - "interrupt", -#ifdef vms - "noshare", - "readonly", -#endif -#if defined(MSDOS) || defined(OS2) - "__cdecl", - "__export", - "__far", - "__fastcall", - "__fortran", - "__huge", - "__inline", - "__interrupt", - "__loadds", - "__near", - "__pascal", - "__saveregs", - "__segment", - "__stdcall", - "__syscall", - "_cdecl", - "_cs", - "_ds", - "_es", - "_export", - "_far", - "_fastcall", - "_fortran", - "_huge", - "_interrupt", - "_loadds", - "_near", - "_pascal", - "_saveregs", - "_seg", - "_segment", - "_ss", - "cdecl", - "far", - "huge", - "near", - "pascal", -#ifdef OS2 - "__far16", -#endif -#endif -#ifdef __GNUC__ - /* gcc aliases */ - "__builtin_va_arg", - "__builtin_va_list", - "__const", - "__const__", - "__inline", - "__inline__", - "__restrict", - "__restrict__", - "__volatile", - "__volatile__", -#endif - }; - unsigned i; - - /* Initialize type qualifier table. */ - type_qualifiers = new_symbol_table(); - for (i = 0; i < sizeof(keywords)/sizeof(keywords[0]); ++i) { - new_symbol(type_qualifiers, keywords[i], NULL, DS_NONE); - } -} - -/* Process the C source file. Write function prototypes to the standard - * output. Convert function definitions and write the converted source - * code to a temporary file. - */ -void -process_file (FILE *infile, char *name) -{ - char *s; - - if (strlen(name) > 2) { - s = name + strlen(name) - 2; - if (*s == '.') { - ++s; - if (*s == 'l' || *s == 'y') - BEGIN LEXYACC; -#if defined(MSDOS) || defined(OS2) - if (*s == 'L' || *s == 'Y') - BEGIN LEXYACC; -#endif - } - } - - included_files = new_symbol_table(); - typedef_names = new_symbol_table(); - define_names = new_symbol_table(); - inc_depth = -1; - curly = 0; - ly_count = 0; - func_params = NULL; - yyin = infile; - include_file(strcpy(base_file, name), func_style != FUNC_NONE); - if (file_comments) { -#if OPT_LINTLIBRARY - if (lintLibrary()) { - put_blankline(stdout); - begin_tracking(); - } -#endif - put_string(stdout, "/* "); - put_string(stdout, cur_file_name()); - put_string(stdout, " */\n"); - } - yyparse(); - free_symbol_table(define_names); - free_symbol_table(typedef_names); - free_symbol_table(included_files); -} - -#ifdef NO_LEAKS -void -free_parser(void) -{ - free_symbol_table (type_qualifiers); -#ifdef FLEX_SCANNER - if (yy_current_buffer != 0) - yy_delete_buffer(yy_current_buffer); -#endif -} -#endif Property changes on: stable/10/usr.bin/yacc/tests/grammar.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/ftp.y =================================================================== --- stable/10/usr.bin/yacc/tests/ftp.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/ftp.y (nonexistent) @@ -1,1228 +0,0 @@ -/* - * Copyright (c) 1985, 1988 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * @(#)ftpcmd.y 5.20.1.1 (Berkeley) 3/2/89 - */ - -/* - * Grammar for FTP commands. - * See RFC 959. - */ - -%{ - -/* sccsid[] = "@(#)ftpcmd.y 5.20.1.1 (Berkeley) 3/2/89"; */ - -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef YYBISON -int yylex(void); -static void yyerror(const char *); -#endif - -extern struct sockaddr_in data_dest; -extern int logged_in; -extern struct passwd *pw; -extern int guest; -extern int logging; -extern int type; -extern int form; -extern int debug; -extern int timeout; -extern int maxtimeout; -extern int pdata; -extern char hostname[], remotehost[]; -extern char proctitle[]; -extern char *globerr; -extern int usedefault; -extern int transflag; -extern char tmpline[]; - -extern char **glob(char *); -extern char *renamefrom(char *); -extern void cwd(const char *); - -extern void dologout(int); -extern void fatal(const char *); -extern void makedir(const char *); -extern void nack(const char *); -extern void pass(const char *); -extern void passive(void); -extern void pwd(void); -extern void removedir(char *); -extern void renamecmd(char *, char *); -extern void retrieve(const char *, const char *); -extern void send_file_list(const char *); -extern void statcmd(void); -extern void statfilecmd(const char *); -extern void store(char *, const char *, int); -extern void user(const char *); - -extern void perror_reply(int, const char *, ...); -extern void reply(int, const char *, ...); -extern void lreply(int, const char *, ...); - -static int cmd_type; -static int cmd_form; -static int cmd_bytesz; -char cbuf[512]; -char *fromname; - -struct tab { - const char *name; - short token; - short state; - short implemented; /* 1 if command is implemented */ - const char *help; -}; - -static char * copy(const char *); - -#ifdef YYBISON -static void sizecmd(char *filename); -static void help(struct tab *ctab, char *s); -struct tab cmdtab[]; -struct tab sitetab[]; -#endif - -static void -yyerror(const char *msg) -{ - perror(msg); -} -%} - -%token - A B C E F I - L N P R S T - - SP CRLF COMMA STRING NUMBER - - USER PASS ACCT REIN QUIT PORT - PASV TYPE STRU MODE RETR STOR - APPE MLFL MAIL MSND MSOM MSAM - MRSQ MRCP ALLO REST RNFR RNTO - ABOR DELE CWD LIST NLST SITE - STAT HELP NOOP MKD RMD PWD - CDUP STOU SMNT SYST SIZE MDTM - - UMASK IDLE CHMOD - - LEXERR - -%start cmd_list - -%% - -cmd_list: /* empty */ - | cmd_list cmd - { - fromname = (char *) 0; - } - | cmd_list rcmd - ; - -cmd: USER SP username CRLF - { - user((char *) $3); - free((char *) $3); - } - | PASS SP password CRLF - { - pass((char *) $3); - free((char *) $3); - } - | PORT SP host_port CRLF - { - usedefault = 0; - if (pdata >= 0) { - (void) close(pdata); - pdata = -1; - } - reply(200, "PORT command successful."); - } - | PASV CRLF - { - passive(); - } - | TYPE SP type_code CRLF - { - switch (cmd_type) { - - case TYPE_A: - if (cmd_form == FORM_N) { - reply(200, "Type set to A."); - type = cmd_type; - form = cmd_form; - } else - reply(504, "Form must be N."); - break; - - case TYPE_E: - reply(504, "Type E not implemented."); - break; - - case TYPE_I: - reply(200, "Type set to I."); - type = cmd_type; - break; - - case TYPE_L: -#if NBBY == 8 - if (cmd_bytesz == 8) { - reply(200, - "Type set to L (byte size 8)."); - type = cmd_type; - } else - reply(504, "Byte size must be 8."); -#else /* NBBY == 8 */ - UNIMPLEMENTED for NBBY != 8 -#endif /* NBBY == 8 */ - } - } - | STRU SP struct_code CRLF - { - switch ($3) { - - case STRU_F: - reply(200, "STRU F ok."); - break; - - default: - reply(504, "Unimplemented STRU type."); - } - } - | MODE SP mode_code CRLF - { - switch ($3) { - - case MODE_S: - reply(200, "MODE S ok."); - break; - - default: - reply(502, "Unimplemented MODE type."); - } - } - | ALLO SP NUMBER CRLF - { - reply(202, "ALLO command ignored."); - } - | ALLO SP NUMBER SP R SP NUMBER CRLF - { - reply(202, "ALLO command ignored."); - } - | RETR check_login SP pathname CRLF - { - if ($2 && $4 != 0) - retrieve((char *) 0, (char *) $4); - if ($4 != 0) - free((char *) $4); - } - | STOR check_login SP pathname CRLF - { - if ($2 && $4 != 0) - store((char *) $4, "w", 0); - if ($4 != 0) - free((char *) $4); - } - | APPE check_login SP pathname CRLF - { - if ($2 && $4 != 0) - store((char *) $4, "a", 0); - if ($4 != 0) - free((char *) $4); - } - | NLST check_login CRLF - { - if ($2) - send_file_list("."); - } - | NLST check_login SP STRING CRLF - { - if ($2 && $4 != 0) - send_file_list((char *) $4); - if ($4 != 0) - free((char *) $4); - } - | LIST check_login CRLF - { - if ($2) - retrieve("/bin/ls -lgA", ""); - } - | LIST check_login SP pathname CRLF - { - if ($2 && $4 != 0) - retrieve("/bin/ls -lgA %s", (char *) $4); - if ($4 != 0) - free((char *) $4); - } - | STAT check_login SP pathname CRLF - { - if ($2 && $4 != 0) - statfilecmd((char *) $4); - if ($4 != 0) - free((char *) $4); - } - | STAT CRLF - { - statcmd(); - } - | DELE check_login SP pathname CRLF - { - if ($2 && $4 != 0) - remove((char *) $4); - if ($4 != 0) - free((char *) $4); - } - | RNTO SP pathname CRLF - { - if (fromname) { - renamecmd(fromname, (char *) $3); - free(fromname); - fromname = (char *) 0; - } else { - reply(503, "Bad sequence of commands."); - } - free((char *) $3); - } - | ABOR CRLF - { - reply(225, "ABOR command successful."); - } - | CWD check_login CRLF - { - if ($2) - cwd(pw->pw_dir); - } - | CWD check_login SP pathname CRLF - { - if ($2 && $4 != 0) - cwd((char *) $4); - if ($4 != 0) - free((char *) $4); - } - | HELP CRLF - { - help(cmdtab, (char *) 0); - } - | HELP SP STRING CRLF - { - register char *cp = (char *)$3; - - if (strncasecmp(cp, "SITE", 4) == 0) { - cp = (char *)$3 + 4; - if (*cp == ' ') - cp++; - if (*cp) - help(sitetab, cp); - else - help(sitetab, (char *) 0); - } else - help(cmdtab, (char *) $3); - } - | NOOP CRLF - { - reply(200, "NOOP command successful."); - } - | MKD check_login SP pathname CRLF - { - if ($2 && $4 != 0) - makedir((char *) $4); - if ($4 != 0) - free((char *) $4); - } - | RMD check_login SP pathname CRLF - { - if ($2 && $4 != 0) - removedir((char *) $4); - if ($4 != 0) - free((char *) $4); - } - | PWD check_login CRLF - { - if ($2) - pwd(); - } - | CDUP check_login CRLF - { - if ($2) - cwd(".."); - } - | SITE SP HELP CRLF - { - help(sitetab, (char *) 0); - } - | SITE SP HELP SP STRING CRLF - { - help(sitetab, (char *) $5); - } - | SITE SP UMASK check_login CRLF - { - int oldmask; - - if ($4) { - oldmask = umask(0); - (void) umask(oldmask); - reply(200, "Current UMASK is %03o", oldmask); - } - } - | SITE SP UMASK check_login SP octal_number CRLF - { - int oldmask; - - if ($4) { - if (($6 == -1) || ($6 > 0777)) { - reply(501, "Bad UMASK value"); - } else { - oldmask = umask($6); - reply(200, - "UMASK set to %03o (was %03o)", - $6, oldmask); - } - } - } - | SITE SP CHMOD check_login SP octal_number SP pathname CRLF - { - if ($4 && ($8 != 0)) { - if ($6 > 0777) - reply(501, - "CHMOD: Mode value must be between 0 and 0777"); - else if (chmod((char *) $8, $6) < 0) - perror_reply(550, (char *) $8); - else - reply(200, "CHMOD command successful."); - } - if ($8 != 0) - free((char *) $8); - } - | SITE SP IDLE CRLF - { - reply(200, - "Current IDLE time limit is %d seconds; max %d", - timeout, maxtimeout); - } - | SITE SP IDLE SP NUMBER CRLF - { - if ($5 < 30 || $5 > maxtimeout) { - reply(501, - "Maximum IDLE time must be between 30 and %d seconds", - maxtimeout); - } else { - timeout = $5; - (void) alarm((unsigned) timeout); - reply(200, - "Maximum IDLE time set to %d seconds", - timeout); - } - } - | STOU check_login SP pathname CRLF - { - if ($2 && $4 != 0) - store((char *) $4, "w", 1); - if ($4 != 0) - free((char *) $4); - } - | SYST CRLF - { -#ifdef unix -#ifdef BSD - reply(215, "UNIX Type: L%d Version: BSD-%d", - NBBY, BSD); -#else /* BSD */ - reply(215, "UNIX Type: L%d", NBBY); -#endif /* BSD */ -#else /* unix */ - reply(215, "UNKNOWN Type: L%d", NBBY); -#endif /* unix */ - } - - /* - * SIZE is not in RFC959, but Postel has blessed it and - * it will be in the updated RFC. - * - * Return size of file in a format suitable for - * using with RESTART (we just count bytes). - */ - | SIZE check_login SP pathname CRLF - { - if ($2 && $4 != 0) - sizecmd((char *) $4); - if ($4 != 0) - free((char *) $4); - } - - /* - * MDTM is not in RFC959, but Postel has blessed it and - * it will be in the updated RFC. - * - * Return modification time of file as an ISO 3307 - * style time. E.g. YYYYMMDDHHMMSS or YYYYMMDDHHMMSS.xxx - * where xxx is the fractional second (of any precision, - * not necessarily 3 digits) - */ - | MDTM check_login SP pathname CRLF - { - if ($2 && $4 != 0) { - struct stat stbuf; - if (stat((char *) $4, &stbuf) < 0) - perror_reply(550, "%s", (char *) $4); - else if ((stbuf.st_mode&S_IFMT) != S_IFREG) { - reply(550, "%s: not a plain file.", - (char *) $4); - } else { - register struct tm *t; - t = gmtime(&stbuf.st_mtime); - reply(213, - "%04d%02d%02d%02d%02d%02d", - 1900 + t->tm_year, - t->tm_mon+1, t->tm_mday, - t->tm_hour, t->tm_min, t->tm_sec); - } - } - if ($4 != 0) - free((char *) $4); - } - | QUIT CRLF - { - reply(221, "Goodbye."); - dologout(0); - } - | error CRLF - { - yyerrok; - } - ; -rcmd: RNFR check_login SP pathname CRLF - { - if ($2 && $4) { - fromname = renamefrom((char *) $4); - if (fromname == (char *) 0 && $4) { - free((char *) $4); - } - } - } - ; - -username: STRING - ; - -password: /* empty */ - { - *(const char **)(&($$)) = ""; - } - | STRING - ; - -byte_size: NUMBER - ; - -host_port: NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA - NUMBER COMMA NUMBER - { - register char *a, *p; - - a = (char *)&data_dest.sin_addr; - a[0] = $1; a[1] = $3; a[2] = $5; a[3] = $7; - p = (char *)&data_dest.sin_port; - p[0] = $9; p[1] = $11; - data_dest.sin_family = AF_INET; - } - ; - -form_code: N - { - $$ = FORM_N; - } - | T - { - $$ = FORM_T; - } - | C - { - $$ = FORM_C; - } - ; - -type_code: A - { - cmd_type = TYPE_A; - cmd_form = FORM_N; - } - | A SP form_code - { - cmd_type = TYPE_A; - cmd_form = $3; - } - | E - { - cmd_type = TYPE_E; - cmd_form = FORM_N; - } - | E SP form_code - { - cmd_type = TYPE_E; - cmd_form = $3; - } - | I - { - cmd_type = TYPE_I; - } - | L - { - cmd_type = TYPE_L; - cmd_bytesz = NBBY; - } - | L SP byte_size - { - cmd_type = TYPE_L; - cmd_bytesz = $3; - } - /* this is for a bug in the BBN ftp */ - | L byte_size - { - cmd_type = TYPE_L; - cmd_bytesz = $2; - } - ; - -struct_code: F - { - $$ = STRU_F; - } - | R - { - $$ = STRU_R; - } - | P - { - $$ = STRU_P; - } - ; - -mode_code: S - { - $$ = MODE_S; - } - | B - { - $$ = MODE_B; - } - | C - { - $$ = MODE_C; - } - ; - -pathname: pathstring - { - /* - * Problem: this production is used for all pathname - * processing, but only gives a 550 error reply. - * This is a valid reply in some cases but not in others. - */ - if (logged_in && $1 && strncmp((char *) $1, "~", 1) == 0) { - *(char **)&($$) = *glob((char *) $1); - if (globerr != 0) { - reply(550, globerr); - $$ = 0; - } - free((char *) $1); - } else - $$ = $1; - } - ; - -pathstring: STRING - ; - -octal_number: NUMBER - { - register int ret, dec, multby, digit; - - /* - * Convert a number that was read as decimal number - * to what it would be if it had been read as octal. - */ - dec = $1; - multby = 1; - ret = 0; - while (dec) { - digit = dec%10; - if (digit > 7) { - ret = -1; - break; - } - ret += digit * multby; - multby *= 8; - dec /= 10; - } - $$ = ret; - } - ; - -check_login: /* empty */ - { - if (logged_in) - $$ = 1; - else { - reply(530, "Please login with USER and PASS."); - $$ = 0; - } - } - ; - -%% - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -extern jmp_buf errcatch; - -static void upper(char *); - -#define CMD 0 /* beginning of command */ -#define ARGS 1 /* expect miscellaneous arguments */ -#define STR1 2 /* expect SP followed by STRING */ -#define STR2 3 /* expect STRING */ -#define OSTR 4 /* optional SP then STRING */ -#define ZSTR1 5 /* SP then optional STRING */ -#define ZSTR2 6 /* optional STRING after SP */ -#define SITECMD 7 /* SITE command */ -#define NSTR 8 /* Number followed by a string */ - -struct tab cmdtab[] = { /* In order defined in RFC 765 */ - { "USER", USER, STR1, 1, " username" }, - { "PASS", PASS, ZSTR1, 1, " password" }, - { "ACCT", ACCT, STR1, 0, "(specify account)" }, - { "SMNT", SMNT, ARGS, 0, "(structure mount)" }, - { "REIN", REIN, ARGS, 0, "(reinitialize server state)" }, - { "QUIT", QUIT, ARGS, 1, "(terminate service)", }, - { "PORT", PORT, ARGS, 1, " b0, b1, b2, b3, b4" }, - { "PASV", PASV, ARGS, 1, "(set server in passive mode)" }, - { "TYPE", TYPE, ARGS, 1, " [ A | E | I | L ]" }, - { "STRU", STRU, ARGS, 1, "(specify file structure)" }, - { "MODE", MODE, ARGS, 1, "(specify transfer mode)" }, - { "RETR", RETR, STR1, 1, " file-name" }, - { "STOR", STOR, STR1, 1, " file-name" }, - { "APPE", APPE, STR1, 1, " file-name" }, - { "MLFL", MLFL, OSTR, 0, "(mail file)" }, - { "MAIL", MAIL, OSTR, 0, "(mail to user)" }, - { "MSND", MSND, OSTR, 0, "(mail send to terminal)" }, - { "MSOM", MSOM, OSTR, 0, "(mail send to terminal or mailbox)" }, - { "MSAM", MSAM, OSTR, 0, "(mail send to terminal and mailbox)" }, - { "MRSQ", MRSQ, OSTR, 0, "(mail recipient scheme question)" }, - { "MRCP", MRCP, STR1, 0, "(mail recipient)" }, - { "ALLO", ALLO, ARGS, 1, "allocate storage (vacuously)" }, - { "REST", REST, ARGS, 0, "(restart command)" }, - { "RNFR", RNFR, STR1, 1, " file-name" }, - { "RNTO", RNTO, STR1, 1, " file-name" }, - { "ABOR", ABOR, ARGS, 1, "(abort operation)" }, - { "DELE", DELE, STR1, 1, " file-name" }, - { "CWD", CWD, OSTR, 1, "[ directory-name ]" }, - { "XCWD", CWD, OSTR, 1, "[ directory-name ]" }, - { "LIST", LIST, OSTR, 1, "[ path-name ]" }, - { "NLST", NLST, OSTR, 1, "[ path-name ]" }, - { "SITE", SITE, SITECMD, 1, "site-cmd [ arguments ]" }, - { "SYST", SYST, ARGS, 1, "(get type of operating system)" }, - { "STAT", STAT, OSTR, 1, "[ path-name ]" }, - { "HELP", HELP, OSTR, 1, "[ ]" }, - { "NOOP", NOOP, ARGS, 1, "" }, - { "MKD", MKD, STR1, 1, " path-name" }, - { "XMKD", MKD, STR1, 1, " path-name" }, - { "RMD", RMD, STR1, 1, " path-name" }, - { "XRMD", RMD, STR1, 1, " path-name" }, - { "PWD", PWD, ARGS, 1, "(return current directory)" }, - { "XPWD", PWD, ARGS, 1, "(return current directory)" }, - { "CDUP", CDUP, ARGS, 1, "(change to parent directory)" }, - { "XCUP", CDUP, ARGS, 1, "(change to parent directory)" }, - { "STOU", STOU, STR1, 1, " file-name" }, - { "SIZE", SIZE, OSTR, 1, " path-name" }, - { "MDTM", MDTM, OSTR, 1, " path-name" }, - { 0, 0, 0, 0, 0 } -}; - -struct tab sitetab[] = { - { "UMASK", UMASK, ARGS, 1, "[ umask ]" }, - { "IDLE", IDLE, ARGS, 1, "[ maximum-idle-time ]" }, - { "CHMOD", CHMOD, NSTR, 1, " mode file-name" }, - { "HELP", HELP, OSTR, 1, "[ ]" }, - { 0, 0, 0, 0, 0 } -}; - -static struct tab * -lookup(struct tab *p, char *cmd) -{ - - for (; p->name != 0; p++) - if (strcmp(cmd, p->name) == 0) - return (p); - return (0); -} - -#include - -/* - * get_line - a hacked up version of fgets to ignore TELNET escape codes. - */ -static char * -get_line(char *s, int n, FILE *iop) -{ - register int c; - register char *cs; - - cs = s; -/* tmpline may contain saved command from urgent mode interruption */ - for (c = 0; tmpline[c] != '\0' && --n > 0; ++c) { - *cs++ = tmpline[c]; - if (tmpline[c] == '\n') { - *cs = '\0'; - if (debug) - syslog(LOG_DEBUG, "command: %s", s); - tmpline[0] = '\0'; - return(s); - } - if (c == 0) - tmpline[0] = '\0'; - } - while ((c = getc(iop)) != EOF) { - c &= 0377; - if (c == IAC) { - if ((c = getc(iop)) != EOF) { - c &= 0377; - switch (c) { - case WILL: - case WONT: - c = getc(iop); - printf("%c%c%c", IAC, DONT, 0377&c); - (void) fflush(stdout); - continue; - case DO: - case DONT: - c = getc(iop); - printf("%c%c%c", IAC, WONT, 0377&c); - (void) fflush(stdout); - continue; - case IAC: - break; - default: - continue; /* ignore command */ - } - } - } - *cs++ = c; - if (--n <= 0 || c == '\n') - break; - } - if (c == EOF && cs == s) - return (0); - *cs = '\0'; - if (debug) - syslog(LOG_DEBUG, "command: %s", s); - return (s); -} - -static void -toolong(int sig) -{ - time_t now; - - (void) sig; - reply(421, - "Timeout (%d seconds): closing control connection.", timeout); - (void) time(&now); - if (logging) { - syslog(LOG_INFO, - "User %s timed out after %d seconds at %s", - (pw ? pw -> pw_name : "unknown"), timeout, ctime(&now)); - } - dologout(1); -} - -int -yylex(void) -{ - static int cpos, state; - register char *cp, *cp2; - register struct tab *p; - int n; - char c; - - for (;;) { - switch (state) { - - case CMD: - (void) signal(SIGALRM, toolong); - (void) alarm((unsigned) timeout); - if (get_line(cbuf, sizeof(cbuf)-1, stdin) == 0) { - reply(221, "You could at least say goodbye."); - dologout(0); - } - (void) alarm(0); -#ifdef SETPROCTITLE - if (strncasecmp(cbuf, "PASS", 4) != 0) - setproctitle("%s: %s", proctitle, cbuf); -#endif /* SETPROCTITLE */ - if ((cp = strchr(cbuf, '\r'))) { - *cp++ = '\n'; - *cp = '\0'; - } - if ((cp = strpbrk(cbuf, " \n"))) - cpos = cp - cbuf; - if (cpos == 0) - cpos = 4; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - upper(cbuf); - p = lookup(cmdtab, cbuf); - cbuf[cpos] = c; - if (p != 0) { - if (p->implemented == 0) { - nack(p->name); - longjmp(errcatch,0); - /* NOTREACHED */ - } - state = p->state; - *(const char **)(&yylval) = p->name; - return (p->token); - } - break; - - case SITECMD: - if (cbuf[cpos] == ' ') { - cpos++; - return (SP); - } - cp = &cbuf[cpos]; - if ((cp2 = strpbrk(cp, " \n"))) - cpos = cp2 - cbuf; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - upper(cp); - p = lookup(sitetab, cp); - cbuf[cpos] = c; - if (p != 0) { - if (p->implemented == 0) { - state = CMD; - nack(p->name); - longjmp(errcatch,0); - /* NOTREACHED */ - } - state = p->state; - *(const char **)(&yylval) = p->name; - return (p->token); - } - state = CMD; - break; - - case OSTR: - if (cbuf[cpos] == '\n') { - state = CMD; - return (CRLF); - } - /* FALLTHROUGH */ - - case STR1: - case ZSTR1: - dostr1: - if (cbuf[cpos] == ' ') { - cpos++; - if (state == OSTR) - state = STR2; - else - ++state; - return (SP); - } - break; - - case ZSTR2: - if (cbuf[cpos] == '\n') { - state = CMD; - return (CRLF); - } - /* FALLTHROUGH */ - - case STR2: - cp = &cbuf[cpos]; - n = strlen(cp); - cpos += n - 1; - /* - * Make sure the string is nonempty and \n terminated. - */ - if (n > 1 && cbuf[cpos] == '\n') { - cbuf[cpos] = '\0'; - *(char **)&yylval = copy(cp); - cbuf[cpos] = '\n'; - state = ARGS; - return (STRING); - } - break; - - case NSTR: - if (cbuf[cpos] == ' ') { - cpos++; - return (SP); - } - if (isdigit(cbuf[cpos])) { - cp = &cbuf[cpos]; - while (isdigit(cbuf[++cpos])) - ; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - yylval = atoi(cp); - cbuf[cpos] = c; - state = STR1; - return (NUMBER); - } - state = STR1; - goto dostr1; - - case ARGS: - if (isdigit(cbuf[cpos])) { - cp = &cbuf[cpos]; - while (isdigit(cbuf[++cpos])) - ; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - yylval = atoi(cp); - cbuf[cpos] = c; - return (NUMBER); - } - switch (cbuf[cpos++]) { - - case '\n': - state = CMD; - return (CRLF); - - case ' ': - return (SP); - - case ',': - return (COMMA); - - case 'A': - case 'a': - return (A); - - case 'B': - case 'b': - return (B); - - case 'C': - case 'c': - return (C); - - case 'E': - case 'e': - return (E); - - case 'F': - case 'f': - return (F); - - case 'I': - case 'i': - return (I); - - case 'L': - case 'l': - return (L); - - case 'N': - case 'n': - return (N); - - case 'P': - case 'p': - return (P); - - case 'R': - case 'r': - return (R); - - case 'S': - case 's': - return (S); - - case 'T': - case 't': - return (T); - - } - break; - - default: - fatal("Unknown state in scanner."); - } - yyerror((char *) 0); - state = CMD; - longjmp(errcatch,0); - } -} - -static void -upper(char *s) -{ - while (*s != '\0') { - if (islower(*s)) - *s = toupper(*s); - s++; - } -} - -static char * -copy(const char *s) -{ - char *p; - - p = (char * )malloc(strlen(s) + 1); - if (p == 0) - fatal("Ran out of memory."); - else - (void) strcpy(p, s); - return (p); -} - -static void -help(struct tab *ctab, char *s) -{ - register struct tab *c; - register int width, NCMDS; - const char *help_type; - - if (ctab == sitetab) - help_type = "SITE "; - else - help_type = ""; - width = 0, NCMDS = 0; - for (c = ctab; c->name != 0; c++) { - int len = strlen(c->name); - - if (len > width) - width = len; - NCMDS++; - } - width = (width + 8) &~ 7; - if (s == 0) { - register int i, j, w; - int columns, lines; - - lreply(214, "The following %scommands are recognized %s.", - help_type, "(* =>'s unimplemented)"); - columns = 76 / width; - if (columns == 0) - columns = 1; - lines = (NCMDS + columns - 1) / columns; - for (i = 0; i < lines; i++) { - printf(" "); - for (j = 0; j < columns; j++) { - c = ctab + j * lines + i; - assert(c->name != 0); - printf("%s%c", c->name, - c->implemented ? ' ' : '*'); - if (c + lines >= &ctab[NCMDS]) - break; - w = strlen(c->name) + 1; - while (w < width) { - putchar(' '); - w++; - } - } - printf("\r\n"); - } - (void) fflush(stdout); - reply(214, "Direct comments to ftp-bugs@%s.", hostname); - return; - } - upper(s); - c = lookup(ctab, s); - if (c == (struct tab *)0) { - reply(502, "Unknown command %s.", s); - return; - } - if (c->implemented) - reply(214, "Syntax: %s%s %s", help_type, c->name, c->help); - else - reply(214, "%s%-*s\t%s; unimplemented.", help_type, width, - c->name, c->help); -} - -static void -sizecmd(char *filename) -{ - switch (type) { - case TYPE_L: - case TYPE_I: { - struct stat stbuf; - if (stat(filename, &stbuf) < 0 || - (stbuf.st_mode&S_IFMT) != S_IFREG) - reply(550, "%s: not a plain file.", filename); - else -#ifdef HAVE_LONG_LONG - reply(213, "%llu", (long long) stbuf.st_size); -#else - reply(213, "%lu", stbuf.st_size); -#endif - break;} - case TYPE_A: { - FILE *fin; - register int c, count; - struct stat stbuf; - fin = fopen(filename, "r"); - if (fin == 0) { - perror_reply(550, filename); - return; - } - if (fstat(fileno(fin), &stbuf) < 0 || - (stbuf.st_mode&S_IFMT) != S_IFREG) { - reply(550, "%s: not a plain file.", filename); - (void) fclose(fin); - return; - } - - count = 0; - while((c=getc(fin)) != EOF) { - if (c == '\n') /* will get expanded to \r\n */ - count++; - count++; - } - (void) fclose(fin); - - reply(213, "%ld", count); - break;} - default: - reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]); - } -} Property changes on: stable/10/usr.bin/yacc/tests/ftp.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/quote_calc2.y =================================================================== --- stable/10/usr.bin/yacc/tests/quote_calc2.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/quote_calc2.y (nonexistent) @@ -1,112 +0,0 @@ -%{ -# include -# include - -int regs[26]; -int base; - -int yylex(void); -static void yyerror(const char *s); - -%} - -%start list - -%token OP_ADD "ADD" -%token OP_SUB "SUB" -%token OP_MUL "MUL" -%token OP_DIV "DIV" -%token OP_MOD "MOD" -%token OP_AND "AND" - -%token DIGIT LETTER - -%left '|' -%left '&' -%left '+' '-' -%left '*' '/' '%' -%left UMINUS /* supplies precedence for unary minus */ - -%% /* beginning of rules section */ - -list : /* empty */ - | list stat '\n' - | list error '\n' - { yyerrok ; } - ; - -stat : expr - { printf("%d\n",$1);} - | LETTER '=' expr - { regs[$1] = $3; } - ; - -expr : '(' expr ')' - { $$ = $2; } - | expr "ADD" expr - { $$ = $1 + $3; } - | expr "SUB" expr - { $$ = $1 - $3; } - | expr "MUL" expr - { $$ = $1 * $3; } - | expr "DIV" expr - { $$ = $1 / $3; } - | expr "MOD" expr - { $$ = $1 % $3; } - | expr "AND" expr - { $$ = $1 & $3; } - | expr '|' expr - { $$ = $1 | $3; } - | "SUB" expr %prec UMINUS - { $$ = - $2; } - | LETTER - { $$ = regs[$1]; } - | number - ; - -number: DIGIT - { $$ = $1; base = ($1==0) ? 8 : 10; } - | number DIGIT - { $$ = base * $1 + $2; } - ; - -%% /* start of programs */ - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) { - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} Property changes on: stable/10/usr.bin/yacc/tests/quote_calc2.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/quote_calc3.y =================================================================== --- stable/10/usr.bin/yacc/tests/quote_calc3.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/quote_calc3.y (nonexistent) @@ -1,112 +0,0 @@ -%{ -# include -# include - -int regs[26]; -int base; - -int yylex(void); -static void yyerror(const char *s); - -%} - -%start list - -%token OP_ADD "ADD-operator" -%token OP_SUB "SUB-operator" -%token OP_MUL "MUL-operator" -%token OP_DIV "DIV-operator" -%token OP_MOD "MOD-operator" -%token OP_AND "AND-operator" - -%token DIGIT LETTER - -%left '|' -%left '&' -%left '+' '-' -%left '*' '/' '%' -%left UMINUS /* supplies precedence for unary minus */ - -%% /* beginning of rules section */ - -list : /* empty */ - | list stat '\n' - | list error '\n' - { yyerrok ; } - ; - -stat : expr - { printf("%d\n",$1);} - | LETTER '=' expr - { regs[$1] = $3; } - ; - -expr : '(' expr ')' - { $$ = $2; } - | expr OP_ADD expr - { $$ = $1 + $3; } - | expr OP_SUB expr - { $$ = $1 - $3; } - | expr OP_MUL expr - { $$ = $1 * $3; } - | expr OP_DIV expr - { $$ = $1 / $3; } - | expr OP_MOD expr - { $$ = $1 % $3; } - | expr OP_AND expr - { $$ = $1 & $3; } - | expr '|' expr - { $$ = $1 | $3; } - | OP_SUB expr %prec UMINUS - { $$ = - $2; } - | LETTER - { $$ = regs[$1]; } - | number - ; - -number: DIGIT - { $$ = $1; base = ($1==0) ? 8 : 10; } - | number DIGIT - { $$ = base * $1 + $2; } - ; - -%% /* start of programs */ - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) { - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} Property changes on: stable/10/usr.bin/yacc/tests/quote_calc3.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/code_calc.y =================================================================== --- stable/10/usr.bin/yacc/tests/code_calc.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/code_calc.y (nonexistent) @@ -1,112 +0,0 @@ -%{ -# include -# include - -int regs[26]; -int base; - -#ifdef YYBISON -int yylex(void); -static void yyerror(const char *s); -#endif - -%} - -%start list - -%token DIGIT LETTER - -%left '|' -%left '&' -%left '+' '-' -%left '*' '/' '%' -%left UMINUS /* supplies precedence for unary minus */ - -%% /* beginning of rules section */ - -list : /* empty */ - | list stat '\n' - | list error '\n' - { yyerrok ; } - ; - -stat : expr - { printf("%d\n",$1);} - | LETTER '=' expr - { regs[$1] = $3; } - ; - -expr : '(' expr ')' - { $$ = $2; } - | expr '+' expr - { $$ = $1 + $3; } - | expr '-' expr - { $$ = $1 - $3; } - | expr '*' expr - { $$ = $1 * $3; } - | expr '/' expr - { $$ = $1 / $3; } - | expr '%' expr - { $$ = $1 % $3; } - | expr '&' expr - { $$ = $1 & $3; } - | expr '|' expr - { $$ = $1 | $3; } - | '-' expr %prec UMINUS - { $$ = - $2; } - | LETTER - { $$ = regs[$1]; } - | number - ; - -number: DIGIT - { $$ = $1; base = ($1==0) ? 8 : 10; } - | number DIGIT - { $$ = base * $1 + $2; } - ; - -%% /* start of programs */ - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) -{ - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} Property changes on: stable/10/usr.bin/yacc/tests/code_calc.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/code_error.y =================================================================== --- stable/10/usr.bin/yacc/tests/code_error.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/code_error.y (nonexistent) @@ -1,36 +0,0 @@ -%{ - -#ifdef YYBISON -int yylex(void); -static void yyerror(const char *); -#endif - -%} -%% -S: error -%% - -#include - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -int -main(void) -{ - printf("yyparse() = %d\n", yyparse()); - return 0; -} - -int -yylex(void) -{ - return -1; -} - -static void -yyerror(const char* s) -{ - printf("%s\n", s); -} Property changes on: stable/10/usr.bin/yacc/tests/code_error.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/error.y =================================================================== --- stable/10/usr.bin/yacc/tests/error.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/error.y (nonexistent) @@ -1,28 +0,0 @@ -%{ -int yylex(void); -static void yyerror(const char *); -%} -%% -S: error -%% - -#include - -int -main(void) -{ - printf("yyparse() = %d\n", yyparse()); - return 0; -} - -int -yylex(void) -{ - return -1; -} - -static void -yyerror(const char* s) -{ - printf("%s\n", s); -} Property changes on: stable/10/usr.bin/yacc/tests/error.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/quote_calc4.y =================================================================== --- stable/10/usr.bin/yacc/tests/quote_calc4.y (revision 272952) +++ stable/10/usr.bin/yacc/tests/quote_calc4.y (nonexistent) @@ -1,112 +0,0 @@ -%{ -# include -# include - -int regs[26]; -int base; - -int yylex(void); -static void yyerror(const char *s); - -%} - -%start list - -%token OP_ADD "ADD-operator" -%token OP_SUB "SUB-operator" -%token OP_MUL "MUL-operator" -%token OP_DIV "DIV-operator" -%token OP_MOD "MOD-operator" -%token OP_AND "AND-operator" - -%token DIGIT LETTER - -%left '|' -%left '&' -%left '+' '-' -%left '*' '/' '%' -%left UMINUS /* supplies precedence for unary minus */ - -%% /* beginning of rules section */ - -list : /* empty */ - | list stat '\n' - | list error '\n' - { yyerrok ; } - ; - -stat : expr - { printf("%d\n",$1);} - | LETTER '=' expr - { regs[$1] = $3; } - ; - -expr : '(' expr ')' - { $$ = $2; } - | expr "ADD-operator" expr - { $$ = $1 + $3; } - | expr "SUB-operator" expr - { $$ = $1 - $3; } - | expr "MUL-operator" expr - { $$ = $1 * $3; } - | expr "DIV-operator" expr - { $$ = $1 / $3; } - | expr "MOD-operator" expr - { $$ = $1 % $3; } - | expr "AND-operator" expr - { $$ = $1 & $3; } - | expr '|' expr - { $$ = $1 | $3; } - | "SUB-operator" expr %prec UMINUS - { $$ = - $2; } - | LETTER - { $$ = regs[$1]; } - | number - ; - -number: DIGIT - { $$ = $1; base = ($1==0) ? 8 : 10; } - | number DIGIT - { $$ = base * $1 + $2; } - ; - -%% /* start of programs */ - -int -main (void) -{ - while(!feof(stdin)) { - yyparse(); - } - return 0; -} - -static void -yyerror(const char *s) -{ - fprintf(stderr, "%s\n", s); -} - -int -yylex(void) { - /* lexical analysis routine */ - /* returns LETTER for a lower case letter, yylval = 0 through 25 */ - /* return DIGIT for a digit, yylval = 0 through 9 */ - /* all other characters are returned immediately */ - - int c; - - while( (c=getchar()) == ' ' ) { /* skip blanks */ } - - /* c is now nonblank */ - - if( islower( c )) { - yylval = c - 'a'; - return ( LETTER ); - } - if( isdigit( c )) { - yylval = c - '0'; - return ( DIGIT ); - } - return( c ); -} Property changes on: stable/10/usr.bin/yacc/tests/quote_calc4.y ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/regress.sh =================================================================== --- stable/10/usr.bin/yacc/tests/regress.sh (revision 272952) +++ stable/10/usr.bin/yacc/tests/regress.sh (nonexistent) @@ -1,28 +0,0 @@ -# $FreeBSD$ - -echo 1..15 - -test_yacc() { - yacc "${@}" | sed -e "s,${SRCDIR}/,,g" -} - -REGRESSION_START($1) - -REGRESSION_TEST(`00', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/undefined.y') -REGRESSION_TEST(`01', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/calc.y') -REGRESSION_TEST(`02', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/calc1.y') -REGRESSION_TEST(`03', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/calc3.y') -REGRESSION_TEST(`04', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/code_calc.y') -REGRESSION_TEST(`05', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/code_error.y') -REGRESSION_TEST(`06', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/error.y') -REGRESSION_TEST(`07', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/ftp.y') -REGRESSION_TEST(`08', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/grammar.y') -REGRESSION_TEST(`09', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/pure_calc.y') -REGRESSION_TEST(`10', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/pure_error.y') -REGRESSION_TEST(`11', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/quote_calc.y') -REGRESSION_TEST(`12', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/quote_calc2.y') -REGRESSION_TEST(`13', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/quote_calc3.y') -REGRESSION_TEST(`14', `test_yacc -b regress -o /dev/stdout ${SRCDIR}/quote_calc4.y') - -REGRESSION_END() - Property changes on: stable/10/usr.bin/yacc/tests/regress.sh ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: stable/10/usr.bin/yacc/tests/Makefile =================================================================== --- stable/10/usr.bin/yacc/tests/Makefile (revision 272952) +++ stable/10/usr.bin/yacc/tests/Makefile (revision 272953) @@ -1,41 +1,334 @@ # $FreeBSD$ +.include + +TEST_DIR= ${.CURDIR}/../../../contrib/byacc/test + +.PATH: ${TEST_DIR} ${TEST_DIR}/yacc + TESTSDIR= ${TESTSBASE}/usr.bin/yacc -TAP_TESTS_SH= legacy_test +PLAIN_TESTS_SH= yacc_tests -FILESDIR= ${TESTSDIR} -FILES= calc.y -FILES+= calc1.y -FILES+= calc2.y -FILES+= calc3.y -FILES+= code_calc.y -FILES+= code_error.y -FILES+= error.y -FILES+= ftp.y -FILES+= grammar.y -FILES+= pure_calc.y -FILES+= pure_error.y -FILES+= quote_calc.y -FILES+= quote_calc2.y -FILES+= quote_calc3.y -FILES+= quote_calc4.y -FILES+= regress.00.out -FILES+= regress.01.out -FILES+= regress.02.out -FILES+= regress.03.out -FILES+= regress.04.out -FILES+= regress.05.out -FILES+= regress.06.out -FILES+= regress.07.out -FILES+= regress.08.out -FILES+= regress.09.out -FILES+= regress.10.out -FILES+= regress.11.out -FILES+= regress.12.out -FILES+= regress.13.out -FILES+= regress.14.out -FILES+= regress.sh -FILES+= undefined.y +SCRIPTS= run_test +SCRIPTSDIR= ${TESTSDIR} + +FILESGROUPS= FILEStest FILEStest_yacc + +FILEStestDIR= ${TESTSDIR} + +FILEStest+= btyacc_calc1.y +FILEStest+= btyacc_demo.y +FILEStest+= calc.y +FILEStest+= calc1.y +FILEStest+= calc2.y +FILEStest+= calc3.y +FILEStest+= code_calc.y +FILEStest+= code_debug.y +FILEStest+= code_error.y +FILEStest+= empty.y +FILEStest+= err_inherit1.y +FILEStest+= err_inherit2.y +FILEStest+= err_inherit3.y +FILEStest+= err_inherit4.y +FILEStest+= err_inherit5.y +FILEStest+= err_syntax1.y +FILEStest+= err_syntax10.y +FILEStest+= err_syntax11.y +FILEStest+= err_syntax12.y +FILEStest+= err_syntax13.y +FILEStest+= err_syntax14.y +FILEStest+= err_syntax15.y +FILEStest+= err_syntax16.y +FILEStest+= err_syntax17.y +FILEStest+= err_syntax18.y +FILEStest+= err_syntax19.y +FILEStest+= err_syntax2.y +FILEStest+= err_syntax20.y +FILEStest+= err_syntax21.y +FILEStest+= err_syntax22.y +FILEStest+= err_syntax23.y +FILEStest+= err_syntax24.y +FILEStest+= err_syntax25.y +FILEStest+= err_syntax26.y +FILEStest+= err_syntax27.y +FILEStest+= err_syntax3.y +FILEStest+= err_syntax4.y +FILEStest+= err_syntax5.y +FILEStest+= err_syntax6.y +FILEStest+= err_syntax7.y +FILEStest+= err_syntax7a.y +FILEStest+= err_syntax7b.y +FILEStest+= err_syntax8.y +FILEStest+= err_syntax8a.y +FILEStest+= err_syntax9.y +FILEStest+= error.y +FILEStest+= grammar.y +FILEStest+= inherit0.y +FILEStest+= inherit1.y +FILEStest+= inherit2.y +FILEStest+= ok_syntax1.y +FILEStest+= pure_calc.y +FILEStest+= pure_error.y +FILEStest+= quote_calc.y +FILEStest+= quote_calc2.y +FILEStest+= quote_calc3.y +FILEStest+= quote_calc4.y +FILEStest+= varsyntax_calc1.y + +FILEStest_yaccDIR= ${TESTSDIR}/yacc + +FILEStest_yacc+= big_b.error +FILEStest_yacc+= big_b.output +FILEStest_yacc+= big_l.error +FILEStest_yacc+= big_l.output +FILEStest_yacc+= calc.error +FILEStest_yacc+= calc.output +FILEStest_yacc+= calc.tab.c +FILEStest_yacc+= calc.tab.h +FILEStest_yacc+= calc1.error +FILEStest_yacc+= calc1.output +FILEStest_yacc+= calc1.tab.c +FILEStest_yacc+= calc1.tab.h +FILEStest_yacc+= calc2.error +FILEStest_yacc+= calc2.output +FILEStest_yacc+= calc2.tab.c +FILEStest_yacc+= calc2.tab.h +FILEStest_yacc+= calc3.error +FILEStest_yacc+= calc3.output +FILEStest_yacc+= calc3.tab.c +FILEStest_yacc+= calc3.tab.h +FILEStest_yacc+= code_calc.code.c +FILEStest_yacc+= code_calc.error +FILEStest_yacc+= code_calc.output +FILEStest_yacc+= code_calc.tab.c +FILEStest_yacc+= code_calc.tab.h +FILEStest_yacc+= code_error.code.c +FILEStest_yacc+= code_error.error +FILEStest_yacc+= code_error.output +FILEStest_yacc+= code_error.tab.c +FILEStest_yacc+= code_error.tab.h +FILEStest_yacc+= empty.error +FILEStest_yacc+= empty.output +FILEStest_yacc+= empty.tab.c +FILEStest_yacc+= empty.tab.h +FILEStest_yacc+= err_syntax1.error +FILEStest_yacc+= err_syntax1.output +FILEStest_yacc+= err_syntax1.tab.c +FILEStest_yacc+= err_syntax1.tab.h +FILEStest_yacc+= err_syntax10.error +FILEStest_yacc+= err_syntax10.output +FILEStest_yacc+= err_syntax10.tab.c +FILEStest_yacc+= err_syntax10.tab.h +FILEStest_yacc+= err_syntax11.error +FILEStest_yacc+= err_syntax11.output +FILEStest_yacc+= err_syntax11.tab.c +FILEStest_yacc+= err_syntax11.tab.h +FILEStest_yacc+= err_syntax12.error +FILEStest_yacc+= err_syntax12.output +FILEStest_yacc+= err_syntax12.tab.c +FILEStest_yacc+= err_syntax12.tab.h +FILEStest_yacc+= err_syntax13.error +FILEStest_yacc+= err_syntax13.output +FILEStest_yacc+= err_syntax13.tab.c +FILEStest_yacc+= err_syntax13.tab.h +FILEStest_yacc+= err_syntax14.error +FILEStest_yacc+= err_syntax14.output +FILEStest_yacc+= err_syntax14.tab.c +FILEStest_yacc+= err_syntax14.tab.h +FILEStest_yacc+= err_syntax15.error +FILEStest_yacc+= err_syntax15.output +FILEStest_yacc+= err_syntax15.tab.c +FILEStest_yacc+= err_syntax15.tab.h +FILEStest_yacc+= err_syntax16.error +FILEStest_yacc+= err_syntax16.output +FILEStest_yacc+= err_syntax16.tab.c +FILEStest_yacc+= err_syntax16.tab.h +FILEStest_yacc+= err_syntax17.error +FILEStest_yacc+= err_syntax17.output +FILEStest_yacc+= err_syntax17.tab.c +FILEStest_yacc+= err_syntax17.tab.h +FILEStest_yacc+= err_syntax18.error +FILEStest_yacc+= err_syntax18.output +FILEStest_yacc+= err_syntax18.tab.c +FILEStest_yacc+= err_syntax18.tab.h +FILEStest_yacc+= err_syntax19.error +FILEStest_yacc+= err_syntax19.output +FILEStest_yacc+= err_syntax19.tab.c +FILEStest_yacc+= err_syntax19.tab.h +FILEStest_yacc+= err_syntax2.error +FILEStest_yacc+= err_syntax2.output +FILEStest_yacc+= err_syntax2.tab.c +FILEStest_yacc+= err_syntax2.tab.h +FILEStest_yacc+= err_syntax20.error +FILEStest_yacc+= err_syntax20.output +FILEStest_yacc+= err_syntax20.tab.c +FILEStest_yacc+= err_syntax20.tab.h +FILEStest_yacc+= err_syntax21.error +FILEStest_yacc+= err_syntax21.output +FILEStest_yacc+= err_syntax21.tab.c +FILEStest_yacc+= err_syntax21.tab.h +FILEStest_yacc+= err_syntax22.error +FILEStest_yacc+= err_syntax22.output +FILEStest_yacc+= err_syntax22.tab.c +FILEStest_yacc+= err_syntax22.tab.h +FILEStest_yacc+= err_syntax23.error +FILEStest_yacc+= err_syntax23.output +FILEStest_yacc+= err_syntax23.tab.c +FILEStest_yacc+= err_syntax23.tab.h +FILEStest_yacc+= err_syntax24.error +FILEStest_yacc+= err_syntax24.output +FILEStest_yacc+= err_syntax24.tab.c +FILEStest_yacc+= err_syntax24.tab.h +FILEStest_yacc+= err_syntax25.error +FILEStest_yacc+= err_syntax25.output +FILEStest_yacc+= err_syntax25.tab.c +FILEStest_yacc+= err_syntax25.tab.h +FILEStest_yacc+= err_syntax26.error +FILEStest_yacc+= err_syntax26.output +FILEStest_yacc+= err_syntax26.tab.c +FILEStest_yacc+= err_syntax26.tab.h +FILEStest_yacc+= err_syntax27.error +FILEStest_yacc+= err_syntax27.output +FILEStest_yacc+= err_syntax27.tab.c +FILEStest_yacc+= err_syntax27.tab.h +FILEStest_yacc+= err_syntax3.error +FILEStest_yacc+= err_syntax3.output +FILEStest_yacc+= err_syntax3.tab.c +FILEStest_yacc+= err_syntax3.tab.h +FILEStest_yacc+= err_syntax4.error +FILEStest_yacc+= err_syntax4.output +FILEStest_yacc+= err_syntax4.tab.c +FILEStest_yacc+= err_syntax4.tab.h +FILEStest_yacc+= err_syntax5.error +FILEStest_yacc+= err_syntax5.output +FILEStest_yacc+= err_syntax5.tab.c +FILEStest_yacc+= err_syntax5.tab.h +FILEStest_yacc+= err_syntax6.error +FILEStest_yacc+= err_syntax6.output +FILEStest_yacc+= err_syntax6.tab.c +FILEStest_yacc+= err_syntax6.tab.h +FILEStest_yacc+= err_syntax7.error +FILEStest_yacc+= err_syntax7.output +FILEStest_yacc+= err_syntax7.tab.c +FILEStest_yacc+= err_syntax7.tab.h +FILEStest_yacc+= err_syntax7a.error +FILEStest_yacc+= err_syntax7a.output +FILEStest_yacc+= err_syntax7a.tab.c +FILEStest_yacc+= err_syntax7a.tab.h +FILEStest_yacc+= err_syntax7b.error +FILEStest_yacc+= err_syntax7b.output +FILEStest_yacc+= err_syntax7b.tab.c +FILEStest_yacc+= err_syntax7b.tab.h +FILEStest_yacc+= err_syntax8.error +FILEStest_yacc+= err_syntax8.output +FILEStest_yacc+= err_syntax8.tab.c +FILEStest_yacc+= err_syntax8.tab.h +FILEStest_yacc+= err_syntax8a.error +FILEStest_yacc+= err_syntax8a.output +FILEStest_yacc+= err_syntax8a.tab.c +FILEStest_yacc+= err_syntax8a.tab.h +FILEStest_yacc+= err_syntax9.error +FILEStest_yacc+= err_syntax9.output +FILEStest_yacc+= err_syntax9.tab.c +FILEStest_yacc+= err_syntax9.tab.h +FILEStest_yacc+= error.error +FILEStest_yacc+= error.output +FILEStest_yacc+= error.tab.c +FILEStest_yacc+= error.tab.h +FILEStest_yacc+= grammar.dot +FILEStest_yacc+= grammar.error +FILEStest_yacc+= grammar.output +FILEStest_yacc+= grammar.tab.c +FILEStest_yacc+= grammar.tab.h +FILEStest_yacc+= help.error +FILEStest_yacc+= help.output +FILEStest_yacc+= no_b_opt.error +FILEStest_yacc+= no_b_opt.output +# XXX: expected: `f - cannot open "nosuchfile.c"; gets +# `e - line 0 of "nosuchfile.y", unexpected end-of-file`. +#FILEStest_yacc+= no_b_opt1.error +#FILEStest_yacc+= no_b_opt1.output +#FILEStest_yacc+= no_code_c.error +#FILEStest_yacc+= no_code_c.output +#FILEStest_yacc+= no_defines.error +#FILEStest_yacc+= no_defines.output +#FILEStest_yacc+= no_graph.error +#FILEStest_yacc+= no_graph.output +#FILEStest_yacc+= no_include.error +#FILEStest_yacc+= no_include.output +FILEStest_yacc+= no_opts.error +FILEStest_yacc+= no_opts.output +# XXX: expected: `f - cannot open "nosuchfile.c"; gets +# `e - line 0 of "nosuchfile.y", unexpected end-of-file`. +#FILEStest_yacc+= no_output.error +#FILEStest_yacc+= no_output.output +#FILEStest_yacc+= no_output1.error +#FILEStest_yacc+= no_output1.output +FILEStest_yacc+= no_output2.error +FILEStest_yacc+= no_output2.output +FILEStest_yacc+= no_p_opt.error +FILEStest_yacc+= no_p_opt.output +# XXX: expected: `f - cannot open "nosuchfile.c"; gets +# `e - line 0 of "nosuchfile.y", unexpected end-of-file`. +#FILEStest_yacc+= no_p_opt1.error +#FILEStest_yacc+= no_p_opt1.output +#FILEStest_yacc+= no_verbose.error +#FILEStest_yacc+= no_verbose.output +FILEStest_yacc+= nostdin.error +FILEStest_yacc+= nostdin.output +FILEStest_yacc+= ok_syntax1.error +FILEStest_yacc+= ok_syntax1.output +FILEStest_yacc+= ok_syntax1.tab.c +FILEStest_yacc+= ok_syntax1.tab.h +FILEStest_yacc+= pure_calc.error +FILEStest_yacc+= pure_calc.output +FILEStest_yacc+= pure_calc.tab.c +FILEStest_yacc+= pure_calc.tab.h +FILEStest_yacc+= pure_error.error +FILEStest_yacc+= pure_error.output +FILEStest_yacc+= pure_error.tab.c +FILEStest_yacc+= pure_error.tab.h +FILEStest_yacc+= quote_calc-s.error +FILEStest_yacc+= quote_calc-s.output +FILEStest_yacc+= quote_calc-s.tab.c +FILEStest_yacc+= quote_calc-s.tab.h +FILEStest_yacc+= quote_calc.error +FILEStest_yacc+= quote_calc.output +FILEStest_yacc+= quote_calc.tab.c +FILEStest_yacc+= quote_calc.tab.h +FILEStest_yacc+= quote_calc2-s.error +FILEStest_yacc+= quote_calc2-s.output +FILEStest_yacc+= quote_calc2-s.tab.c +FILEStest_yacc+= quote_calc2-s.tab.h +FILEStest_yacc+= quote_calc2.error +FILEStest_yacc+= quote_calc2.output +FILEStest_yacc+= quote_calc2.tab.c +FILEStest_yacc+= quote_calc2.tab.h +FILEStest_yacc+= quote_calc3-s.error +FILEStest_yacc+= quote_calc3-s.output +FILEStest_yacc+= quote_calc3-s.tab.c +FILEStest_yacc+= quote_calc3-s.tab.h +FILEStest_yacc+= quote_calc3.error +FILEStest_yacc+= quote_calc3.output +FILEStest_yacc+= quote_calc3.tab.c +FILEStest_yacc+= quote_calc3.tab.h +FILEStest_yacc+= quote_calc4-s.error +FILEStest_yacc+= quote_calc4-s.output +FILEStest_yacc+= quote_calc4-s.tab.c +FILEStest_yacc+= quote_calc4-s.tab.h +FILEStest_yacc+= quote_calc4.error +FILEStest_yacc+= quote_calc4.output +FILEStest_yacc+= quote_calc4.tab.c +FILEStest_yacc+= quote_calc4.tab.h +FILEStest_yacc+= rename_debug.c +FILEStest_yacc+= rename_debug.error +FILEStest_yacc+= rename_debug.h +FILEStest_yacc+= rename_debug.i +FILEStest_yacc+= rename_debug.output +FILEStest_yacc+= varsyntax_calc1.error +FILEStest_yacc+= varsyntax_calc1.output +FILEStest_yacc+= varsyntax_calc1.tab.c +FILEStest_yacc+= varsyntax_calc1.tab.h .include Index: stable/10/usr.bin/yacc/tests/yacc_tests.sh =================================================================== --- stable/10/usr.bin/yacc/tests/yacc_tests.sh (nonexistent) +++ stable/10/usr.bin/yacc/tests/yacc_tests.sh (revision 272953) @@ -0,0 +1,24 @@ +#!/bin/sh +# $FreeBSD$ + +set -e + +cd $(dirname $0) + +TMPDIR=$(mktemp -d /tmp/tmp.XXXXXXXX) +TEST_DIR="$TMPDIR/test" +trap "cd /; rm -Rf $TMPDIR" EXIT INT TERM + +# Setup the environment for run_test.sh +mkdir -p "$TEST_DIR" +cp -Rf * "$TEST_DIR/." +echo > "$TMPDIR/config.h" +ln /usr/bin/yacc $TMPDIR/yacc + +log=$TMPDIR/run_test.log +(cd $TEST_DIR && ./run_test 2>&1 && : > run_test.ok) | tee $log +if [ -f run_test.ok ] && ! egrep "^...(diff|not found)[^\*]+$" $log; then + exit 0 +else + exit 1 +fi Property changes on: stable/10/usr.bin/yacc/tests/yacc_tests.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: stable/10 =================================================================== --- stable/10 (revision 272952) +++ stable/10 (revision 272953) Property changes on: stable/10 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r268811