projects
/
uebersetzerbau-ss10.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
scanner: bissl schoener
[uebersetzerbau-ss10.git]
/
scanner
/
scanner.lex
diff --git
a/scanner/scanner.lex
b/scanner/scanner.lex
index b20091006473beb26dbb60233aeabefe7117c162..ecdb05e92ea54b0b4e541054e9d7cd0d6a68f6a9 100644
(file)
--- a/
scanner/scanner.lex
+++ b/
scanner/scanner.lex
@@
-20,7
+20,10
@@
COMMENT_END \*\/
<COMMENT>{COMMENT_END} BEGIN(INITIAL);
<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>(.|\n) /* alles im kommentar wird ignoriert */
<COMMENT>(.|\n) /* alles im kommentar wird ignoriert */
@@
-32,17
+35,14
@@
COMMENT_END \*\/
{NUMBER_DEC} printf("num %lx\n", strtol(yytext, (char **)NULL, 10));
{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 */
{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);
+}
%%
%%