parser/lexer.ll
author Markus Bröker <mbroeker@largo.dyndns.tv>
Sat, 13 Dec 2008 17:58:16 +0100
changeset 23 7acfc5eda7ed
parent 9 c3fecc82ade6
permissions -rw-r--r--
this seems to be the proper way under ms, but it won't work under wine committer: Markus Bröker <mbroeker@largo.homelinux.org>

/**
 * 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);
%%