X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/6deb44470e47bb02f0ca3ea630408d013e128710..73975f004cc9e9875a10e5135068ac9281ea46bc:/doc/bison.texinfo diff --git a/doc/bison.texinfo b/doc/bison.texinfo index be291754..29ce7b69 100644 --- a/doc/bison.texinfo +++ b/doc/bison.texinfo @@ -1859,17 +1859,20 @@ The symbol table itself consists of a linked list of records. Its definition, which is kept in the header @file{calc.h}, is as follows. It provides for either functions or variables to be placed in the table. -@c FIXME: ANSIfy the prototypes for FNCTPTR etc. @smallexample @group +/* Fonctions type. */ +typedef double (*func_t) (double); + /* Data type for links in the chain of symbols. */ struct symrec @{ char *name; /* name of symbol */ int type; /* type of symbol: either VAR or FNCT */ - union @{ - double var; /* value of a VAR */ - double (*fnctptr)(); /* value of a FNCT */ + union + @{ + double var; /* value of a VAR */ + func_t fnctptr; /* value of a FNCT */ @} value; struct symrec *next; /* link field */ @}; @@ -1881,8 +1884,8 @@ typedef struct symrec symrec; /* The symbol table: a chain of `struct symrec'. */ extern symrec *sym_table; -symrec *putsym (); -symrec *getsym (); +symrec *putsym (const char *, func_t); +symrec *getsym (const char *); @end group @end smallexample @@ -1912,24 +1915,24 @@ yyerror (const char *s) /* Called by yyparse on error */ struct init @{ char *fname; - double (*fnct)(); + double (*fnct)(double); @}; @end group @group struct init arith_fncts[] = @{ - "sin", sin, - "cos", cos, + "sin", sin, + "cos", cos, "atan", atan, - "ln", log, - "exp", exp, + "ln", log, + "exp", exp, "sqrt", sqrt, 0, 0 @}; /* The symbol table: a chain of `struct symrec'. */ -symrec *sym_table = (symrec *)0; +symrec *sym_table = (symrec *) 0; @end group @group @@ -3255,13 +3258,6 @@ Therefore, if the input file is @file{foo.y}, then the parser file is called @file{foo.tab.c} by default. As a consequence, the verbose output file is called @file{foo.output}.@refill -@item %raw -The output file @file{@var{name}.h} normally defines the tokens with -Yacc-compatible token numbers. If this option is specified, the -internal Bison numbers are used instead. (Yacc-compatible numbers start -at 257 except for single-character tokens; Bison assigns token numbers -sequentially for all tokens starting at 3.) - @item %token_table Generate an array of token names in the parser file. The name of the array is @code{yytname}; @code{yytname[@var{i}]} is the name of the @@ -4984,6 +4980,11 @@ bison -y $* Tuning the parser: @table @option +@item -S @var{file} +@itemx --skeleton=@var{file} +Specify the skeleton to use. You probably don't need this option unless +you are developing Bison. + @item -t @itemx --debug Output a definition of the macro @code{YYDEBUG} into the parser file, so @@ -5017,10 +5018,6 @@ parser file, treating it as an independent source file in its own right. @itemx --no-parser Pretend that @code{%no_parser} was specified. @xref{Decl Summary}. -@item -r -@itemx --raw -Pretend that @code{%raw} was specified. @xref{Decl Summary}. - @item -k @itemx --token-table Pretend that @code{%token_table} was specified. @xref{Decl Summary}. @@ -5100,7 +5097,6 @@ the corresponding short option. \line{ --no-lines \leaderfill -l} \line{ --no-parser \leaderfill -n} \line{ --output-file \leaderfill -o} -\line{ --raw \leaderfill -r} \line{ --token-table \leaderfill -k} \line{ --verbose \leaderfill -v} \line{ --version \leaderfill -V} @@ -5119,7 +5115,6 @@ the corresponding short option. --no-lines -l --no-parser -n --output-file=@var{outfile} -o @var{outfile} ---raw -r --token-table -k --verbose -v --version -V @@ -5307,11 +5302,6 @@ Bison declaration to assign a precedence to a specific rule. Bison declaration to request a pure (reentrant) parser. @xref{Pure Decl, ,A Pure (Reentrant) Parser}. -@item %raw -Bison declaration to use Bison internal token code numbers in token -tables instead of the usual Yacc-compatible token code numbers. -@xref{Decl Summary}. - @item %right Bison declaration to assign right associativity to token(s). @xref{Precedence Decl, ,Operator Precedence}.