parser/lexer.ll
changeset 5 d752cbe8208e
child 9 c3fecc82ade6
equal deleted inserted replaced
4:236f8f747073 5:d752cbe8208e
       
     1 /* 
       
     2  *  $Id$
       
     3  * $URL$
       
     4  */
       
     5 
       
     6 %{
       
     7 	#include <stdio.h>
       
     8 	#include "parser.h"
       
     9 %}
       
    10 
       
    11 %%
       
    12 
       
    13 [0-9]+			{ yylval = atoi(yytext); return DIGIT;    }
       
    14 [a-zA-Z]		{ yylval = yytext[0]; return LETTER;      }
       
    15 "+"			return PLUS;	     
       
    16 "-"			return MINUS;       
       
    17 "*"			return MUL;         
       
    18 "/"			return DIV;       
       
    19 "("|")"|"="		return yytext[0]; 
       
    20 [ \t]+			;
       
    21 \n			return yytext[0];
       
    22 .			printf("FEHLER: %s\n", yytext);
       
    23 %%