Skip to content

Commit da789fc

Browse files
Create example3_linuxzoo.l
1 parent aa08a4b commit da789fc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
%{
2+
#include <stdio.h>
3+
%}
4+
5+
%option noyywrap
6+
7+
%%
8+
[a-zA-Z][a-zA-Z0-9]* { printf("WORD "); }
9+
[a-zA-Z0-9\/.-]+ { printf("FILENAME "); }
10+
\" { printf("QUOTE "); }
11+
\{ { printf("OBRACE "); }
12+
\} { printf("EBRACE "); }
13+
; { printf("SEMICOLON "); }
14+
\n { printf("\n"); }
15+
[ \t]+ /* ignore whitespace */
16+
%%
17+
18+
int main() {
19+
yylex();
20+
return 0;
21+
}

0 commit comments

Comments
 (0)