4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change
on this file since e78e408 was
fade02b,
checked in by Shane Alcock <salcock@…>, 11 years ago
|
- Fix strict-aliasing warning in bitbuffer.c
- Fixed warnings about unused functions in the lexer code
|
-
Property mode set to
100644
|
File size:
968 bytes
|
Line | |
---|
1 | DIGIT [0-9] |
---|
2 | LETTER [a-zA-Z_: ] |
---|
3 | HEXDIGIT [0-9A-Fa-f] |
---|
4 | |
---|
5 | %option noyywrap |
---|
6 | %option nounput |
---|
7 | %option noinput |
---|
8 | |
---|
9 | %{ |
---|
10 | #include <stdio.h> |
---|
11 | #include "grammar.h" |
---|
12 | #include "parser.h" |
---|
13 | |
---|
14 | int yylex(void); |
---|
15 | int yyerror(char *s); |
---|
16 | |
---|
17 | int lines = 1; |
---|
18 | %} |
---|
19 | |
---|
20 | %% |
---|
21 | |
---|
22 | "#".*"\n" { /* ignore comments */ } |
---|
23 | |
---|
24 | "be" { return TOK_BIGENDIAN; } |
---|
25 | "le" { return TOK_LITTLEENDIAN; } |
---|
26 | "next" { return TOK_NEXT; } |
---|
27 | |
---|
28 | "hex" { return TOK_OUTPUT_HEX;} |
---|
29 | "integer" { return TOK_OUTPUT_INT;} |
---|
30 | "ipv4" { return TOK_OUTPUT_IPV4;} |
---|
31 | "mac" { return TOK_OUTPUT_MAC;} |
---|
32 | "hidden" { return TOK_OUTPUT_NONE;} |
---|
33 | |
---|
34 | "flag" { return TOK_OUTPUT_FLAG; } |
---|
35 | |
---|
36 | {DIGIT}+ { yylval.intval = atoi(yytext); |
---|
37 | return TOK_CONSTANT; } |
---|
38 | \"[^\"]*\" { int i; |
---|
39 | for(i=0;yytext[i] != '\0'; i++) |
---|
40 | if(yytext[i] == '"') |
---|
41 | yytext[i] = '\0'; |
---|
42 | yylval.textval = &yytext[1]; |
---|
43 | return TOK_IDENTIFIER; |
---|
44 | } |
---|
45 | |
---|
46 | "\n" { lines++; } |
---|
47 | . { /* ignore everything else */ } |
---|
48 | |
---|
49 | %% |
---|
50 | |
---|
Note: See
TracBrowser
for help on using the repository browser.