/*
  Tiny Haskell subset 
  Lex rules
 */
%{
#include <stdio.h>
#include <string.h>
#include "types.h"
#include "parser.h"
%}
%%
[0-9]+                  yylval.n=atoi(yytext); return NUMBER;
mod                     return MOD;
'mod'                   return MOD;
Int                     return INTTYPE;
True			return TRUEV;
otherwise		return OTHERWISE;
[a-z][a-z0-9]*          yylval.s=strdup(yytext);return IDENT;
::			return COLONCOLON;
->			return IMPLIES;
==			return EQ;
=			return IS;
>			return GT;
>=			return GE;
\<			return LT;
\<=			return LE;
!=			return NE;
\+			return PLUS;
-			return MINUS;
\*			return MUL;
\/			return DIV;
\(			return OPEN;
\)			return CLOSE;
\|			return GUARD;
\n                      /* ignore end of line */;
[ \t]+                  /* ignore whitespace */;
.			return TOKERR;
%%
