-
Notifications
You must be signed in to change notification settings - Fork 0
/
anotacoes.l
22 lines (22 loc) · 1.07 KB
/
anotacoes.l
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
%{
#include "y.tab.h"
#include "string.h"
%}
%option noyywrap
%option yylineno
%x TRIPLOS
%%
<*>^===\ : {BEGIN INITIAL; return(IN);}
^(?i:@tit:) {return(INITIT);}
^(?i:@triplos:) {BEGIN TRIPLOS; return(INITTRIP);}
<TRIPLOS>:img {yylval.palavra = strdup(yytext); return img;}
<TRIPLOS>a/[ ]+: {yylval.palavra = strdup(yytext); return esp;}
<TRIPLOS>[ ]+ {return SPACE;}
[a-zA-Z\ óáéí.0-9\-,;]+\n {yylval.palavra = strdup(yytext); return pal;}
<TRIPLOS>, {return(VIRG);}
<TRIPLOS>[;.] {return(PONTOVIRGULA);}
<TRIPLOS>^:[A-Za-zóáéí0-9_]+ {yylval.objeto = strdup(yytext); return suj;}
<TRIPLOS>:[A-Za-zóáéí0-9_]+ {yylval.objeto = strdup(yytext); return obj;}
<TRIPLOS>\"[A-Za-zóáéí.0-9_]+\" {yylval.objeto = strdup(yytext); return obj;}
<*>.|\n {;}
%%