/*Regular Definitions*/
delim[\t\n]
WS{delim}+
letter[A-Za-z]
digit[0-9]
id{letter}({letter|digit})*
number{digit}+(\.{digit}+?(E[+-]?{digit}+)?
%%
{WS}{/*do nothing*/}
if{printf("\nIF found");return 0;}
then{printf("\nTHEN found");return 0;}
else{printf("\nELSE found");return 0;}
{id}{printf("\nID found");return 0;}
{number}{printf("\nNUMBER found");return 0;}
"<"{printf("\nLess than symbol found.");return 0;}
"<="{printf("\nLess than or Equals to symbol found.");return 0;}
"="{printf("\nEquals to symbol found.");return 0;}
"<>"{printf("\nNot equals to symbol found.");return 0;}
">"{printf("\nGreater than symbol found.");return 0;}
">="{printf("\nGreater than or equal to symbol found.");return 0;}
%%
При использовании flex для компиляции
G:\>flex Lex.l
я получаю следующие ошибки:
"Lex.l", line 14: unrecognized rule
"Lex.l", line 14: unrecognized rule
"Lex.l", line 14: unrecognized rule
"Lex.l", line 14: unrecognized rule
"Lex.l", line 14: unrecognized rule
"Lex.l", line 27: EOF encountered inside an action
Может кто-нибудь помочь мне с этим?
Спасибо.