%{ /* In der Vorlesung am 14.1.2008 gemeinsam erstellte Variante von * calc-int.[ly], bei der zusätzlich ein unaeres Minus vorkommen * darf. Ausserdem wird ausgegeben, wann dieses ausgewertet wird. */ #include #include "calc-int1.tab.h" %} %option noyywrap DIGIT [0-9] %% {DIGIT}+ { yylval = atoi(yytext); return NUMBER; } "=" | "(" | ")" | "+" | "-" | "*" | "/" { return *yytext; } [[:space:]] { /* ignoriere Whitespace */ } . { return ILLEGAL_CHAR; }