<COMMENT>{COMMENT_END} BEGIN(INITIAL);
-<COMMENT><<EOF>> { (void) fprintf(stderr, "kommentar nicht geschlossen\n"); exit(1); }
+<COMMENT><<EOF>> {
+ fprintf(stderr, "Kommentar nicht geschlossen\n");
+ exit(1);
+}
-<COMMENT>. /* alles im kommentar wird ignoriert */
+<COMMENT>(.|\n) /* alles im kommentar wird ignoriert */
{KEYWORD} printf("%s\n", yytext);
{NUMBER_DEC} printf("num %lx\n", strtol(yytext, (char **)NULL, 10));
-{NUMBER_HEX} {
-#if 0
- char *copy=strdup(yytext);
- copy[strlen(copy)-1]='\0';
-#endif
- printf("num %lx\n", strtol(yytext, (char **)NULL, 16));
-}
+{NUMBER_HEX} printf("num %lx\n", strtol(yytext, (char **)NULL, 16));
{WHITESPACE} /* ignorieren */
-. { (void) fprintf(stderr, "Lexikalischer fehler auf Zeile %i\n", yylineno); exit(1); }
+. {
+ fprintf(stderr, "Lexikalischer Fehler auf Zeile %i\n", yylineno);
+ exit(1);
+}
%%