tp-langages-formels/syntaxique/langlex.l

30 lines
449 B
Plaintext
Raw Normal View History

2020-05-15 23:51:08 +00:00
%option noyywrap
DIG [0-9]
%%
"bool" { return BOOL; }
"while" { return WHILE; }
"do" { return DO; }
"od" { return OD; }
"print" { return PRINT; }
"true" { return TRUE; }
"false" { return FALSE; }
":=" { return ASSIGN; }
2020-05-16 00:49:34 +00:00
"^" { return XOR; }
2020-05-15 23:51:08 +00:00
"||" { return OR; }
"&&" { return AND; }
2020-05-16 00:49:34 +00:00
"!" { return NOT; }
"<=>" { return EQUIV; }
2020-05-15 23:51:08 +00:00
[a-z_][a-z0-9_]* { yylval.i = strdup(yytext); return IDENT; }
[ \n] { /* ignore */ }
. { return *yytext; }
%%