Handle errors from parser slightly differently.

This commit is contained in:
steve 2000-06-30 15:49:44 +00:00
parent 337eee7dcb
commit 888360dd3b
2 changed files with 16 additions and 3 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: globals.h,v 1.2 1999/09/05 22:33:18 steve Exp $"
#ident "$Id: globals.h,v 1.3 2000/06/30 15:49:44 steve Exp $"
#endif
# include <stdio.h>
@ -35,11 +35,16 @@ extern unsigned include_cnt;
/* This flag is true if #line directives are to be generated. */
extern int line_direct_flag;
extern unsigned error_count;
/* This is the entry to the parser. */
extern int yyparse();
/*
* $Log: globals.h,v $
* Revision 1.3 2000/06/30 15:49:44 steve
* Handle errors from parser slightly differently.
*
* Revision 1.2 1999/09/05 22:33:18 steve
* Take multiple source files on the command line.
*

View File

@ -17,7 +17,7 @@ const char COPYRIGHT[] =
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: main.c,v 1.4 1999/11/29 17:02:21 steve Exp $"
#ident "$Id: main.c,v 1.5 2000/06/30 15:49:44 steve Exp $"
#endif
const char NOTICE[] =
@ -52,6 +52,8 @@ unsigned include_cnt = 0;
int line_direct_flag = 0;
unsigned error_count = 0;
int main(int argc, char*argv[])
{
int opt;
@ -138,11 +140,17 @@ int main(int argc, char*argv[])
}
reset_lexor(out, argv+optind);
return yyparse();
if (yyparse()) return -1;
return error_count;
}
/*
* $Log: main.c,v $
* Revision 1.5 2000/06/30 15:49:44 steve
* Handle errors from parser slightly differently.
*
* Revision 1.4 1999/11/29 17:02:21 steve
* include getopt if present.
*