projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Made it possible to run on other people's machines, changed over to rrz80 for the...
[fw/sdcc]
/
src
/
SDCC.lex
diff --git
a/src/SDCC.lex
b/src/SDCC.lex
index cd19d787befd8efc7dc4bc4b1fefeb466818bdce..b335a917aaf958af396969789c558046a5d9867b 100644
(file)
--- a/
src/SDCC.lex
+++ b/
src/SDCC.lex
@@
-34,6
+34,7
@@
IS (u|U|l|L)*
#include <string.h>
#include <ctype.h>
#include "common.h"
#include <string.h>
#include <ctype.h>
#include "common.h"
+#include "newalloc.h"
char *stringLiteral();
char *currFname;
char *stringLiteral();
char *currFname;
@@
-117,6
+118,8
@@
struct options save_options ;
"if" { count(); return(IF); }
"int" { count(); return(INT); }
"interrupt" { count(); return(INTERRUPT);}
"if" { count(); return(IF); }
"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); }
"long" { count(); return(LONG); }
"near" { count(); TKEYWORD(DATA);}
"pdata" { count(); TKEYWORD(PDATA); }
@@
-260,7
+263,7
@@
int checkCurrFile ( char *s)
/* mark the end of the filename */
while (*s != '"') s++;
*s = '\0';
/* 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;
}
strcpy(currFname,sb);
yylineno = lNum - 2;
}
@@
-519,3
+522,17
@@
int isTargetKeyword(char *s)
return 0;
}
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;
+}