#include <string.h>
#include <ctype.h>
#include "common.h"
+#include "newalloc.h"
char *stringLiteral();
char *currFname;
"int" { count(); return(INT); }
"interrupt" { count(); return(INTERRUPT);}
"nonbanked" { count(); TKEYWORD(NONBANKED);}
+"banked" { count(); TKEYWORD(BANKED);}
"long" { count(); return(LONG); }
"near" { count(); TKEYWORD(DATA);}
"pdata" { count(); TKEYWORD(PDATA); }
/* mark the end of the filename */
while (*s != '"') s++;
*s = '\0';
- ALLOC_ATOMIC(currFname,strlen(sb)+1);
+ currFname = Safe_calloc(1,strlen(sb)+1);
strcpy(currFname,sb);
yylineno = lNum - 2;
}
return 0;
}
+
+extern int fatalError;
+
+int yyerror(char *s)
+{
+ fflush(stdout);
+
+ if (yylineno && filename)
+ fprintf(stdout,"\n%s(%d) %s: token -> '%s' ; column %d\n",
+ filename,yylineno,
+ s,yytext,column);
+ fatalError++;
+ return 0;
+}