* src/output.c: Formatting changes.

* src/machine.h: Remove, leaving its contents in...
* src/system.h: here.
Include stdio.h.
Adjust all dependencies on stdio.h and machine.h.
* src/getargs.h: New file.
Let all `extern' declarations about getargs.c be replaced with
inclusion of `getargs.h'.
* src/Makefile.am (noinst_HEADERS): Adjust.

* tests/calc.m4 (yyin): Be initialized in main, not on the global
scope.
(yyerror): Returns void, not int.
* doc/bison.texinfo: Formatting changes.
This commit is contained in:
Akim Demaille
2000-09-19 18:10:41 +00:00
parent 05a1d24b1e
commit ceed8467b7
31 changed files with 1409 additions and 1370 deletions

View File

@@ -24,6 +24,7 @@ AT_DATA([calc.y],
static int power (int base, int exponent);
static int read_signed_integer (FILE *stream);
static void yyerror (const char *s);
extern void perror (const char *s);
%}
@@ -54,23 +55,10 @@ exp: NUM { $$ = $1; }
| '(' exp ')' { $$ = $2; }
;
%%
FILE *yyin = stdin;
/* The input. */
FILE *yyin;
int
main (int argn, const char **argv)
{
if (argn == 2)
yyin = fopen (argv[1], "r");
if (!stdin)
{
perror (argv[1]);
exit (1);
}
yyparse ();
return 0;
}
int
static void
yyerror (const char *s)
{
fprintf (stderr, "%s\n", s);
@@ -138,6 +126,23 @@ power (int base, int exponent)
res *= base;
return res;
}
int
main (int argn, const char **argv)
{
if (argn == 2)
yyin = fopen (argv[1], "r");
else
yyin = stdin;
if (!stdin)
{
perror (argv[1]);
exit (1);
}
yyparse ();
return 0;
}
]])
# Specify the output files to avoid problems on different file systems.