Boas! Depois de compilar o seguite ficheiro..
%{
#include <string.h>
%}
digito [0-9]
letra [a-zA-Z]
%%
{digito}+ {strcpy(yylval.s, yytext);return NUM;}
(INSERIR|inserir) return INSERIR;
(SUBSTITUIR|substituir) return (SUBSTITUIR);
(SUBSTITUIRTODAS|subtituirtodas) return (SUBSTITUIRTODAS);
(APAGAR|apagar) return (APAGAR);
(APAGARTODAS|apagartodas) return (APAGARTODAS);
(APAGARLINHA|apagarlinha) return (APAGARLINHA);
{letra}+[-]?{letra}+ {strcpy(yylval.s,yytext);return (TEXTO);}
\; return(';');
[ \t\n] ;
. printf("Erro Lexico\n");
%%
yywrap(){return 1;}
Obtenho os seguintes erros....
lex.l: In function `yylex':
lex.l:9: error: `yylval' undeclared (first use in this function)
lex.l:9: error: (Each undeclared identifier is reported only once
lex.l:9: error: for each function it appears in.)
lex.l:9: error: `NUM' undeclared (first use in this function)
lex.l:11: error: `INSERIR' undeclared (first use in this function)
lex.l:13: error: `SUBSTITUIR' undeclared (first use in this function)
lex.l:15: error: `SUBSTITUIRTODAS' undeclared (first use in this function)
lex.l:17: error: `APAGAR' undeclared (first use in this function)
lex.l:19: error: `APAGARTODAS' undeclared (first use in this function)
lex.l:21: error: `APAGARLINHA' undeclared (first use in this function)
lex.l:23: error: `TEXTO' undeclared (first use in this function)
Alguem me pode dar uma ajuda no erro da linha 9? Não percebo pk dá erro!!

