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