author | Markus Brökers <mbroeker@largo.homelinux.org> |
Wed, 18 Aug 2010 18:17:51 +0200 | |
changeset 143 | 88d9b8bfa7a5 |
parent 39 | 46d7ec9d63bd |
permissions | -rw-r--r-- |
/** * test/demos/parser/lexer.ll * Copyright (C) 2008 Markus Broeker */ %{ #include <stdio.h> #include "parser.h" %} %% [0-9]+ { yylval = atoi(yytext); return DIGIT; } [a-zA-Z] { yylval = yytext[0]; return LETTER; } "+" { return PLUS; } "-" { return MINUS; } "*" { return MUL; } "/" { return DIV; } "("|")"|"=" { return yytext[0]; } [ \t]+ {} \n { return yytext[0]; } . { printf("FEHLER: %s\n", yytext); } %%