*** empty log message ***
[fw/sdcc] / src / SDCC.lex
index 447560518ff3d0164067cbf819495b8e3751ae87..b67cda3da8f7c1fd7747e2eb381e20574cea6955 100644 (file)
@@ -76,7 +76,8 @@ struct options  save_options  ;
      P_NOGCSE    ,
      P_CALLEE_SAVES,
      P_EXCLUDE   ,
-     P_LOOPREV
+     P_LOOPREV   ,
+     P_OVERLAY
  };
 
 %}
@@ -171,6 +172,9 @@ struct options  save_options  ;
 "while"        { count(); return(WHILE); }
 "xdata"        { count(); TKEYWORD(XDATA); }
 "..."         { count(); return(VAR_ARGS);}
+"__typeof"     { count(); return TYPEOF;}
+"_JavaNative"  { count(); TKEYWORD(JAVANATIVE);}
+"_overlay"     { count(); TKEYWORD(OVERLAY);}
 {L}({L}|{D})*  { count(); return(check_type()); }
 0[xX]{H}+{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); }
 0{D}+{IS}?     { count(); yylval.val = constVal(yytext); return(CONSTANT); }
@@ -456,6 +460,8 @@ void doPragma (int op, char *cp)
     case P_LOOPREV:
        optimize.noLoopReverse = 1;
        break;
+    case P_OVERLAY:
+       break; /* notyet */
     }
 }
 
@@ -567,10 +573,13 @@ 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++;
+   if (yylineno && filename) {
+     fprintf(stdout,"\n%s:%d: %s: token -> '%s' ; column %d\n",
+            filename,yylineno,
+            s,yytext,column);
+     fatalError++;
+   } else {
+     // this comes from an empy file, no problem
+   }
    return 0;
 }