Modified Files:

Makefile mod_lex.l mod_yacc.y pp_lst.c pp_mod.c read_ifs.c

	Fixed up -lst so it works like Spice Opus and finally fix char *yytext
	not char yytext[];
	Call yyrestart(NULL) at the end of each yyparse to reset state.
This commit is contained in:
stefanjones 2003-06-26 13:11:23 +00:00
parent 71bd746339
commit f9e5f560ac
5 changed files with 10 additions and 15 deletions

View File

@ -1,6 +1,5 @@
%option yylineno
%option noyywrap
%array
%{ /* $Id$ */
/*============================================================================

View File

@ -52,17 +52,11 @@ NON-STANDARD FEATURES
Ifs_Table_t *mod_ifs_table;
extern char mod_yytext[];
extern char *mod_yytext;
extern FILE* mod_yyout;
/* saj - use standard includes */
#include <string.h>
#include <ctype.h>
/*
extern char *strdup(char*);
extern int strlen(char*);
extern char *strcat(char*, char*);
*/
int mod_num_errors;
@ -251,7 +245,6 @@ static int check_id (Sub_Id_t sub_id, Id_Kind_t kind, Boolean_t do_subscript)
sub_id.id);
yyerror (error_str);
mod_num_errors++;
abort();
return -1;
}

View File

@ -784,7 +784,7 @@ static Status_t write_CMextrn(
/* Open the file to be written */
fp = fopen("CMextrn.h", "w");
fp = fopen("cmextrn.h", "w");
if(fp == NULL) {
print_error("ERROR - Problems opening CMextrn.h for write");
return(ERROR);
@ -824,7 +824,7 @@ static Status_t write_CMinfo(
/* Open the file to be written */
fp = fopen("CMinfo.h", "w");
fp = fopen("cminfo.h", "w");
if(fp == NULL) {
print_error("ERROR - Problems opening CMinfo.h for write");
return(ERROR);
@ -868,7 +868,7 @@ static Status_t write_UDNextrn(
/* Open the file to be written */
fp = fopen("UDNextrn.h", "w");
fp = fopen("udnextrn.h", "w");
if(fp == NULL) {
print_error("ERROR - Problems opening UDNextrn.h for write");
return(ERROR);
@ -910,7 +910,7 @@ static Status_t write_UDNinfo(
/* Open the file to be written */
fp = fopen("UDNinfo.h", "w");
fp = fopen("udninfo.h", "w");
if(fp == NULL) {
print_error("ERROR - Problems opening UDNinfo.h for write");
return(ERROR);

View File

@ -163,6 +163,7 @@ void preprocess_mod_file (
exit (1);
}
fclose (mod_yyout);
mod_yyrestart(NULL);
}
/*---------------------------------------------------------------------------*/
@ -170,7 +171,7 @@ int mod_yyerror (str)
char *str;
{
extern int mod_yylineno;
extern char mod_yytext[];
extern char *mod_yytext;
extern char *current_filename;
extern char *prog_name;

View File

@ -155,8 +155,10 @@ static Status_t read_ifs_table(
if (ifs_yyparse()) {
print_error ("Error parsing interface specification file");
ifs_yyrestart(NULL);
return ERROR;
}
ifs_yyrestart(NULL);
return OK;
}
@ -165,7 +167,7 @@ int ifs_yyerror (str)
char *str;
{
extern int ifs_yylineno;
extern char ifs_yytext[];
extern char *ifs_yytext;
fprintf (stderr, "%s: Error: \"%s\": line %d (near \'%s\'):\n\t%s.\n",
prog_name, current_filename, ifs_yylineno, ifs_yytext, str);