%{ /*-----------------------------------------------------------------------------\ | GE_VERB.L | \-----------------------------------------------------------------------------*/ int linha = 1; void trata_ws(char *yytext) { int i; i = 0; while (yytext[i] != '\0') { if (yytext[i] == '\n') linha++; i++; } } %} DELIM [ \t\n] WS {DELIM}* PALAVRA [a-zA-Z0-9_'`~^αινσϊΰθμςωγυβκτηόρ\-]+ LETRA \:[a-z] %start NORMAL COMENT %% BEGIN NORMAL; {PALAVRA} {strcpy(yylval.str, yytext); /*fprintf(stderr, "%s", yylval.str);*/ return(PALAVRA);} {LETRA} {yylval.ch = yytext[1]; return(LETRA);} "#v" {return(V);} "#vX" {return(VX);} "//" {BEGIN COMENT;} {WS} {trata_ws(yytext);} . {return(yytext[0]);} \n {linha++; BEGIN NORMAL;} . {} %% yywrap(){return(1);} /* deve existir quando se usa lex, yacc */