eliot/dic/er.l
Antoine Fraboulet 49a41bb311 - added + ? and [^xx] works in most of the cases, automata is no more
deterministic, I have to rewrite the automaton_build to correct this.
2005-04-27 17:35:03 +00:00

40 lines
845 B
Text

%{
#include "dic.h"
#include "regexp.h"
#include "libdic_a-er.h"
#define MASK_TO_REMOVE 0x1F
%}
%option prefix="regexp"
%option outfile="lex.yy.c"
%option header-file="scanner.h"
%option reentrant bison-bridge
%option bison-locations
%option noyywrap
/* TODO : remove lexer translation */
alphabet [a-zA-Z]
%%
{alphabet} {yylval_param->c=(yytext[0]&MASK_TO_REMOVE); return LEX_CHAR;}
"[" {return LEX_L_SQBRACKET;}
"]" {return LEX_R_SQBRACKET;}
"(" {return LEX_L_BRACKET;}
")" {return LEX_R_BRACKET;}
"^" {return LEX_HAT;}
"." {return LEX_ALL;}
":v:" {return LEX_VOWL;}
":c:" {return LEX_CONS;}
":1:" {return LEX_USER1;}
":2:" {return LEX_USER2;}
"?" {return LEX_QMARK;}
"+" {return LEX_PLUS;}
"*" {return LEX_STAR;}
"#" {return LEX_SHARP;}
%%