Tizen 2.1 base
[platform/upstream/libnl2.git] / lib / route / pktloc_grammar.l
1 %{
2  #include <netlink-local.h>
3  #include <netlink-tc.h>
4  #include <netlink/netlink.h>
5  #include <netlink/utils.h>
6  #include <netlink/route/pktloc.h>
7  #include "pktloc_syntax.h"
8 %}
9
10 %option 8bit
11 %option reentrant
12 %option warn
13 %option noyywrap
14 %option nounput
15 %option bison-bridge
16 %option bison-locations
17 %option prefix="pktloc_"
18
19 %%
20
21 [ \t\r\n]+
22
23 "#".*
24
25 [[:digit:]]+            |
26 0[xX][[:xdigit:]]+      {
27                                 yylval->i = strtoul(yytext, NULL, 0);
28                                 return NUMBER;
29                         }
30
31 "+"                     { return yylval->i = yytext[0]; }
32
33 [lL][iI][nN][kK]        { yylval->i = TCF_LAYER_LINK; return LAYER; }
34 [nN][eE][tT]            { yylval->i = TCF_LAYER_NETWORK; return LAYER; }
35 [tT][cC][pP]            { yylval->i = TCF_LAYER_TRANSPORT; return LAYER; }
36
37 [^ \t\r\n+]+            {
38                                 yylval->s = strdup(yytext);
39                                 if (yylval->s == NULL)
40                                         return ERROR;
41                                 return NAME;
42                         }