|
From: Yanela S. <ai...@ho...> - 2010-06-21 07:03:11
|
Hi,
I'm trying to make a scanner for an assignment, but I always get the error "premature EOF". I've been learning how to use Flex only since today, but I've been trying and comparing different examples and I don't see what's missing in my file (I understand the user code is optional). I hope someone can explain how to fix it.
This is it:
-------------------
%{
%}
ID [a-z][a-z0-9]*
OPAR \(
CPAR \)
OPLOG \.[AND|OR|NOT]\.
OPREL \.[LT|LE|GT|GE|EQ|NE]\.
%%
{ID}+ {printf("Identificador: %s", yytext);}
{OPREL}+ {printf("Operador relacional: %s", yytext);}
{OPLOG}+ {printf("Operador Lógico: %s", yytext);}
{OPAR}+ {printf("Paréntesis de apertura: %s", yytext);}
{CPAR}+ {printf("Paréntesis de cierre: %s", yytext);}
%%
-----------------
Thanks in advance for any help.
Yane
_________________________________________________________________
Ahora Hotmail es un 70% más rápido. Para que chequear correos sea cada vez más fácil. Ver más
http://www.descubrehotmail.com/velocidad.asp
|