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