+2001-03-16 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: ANSIfy the examples.
+
2001-03-16 Akim Demaille <akim@epita.fr>
* getargs.c (skeleton): New variable.
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 */
@};
/* 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
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