* doc/bison.texinfo: ANSIfy the examples.

This commit is contained in:
Akim Demaille
2001-03-16 15:32:48 +00:00
parent cd5bd6ac4f
commit 32dfccf8f8
2 changed files with 19 additions and 12 deletions

View File

@@ -1,3 +1,7 @@
2001-03-16 Akim Demaille <akim@epita.fr>
* doc/bison.texinfo: ANSIfy the examples.
2001-03-16 Akim Demaille <akim@epita.fr> 2001-03-16 Akim Demaille <akim@epita.fr>
* getargs.c (skeleton): New variable. * getargs.c (skeleton): New variable.

View File

@@ -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 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. provides for either functions or variables to be placed in the table.
@c FIXME: ANSIfy the prototypes for FNCTPTR etc.
@smallexample @smallexample
@group @group
/* Fonctions type. */
typedef double (*func_t) (double);
/* Data type for links in the chain of symbols. */ /* Data type for links in the chain of symbols. */
struct symrec struct symrec
@{ @{
char *name; /* name of symbol */ char *name; /* name of symbol */
int type; /* type of symbol: either VAR or FNCT */ int type; /* type of symbol: either VAR or FNCT */
union @{ union
double var; /* value of a VAR */ @{
double (*fnctptr)(); /* value of a FNCT */ double var; /* value of a VAR */
func_t fnctptr; /* value of a FNCT */
@} value; @} value;
struct symrec *next; /* link field */ struct symrec *next; /* link field */
@}; @};
@@ -1881,8 +1884,8 @@ typedef struct symrec symrec;
/* The symbol table: a chain of `struct symrec'. */ /* The symbol table: a chain of `struct symrec'. */
extern symrec *sym_table; extern symrec *sym_table;
symrec *putsym (); symrec *putsym (const char *, func_t);
symrec *getsym (); symrec *getsym (const char *);
@end group @end group
@end smallexample @end smallexample
@@ -1912,24 +1915,24 @@ yyerror (const char *s) /* Called by yyparse on error */
struct init struct init
@{ @{
char *fname; char *fname;
double (*fnct)(); double (*fnct)(double);
@}; @};
@end group @end group
@group @group
struct init arith_fncts[] = struct init arith_fncts[] =
@{ @{
"sin", sin, "sin", sin,
"cos", cos, "cos", cos,
"atan", atan, "atan", atan,
"ln", log, "ln", log,
"exp", exp, "exp", exp,
"sqrt", sqrt, "sqrt", sqrt,
0, 0 0, 0
@}; @};
/* The symbol table: a chain of `struct symrec'. */ /* The symbol table: a chain of `struct symrec'. */
symrec *sym_table = (symrec *)0; symrec *sym_table = (symrec *) 0;
@end group @end group
@group @group